Repository: ChilliWorks/ChilliSource Branch: master Commit: 1f482f1e84c1 Files: 2333 Total size: 98.7 MB Directory structure: gitextract_4vhph7y5/ ├── .gitignore ├── CSResources/ │ ├── Fonts/ │ │ ├── CarlitoMed.high.csfont │ │ ├── CarlitoMed.high.csimage │ │ ├── CarlitoMed.low.csfont │ │ ├── CarlitoMed.low.csimage │ │ ├── CarlitoMed.med.csfont │ │ └── CarlitoMed.med.csimage │ ├── Shaders/ │ │ ├── Animated-Blinn-Base.csshader │ │ ├── Animated-Blinn-Directional.csshader │ │ ├── Animated-Blinn-DirectionalShadows.csshader │ │ ├── Animated-Blinn-Point.csshader │ │ ├── Animated-ShadowMap.csshader │ │ ├── Animated-Unlit.csshader │ │ ├── Skybox.csshader │ │ ├── Sprite-Unlit.csshader │ │ ├── Sprite-UnlitStencil.csshader │ │ ├── Static-Blinn-Base.csshader │ │ ├── Static-Blinn-Directional.csshader │ │ ├── Static-Blinn-DirectionalShadows.csshader │ │ ├── Static-Blinn-Point.csshader │ │ ├── Static-ShadowMap.csshader │ │ └── Static-Unlit.csshader │ ├── Textures/ │ │ └── Blank.csimage │ └── Widgets/ │ ├── DefaultCursor.csui │ ├── EditableLabel.csuidef │ ├── HighlightButton.csuidef │ ├── HorizontalFillProgressBar.csuidef │ ├── HorizontalSlider.csuidef │ ├── HorizontalStretchProgressBar.csuidef │ ├── Image.csuidef │ ├── Label.csuidef │ ├── Layout.csuidef │ ├── ToggleButton.csuidef │ ├── VerticalFillProgressBar.csuidef │ ├── VerticalSlider.csuidef │ ├── VerticalStretchProgressBar.csuidef │ └── Widget.csuidef ├── Documents/ │ ├── ChangeLog.md │ └── RPi_GettingStarted.md ├── LICENSE ├── Libraries/ │ ├── Core/ │ │ ├── Android/ │ │ │ ├── Headers/ │ │ │ │ ├── SHA1/ │ │ │ │ │ ├── HMAC_SHA1.h │ │ │ │ │ └── SHA1.h │ │ │ │ ├── SHA256/ │ │ │ │ │ └── sha256.h │ │ │ │ ├── aes/ │ │ │ │ │ └── aes.h │ │ │ │ ├── base64/ │ │ │ │ │ └── base64.h │ │ │ │ ├── json/ │ │ │ │ │ ├── assertions.h │ │ │ │ │ ├── autolink.h │ │ │ │ │ ├── config.h │ │ │ │ │ ├── features.h │ │ │ │ │ ├── forwards.h │ │ │ │ │ ├── json.h │ │ │ │ │ ├── json_batchallocator.h │ │ │ │ │ ├── json_internalarray.inl │ │ │ │ │ ├── json_internalmap.inl │ │ │ │ │ ├── json_tool.h │ │ │ │ │ ├── json_valueiterator.inl │ │ │ │ │ ├── reader.h │ │ │ │ │ ├── value.h │ │ │ │ │ └── writer.h │ │ │ │ ├── md5/ │ │ │ │ │ └── md5.h │ │ │ │ ├── minizip/ │ │ │ │ │ ├── crypt.h │ │ │ │ │ ├── ioapi.h │ │ │ │ │ ├── mztools.h │ │ │ │ │ ├── unzip.h │ │ │ │ │ └── zip.h │ │ │ │ ├── png/ │ │ │ │ │ ├── png.h │ │ │ │ │ ├── pngconf.h │ │ │ │ │ ├── pngdebug.h │ │ │ │ │ ├── pnginfo.h │ │ │ │ │ ├── pnglibconf.h │ │ │ │ │ ├── pngpriv.h │ │ │ │ │ └── pngstruct.h │ │ │ │ └── rapidxml/ │ │ │ │ ├── rapidxml.hpp │ │ │ │ ├── rapidxml_iterators.hpp │ │ │ │ ├── rapidxml_print.hpp │ │ │ │ └── rapidxml_utils.hpp │ │ │ └── Libs/ │ │ │ ├── arm64-v8a/ │ │ │ │ └── libCSBase.a │ │ │ ├── armeabi/ │ │ │ │ └── libCSBase.a │ │ │ ├── armeabi-v7a/ │ │ │ │ └── libCSBase.a │ │ │ ├── jars/ │ │ │ │ ├── AmazonIAP.jar │ │ │ │ ├── googleplayexpansiondownloader.jar │ │ │ │ ├── googleplayexpansionunzipper.jar │ │ │ │ └── googleplaylicensing.jar │ │ │ ├── x86/ │ │ │ │ └── libCSBase.a │ │ │ └── x86_64/ │ │ │ └── libCSBase.a │ │ ├── RPi/ │ │ │ ├── Headers/ │ │ │ │ ├── EGL/ │ │ │ │ │ ├── egl.h │ │ │ │ │ ├── eglext.h │ │ │ │ │ ├── eglext_android.h │ │ │ │ │ ├── eglext_brcm.h │ │ │ │ │ ├── eglext_nvidia.h │ │ │ │ │ └── eglplatform.h │ │ │ │ ├── GLES2/ │ │ │ │ │ ├── gl2.h │ │ │ │ │ ├── gl2ext.h │ │ │ │ │ └── gl2platform.h │ │ │ │ ├── IL/ │ │ │ │ │ ├── OMX_Audio.h │ │ │ │ │ ├── OMX_Broadcom.h │ │ │ │ │ ├── OMX_Component.h │ │ │ │ │ ├── OMX_Core.h │ │ │ │ │ ├── OMX_ILCS.h │ │ │ │ │ ├── OMX_IVCommon.h │ │ │ │ │ ├── OMX_Image.h │ │ │ │ │ ├── OMX_Index.h │ │ │ │ │ ├── OMX_Other.h │ │ │ │ │ ├── OMX_Types.h │ │ │ │ │ └── OMX_Video.h │ │ │ │ ├── KHR/ │ │ │ │ │ └── khrplatform.h │ │ │ │ ├── SHA1/ │ │ │ │ │ ├── HMAC_SHA1.h │ │ │ │ │ └── SHA1.h │ │ │ │ ├── SHA256/ │ │ │ │ │ └── sha256.h │ │ │ │ ├── X11/ │ │ │ │ │ ├── DECkeysym.h │ │ │ │ │ ├── HPkeysym.h │ │ │ │ │ ├── ImUtil.h │ │ │ │ │ ├── Sunkeysym.h │ │ │ │ │ ├── X.h │ │ │ │ │ ├── XF86keysym.h │ │ │ │ │ ├── XKBlib.h │ │ │ │ │ ├── XWDFile.h │ │ │ │ │ ├── Xalloca.h │ │ │ │ │ ├── Xarch.h │ │ │ │ │ ├── Xatom.h │ │ │ │ │ ├── Xauth.h │ │ │ │ │ ├── Xcms.h │ │ │ │ │ ├── Xdefs.h │ │ │ │ │ ├── Xdmcp.h │ │ │ │ │ ├── Xfuncproto.h │ │ │ │ │ ├── Xfuncs.h │ │ │ │ │ ├── Xlib.h │ │ │ │ │ ├── XlibConf.h │ │ │ │ │ ├── Xlibint.h │ │ │ │ │ ├── Xlocale.h │ │ │ │ │ ├── Xmd.h │ │ │ │ │ ├── Xos.h │ │ │ │ │ ├── Xos_r.h │ │ │ │ │ ├── Xosdefs.h │ │ │ │ │ ├── Xpoll.h │ │ │ │ │ ├── Xproto.h │ │ │ │ │ ├── Xprotostr.h │ │ │ │ │ ├── Xregion.h │ │ │ │ │ ├── Xresource.h │ │ │ │ │ ├── Xthreads.h │ │ │ │ │ ├── Xtrans/ │ │ │ │ │ │ ├── Xtrans.c │ │ │ │ │ │ ├── Xtrans.h │ │ │ │ │ │ ├── Xtransint.h │ │ │ │ │ │ ├── Xtranslcl.c │ │ │ │ │ │ ├── Xtranssock.c │ │ │ │ │ │ ├── Xtransutil.c │ │ │ │ │ │ └── transport.c │ │ │ │ │ ├── Xutil.h │ │ │ │ │ ├── Xw32defs.h │ │ │ │ │ ├── Xwindows.h │ │ │ │ │ ├── Xwinsock.h │ │ │ │ │ ├── ap_keysym.h │ │ │ │ │ ├── bitmaps/ │ │ │ │ │ │ ├── xm_error │ │ │ │ │ │ ├── xm_hour16 │ │ │ │ │ │ ├── xm_hour16m │ │ │ │ │ │ ├── xm_hour32 │ │ │ │ │ │ ├── xm_hour32m │ │ │ │ │ │ ├── xm_information │ │ │ │ │ │ ├── xm_noenter16 │ │ │ │ │ │ ├── xm_noenter16m │ │ │ │ │ │ ├── xm_noenter32 │ │ │ │ │ │ ├── xm_noenter32m │ │ │ │ │ │ ├── xm_question │ │ │ │ │ │ ├── xm_warning │ │ │ │ │ │ └── xm_working │ │ │ │ │ ├── cursorfont.h │ │ │ │ │ ├── extensions/ │ │ │ │ │ │ ├── XI.h │ │ │ │ │ │ ├── XI2.h │ │ │ │ │ │ ├── XI2proto.h │ │ │ │ │ │ ├── XIproto.h │ │ │ │ │ │ ├── XKB.h │ │ │ │ │ │ ├── XKBgeom.h │ │ │ │ │ │ ├── XKBproto.h │ │ │ │ │ │ ├── XKBsrv.h │ │ │ │ │ │ └── XKBstr.h │ │ │ │ │ ├── keysym.h │ │ │ │ │ └── keysymdef.h │ │ │ │ ├── aes/ │ │ │ │ │ └── aes.h │ │ │ │ ├── base64/ │ │ │ │ │ └── base64.h │ │ │ │ ├── bcm_host.h │ │ │ │ ├── curl/ │ │ │ │ │ ├── curl.h │ │ │ │ │ ├── curlbuild.h │ │ │ │ │ ├── curlrules.h │ │ │ │ │ ├── curlver.h │ │ │ │ │ ├── easy.h │ │ │ │ │ ├── mprintf.h │ │ │ │ │ ├── multi.h │ │ │ │ │ ├── stdcheaders.h │ │ │ │ │ └── typecheck-gcc.h │ │ │ │ ├── interface/ │ │ │ │ │ ├── vchi/ │ │ │ │ │ │ ├── common/ │ │ │ │ │ │ │ └── endian.h │ │ │ │ │ │ ├── connections/ │ │ │ │ │ │ │ └── connection.h │ │ │ │ │ │ ├── message_drivers/ │ │ │ │ │ │ │ └── message.h │ │ │ │ │ │ ├── vchi.h │ │ │ │ │ │ ├── vchi_cfg.h │ │ │ │ │ │ ├── vchi_cfg_internal.h │ │ │ │ │ │ ├── vchi_common.h │ │ │ │ │ │ └── vchi_mh.h │ │ │ │ │ ├── vchiq_arm/ │ │ │ │ │ │ ├── vchiq.h │ │ │ │ │ │ ├── vchiq_cfg.h │ │ │ │ │ │ ├── vchiq_if.h │ │ │ │ │ │ ├── vchiq_ioctl.h │ │ │ │ │ │ ├── vchiq_test.h │ │ │ │ │ │ ├── vchiq_test_if.h │ │ │ │ │ │ └── vchiq_util.h │ │ │ │ │ ├── vcos/ │ │ │ │ │ │ ├── generic/ │ │ │ │ │ │ │ ├── vcos_common.h │ │ │ │ │ │ │ ├── vcos_deprecated.h │ │ │ │ │ │ │ ├── vcos_generic_blockpool.h │ │ │ │ │ │ │ ├── vcos_generic_event_flags.h │ │ │ │ │ │ │ ├── vcos_generic_named_sem.h │ │ │ │ │ │ │ ├── vcos_generic_quickslow_mutex.h │ │ │ │ │ │ │ ├── vcos_generic_reentrant_mtx.h │ │ │ │ │ │ │ ├── vcos_generic_tls.h │ │ │ │ │ │ │ ├── vcos_joinable_thread_from_plain.h │ │ │ │ │ │ │ ├── vcos_latch_from_sem.h │ │ │ │ │ │ │ ├── vcos_mem_from_malloc.h │ │ │ │ │ │ │ ├── vcos_mutexes_are_reentrant.h │ │ │ │ │ │ │ └── vcos_thread_reaper.h │ │ │ │ │ │ ├── pthreads/ │ │ │ │ │ │ │ ├── vcos_futex_mutex.h │ │ │ │ │ │ │ ├── vcos_platform.h │ │ │ │ │ │ │ └── vcos_platform_types.h │ │ │ │ │ │ ├── user_nodefs.h │ │ │ │ │ │ ├── vcos.h │ │ │ │ │ │ ├── vcos_assert.h │ │ │ │ │ │ ├── vcos_atomic_flags.h │ │ │ │ │ │ ├── vcos_attr.h │ │ │ │ │ │ ├── vcos_blockpool.h │ │ │ │ │ │ ├── vcos_build_info.h │ │ │ │ │ │ ├── vcos_cfg.h │ │ │ │ │ │ ├── vcos_cmd.h │ │ │ │ │ │ ├── vcos_ctype.h │ │ │ │ │ │ ├── vcos_dlfcn.h │ │ │ │ │ │ ├── vcos_event.h │ │ │ │ │ │ ├── vcos_event_flags.h │ │ │ │ │ │ ├── vcos_init.h │ │ │ │ │ │ ├── vcos_inttypes.h │ │ │ │ │ │ ├── vcos_isr.h │ │ │ │ │ │ ├── vcos_legacy_isr.h │ │ │ │ │ │ ├── vcos_logging.h │ │ │ │ │ │ ├── vcos_logging_control.h │ │ │ │ │ │ ├── vcos_lowlevel_thread.h │ │ │ │ │ │ ├── vcos_mem.h │ │ │ │ │ │ ├── vcos_mempool.h │ │ │ │ │ │ ├── vcos_msgqueue.h │ │ │ │ │ │ ├── vcos_mutex.h │ │ │ │ │ │ ├── vcos_named_semaphore.h │ │ │ │ │ │ ├── vcos_once.h │ │ │ │ │ │ ├── vcos_queue.h │ │ │ │ │ │ ├── vcos_quickslow_mutex.h │ │ │ │ │ │ ├── vcos_reentrant_mutex.h │ │ │ │ │ │ ├── vcos_semaphore.h │ │ │ │ │ │ ├── vcos_stdbool.h │ │ │ │ │ │ ├── vcos_stdint.h │ │ │ │ │ │ ├── vcos_string.h │ │ │ │ │ │ ├── vcos_thread.h │ │ │ │ │ │ ├── vcos_thread_attr.h │ │ │ │ │ │ ├── vcos_timer.h │ │ │ │ │ │ ├── vcos_tls.h │ │ │ │ │ │ └── vcos_types.h │ │ │ │ │ ├── vctypes/ │ │ │ │ │ │ ├── vc_display_types.h │ │ │ │ │ │ └── vc_image_types.h │ │ │ │ │ └── vmcs_host/ │ │ │ │ │ ├── khronos/ │ │ │ │ │ │ └── IL/ │ │ │ │ │ │ ├── OMX_Audio.h │ │ │ │ │ │ ├── OMX_Broadcom.h │ │ │ │ │ │ ├── OMX_Component.h │ │ │ │ │ │ ├── OMX_Core.h │ │ │ │ │ │ ├── OMX_ILCS.h │ │ │ │ │ │ ├── OMX_IVCommon.h │ │ │ │ │ │ ├── OMX_Image.h │ │ │ │ │ │ ├── OMX_Index.h │ │ │ │ │ │ ├── OMX_Other.h │ │ │ │ │ │ ├── OMX_Types.h │ │ │ │ │ │ └── OMX_Video.h │ │ │ │ │ ├── linux/ │ │ │ │ │ │ ├── vcfiled/ │ │ │ │ │ │ │ └── vcfiled_check.h │ │ │ │ │ │ └── vchost_config.h │ │ │ │ │ ├── vc_cec.h │ │ │ │ │ ├── vc_cecservice.h │ │ │ │ │ ├── vc_cecservice_defs.h │ │ │ │ │ ├── vc_cma.h │ │ │ │ │ ├── vc_dispmanx.h │ │ │ │ │ ├── vc_dispmanx_types.h │ │ │ │ │ ├── vc_dispservice_defs.h │ │ │ │ │ ├── vc_dispservice_x_defs.h │ │ │ │ │ ├── vc_fileservice_defs.h │ │ │ │ │ ├── vc_gencmd_defs.h │ │ │ │ │ ├── vc_hdmi.h │ │ │ │ │ ├── vc_hdmi_property.h │ │ │ │ │ ├── vc_ilcs_defs.h │ │ │ │ │ ├── vc_imageconv_defs.h │ │ │ │ │ ├── vc_sdtv.h │ │ │ │ │ ├── vc_service_common.h │ │ │ │ │ ├── vc_tvservice.h │ │ │ │ │ ├── vc_tvservice_defs.h │ │ │ │ │ ├── vc_vchi_audioserv_defs.h │ │ │ │ │ ├── vc_vchi_bufman.h │ │ │ │ │ ├── vc_vchi_bufman_defs.h │ │ │ │ │ ├── vc_vchi_dispmanx.h │ │ │ │ │ ├── vc_vchi_fileservice_defs.h │ │ │ │ │ ├── vc_vchi_filesys.h │ │ │ │ │ ├── vc_vchi_gencmd.h │ │ │ │ │ ├── vc_vchi_gpuserv.h │ │ │ │ │ ├── vcfilesys.h │ │ │ │ │ ├── vcfilesys_defs.h │ │ │ │ │ ├── vcgencmd.h │ │ │ │ │ ├── vchost.h │ │ │ │ │ ├── vchost_platform_config.h │ │ │ │ │ ├── vcilcs.h │ │ │ │ │ └── vcilcs_common.h │ │ │ │ ├── json/ │ │ │ │ │ ├── assertions.h │ │ │ │ │ ├── autolink.h │ │ │ │ │ ├── config.h │ │ │ │ │ ├── features.h │ │ │ │ │ ├── forwards.h │ │ │ │ │ ├── json.h │ │ │ │ │ ├── json_batchallocator.h │ │ │ │ │ ├── json_internalarray.inl │ │ │ │ │ ├── json_internalmap.inl │ │ │ │ │ ├── json_tool.h │ │ │ │ │ ├── json_valueiterator.inl │ │ │ │ │ ├── reader.h │ │ │ │ │ ├── value.h │ │ │ │ │ └── writer.h │ │ │ │ ├── libevdev/ │ │ │ │ │ ├── libevdev-uinput.h │ │ │ │ │ └── libevdev.h │ │ │ │ ├── libudev.h │ │ │ │ ├── md5/ │ │ │ │ │ └── md5.h │ │ │ │ ├── minizip/ │ │ │ │ │ ├── crypt.h │ │ │ │ │ ├── ioapi.h │ │ │ │ │ ├── mztools.h │ │ │ │ │ ├── unzip.h │ │ │ │ │ └── zip.h │ │ │ │ ├── png/ │ │ │ │ │ ├── png.h │ │ │ │ │ ├── pngconf.h │ │ │ │ │ ├── pngdebug.h │ │ │ │ │ ├── pnginfo.h │ │ │ │ │ ├── pnglibconf.h │ │ │ │ │ ├── pngpriv.h │ │ │ │ │ └── pngstruct.h │ │ │ │ ├── rapidxml/ │ │ │ │ │ ├── rapidxml.hpp │ │ │ │ │ ├── rapidxml_iterators.hpp │ │ │ │ │ ├── rapidxml_print.hpp │ │ │ │ │ └── rapidxml_utils.hpp │ │ │ │ ├── vcinclude/ │ │ │ │ │ ├── common.h │ │ │ │ │ ├── vc_image_types.h │ │ │ │ │ └── vcore.h │ │ │ │ ├── zconf.h │ │ │ │ └── zlib.h │ │ │ └── Libs/ │ │ │ ├── libCSBase.a │ │ │ ├── libX11.so.6.3.0 │ │ │ ├── libXau.so.6.0.0 │ │ │ ├── libXdmcp.so.6.0.0 │ │ │ ├── libcom_err.so.2.1 │ │ │ ├── libcrypto.so.1.0.0 │ │ │ ├── libcurl.so.4.3.0 │ │ │ ├── libevdev.so.2.1.3 │ │ │ ├── libffi.so.6.0.2 │ │ │ ├── libgcrypt.so.20.0.3 │ │ │ ├── libgmp.so.10.2.0 │ │ │ ├── libgnutls-deb0.so.28.41.0 │ │ │ ├── libgpg-error.so.0.13.0 │ │ │ ├── libgssapi_krb5.so.2.2 │ │ │ ├── libhogweed.so.2.5 │ │ │ ├── libidn.so.11.6.12 │ │ │ ├── libk5crypto.so.3.1 │ │ │ ├── libkeyutils.so.1.5 │ │ │ ├── libkrb5.so.3.3 │ │ │ ├── libkrb5support.so.0.1 │ │ │ ├── liblber-2.4.so.2.10.3 │ │ │ ├── libldap_r-2.4.so.2.10.3 │ │ │ ├── libnettle.so.4.7 │ │ │ ├── libp11-kit.so.0.0.0 │ │ │ ├── librtmp.so.1 │ │ │ ├── libsasl2.so.2.0.25 │ │ │ ├── libssh2.so.1.0.1 │ │ │ ├── libssl.so.1.0.0 │ │ │ ├── libtasn1.so.6.3.2 │ │ │ ├── libudev.so.1.5.0 │ │ │ ├── libxcb-xkb.so.1.0.0 │ │ │ ├── libxcb.so.1.1.0 │ │ │ ├── libxkbcommon-x11.so.0.0.0 │ │ │ ├── libxkbcommon.so.0.0.0 │ │ │ └── libz.so.1.2.8 │ │ ├── Windows/ │ │ │ ├── Headers/ │ │ │ │ ├── GL/ │ │ │ │ │ ├── glew.h │ │ │ │ │ ├── glxew.h │ │ │ │ │ └── wglew.h │ │ │ │ ├── SFML/ │ │ │ │ │ ├── Audio/ │ │ │ │ │ │ ├── AlResource.hpp │ │ │ │ │ │ ├── Export.hpp │ │ │ │ │ │ ├── InputSoundFile.hpp │ │ │ │ │ │ ├── Listener.hpp │ │ │ │ │ │ ├── Music.hpp │ │ │ │ │ │ ├── OutputSoundFile.hpp │ │ │ │ │ │ ├── Sound.hpp │ │ │ │ │ │ ├── SoundBuffer.hpp │ │ │ │ │ │ ├── SoundBufferRecorder.hpp │ │ │ │ │ │ ├── SoundFileFactory.hpp │ │ │ │ │ │ ├── SoundFileFactory.inl │ │ │ │ │ │ ├── SoundFileReader.hpp │ │ │ │ │ │ ├── SoundFileWriter.hpp │ │ │ │ │ │ ├── SoundRecorder.hpp │ │ │ │ │ │ ├── SoundSource.hpp │ │ │ │ │ │ └── SoundStream.hpp │ │ │ │ │ ├── Audio.hpp │ │ │ │ │ ├── Config.hpp │ │ │ │ │ ├── Graphics/ │ │ │ │ │ │ ├── BlendMode.hpp │ │ │ │ │ │ ├── CircleShape.hpp │ │ │ │ │ │ ├── Color.hpp │ │ │ │ │ │ ├── ConvexShape.hpp │ │ │ │ │ │ ├── Drawable.hpp │ │ │ │ │ │ ├── Export.hpp │ │ │ │ │ │ ├── Font.hpp │ │ │ │ │ │ ├── Glsl.hpp │ │ │ │ │ │ ├── Glsl.inl │ │ │ │ │ │ ├── Glyph.hpp │ │ │ │ │ │ ├── Image.hpp │ │ │ │ │ │ ├── PrimitiveType.hpp │ │ │ │ │ │ ├── Rect.hpp │ │ │ │ │ │ ├── Rect.inl │ │ │ │ │ │ ├── RectangleShape.hpp │ │ │ │ │ │ ├── RenderStates.hpp │ │ │ │ │ │ ├── RenderTarget.hpp │ │ │ │ │ │ ├── RenderTexture.hpp │ │ │ │ │ │ ├── RenderWindow.hpp │ │ │ │ │ │ ├── Shader.hpp │ │ │ │ │ │ ├── Shape.hpp │ │ │ │ │ │ ├── Sprite.hpp │ │ │ │ │ │ ├── Text.hpp │ │ │ │ │ │ ├── Texture.hpp │ │ │ │ │ │ ├── Transform.hpp │ │ │ │ │ │ ├── Transformable.hpp │ │ │ │ │ │ ├── Vertex.hpp │ │ │ │ │ │ ├── VertexArray.hpp │ │ │ │ │ │ └── View.hpp │ │ │ │ │ ├── Graphics.hpp │ │ │ │ │ ├── Main.hpp │ │ │ │ │ ├── Network/ │ │ │ │ │ │ ├── Export.hpp │ │ │ │ │ │ ├── Ftp.hpp │ │ │ │ │ │ ├── Http.hpp │ │ │ │ │ │ ├── IpAddress.hpp │ │ │ │ │ │ ├── Packet.hpp │ │ │ │ │ │ ├── Socket.hpp │ │ │ │ │ │ ├── SocketHandle.hpp │ │ │ │ │ │ ├── SocketSelector.hpp │ │ │ │ │ │ ├── TcpListener.hpp │ │ │ │ │ │ ├── TcpSocket.hpp │ │ │ │ │ │ └── UdpSocket.hpp │ │ │ │ │ ├── Network.hpp │ │ │ │ │ ├── OpenGL.hpp │ │ │ │ │ ├── System/ │ │ │ │ │ │ ├── Clock.hpp │ │ │ │ │ │ ├── Err.hpp │ │ │ │ │ │ ├── Export.hpp │ │ │ │ │ │ ├── FileInputStream.hpp │ │ │ │ │ │ ├── InputStream.hpp │ │ │ │ │ │ ├── Lock.hpp │ │ │ │ │ │ ├── MemoryInputStream.hpp │ │ │ │ │ │ ├── Mutex.hpp │ │ │ │ │ │ ├── NativeActivity.hpp │ │ │ │ │ │ ├── NonCopyable.hpp │ │ │ │ │ │ ├── Sleep.hpp │ │ │ │ │ │ ├── String.hpp │ │ │ │ │ │ ├── String.inl │ │ │ │ │ │ ├── Thread.hpp │ │ │ │ │ │ ├── Thread.inl │ │ │ │ │ │ ├── ThreadLocal.hpp │ │ │ │ │ │ ├── ThreadLocalPtr.hpp │ │ │ │ │ │ ├── ThreadLocalPtr.inl │ │ │ │ │ │ ├── Time.hpp │ │ │ │ │ │ ├── Utf.hpp │ │ │ │ │ │ ├── Utf.inl │ │ │ │ │ │ ├── Vector2.hpp │ │ │ │ │ │ ├── Vector2.inl │ │ │ │ │ │ ├── Vector3.hpp │ │ │ │ │ │ └── Vector3.inl │ │ │ │ │ ├── System.hpp │ │ │ │ │ ├── Window/ │ │ │ │ │ │ ├── Context.hpp │ │ │ │ │ │ ├── ContextSettings.hpp │ │ │ │ │ │ ├── Event.hpp │ │ │ │ │ │ ├── Export.hpp │ │ │ │ │ │ ├── GlResource.hpp │ │ │ │ │ │ ├── Joystick.hpp │ │ │ │ │ │ ├── Keyboard.hpp │ │ │ │ │ │ ├── Mouse.hpp │ │ │ │ │ │ ├── Sensor.hpp │ │ │ │ │ │ ├── Touch.hpp │ │ │ │ │ │ ├── VideoMode.hpp │ │ │ │ │ │ ├── Window.hpp │ │ │ │ │ │ ├── WindowHandle.hpp │ │ │ │ │ │ └── WindowStyle.hpp │ │ │ │ │ └── Window.hpp │ │ │ │ ├── SHA1/ │ │ │ │ │ ├── HMAC_SHA1.h │ │ │ │ │ └── SHA1.h │ │ │ │ ├── SHA256/ │ │ │ │ │ └── sha256.h │ │ │ │ ├── aes/ │ │ │ │ │ └── aes.h │ │ │ │ ├── base64/ │ │ │ │ │ └── base64.h │ │ │ │ ├── json/ │ │ │ │ │ ├── assertions.h │ │ │ │ │ ├── autolink.h │ │ │ │ │ ├── config.h │ │ │ │ │ ├── features.h │ │ │ │ │ ├── forwards.h │ │ │ │ │ ├── json.h │ │ │ │ │ ├── json_batchallocator.h │ │ │ │ │ ├── json_internalarray.inl │ │ │ │ │ ├── json_internalmap.inl │ │ │ │ │ ├── json_tool.h │ │ │ │ │ ├── json_valueiterator.inl │ │ │ │ │ ├── reader.h │ │ │ │ │ ├── value.h │ │ │ │ │ └── writer.h │ │ │ │ ├── md5/ │ │ │ │ │ └── md5.h │ │ │ │ ├── minizip/ │ │ │ │ │ ├── crypt.h │ │ │ │ │ ├── ioapi.h │ │ │ │ │ ├── mztools.h │ │ │ │ │ ├── unzip.h │ │ │ │ │ └── zip.h │ │ │ │ ├── png/ │ │ │ │ │ ├── png.h │ │ │ │ │ ├── pngconf.h │ │ │ │ │ ├── pngdebug.h │ │ │ │ │ ├── pnginfo.h │ │ │ │ │ ├── pnglibconf.h │ │ │ │ │ ├── pngpriv.h │ │ │ │ │ └── pngstruct.h │ │ │ │ ├── rapidxml/ │ │ │ │ │ ├── rapidxml.hpp │ │ │ │ │ ├── rapidxml_iterators.hpp │ │ │ │ │ ├── rapidxml_print.hpp │ │ │ │ │ └── rapidxml_utils.hpp │ │ │ │ ├── zconf.h │ │ │ │ └── zlib.h │ │ │ └── Libs/ │ │ │ ├── Win32/ │ │ │ │ ├── Debug/ │ │ │ │ │ ├── CSBase.lib │ │ │ │ │ ├── CSBase.pdb │ │ │ │ │ ├── glew32s.lib │ │ │ │ │ ├── sfml-system-s-d.lib │ │ │ │ │ ├── sfml-window-s-d.lib │ │ │ │ │ └── zlibstat.lib │ │ │ │ └── Release/ │ │ │ │ ├── CSBase.lib │ │ │ │ ├── glew32s.lib │ │ │ │ ├── sfml-system-s.lib │ │ │ │ ├── sfml-window-s.lib │ │ │ │ └── zlibstat.lib │ │ │ └── x64/ │ │ │ ├── Debug/ │ │ │ │ ├── CSBase.lib │ │ │ │ ├── CSBase.pdb │ │ │ │ ├── glew32s.lib │ │ │ │ ├── sfml-system-s-d.lib │ │ │ │ ├── sfml-window-s-d.lib │ │ │ │ └── zlibstat.lib │ │ │ └── Release/ │ │ │ ├── CSBase.lib │ │ │ ├── glew32s.lib │ │ │ ├── sfml-system-s.lib │ │ │ ├── sfml-window-s.lib │ │ │ └── zlibstat.lib │ │ └── iOS/ │ │ ├── Headers/ │ │ │ ├── Reachability/ │ │ │ │ └── CSReachability.h │ │ │ ├── SHA1/ │ │ │ │ ├── HMAC_SHA1.h │ │ │ │ └── SHA1.h │ │ │ ├── SHA256/ │ │ │ │ └── sha256.h │ │ │ ├── aes/ │ │ │ │ └── aes.h │ │ │ ├── base64/ │ │ │ │ └── base64.h │ │ │ ├── json/ │ │ │ │ ├── assertions.h │ │ │ │ ├── autolink.h │ │ │ │ ├── config.h │ │ │ │ ├── features.h │ │ │ │ ├── forwards.h │ │ │ │ ├── json.h │ │ │ │ ├── json_batchallocator.h │ │ │ │ ├── json_internalarray.inl │ │ │ │ ├── json_internalmap.inl │ │ │ │ ├── json_tool.h │ │ │ │ ├── json_valueiterator.inl │ │ │ │ ├── reader.h │ │ │ │ ├── value.h │ │ │ │ └── writer.h │ │ │ ├── md5/ │ │ │ │ └── md5.h │ │ │ ├── minizip/ │ │ │ │ ├── crypt.h │ │ │ │ ├── ioapi.h │ │ │ │ ├── mztools.h │ │ │ │ ├── unzip.h │ │ │ │ └── zip.h │ │ │ ├── png/ │ │ │ │ ├── png.h │ │ │ │ ├── pngconf.h │ │ │ │ ├── pngdebug.h │ │ │ │ ├── pnginfo.h │ │ │ │ ├── pnglibconf.h │ │ │ │ ├── pngpriv.h │ │ │ │ └── pngstruct.h │ │ │ └── rapidxml/ │ │ │ ├── rapidxml.hpp │ │ │ ├── rapidxml_iterators.hpp │ │ │ ├── rapidxml_print.hpp │ │ │ └── rapidxml_utils.hpp │ │ └── Libs/ │ │ └── libCSBase.a │ └── CricketAudio/ │ ├── Android/ │ │ ├── Headers/ │ │ │ └── ck/ │ │ │ ├── attenuationmode.h │ │ │ ├── bank.h │ │ │ ├── ck.h │ │ │ ├── config.h │ │ │ ├── customfile.h │ │ │ ├── customstream.h │ │ │ ├── effect.h │ │ │ ├── effectbus.h │ │ │ ├── effectparam.h │ │ │ ├── effectprocessor.h │ │ │ ├── effecttype.h │ │ │ ├── mixer.h │ │ │ ├── pathtype.h │ │ │ ├── platform.h │ │ │ └── sound.h │ │ └── Libs/ │ │ ├── arm64-v8a/ │ │ │ └── libck.a │ │ ├── armeabi/ │ │ │ └── libck.a │ │ ├── armeabi-v7a/ │ │ │ └── libck.a │ │ ├── x86/ │ │ │ └── libck.a │ │ └── x86_64/ │ │ └── libck.a │ ├── RPi/ │ │ └── Headers/ │ │ └── ck/ │ │ ├── attenuationmode.h │ │ ├── bank.h │ │ ├── ck.h │ │ ├── config.h │ │ ├── customfile.h │ │ ├── customstream.h │ │ ├── effect.h │ │ ├── effectbus.h │ │ ├── effectparam.h │ │ ├── effectprocessor.h │ │ ├── effecttype.h │ │ ├── mixer.h │ │ ├── pathtype.h │ │ ├── platform.h │ │ └── sound.h │ ├── Windows/ │ │ ├── Headers/ │ │ │ └── ck/ │ │ │ ├── attenuationmode.h │ │ │ ├── bank.h │ │ │ ├── ck.h │ │ │ ├── config.h │ │ │ ├── customfile.h │ │ │ ├── customstream.h │ │ │ ├── effect.h │ │ │ ├── effectbus.h │ │ │ ├── effectparam.h │ │ │ ├── effectprocessor.h │ │ │ ├── effecttype.h │ │ │ ├── mixer.h │ │ │ ├── pathtype.h │ │ │ ├── platform.h │ │ │ └── sound.h │ │ └── Libs/ │ │ ├── Win32/ │ │ │ ├── Debug/ │ │ │ │ └── ck.lib │ │ │ └── Release/ │ │ │ └── ck.lib │ │ └── x64/ │ │ ├── Debug/ │ │ │ └── ck.lib │ │ └── Release/ │ │ └── ck.lib │ └── iOS/ │ ├── Headers/ │ │ └── ck/ │ │ ├── attenuationmode.h │ │ ├── bank.h │ │ ├── ck.h │ │ ├── config.h │ │ ├── customfile.h │ │ ├── customstream.h │ │ ├── effect.h │ │ ├── effectbus.h │ │ ├── effectparam.h │ │ ├── effectprocessor.h │ │ ├── effecttype.h │ │ ├── mixer.h │ │ ├── objc/ │ │ │ ├── attenuationmode.h │ │ │ ├── bank.h │ │ │ ├── ck.h │ │ │ ├── config.h │ │ │ ├── effect.h │ │ │ ├── effectbus.h │ │ │ ├── effectparam.h │ │ │ ├── effecttype.h │ │ │ ├── mixer.h │ │ │ ├── pathtype.h │ │ │ ├── platform.h │ │ │ └── sound.h │ │ ├── pathtype.h │ │ ├── platform.h │ │ └── sound.h │ └── Libs/ │ └── libck.a ├── Projects/ │ ├── Android/ │ │ ├── chillisource/ │ │ │ ├── build.gradle │ │ │ ├── chillisource.iml │ │ │ └── src/ │ │ │ ├── amazon/ │ │ │ │ └── libs/ │ │ │ │ └── AmazonIAP.jar │ │ │ ├── googlePlay/ │ │ │ │ └── aidl/ │ │ │ │ └── com/ │ │ │ │ └── android/ │ │ │ │ └── vending/ │ │ │ │ └── billing/ │ │ │ │ └── IInAppBillingService.aidl │ │ │ └── main/ │ │ │ ├── AndroidManifest.xml │ │ │ ├── jni/ │ │ │ │ ├── Android.mk │ │ │ │ └── Application.mk │ │ │ └── res/ │ │ │ └── values/ │ │ │ └── strings.xml │ │ ├── playapkexpansion/ │ │ │ ├── build.gradle │ │ │ ├── playapkexpansion.iml │ │ │ └── src/ │ │ │ └── main/ │ │ │ ├── AndroidManifest.xml │ │ │ ├── java/ │ │ │ │ └── com/ │ │ │ │ └── google/ │ │ │ │ └── android/ │ │ │ │ └── vending/ │ │ │ │ └── expansion/ │ │ │ │ └── downloader/ │ │ │ │ ├── Constants.java │ │ │ │ ├── DownloadProgressInfo.java │ │ │ │ ├── DownloaderClientMarshaller.java │ │ │ │ ├── DownloaderServiceMarshaller.java │ │ │ │ ├── Helpers.java │ │ │ │ ├── IDownloaderClient.java │ │ │ │ ├── IDownloaderService.java │ │ │ │ ├── IStub.java │ │ │ │ ├── SystemFacade.java │ │ │ │ └── impl/ │ │ │ │ ├── AndroidHttpClient.java │ │ │ │ ├── CustomIntentService.java │ │ │ │ ├── CustomNotificationFactory.java │ │ │ │ ├── DownloadInfo.java │ │ │ │ ├── DownloadNotification.java │ │ │ │ ├── DownloadThread.java │ │ │ │ ├── DownloaderService.java │ │ │ │ ├── DownloadsDB.java │ │ │ │ ├── HttpDateTime.java │ │ │ │ ├── V14CustomNotification.java │ │ │ │ └── V3CustomNotification.java │ │ │ └── res/ │ │ │ ├── layout/ │ │ │ │ └── status_bar_ongoing_event_progress_bar.xml │ │ │ ├── values/ │ │ │ │ ├── strings.xml │ │ │ │ └── styles.xml │ │ │ ├── values-v11/ │ │ │ │ └── styles.xml │ │ │ └── values-v9/ │ │ │ └── styles.xml │ │ └── playlicensing/ │ │ ├── build.gradle │ │ ├── playlicensing.iml │ │ └── src/ │ │ └── main/ │ │ ├── AndroidManifest.xml │ │ ├── aidl/ │ │ │ └── com/ │ │ │ └── android/ │ │ │ └── vending/ │ │ │ └── licensing/ │ │ │ ├── ILicenseResultListener.aidl │ │ │ └── ILicensingService.aidl │ │ └── java/ │ │ └── com/ │ │ └── google/ │ │ └── android/ │ │ └── vending/ │ │ └── licensing/ │ │ ├── AESObfuscator.java │ │ ├── APKExpansionPolicy.java │ │ ├── DeviceLimiter.java │ │ ├── ILicenseResultListener.java │ │ ├── ILicensingService.java │ │ ├── LicenseChecker.java │ │ ├── LicenseCheckerCallback.java │ │ ├── LicenseValidator.java │ │ ├── NullDeviceLimiter.java │ │ ├── Obfuscator.java │ │ ├── Policy.java │ │ ├── PreferenceObfuscator.java │ │ ├── ResponseData.java │ │ ├── ServerManagedPolicy.java │ │ ├── StrictPolicy.java │ │ ├── ValidationException.java │ │ └── util/ │ │ ├── Base64.java │ │ └── Base64DecoderException.java │ ├── Libraries/ │ │ └── CSBase/ │ │ ├── AndroidManifest.xml │ │ ├── CSBase.sln │ │ ├── CSBase.vcxproj │ │ ├── CSBase.vcxproj.filters │ │ ├── CSBase.xcodeproj/ │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace/ │ │ │ │ └── contents.xcworkspacedata │ │ │ └── xcshareddata/ │ │ │ └── xcschemes/ │ │ │ ├── CSBase.xcscheme │ │ │ └── UniversalLib.xcscheme │ │ ├── PlatformSource/ │ │ │ ├── RPi/ │ │ │ │ ├── zconf.h │ │ │ │ └── zlib.h │ │ │ ├── Windows/ │ │ │ │ ├── zconf.h │ │ │ │ └── zlib.h │ │ │ └── iOS/ │ │ │ └── Reachability/ │ │ │ ├── CSReachability.h │ │ │ └── CSReachability.m │ │ ├── Source/ │ │ │ ├── SHA1/ │ │ │ │ ├── HMAC_SHA1.cpp │ │ │ │ ├── HMAC_SHA1.h │ │ │ │ ├── SHA1.cpp │ │ │ │ └── SHA1.h │ │ │ ├── SHA256/ │ │ │ │ ├── sha256.cpp │ │ │ │ └── sha256.h │ │ │ ├── aes/ │ │ │ │ ├── aes.c │ │ │ │ └── aes.h │ │ │ ├── base64/ │ │ │ │ ├── base64.cpp │ │ │ │ └── base64.h │ │ │ ├── json/ │ │ │ │ ├── assertions.h │ │ │ │ ├── autolink.h │ │ │ │ ├── config.h │ │ │ │ ├── features.h │ │ │ │ ├── forwards.h │ │ │ │ ├── json.h │ │ │ │ ├── json_batchallocator.h │ │ │ │ ├── json_internalarray.inl │ │ │ │ ├── json_internalmap.inl │ │ │ │ ├── json_reader.cpp │ │ │ │ ├── json_tool.h │ │ │ │ ├── json_value.cpp │ │ │ │ ├── json_valueiterator.inl │ │ │ │ ├── json_writer.cpp │ │ │ │ ├── reader.h │ │ │ │ ├── value.h │ │ │ │ ├── version.h.in │ │ │ │ └── writer.h │ │ │ ├── md5/ │ │ │ │ ├── md5.cpp │ │ │ │ └── md5.h │ │ │ ├── minizip/ │ │ │ │ ├── crypt.h │ │ │ │ ├── ioapi.c │ │ │ │ ├── ioapi.h │ │ │ │ ├── mztools.c │ │ │ │ ├── mztools.h │ │ │ │ ├── unzip.c │ │ │ │ ├── unzip.h │ │ │ │ ├── zip.c │ │ │ │ └── zip.h │ │ │ ├── png/ │ │ │ │ ├── png.c │ │ │ │ ├── png.h │ │ │ │ ├── pngconf.h │ │ │ │ ├── pngdebug.h │ │ │ │ ├── pngerror.c │ │ │ │ ├── pngget.c │ │ │ │ ├── pnginfo.h │ │ │ │ ├── pnglibconf.h │ │ │ │ ├── pngmem.c │ │ │ │ ├── pngpread.c │ │ │ │ ├── pngpriv.h │ │ │ │ ├── pngread.c │ │ │ │ ├── pngrio.c │ │ │ │ ├── pngrtran.c │ │ │ │ ├── pngrutil.c │ │ │ │ ├── pngset.c │ │ │ │ ├── pngstruct.h │ │ │ │ ├── pngtest.c │ │ │ │ ├── pngtrans.c │ │ │ │ ├── pngwio.c │ │ │ │ ├── pngwrite.c │ │ │ │ ├── pngwtran.c │ │ │ │ └── pngwutil.c │ │ │ ├── rapidxml/ │ │ │ │ ├── rapidxml.hpp │ │ │ │ ├── rapidxml_iterators.hpp │ │ │ │ ├── rapidxml_print.hpp │ │ │ │ └── rapidxml_utils.hpp │ │ │ └── zlib/ │ │ │ ├── adler32.c │ │ │ ├── compress.c │ │ │ ├── crc32.c │ │ │ ├── crc32.h │ │ │ ├── deflate.c │ │ │ ├── deflate.h │ │ │ ├── gzclose.c │ │ │ ├── gzguts.h │ │ │ ├── gzlib.c │ │ │ ├── gzread.c │ │ │ ├── gzwrite.c │ │ │ ├── infback.c │ │ │ ├── inffast.c │ │ │ ├── inffast.h │ │ │ ├── inffixed.h │ │ │ ├── inflate.c │ │ │ ├── inflate.h │ │ │ ├── inftrees.c │ │ │ ├── inftrees.h │ │ │ ├── trees.c │ │ │ ├── trees.h │ │ │ ├── uncompr.c │ │ │ ├── zconf.h │ │ │ ├── zlib.h │ │ │ ├── zutil.c │ │ │ └── zutil.h │ │ ├── jni/ │ │ │ ├── Android.mk │ │ │ └── Application.mk │ │ └── rpi_csbase_build.py │ ├── Tools/ │ │ ├── AndroidManifestBuilder/ │ │ │ ├── .classpath │ │ │ ├── .project │ │ │ ├── Manifest.txt │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── androidmanifestbuilder/ │ │ │ ├── AndroidManifestBuilder.java │ │ │ ├── Main.java │ │ │ └── UserManifestData.java │ │ ├── CSAtlasBuilder/ │ │ │ ├── .classpath │ │ │ ├── .gitignore │ │ │ ├── .project │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── csatlasbuilder/ │ │ │ ├── AtlasBuilderOptions.java │ │ │ ├── AtlasImage.java │ │ │ ├── CSAtlasBuilder.java │ │ │ └── Main.java │ │ ├── CSFontBuilder/ │ │ │ ├── .classpath │ │ │ ├── .gitignore │ │ │ ├── .project │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── csfontbuilder/ │ │ │ ├── Main.java │ │ │ ├── fontbuilder/ │ │ │ │ └── FontBuilder.java │ │ │ ├── fontfromglyphsbuilder/ │ │ │ │ ├── CSFontWriter.java │ │ │ │ ├── FontFromGlyphsBuilder.java │ │ │ │ ├── FontFromGlyphsBuilderOptions.java │ │ │ │ ├── FontFromGlyphsBuilderOptionsParser.java │ │ │ │ ├── Glyph.java │ │ │ │ ├── Glyphs.java │ │ │ │ └── GlyphsReader.java │ │ │ └── glyphsbuilder/ │ │ │ ├── Glyph.java │ │ │ ├── Glyphs.java │ │ │ ├── GlyphsBuilder.java │ │ │ ├── GlyphsBuilderOptions.java │ │ │ ├── GlyphsBuilderOptionsParser.java │ │ │ ├── GlyphsRenderer.java │ │ │ └── GlyphsWriter.java │ │ ├── CSProjectGenerator/ │ │ │ ├── .classpath │ │ │ ├── .project │ │ │ ├── Manifest.txt │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── csprojectgenerator/ │ │ │ ├── CSProjectGenerator.java │ │ │ ├── Main.java │ │ │ └── Options.java │ │ ├── CSTextBuilder/ │ │ │ ├── .classpath │ │ │ ├── .project │ │ │ ├── Manifest/ │ │ │ │ └── man.txt │ │ │ ├── lib/ │ │ │ │ └── jxl.jar │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── cstextbuilder/ │ │ │ ├── CSTextBuilder.java │ │ │ ├── ExtractTextOptions.java │ │ │ └── Main.java │ │ ├── CkTool/ │ │ │ ├── .classpath │ │ │ ├── .project │ │ │ ├── Manifest.txt │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── cktool/ │ │ │ ├── CkTool.java │ │ │ ├── Main.java │ │ │ └── Options.java │ │ ├── ColladaParserUtils/ │ │ │ ├── .classpath │ │ │ ├── .project │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── colladaparserutils/ │ │ │ ├── AssetParser.java │ │ │ ├── ColladaParser.java │ │ │ ├── ColladaUtils.java │ │ │ ├── LibraryAnimationsParser.java │ │ │ ├── LibraryControllersParser.java │ │ │ ├── LibraryEffectsParser.java │ │ │ ├── LibraryGeometriesParser.java │ │ │ ├── LibraryImagesParser.java │ │ │ ├── LibraryMaterialsParser.java │ │ │ ├── LibraryVisualScenesParser.java │ │ │ ├── SceneParser.java │ │ │ └── colladadata/ │ │ │ ├── Collada.java │ │ │ ├── ColladaAccessor.java │ │ │ ├── ColladaAnimation.java │ │ │ ├── ColladaAsset.java │ │ │ ├── ColladaAuthoringTool.java │ │ │ ├── ColladaBindMaterial.java │ │ │ ├── ColladaBindShapeMatrix.java │ │ │ ├── ColladaBindVertexInput.java │ │ │ ├── ColladaBlinnAndPhong.java │ │ │ ├── ColladaChannel.java │ │ │ ├── ColladaColour.java │ │ │ ├── ColladaContributor.java │ │ │ ├── ColladaController.java │ │ │ ├── ColladaEffect.java │ │ │ ├── ColladaExtra.java │ │ │ ├── ColladaFloat.java │ │ │ ├── ColladaFloatArray.java │ │ │ ├── ColladaGeometry.java │ │ │ ├── ColladaImage.java │ │ │ ├── ColladaInitFrom.java │ │ │ ├── ColladaInput.java │ │ │ ├── ColladaInstanceCamera.java │ │ │ ├── ColladaInstanceController.java │ │ │ ├── ColladaInstanceEffect.java │ │ │ ├── ColladaInstanceGeometry.java │ │ │ ├── ColladaInstanceLight.java │ │ │ ├── ColladaInstanceMaterial.java │ │ │ ├── ColladaInstanceVisualScene.java │ │ │ ├── ColladaJoints.java │ │ │ ├── ColladaMaterial.java │ │ │ ├── ColladaMaterialColour.java │ │ │ ├── ColladaMesh.java │ │ │ ├── ColladaNameArray.java │ │ │ ├── ColladaNewParam.java │ │ │ ├── ColladaNode.java │ │ │ ├── ColladaP.java │ │ │ ├── ColladaParam.java │ │ │ ├── ColladaProfileCommon.java │ │ │ ├── ColladaSampler.java │ │ │ ├── ColladaSampler2D.java │ │ │ ├── ColladaScene.java │ │ │ ├── ColladaShininess.java │ │ │ ├── ColladaSkeleton.java │ │ │ ├── ColladaSkin.java │ │ │ ├── ColladaSource.java │ │ │ ├── ColladaSurface.java │ │ │ ├── ColladaTechnique.java │ │ │ ├── ColladaTechniqueCommon.java │ │ │ ├── ColladaTexture.java │ │ │ ├── ColladaTriangles.java │ │ │ ├── ColladaUserProperties.java │ │ │ ├── ColladaV.java │ │ │ ├── ColladaVCount.java │ │ │ ├── ColladaVertexWeights.java │ │ │ ├── ColladaVertices.java │ │ │ └── ColladaVisualScene.java │ │ ├── ColladaToCSAnim/ │ │ │ ├── .classpath │ │ │ ├── .project │ │ │ ├── Manifest/ │ │ │ │ └── Manifest.txt │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── colladatocsanim/ │ │ │ ├── Animation.java │ │ │ ├── CSAnimConverter.java │ │ │ ├── CSAnimOutputer.java │ │ │ ├── CSAnimTransformer.java │ │ │ ├── ColladaToCSAnim.java │ │ │ ├── ColladaToCSAnimOptions.java │ │ │ ├── Main.java │ │ │ ├── SkeletonBuilder.java │ │ │ ├── SkeletonNodeComparator.java │ │ │ └── csanim/ │ │ │ ├── CSAnim.java │ │ │ ├── CSAnimFrame.java │ │ │ ├── CSAnimSkeleton.java │ │ │ └── CSAnimSkeletonNode.java │ │ ├── ColladaToCSModel/ │ │ │ ├── .classpath │ │ │ ├── .project │ │ │ ├── Manifest/ │ │ │ │ └── Manifest.txt │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── colladatocsmodel/ │ │ │ ├── CSModelConverter.java │ │ │ ├── CSModelOutputer.java │ │ │ ├── CSModelTransformer.java │ │ │ ├── CSModelWeightIndexData.java │ │ │ ├── ColladaToCSModel.java │ │ │ ├── ColladaToCSModelOptions.java │ │ │ ├── Main.java │ │ │ ├── ModelChecker.java │ │ │ ├── ParamsChecker.java │ │ │ ├── SkeletonBuilder.java │ │ │ ├── SkeletonNodeComparator.java │ │ │ ├── UserPropertiesParser.java │ │ │ └── csmodel/ │ │ │ ├── CSModel.java │ │ │ ├── CSModelMaterial.java │ │ │ ├── CSModelMesh.java │ │ │ ├── CSModelSkeleton.java │ │ │ ├── CSModelSkeletonNode.java │ │ │ └── CSModelVertex.java │ │ ├── CoreUtils/ │ │ │ ├── .classpath │ │ │ ├── .gitignore │ │ │ ├── .project │ │ │ └── src/ │ │ │ ├── com/ │ │ │ │ └── chilliworks/ │ │ │ │ └── chillisource/ │ │ │ │ └── coreutils/ │ │ │ │ ├── CSException.java │ │ │ │ ├── Colour.java │ │ │ │ ├── ExternalProcess.java │ │ │ │ ├── FileUtils.java │ │ │ │ ├── HashCodeUtils.java │ │ │ │ ├── Integer2.java │ │ │ │ ├── Integer3.java │ │ │ │ ├── Integer4.java │ │ │ │ ├── LittleEndianWriterUtils.java │ │ │ │ ├── Logging.java │ │ │ │ ├── Matrix4.java │ │ │ │ ├── Pair.java │ │ │ │ ├── Quaternion.java │ │ │ │ ├── StringUtils.java │ │ │ │ ├── StringWriterUtils.java │ │ │ │ ├── Tuple3.java │ │ │ │ ├── Tuple4.java │ │ │ │ ├── Tuple5.java │ │ │ │ ├── Vector2.java │ │ │ │ ├── Vector3.java │ │ │ │ ├── Vector4.java │ │ │ │ └── ZipUtils.java │ │ │ └── org/ │ │ │ └── json/ │ │ │ ├── JSONArray.java │ │ │ ├── JSONException.java │ │ │ ├── JSONObject.java │ │ │ ├── JSONString.java │ │ │ ├── JSONStringer.java │ │ │ ├── JSONTokener.java │ │ │ └── JSONWriter.java │ │ ├── PNGAlphaPremultiplier/ │ │ │ ├── .classpath │ │ │ ├── .gitignore │ │ │ ├── .project │ │ │ ├── Manifest/ │ │ │ │ └── Manifest.txt │ │ │ ├── Native/ │ │ │ │ ├── Config.mk │ │ │ │ ├── Makefile │ │ │ │ ├── PNGAlphaPremultiplier.sln │ │ │ │ ├── PNGAlphaPremultiplier.vcxproj │ │ │ │ └── Source/ │ │ │ │ ├── CLogging.cpp │ │ │ │ ├── CLogging.h │ │ │ │ ├── LibPng/ │ │ │ │ │ ├── example.c │ │ │ │ │ ├── png.c │ │ │ │ │ ├── png.h │ │ │ │ │ ├── pngconf.h │ │ │ │ │ ├── pngdebug.h │ │ │ │ │ ├── pngerror.c │ │ │ │ │ ├── pngget.c │ │ │ │ │ ├── pnginfo.h │ │ │ │ │ ├── pnglibconf.h │ │ │ │ │ ├── pngmem.c │ │ │ │ │ ├── pngpread.c │ │ │ │ │ ├── pngpriv.h │ │ │ │ │ ├── pngread.c │ │ │ │ │ ├── pngrio.c │ │ │ │ │ ├── pngrtran.c │ │ │ │ │ ├── pngrutil.c │ │ │ │ │ ├── pngset.c │ │ │ │ │ ├── pngstruct.h │ │ │ │ │ ├── pngtest.c │ │ │ │ │ ├── pngtrans.c │ │ │ │ │ ├── pngwio.c │ │ │ │ │ ├── pngwrite.c │ │ │ │ │ ├── pngwtran.c │ │ │ │ │ └── pngwutil.c │ │ │ │ ├── Logging.cpp │ │ │ │ ├── Logging.h │ │ │ │ ├── Main.cpp │ │ │ │ ├── PNGAlphaPremultiplier.c │ │ │ │ ├── PNGAlphaPremultiplier.h │ │ │ │ ├── StringUtils.cpp │ │ │ │ ├── StringUtils.h │ │ │ │ └── ZLib/ │ │ │ │ ├── adler32.c │ │ │ │ ├── compress.c │ │ │ │ ├── crc32.c │ │ │ │ ├── crc32.h │ │ │ │ ├── deflate.c │ │ │ │ ├── deflate.h │ │ │ │ ├── gzclose.c │ │ │ │ ├── gzguts.h │ │ │ │ ├── gzlib.c │ │ │ │ ├── gzread.c │ │ │ │ ├── gzwrite.c │ │ │ │ ├── infback.c │ │ │ │ ├── inffast.c │ │ │ │ ├── inffast.h │ │ │ │ ├── inffixed.h │ │ │ │ ├── inflate.c │ │ │ │ ├── inflate.h │ │ │ │ ├── inftrees.c │ │ │ │ ├── inftrees.h │ │ │ │ ├── trees.c │ │ │ │ ├── trees.h │ │ │ │ ├── uncompr.c │ │ │ │ ├── zconf.h │ │ │ │ ├── zlib.h │ │ │ │ ├── zutil.c │ │ │ │ └── zutil.h │ │ │ ├── PNGAlphaPremultiplier/ │ │ │ │ ├── PNGAlphaPremultiplierLinux │ │ │ │ └── PNGAlphaPremultiplierOSX │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── pngalphapremultiplier/ │ │ │ ├── Main.java │ │ │ ├── PngPremultiplier.java │ │ │ └── PremultiplicationOptions.java │ │ ├── PNGToCSImage/ │ │ │ ├── .classpath │ │ │ ├── .gitignore │ │ │ ├── .project │ │ │ ├── Manifest/ │ │ │ │ └── Manifest.txt │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── pngtocsimage/ │ │ │ ├── ImageContainer.java │ │ │ ├── Main.java │ │ │ ├── PNGToCSImage.java │ │ │ └── PNGToCSImageOptions.java │ │ ├── TGAToCSImage/ │ │ │ ├── .classpath │ │ │ ├── .project │ │ │ ├── Manifest/ │ │ │ │ └── Manifest.txt │ │ │ ├── com.realityinteractive.imageio.tga.jar │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── tgatocsimage/ │ │ │ ├── ImageContainer.java │ │ │ ├── Main.java │ │ │ ├── TGAToCSImage.java │ │ │ └── TGAToCSImageOptions.java │ │ ├── TexturePackerUtils/ │ │ │ ├── .classpath │ │ │ ├── .gitignore │ │ │ ├── .project │ │ │ └── src/ │ │ │ └── com/ │ │ │ └── chilliworks/ │ │ │ └── chillisource/ │ │ │ └── texturepackerutils/ │ │ │ ├── CollisionGrid.java │ │ │ ├── PackedTexture.java │ │ │ ├── PackerInfo.java │ │ │ ├── Rectangle.java │ │ │ └── TexturePacker.java │ │ └── Zip/ │ │ ├── .classpath │ │ ├── .project │ │ └── src/ │ │ └── com/ │ │ └── chilliworks/ │ │ └── chillisource/ │ │ └── zip/ │ │ ├── Main.java │ │ ├── ZipOptions.java │ │ └── Zipper.java │ ├── Windows/ │ │ ├── ChilliSource.vcxproj │ │ └── ChilliSource.vcxproj.filters │ └── iOS/ │ └── ChilliSource.xcodeproj/ │ ├── project.pbxproj │ ├── project.xcworkspace/ │ │ └── contents.xcworkspacedata │ └── xcshareddata/ │ └── xcschemes/ │ └── ChilliSource.xcscheme ├── Source/ │ ├── CSBackend/ │ │ ├── Platform/ │ │ │ ├── Android/ │ │ │ │ ├── Amazon/ │ │ │ │ │ ├── JNI/ │ │ │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ │ │ └── Networking/ │ │ │ │ │ │ └── IAP/ │ │ │ │ │ │ ├── AmazonIAPJavaInterface.cpp │ │ │ │ │ │ ├── AmazonIAPJavaInterface.h │ │ │ │ │ │ ├── AmazonIAPSystem.cpp │ │ │ │ │ │ └── AmazonIAPSystem.h │ │ │ │ │ └── Java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── chilliworks/ │ │ │ │ │ └── chillisource/ │ │ │ │ │ ├── core/ │ │ │ │ │ │ ├── PackageFileUtils.java │ │ │ │ │ │ └── StartupActivityFactory.java │ │ │ │ │ └── networking/ │ │ │ │ │ ├── AmazonIAPNativeInterface.java │ │ │ │ │ ├── DataStore.java │ │ │ │ │ ├── PurchaseTransaction.java │ │ │ │ │ └── PurchasingObserver.java │ │ │ │ ├── GooglePlay/ │ │ │ │ │ ├── JNI/ │ │ │ │ │ │ ├── Core/ │ │ │ │ │ │ │ └── Base/ │ │ │ │ │ │ │ └── GooglePlayLicense.cpp │ │ │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ │ │ └── Networking/ │ │ │ │ │ │ └── IAP/ │ │ │ │ │ │ ├── GooglePlayIAPJavaInterface.cpp │ │ │ │ │ │ ├── GooglePlayIAPJavaInterface.h │ │ │ │ │ │ ├── GooglePlayIAPSystem.cpp │ │ │ │ │ │ └── GooglePlayIAPSystem.h │ │ │ │ │ └── Java/ │ │ │ │ │ └── com/ │ │ │ │ │ └── chilliworks/ │ │ │ │ │ └── chillisource/ │ │ │ │ │ ├── core/ │ │ │ │ │ │ ├── ApkExpansionContentProvider.java │ │ │ │ │ │ ├── ApkExpansionFileUtils.java │ │ │ │ │ │ ├── ApkExpansionInfo.java │ │ │ │ │ │ ├── GooglePlayLicensing.java │ │ │ │ │ │ ├── ListenableParcelFileDescriptor.java │ │ │ │ │ │ ├── PackageFileUtils.java │ │ │ │ │ │ └── StartupActivityFactory.java │ │ │ │ │ └── networking/ │ │ │ │ │ ├── ApkExpansionDownloadActivity.java │ │ │ │ │ ├── ApkExpansionDownloadAlarmReceiver.java │ │ │ │ │ ├── ApkExpansionDownloadService.java │ │ │ │ │ ├── ApkExpansionDownloadState.java │ │ │ │ │ ├── ApkExpansionDownloadValidator.java │ │ │ │ │ ├── ApkExpansionDownloadView.java │ │ │ │ │ ├── ApkExpansionDownloadViewFactory.java │ │ │ │ │ ├── Base64.java │ │ │ │ │ ├── Base64DecoderException.java │ │ │ │ │ ├── DefaultApkExpansionDownloadView.java │ │ │ │ │ ├── GooglePlayIAPNativeInterface.java │ │ │ │ │ ├── IabException.java │ │ │ │ │ ├── IabHelper.java │ │ │ │ │ ├── IabResult.java │ │ │ │ │ ├── Inventory.java │ │ │ │ │ ├── Purchase.java │ │ │ │ │ ├── Security.java │ │ │ │ │ └── SkuDetails.java │ │ │ │ └── Main/ │ │ │ │ ├── JNI/ │ │ │ │ │ ├── Audio/ │ │ │ │ │ │ └── CricketAudio/ │ │ │ │ │ │ ├── ZippedCkBankLoader.cpp │ │ │ │ │ │ └── ZippedCkBankLoader.h │ │ │ │ │ ├── Core/ │ │ │ │ │ │ ├── Base/ │ │ │ │ │ │ │ ├── CoreJavaInterface.cpp │ │ │ │ │ │ │ ├── CoreJavaInterface.h │ │ │ │ │ │ │ ├── DeviceJavaInterface.cpp │ │ │ │ │ │ │ ├── DeviceJavaInterface.h │ │ │ │ │ │ │ ├── PlatformSystem.cpp │ │ │ │ │ │ │ ├── PlatformSystem.h │ │ │ │ │ │ │ ├── Screen.cpp │ │ │ │ │ │ │ ├── Screen.h │ │ │ │ │ │ │ ├── SystemInfoFactory.cpp │ │ │ │ │ │ │ └── SystemInfoFactory.h │ │ │ │ │ │ ├── DialogueBox/ │ │ │ │ │ │ │ ├── DialogueBoxJavaInterface.cpp │ │ │ │ │ │ │ ├── DialogueBoxJavaInterface.h │ │ │ │ │ │ │ ├── DialogueBoxSystem.cpp │ │ │ │ │ │ │ └── DialogueBoxSystem.h │ │ │ │ │ │ ├── File/ │ │ │ │ │ │ │ ├── FileSystem.cpp │ │ │ │ │ │ │ ├── FileSystem.h │ │ │ │ │ │ │ ├── VirtualBinaryInputStream.cpp │ │ │ │ │ │ │ ├── VirtualBinaryInputStream.h │ │ │ │ │ │ │ ├── VirtualTextInputStream.cpp │ │ │ │ │ │ │ ├── VirtualTextInputStream.h │ │ │ │ │ │ │ ├── ZippedFileSystem.cpp │ │ │ │ │ │ │ └── ZippedFileSystem.h │ │ │ │ │ │ ├── Image/ │ │ │ │ │ │ │ ├── PNGImageProvider.cpp │ │ │ │ │ │ │ ├── PNGImageProvider.h │ │ │ │ │ │ │ ├── PngImage.cpp │ │ │ │ │ │ │ └── PngImage.h │ │ │ │ │ │ ├── Java/ │ │ │ │ │ │ │ ├── BoxedPointer.cpp │ │ │ │ │ │ │ ├── BoxedPointer.h │ │ │ │ │ │ │ ├── JavaClass.cpp │ │ │ │ │ │ │ ├── JavaClass.h │ │ │ │ │ │ │ ├── JavaClassDef.cpp │ │ │ │ │ │ │ ├── JavaClassDef.h │ │ │ │ │ │ │ ├── JavaInterface.cpp │ │ │ │ │ │ │ ├── JavaInterface.h │ │ │ │ │ │ │ ├── JavaInterfaceManager.cpp │ │ │ │ │ │ │ ├── JavaInterfaceManager.h │ │ │ │ │ │ │ ├── JavaMethodSignature.cpp │ │ │ │ │ │ │ ├── JavaMethodSignature.h │ │ │ │ │ │ │ ├── JavaStaticClass.cpp │ │ │ │ │ │ │ ├── JavaStaticClass.h │ │ │ │ │ │ │ ├── JavaStaticClassDef.cpp │ │ │ │ │ │ │ ├── JavaStaticClassDef.h │ │ │ │ │ │ │ ├── JavaSystem.cpp │ │ │ │ │ │ │ ├── JavaSystem.h │ │ │ │ │ │ │ ├── JavaUtils.cpp │ │ │ │ │ │ │ ├── JavaUtils.h │ │ │ │ │ │ │ ├── JavaVirtualMachine.cpp │ │ │ │ │ │ │ ├── JavaVirtualMachine.h │ │ │ │ │ │ │ ├── _JavaInterface.cpp │ │ │ │ │ │ │ └── _JavaInterface.h │ │ │ │ │ │ └── Notification/ │ │ │ │ │ │ ├── LocalNotificationJavaInterface.cpp │ │ │ │ │ │ ├── LocalNotificationJavaInterface.h │ │ │ │ │ │ ├── LocalNotificationSystem.cpp │ │ │ │ │ │ └── LocalNotificationSystem.h │ │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ │ ├── Input/ │ │ │ │ │ │ ├── Accelerometer/ │ │ │ │ │ │ │ ├── Accelerometer.cpp │ │ │ │ │ │ │ ├── Accelerometer.h │ │ │ │ │ │ │ ├── AccelerometerJavaInterface.cpp │ │ │ │ │ │ │ └── AccelerometerJavaInterface.h │ │ │ │ │ │ ├── DeviceButtons/ │ │ │ │ │ │ │ ├── DeviceButtonJavaInterface.cpp │ │ │ │ │ │ │ ├── DeviceButtonJavaInterface.h │ │ │ │ │ │ │ ├── DeviceButtonSystem.cpp │ │ │ │ │ │ │ └── DeviceButtonSystem.h │ │ │ │ │ │ ├── Gyroscope/ │ │ │ │ │ │ │ ├── Gyroscope.cpp │ │ │ │ │ │ │ ├── Gyroscope.h │ │ │ │ │ │ │ ├── GyroscopeJavaInterface.cpp │ │ │ │ │ │ │ └── GyroscopeJavaInterface.h │ │ │ │ │ │ ├── Pointer/ │ │ │ │ │ │ │ ├── PointerSystem.cpp │ │ │ │ │ │ │ ├── PointerSystem.h │ │ │ │ │ │ │ ├── TouchInputJavaInterface.cpp │ │ │ │ │ │ │ └── TouchInputJavaInterface.h │ │ │ │ │ │ └── TextEntry/ │ │ │ │ │ │ ├── TextEntry.cpp │ │ │ │ │ │ ├── TextEntry.h │ │ │ │ │ │ ├── TextEntryJavaInterface.cpp │ │ │ │ │ │ └── TextEntryJavaInterface.h │ │ │ │ │ ├── Networking/ │ │ │ │ │ │ └── Http/ │ │ │ │ │ │ ├── HttpRequest.cpp │ │ │ │ │ │ ├── HttpRequest.h │ │ │ │ │ │ ├── HttpRequestSystem.cpp │ │ │ │ │ │ └── HttpRequestSystem.h │ │ │ │ │ ├── Social/ │ │ │ │ │ │ └── Communications/ │ │ │ │ │ │ ├── EmailComposer.cpp │ │ │ │ │ │ ├── EmailComposer.h │ │ │ │ │ │ ├── EmailComposerJavaInterface.cpp │ │ │ │ │ │ └── EmailComposerJavaInterface.h │ │ │ │ │ ├── Video/ │ │ │ │ │ │ └── Base/ │ │ │ │ │ │ ├── VideoPlayer.cpp │ │ │ │ │ │ └── VideoPlayer.h │ │ │ │ │ └── Web/ │ │ │ │ │ └── Base/ │ │ │ │ │ ├── WebView.cpp │ │ │ │ │ ├── WebView.h │ │ │ │ │ ├── WebViewJavaInterface.cpp │ │ │ │ │ └── WebViewJavaInterface.h │ │ │ │ └── Java/ │ │ │ │ └── com/ │ │ │ │ └── chilliworks/ │ │ │ │ └── chillisource/ │ │ │ │ ├── core/ │ │ │ │ │ ├── AESEncryption.java │ │ │ │ │ ├── ApkFileUtils.java │ │ │ │ │ ├── AppConfig.java │ │ │ │ │ ├── BoxedPointer.java │ │ │ │ │ ├── CSActivity.java │ │ │ │ │ ├── CSApplication.java │ │ │ │ │ ├── ConfigChooser.java │ │ │ │ │ ├── ContextFactory.java │ │ │ │ │ ├── CoreNativeInterface.java │ │ │ │ │ ├── DeviceNativeInterface.java │ │ │ │ │ ├── DialogueBoxNativeInterface.java │ │ │ │ │ ├── DynamicByteBuffer.java │ │ │ │ │ ├── ExceptionUtils.java │ │ │ │ │ ├── FileUtils.java │ │ │ │ │ ├── HashCRC32.java │ │ │ │ │ ├── HashMD5.java │ │ │ │ │ ├── HashSHA256.java │ │ │ │ │ ├── IQueryableInterface.java │ │ │ │ │ ├── InterfaceId.java │ │ │ │ │ ├── InternalFileUtils.java │ │ │ │ │ ├── LoadingView.java │ │ │ │ │ ├── LocalNotification.java │ │ │ │ │ ├── LocalNotificationNativeInterface.java │ │ │ │ │ ├── LocalNotificationReceiver.java │ │ │ │ │ ├── LocalNotificationStore.java │ │ │ │ │ ├── Logging.java │ │ │ │ │ ├── NativeLibraryLoader.java │ │ │ │ │ ├── R.java │ │ │ │ │ ├── Renderer.java │ │ │ │ │ ├── SharedPreferencesNativeInterface.java │ │ │ │ │ ├── StringUtils.java │ │ │ │ │ ├── Surface.java │ │ │ │ │ └── System.java │ │ │ │ ├── input/ │ │ │ │ │ ├── AccelerometerNativeInterface.java │ │ │ │ │ ├── DeviceButtonNativeInterface.java │ │ │ │ │ ├── GyroscopeNativeInterface.java │ │ │ │ │ ├── TextEntryNativeInterface.java │ │ │ │ │ └── TouchInputNativeInterface.java │ │ │ │ ├── networking/ │ │ │ │ │ ├── HttpRequest.java │ │ │ │ │ ├── HttpRequestSystem.java │ │ │ │ │ ├── IAPProductDescription.java │ │ │ │ │ ├── IAPTransactionDescription.java │ │ │ │ │ ├── InsecureHostnameVerifier.java │ │ │ │ │ └── InsecureTrustManager.java │ │ │ │ ├── social/ │ │ │ │ │ └── EmailComposerNativeInterface.java │ │ │ │ ├── video/ │ │ │ │ │ ├── SubtitlesView.java │ │ │ │ │ ├── VideoPlayer.java │ │ │ │ │ ├── VideoPlayerActivity.java │ │ │ │ │ └── VideoPlayerView.java │ │ │ │ └── web/ │ │ │ │ ├── CSWebView.java │ │ │ │ ├── CSWebViewClient.java │ │ │ │ ├── WebViewCloseButton.java │ │ │ │ └── WebViewNativeInterface.java │ │ │ ├── RPi/ │ │ │ │ ├── Core/ │ │ │ │ │ ├── Base/ │ │ │ │ │ │ ├── DispmanWindow.cpp │ │ │ │ │ │ ├── DispmanWindow.h │ │ │ │ │ │ ├── EGLConfigChooser.cpp │ │ │ │ │ │ ├── EGLConfigChooser.h │ │ │ │ │ │ ├── PlatformSystem.cpp │ │ │ │ │ │ ├── PlatformSystem.h │ │ │ │ │ │ ├── Screen.cpp │ │ │ │ │ │ ├── Screen.h │ │ │ │ │ │ ├── SystemInfoFactory.cpp │ │ │ │ │ │ └── SystemInfoFactory.h │ │ │ │ │ ├── File/ │ │ │ │ │ │ ├── FileSystem.cpp │ │ │ │ │ │ └── FileSystem.h │ │ │ │ │ └── Image/ │ │ │ │ │ ├── PNGImageProvider.cpp │ │ │ │ │ ├── PNGImageProvider.h │ │ │ │ │ ├── PngImage.cpp │ │ │ │ │ └── PngImage.h │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ ├── Input/ │ │ │ │ │ ├── Gamepad/ │ │ │ │ │ │ ├── GamepadSystem.cpp │ │ │ │ │ │ └── GamepadSystem.h │ │ │ │ │ ├── Keyboard/ │ │ │ │ │ │ ├── Keyboard.cpp │ │ │ │ │ │ └── Keyboard.h │ │ │ │ │ ├── Pointer/ │ │ │ │ │ │ ├── PointerSystem.cpp │ │ │ │ │ │ └── PointerSystem.h │ │ │ │ │ └── TextEntry/ │ │ │ │ │ ├── TextEntry.cpp │ │ │ │ │ └── TextEntry.h │ │ │ │ ├── Main.cpp │ │ │ │ └── Networking/ │ │ │ │ └── Http/ │ │ │ │ ├── HttpRequest.cpp │ │ │ │ ├── HttpRequest.h │ │ │ │ ├── HttpRequestSystem.cpp │ │ │ │ └── HttpRequestSystem.h │ │ │ ├── Windows/ │ │ │ │ ├── Core/ │ │ │ │ │ ├── Base/ │ │ │ │ │ │ ├── PlatformSystem.cpp │ │ │ │ │ │ ├── PlatformSystem.h │ │ │ │ │ │ ├── Screen.cpp │ │ │ │ │ │ ├── Screen.h │ │ │ │ │ │ ├── SystemInfoFactory.cpp │ │ │ │ │ │ └── SystemInfoFactory.h │ │ │ │ │ ├── DialogueBox/ │ │ │ │ │ │ ├── DialogueBoxSystem.cpp │ │ │ │ │ │ └── DialogueBoxSystem.h │ │ │ │ │ ├── File/ │ │ │ │ │ │ ├── FileSystem.cpp │ │ │ │ │ │ ├── FileSystem.h │ │ │ │ │ │ ├── WindowsFileUtils.cpp │ │ │ │ │ │ └── WindowsFileUtils.h │ │ │ │ │ ├── Image/ │ │ │ │ │ │ ├── PNGImageProvider.cpp │ │ │ │ │ │ ├── PNGImageProvider.h │ │ │ │ │ │ ├── PngImage.cpp │ │ │ │ │ │ └── PngImage.h │ │ │ │ │ └── String/ │ │ │ │ │ ├── WindowsStringUtils.cpp │ │ │ │ │ └── WindowsStringUtils.h │ │ │ │ ├── ForwardDeclarations.h │ │ │ │ ├── Input/ │ │ │ │ │ ├── DeviceButtons/ │ │ │ │ │ │ ├── DeviceButtonSystem.cpp │ │ │ │ │ │ └── DeviceButtonSystem.h │ │ │ │ │ ├── Gamepad/ │ │ │ │ │ │ ├── GamepadSystem.cpp │ │ │ │ │ │ └── GamepadSystem.h │ │ │ │ │ ├── Keyboard/ │ │ │ │ │ │ ├── Keyboard.cpp │ │ │ │ │ │ └── Keyboard.h │ │ │ │ │ ├── Pointer/ │ │ │ │ │ │ ├── PointerSystem.cpp │ │ │ │ │ │ └── PointerSystem.h │ │ │ │ │ └── TextEntry/ │ │ │ │ │ ├── TextEntry.cpp │ │ │ │ │ └── TextEntry.h │ │ │ │ ├── Main.cpp │ │ │ │ ├── Networking/ │ │ │ │ │ └── Http/ │ │ │ │ │ ├── HttpRequest.cpp │ │ │ │ │ ├── HttpRequest.h │ │ │ │ │ ├── HttpRequestSystem.cpp │ │ │ │ │ └── HttpRequestSystem.h │ │ │ │ └── SFML/ │ │ │ │ └── Base/ │ │ │ │ ├── SFMLWindow.cpp │ │ │ │ └── SFMLWindow.h │ │ │ └── iOS/ │ │ │ ├── Core/ │ │ │ │ ├── Base/ │ │ │ │ │ ├── CSAppDelegate.h │ │ │ │ │ ├── CSAppDelegate.mm │ │ │ │ │ ├── CSGLViewController.h │ │ │ │ │ ├── CSGLViewController.mm │ │ │ │ │ ├── PlatformSystem.h │ │ │ │ │ ├── PlatformSystem.mm │ │ │ │ │ ├── Screen.h │ │ │ │ │ ├── Screen.mm │ │ │ │ │ ├── SystemInfoFactory.h │ │ │ │ │ └── SystemInfoFactory.mm │ │ │ │ ├── DialogueBox/ │ │ │ │ │ ├── DialogueBoxListener.h │ │ │ │ │ ├── DialogueBoxListener.mm │ │ │ │ │ ├── DialogueBoxSystem.h │ │ │ │ │ └── DialogueBoxSystem.mm │ │ │ │ ├── File/ │ │ │ │ │ ├── FileSystem.h │ │ │ │ │ └── FileSystem.mm │ │ │ │ ├── Image/ │ │ │ │ │ ├── PNGImageProvider.cpp │ │ │ │ │ └── PNGImageProvider.h │ │ │ │ ├── Math/ │ │ │ │ │ ├── RNGContainer.h │ │ │ │ │ └── RNGContainer.mm │ │ │ │ ├── Notification/ │ │ │ │ │ ├── LocalNotificationSystem.cpp │ │ │ │ │ ├── LocalNotificationSystem.h │ │ │ │ │ ├── NSNotificationAdapter.h │ │ │ │ │ ├── NSNotificationAdapter.mm │ │ │ │ │ ├── RemoteNotificationSystem.cpp │ │ │ │ │ └── RemoteNotificationSystem.h │ │ │ │ └── String/ │ │ │ │ ├── NSStringUtils.h │ │ │ │ └── NSStringUtils.mm │ │ │ ├── ForwardDeclarations.h │ │ │ ├── Input/ │ │ │ │ ├── Accelerometer/ │ │ │ │ │ ├── Accelerometer.h │ │ │ │ │ └── Accelerometer.mm │ │ │ │ ├── DeviceButtons/ │ │ │ │ │ ├── DeviceButtonSystem.h │ │ │ │ │ └── DeviceButtonSystem.mm │ │ │ │ ├── Gyroscope/ │ │ │ │ │ ├── Gyroscope.h │ │ │ │ │ └── Gyroscope.mm │ │ │ │ ├── Pointer/ │ │ │ │ │ ├── PointerSystem.h │ │ │ │ │ └── PointerSystem.mm │ │ │ │ └── TextEntry/ │ │ │ │ ├── TextEntry.h │ │ │ │ ├── TextEntry.mm │ │ │ │ ├── TextEntryDelegate.h │ │ │ │ └── TextEntryDelegate.mm │ │ │ ├── Main.cpp │ │ │ ├── Networking/ │ │ │ │ ├── Http/ │ │ │ │ │ ├── HttpDelegate.h │ │ │ │ │ ├── HttpDelegate.mm │ │ │ │ │ ├── HttpRequest.h │ │ │ │ │ ├── HttpRequest.mm │ │ │ │ │ ├── HttpRequestSystem.h │ │ │ │ │ └── HttpRequestSystem.mm │ │ │ │ └── IAP/ │ │ │ │ ├── IAPSystem.h │ │ │ │ ├── IAPSystem.mm │ │ │ │ ├── StoreKitIAPSystem.h │ │ │ │ └── StoreKitIAPSystem.mm │ │ │ ├── Social/ │ │ │ │ └── Communications/ │ │ │ │ ├── EmailComposer.h │ │ │ │ ├── EmailComposer.mm │ │ │ │ ├── EmailComposerDelegate.h │ │ │ │ └── EmailComposerDelegate.mm │ │ │ ├── Video/ │ │ │ │ └── Base/ │ │ │ │ ├── SubtitlesRenderer.h │ │ │ │ ├── SubtitlesRenderer.mm │ │ │ │ ├── VideoOverlayView.h │ │ │ │ ├── VideoOverlayView.mm │ │ │ │ ├── VideoPlayer.h │ │ │ │ ├── VideoPlayer.mm │ │ │ │ ├── VideoPlayerTapListener.h │ │ │ │ └── VideoPlayerTapListener.mm │ │ │ └── Web/ │ │ │ └── Base/ │ │ │ ├── WebView.h │ │ │ ├── WebView.mm │ │ │ ├── WebViewDelegate.h │ │ │ └── WebViewDelegate.mm │ │ └── Rendering/ │ │ └── OpenGL/ │ │ ├── Base/ │ │ │ ├── GLContextRestorer.cpp │ │ │ ├── GLContextRestorer.h │ │ │ ├── GLError.cpp │ │ │ ├── GLError.h │ │ │ ├── GLExtensions.cpp │ │ │ ├── GLExtensions.h │ │ │ ├── GLIncludes.h │ │ │ ├── RenderCommandProcessor.cpp │ │ │ ├── RenderCommandProcessor.h │ │ │ ├── RenderInfoFactory.cpp │ │ │ └── RenderInfoFactory.h │ │ ├── Camera/ │ │ │ ├── GLCamera.cpp │ │ │ └── GLCamera.h │ │ ├── ForwardDeclarations.h │ │ ├── Lighting/ │ │ │ ├── GLAmbientLight.cpp │ │ │ ├── GLAmbientLight.h │ │ │ ├── GLDirectionalLight.cpp │ │ │ ├── GLDirectionalLight.h │ │ │ ├── GLLight.h │ │ │ ├── GLPointLight.cpp │ │ │ └── GLPointLight.h │ │ ├── Material/ │ │ │ ├── GLMaterial.cpp │ │ │ └── GLMaterial.h │ │ ├── Model/ │ │ │ ├── GLDynamicMesh.cpp │ │ │ ├── GLDynamicMesh.h │ │ │ ├── GLMesh.cpp │ │ │ ├── GLMesh.h │ │ │ ├── GLMeshUtils.cpp │ │ │ ├── GLMeshUtils.h │ │ │ ├── GLSkinnedAnimation.cpp │ │ │ └── GLSkinnedAnimation.h │ │ ├── Shader/ │ │ │ ├── GLShader.cpp │ │ │ └── GLShader.h │ │ ├── Target/ │ │ │ ├── GLTargetGroup.cpp │ │ │ └── GLTargetGroup.h │ │ └── Texture/ │ │ ├── GLCubemap.cpp │ │ ├── GLCubemap.h │ │ ├── GLTexture.cpp │ │ ├── GLTexture.h │ │ ├── GLTextureUnitManager.cpp │ │ ├── GLTextureUnitManager.h │ │ ├── GLTextureUtils.cpp │ │ └── GLTextureUtils.h │ └── ChilliSource/ │ ├── Audio/ │ │ ├── CricketAudio/ │ │ │ ├── CkAudioPlayer.cpp │ │ │ ├── CkAudioPlayer.h │ │ │ ├── CkBank.cpp │ │ │ ├── CkBank.h │ │ │ ├── CkBankProvider.cpp │ │ │ ├── CkBankProvider.h │ │ │ ├── CkForwardDeclarations.h │ │ │ ├── CkSound.cpp │ │ │ ├── CkSound.h │ │ │ ├── CricketAudioSystem.cpp │ │ │ └── CricketAudioSystem.h │ │ ├── CricketAudio.h │ │ └── ForwardDeclarations.h │ ├── ChilliSource.h │ ├── Core/ │ │ ├── Base/ │ │ │ ├── AppConfig.cpp │ │ │ ├── AppConfig.h │ │ │ ├── Application.cpp │ │ │ ├── Application.h │ │ │ ├── ByteBuffer.cpp │ │ │ ├── ByteBuffer.h │ │ │ ├── ByteColour.cpp │ │ │ ├── ByteColour.h │ │ │ ├── Colour.cpp │ │ │ ├── Colour.h │ │ │ ├── ColourUtils.cpp │ │ │ ├── ColourUtils.h │ │ │ ├── ConstMethodCast.h │ │ │ ├── CursorType.h │ │ │ ├── Device.cpp │ │ │ ├── Device.h │ │ │ ├── DeviceInfo.cpp │ │ │ ├── DeviceInfo.h │ │ │ ├── GenericFactory.h │ │ │ ├── LifecycleManager.cpp │ │ │ ├── LifecycleManager.h │ │ │ ├── Logging.cpp │ │ │ ├── Logging.h │ │ │ ├── MakeSharedArray.h │ │ │ ├── PlatformSystem.cpp │ │ │ ├── PlatformSystem.h │ │ │ ├── QueryableInterface.h │ │ │ ├── RenderInfo.cpp │ │ │ ├── RenderInfo.h │ │ │ ├── Screen.cpp │ │ │ ├── Screen.h │ │ │ ├── ScreenInfo.cpp │ │ │ ├── ScreenInfo.h │ │ │ ├── Singleton.h │ │ │ ├── StandardMacros.h │ │ │ ├── SystemInfo.cpp │ │ │ ├── SystemInfo.h │ │ │ ├── Utils.cpp │ │ │ └── Utils.h │ │ ├── Base.h │ │ ├── Container/ │ │ │ ├── HashedArray.h │ │ │ ├── ParamDictionary.cpp │ │ │ ├── ParamDictionary.h │ │ │ ├── ParamDictionarySerialiser.cpp │ │ │ ├── ParamDictionarySerialiser.h │ │ │ ├── Property/ │ │ │ │ ├── IProperty.h │ │ │ │ ├── IPropertyType.h │ │ │ │ ├── Property.h │ │ │ │ ├── PropertyMap.cpp │ │ │ │ ├── PropertyMap.h │ │ │ │ ├── PropertyType.h │ │ │ │ ├── PropertyTypes.cpp │ │ │ │ ├── PropertyTypes.h │ │ │ │ ├── ReferenceProperty.h │ │ │ │ └── ValueProperty.h │ │ │ ├── VectorUtils.h │ │ │ ├── concurrent_blocking_queue.h │ │ │ ├── concurrent_vector.h │ │ │ ├── concurrent_vector_const_forward_iterator.h │ │ │ ├── concurrent_vector_const_reverse_iterator.h │ │ │ ├── concurrent_vector_forward_iterator.h │ │ │ ├── concurrent_vector_reverse_iterator.h │ │ │ ├── dynamic_array.h │ │ │ └── random_access_iterator.h │ │ ├── Container.h │ │ ├── Cryptographic/ │ │ │ ├── AESEncrypt.cpp │ │ │ ├── AESEncrypt.h │ │ │ ├── BaseEncoding.cpp │ │ │ ├── BaseEncoding.h │ │ │ ├── HashCRC32.cpp │ │ │ ├── HashCRC32.h │ │ │ ├── HashMD5.cpp │ │ │ ├── HashMD5.h │ │ │ ├── HashSHA1.cpp │ │ │ ├── HashSHA1.h │ │ │ ├── HashSHA256.cpp │ │ │ ├── HashSHA256.h │ │ │ ├── OAuth.cpp │ │ │ └── OAuth.h │ │ ├── Cryptographic.h │ │ ├── Delegate/ │ │ │ ├── ConnectableDelegate.h │ │ │ ├── DelegateConnection.h │ │ │ ├── MakeConnectableDelegate.h │ │ │ └── MakeDelegate.h │ │ ├── Delegate.h │ │ ├── DialogueBox/ │ │ │ ├── DialogueBoxSystem.cpp │ │ │ └── DialogueBoxSystem.h │ │ ├── DialogueBox.h │ │ ├── Entity/ │ │ │ ├── Component.cpp │ │ │ ├── Component.h │ │ │ ├── Entity.cpp │ │ │ ├── Entity.h │ │ │ ├── PrimitiveEntityFactory.cpp │ │ │ ├── PrimitiveEntityFactory.h │ │ │ ├── Transform.cpp │ │ │ └── Transform.h │ │ ├── Entity.h │ │ ├── Event/ │ │ │ ├── Event.h │ │ │ ├── EventConnection.cpp │ │ │ ├── EventConnection.h │ │ │ ├── IConnectableEvent.h │ │ │ └── IDisconnectableEvent.h │ │ ├── Event.h │ │ ├── File/ │ │ │ ├── AppDataStore.cpp │ │ │ ├── AppDataStore.h │ │ │ ├── CSBinaryChunk.cpp │ │ │ ├── CSBinaryChunk.h │ │ │ ├── CSBinaryInputStream.cpp │ │ │ ├── CSBinaryInputStream.h │ │ │ ├── FileStream/ │ │ │ │ ├── BinaryInputStream.cpp │ │ │ │ ├── BinaryInputStream.h │ │ │ │ ├── BinaryOutputStream.cpp │ │ │ │ ├── BinaryOutputStream.h │ │ │ │ ├── FileWriteMode.cpp │ │ │ │ ├── FileWriteMode.h │ │ │ │ ├── IBinaryInputStream.h │ │ │ │ ├── ITextInputStream.h │ │ │ │ ├── TextInputStream.cpp │ │ │ │ ├── TextInputStream.h │ │ │ │ ├── TextOutputStream.cpp │ │ │ │ └── TextOutputStream.h │ │ │ ├── FileSystem.cpp │ │ │ ├── FileSystem.h │ │ │ ├── StorageLocation.h │ │ │ ├── TaggedFilePathResolver.cpp │ │ │ └── TaggedFilePathResolver.h │ │ ├── File.h │ │ ├── ForwardDeclarations.h │ │ ├── Image/ │ │ │ ├── CSImageProvider.cpp │ │ │ ├── CSImageProvider.h │ │ │ ├── ETC1ImageProvider.cpp │ │ │ ├── ETC1ImageProvider.h │ │ │ ├── Image.cpp │ │ │ ├── Image.h │ │ │ ├── ImageCompression.h │ │ │ ├── ImageFormat.h │ │ │ ├── ImageFormatConverter.cpp │ │ │ ├── ImageFormatConverter.h │ │ │ ├── PNGImageProvider.cpp │ │ │ ├── PNGImageProvider.h │ │ │ ├── PVRImageProvider.cpp │ │ │ └── PVRImageProvider.h │ │ ├── Image.h │ │ ├── Json/ │ │ │ ├── JsonUtils.cpp │ │ │ └── JsonUtils.h │ │ ├── Json.h │ │ ├── Localisation/ │ │ │ ├── LocalisedText.cpp │ │ │ ├── LocalisedText.h │ │ │ ├── LocalisedTextProvider.cpp │ │ │ └── LocalisedTextProvider.h │ │ ├── Localisation.h │ │ ├── Math/ │ │ │ ├── Geometry/ │ │ │ │ ├── Curves.h │ │ │ │ ├── ShapeIntersection.cpp │ │ │ │ ├── ShapeIntersection.h │ │ │ │ ├── Shapes.cpp │ │ │ │ └── Shapes.h │ │ │ ├── Interpolate.cpp │ │ │ ├── Interpolate.h │ │ │ ├── MathUtils.cpp │ │ │ ├── MathUtils.h │ │ │ ├── Matrix3.h │ │ │ ├── Matrix4.h │ │ │ ├── NumericLimits.h │ │ │ ├── Quaternion.h │ │ │ ├── Random.cpp │ │ │ ├── Random.h │ │ │ ├── RandomImpl.h │ │ │ ├── UnifiedCoordinates.cpp │ │ │ ├── UnifiedCoordinates.h │ │ │ ├── Vector2.h │ │ │ ├── Vector3.h │ │ │ └── Vector4.h │ │ ├── Math.h │ │ ├── Memory/ │ │ │ ├── IAllocator.h │ │ │ ├── LinearAllocator.cpp │ │ │ ├── LinearAllocator.h │ │ │ ├── MemoryUtils.h │ │ │ ├── MemoryUtilsImpl.h │ │ │ ├── ObjectPoolAllocator.h │ │ │ ├── PagedLinearAllocator.cpp │ │ │ ├── PagedLinearAllocator.h │ │ │ ├── SharedPtr.h │ │ │ ├── SharedPtrImpl.h │ │ │ ├── UniquePtr.h │ │ │ └── UniquePtrImpl.h │ │ ├── Memory.h │ │ ├── Notification/ │ │ │ ├── AppNotificationSystem.cpp │ │ │ ├── AppNotificationSystem.h │ │ │ ├── LocalNotificationSystem.cpp │ │ │ ├── LocalNotificationSystem.h │ │ │ ├── Notification.h │ │ │ ├── NotificationManager.cpp │ │ │ ├── NotificationManager.h │ │ │ ├── RemoteNotificationSystem.cpp │ │ │ └── RemoteNotificationSystem.h │ │ ├── Notification.h │ │ ├── Resource/ │ │ │ ├── IResourceOptions.h │ │ │ ├── Resource.cpp │ │ │ ├── Resource.h │ │ │ ├── ResourcePool.cpp │ │ │ ├── ResourcePool.h │ │ │ ├── ResourceProvider.cpp │ │ │ └── ResourceProvider.h │ │ ├── Resource.h │ │ ├── Scene/ │ │ │ ├── Scene.cpp │ │ │ └── Scene.h │ │ ├── Scene.h │ │ ├── State/ │ │ │ ├── State.cpp │ │ │ ├── State.h │ │ │ ├── StateManager.cpp │ │ │ └── StateManager.h │ │ ├── State.h │ │ ├── String/ │ │ │ ├── MarkupDef.cpp │ │ │ ├── MarkupDef.h │ │ │ ├── StringMarkupParser.cpp │ │ │ ├── StringMarkupParser.h │ │ │ ├── StringParser.cpp │ │ │ ├── StringParser.h │ │ │ ├── StringUtils.cpp │ │ │ ├── StringUtils.h │ │ │ ├── ToString.cpp │ │ │ ├── ToString.h │ │ │ ├── UTF8StringUtils.cpp │ │ │ └── UTF8StringUtils.h │ │ ├── String.h │ │ ├── System/ │ │ │ ├── AppSystem.h │ │ │ ├── StateSystem.cpp │ │ │ └── StateSystem.h │ │ ├── System.h │ │ ├── Threading/ │ │ │ ├── SingleThreadTaskPool.cpp │ │ │ ├── SingleThreadTaskPool.h │ │ │ ├── Task.h │ │ │ ├── TaskContext.cpp │ │ │ ├── TaskContext.h │ │ │ ├── TaskPool.cpp │ │ │ ├── TaskPool.h │ │ │ ├── TaskScheduler.cpp │ │ │ ├── TaskScheduler.h │ │ │ └── TaskType.h │ │ ├── Threading.h │ │ ├── Time/ │ │ │ ├── CoreTimer.cpp │ │ │ ├── CoreTimer.h │ │ │ ├── PerformanceTimer.cpp │ │ │ ├── PerformanceTimer.h │ │ │ ├── Timer.cpp │ │ │ └── Timer.h │ │ ├── Time.h │ │ ├── Tween/ │ │ │ ├── EaseBack.h │ │ │ ├── EaseQuad.h │ │ │ ├── Linear.h │ │ │ ├── SmoothStep.h │ │ │ └── Tween.h │ │ ├── Tween.h │ │ ├── Volume/ │ │ │ ├── VolumeComponent.cpp │ │ │ └── VolumeComponent.h │ │ ├── Volume.h │ │ ├── XML/ │ │ │ ├── XML.cpp │ │ │ ├── XML.h │ │ │ ├── XMLUtils.cpp │ │ │ └── XMLUtils.h │ │ └── XML.h │ ├── Input/ │ │ ├── Accelerometer/ │ │ │ ├── Accelerometer.cpp │ │ │ └── Accelerometer.h │ │ ├── Accelerometer.h │ │ ├── Base/ │ │ │ ├── InputFilter.cpp │ │ │ └── InputFilter.h │ │ ├── Base.h │ │ ├── DeviceButtons/ │ │ │ ├── DeviceButtonSystem.cpp │ │ │ └── DeviceButtonSystem.h │ │ ├── DeviceButtons.h │ │ ├── ForwardDeclarations.h │ │ ├── Gamepad/ │ │ │ ├── Gamepad.cpp │ │ │ ├── Gamepad.h │ │ │ ├── GamepadAxis.h │ │ │ ├── GamepadMappings.h │ │ │ ├── GamepadSystem.cpp │ │ │ └── GamepadSystem.h │ │ ├── Gamepad.h │ │ ├── Gesture/ │ │ │ ├── DragGesture.cpp │ │ │ ├── DragGesture.h │ │ │ ├── Gesture.cpp │ │ │ ├── Gesture.h │ │ │ ├── GestureSystem.cpp │ │ │ ├── GestureSystem.h │ │ │ ├── HoldGesture.cpp │ │ │ ├── HoldGesture.h │ │ │ ├── PinchGesture.cpp │ │ │ ├── PinchGesture.h │ │ │ ├── RotationGesture.cpp │ │ │ ├── RotationGesture.h │ │ │ ├── TapGesture.cpp │ │ │ └── TapGesture.h │ │ ├── Gesture.h │ │ ├── Gyroscope/ │ │ │ ├── Gyroscope.cpp │ │ │ └── Gyroscope.h │ │ ├── Gyroscope.h │ │ ├── Keyboard/ │ │ │ ├── KeyCode.cpp │ │ │ ├── KeyCode.h │ │ │ ├── Keyboard.cpp │ │ │ ├── Keyboard.h │ │ │ └── ModifierKeyCode.h │ │ ├── Keyboard.h │ │ ├── Pointer/ │ │ │ ├── Pointer.cpp │ │ │ ├── Pointer.h │ │ │ ├── PointerSystem.cpp │ │ │ └── PointerSystem.h │ │ ├── Pointer.h │ │ ├── TextEntry/ │ │ │ ├── TextEntry.cpp │ │ │ ├── TextEntry.h │ │ │ ├── TextEntryCapitalisation.cpp │ │ │ ├── TextEntryCapitalisation.h │ │ │ ├── TextEntryType.cpp │ │ │ └── TextEntryType.h │ │ └── TextEntry.h │ ├── Networking/ │ │ ├── ContentDownload/ │ │ │ ├── ContentManagementSystem.cpp │ │ │ ├── ContentManagementSystem.h │ │ │ ├── IContentDownloader.h │ │ │ ├── MoContentDownloader.cpp │ │ │ └── MoContentDownloader.h │ │ ├── ContentDownload.h │ │ ├── ForwardDeclarations.h │ │ ├── Http/ │ │ │ ├── HttpRequest.h │ │ │ ├── HttpRequestSystem.cpp │ │ │ ├── HttpRequestSystem.h │ │ │ ├── HttpResponse.cpp │ │ │ └── HttpResponse.h │ │ ├── Http.h │ │ ├── IAP/ │ │ │ ├── IAPSystem.cpp │ │ │ └── IAPSystem.h │ │ └── IAP.h │ ├── Rendering/ │ │ ├── Base/ │ │ │ ├── AlignmentAnchors.cpp │ │ │ ├── AlignmentAnchors.h │ │ │ ├── AspectRatioUtils.cpp │ │ │ ├── AspectRatioUtils.h │ │ │ ├── BlendMode.h │ │ │ ├── CameraRenderPassGroup.cpp │ │ │ ├── CameraRenderPassGroup.h │ │ │ ├── CanvasDrawMode.cpp │ │ │ ├── CanvasDrawMode.h │ │ │ ├── CanvasMaterialPool.cpp │ │ │ ├── CanvasMaterialPool.h │ │ │ ├── CanvasRenderer.cpp │ │ │ ├── CanvasRenderer.h │ │ │ ├── CullFace.h │ │ │ ├── ForwardRenderPassCompiler.cpp │ │ │ ├── ForwardRenderPassCompiler.h │ │ │ ├── FrameAllocatorQueue.cpp │ │ │ ├── FrameAllocatorQueue.h │ │ │ ├── HorizontalTextJustification.cpp │ │ │ ├── HorizontalTextJustification.h │ │ │ ├── IRenderCommandProcessor.cpp │ │ │ ├── IRenderCommandProcessor.h │ │ │ ├── IRenderPassCompiler.h │ │ │ ├── RenderCapabilities.cpp │ │ │ ├── RenderCapabilities.h │ │ │ ├── RenderCommandBufferManager.cpp │ │ │ ├── RenderCommandBufferManager.h │ │ │ ├── RenderCommandCompiler.cpp │ │ │ ├── RenderCommandCompiler.h │ │ │ ├── RenderFrame.cpp │ │ │ ├── RenderFrame.h │ │ │ ├── RenderFrameCompiler.cpp │ │ │ ├── RenderFrameCompiler.h │ │ │ ├── RenderFrameData.cpp │ │ │ ├── RenderFrameData.h │ │ │ ├── RenderLayer.h │ │ │ ├── RenderObject.cpp │ │ │ ├── RenderObject.h │ │ │ ├── RenderPass.cpp │ │ │ ├── RenderPass.h │ │ │ ├── RenderPassObject.cpp │ │ │ ├── RenderPassObject.h │ │ │ ├── RenderPassObjectSorter.cpp │ │ │ ├── RenderPassObjectSorter.h │ │ │ ├── RenderPassVisibilityChecker.cpp │ │ │ ├── RenderPassVisibilityChecker.h │ │ │ ├── RenderPasses.h │ │ │ ├── RenderSnapshot.cpp │ │ │ ├── RenderSnapshot.h │ │ │ ├── Renderer.cpp │ │ │ ├── Renderer.h │ │ │ ├── SizePolicy.cpp │ │ │ ├── SizePolicy.h │ │ │ ├── StencilOp.h │ │ │ ├── SurfaceFormat.h │ │ │ ├── TargetRenderPassGroup.cpp │ │ │ ├── TargetRenderPassGroup.h │ │ │ ├── TargetType.h │ │ │ ├── TestFunc.h │ │ │ ├── VerticalTextJustification.cpp │ │ │ └── VerticalTextJustification.h │ │ ├── Base.h │ │ ├── Camera/ │ │ │ ├── CameraComponent.cpp │ │ │ ├── CameraComponent.h │ │ │ ├── OrthographicCameraComponent.cpp │ │ │ ├── OrthographicCameraComponent.h │ │ │ ├── PerspectiveCameraComponent.cpp │ │ │ ├── PerspectiveCameraComponent.h │ │ │ ├── RenderCamera.cpp │ │ │ └── RenderCamera.h │ │ ├── Camera.h │ │ ├── Font/ │ │ │ ├── Font.cpp │ │ │ ├── Font.h │ │ │ ├── FontProvider.cpp │ │ │ └── FontProvider.h │ │ ├── Font.h │ │ ├── ForwardDeclarations.h │ │ ├── Lighting/ │ │ │ ├── AmbientLightComponent.cpp │ │ │ ├── AmbientLightComponent.h │ │ │ ├── AmbientRenderLight.cpp │ │ │ ├── AmbientRenderLight.h │ │ │ ├── DirectionalLightComponent.cpp │ │ │ ├── DirectionalLightComponent.h │ │ │ ├── DirectionalRenderLight.cpp │ │ │ ├── DirectionalRenderLight.h │ │ │ ├── PointLightComponent.cpp │ │ │ ├── PointLightComponent.h │ │ │ ├── PointRenderLight.cpp │ │ │ └── PointRenderLight.h │ │ ├── Lighting.h │ │ ├── Material/ │ │ │ ├── ForwardRenderMaterialGroupManager.cpp │ │ │ ├── ForwardRenderMaterialGroupManager.h │ │ │ ├── Material.cpp │ │ │ ├── Material.h │ │ │ ├── MaterialFactory.cpp │ │ │ ├── MaterialFactory.h │ │ │ ├── MaterialProvider.cpp │ │ │ ├── MaterialProvider.h │ │ │ ├── MaterialShadingType.h │ │ │ ├── RenderMaterial.cpp │ │ │ ├── RenderMaterial.h │ │ │ ├── RenderMaterialGroup.cpp │ │ │ ├── RenderMaterialGroup.h │ │ │ ├── RenderMaterialGroupManager.cpp │ │ │ └── RenderMaterialGroupManager.h │ │ ├── Material.h │ │ ├── Model/ │ │ │ ├── AnimatedModelComponent.cpp │ │ │ ├── AnimatedModelComponent.h │ │ │ ├── CSAnimProvider.cpp │ │ │ ├── CSAnimProvider.h │ │ │ ├── CSModelProvider.cpp │ │ │ ├── CSModelProvider.h │ │ │ ├── IndexFormat.cpp │ │ │ ├── IndexFormat.h │ │ │ ├── MeshDesc.cpp │ │ │ ├── MeshDesc.h │ │ │ ├── Model.cpp │ │ │ ├── Model.h │ │ │ ├── ModelDesc.cpp │ │ │ ├── ModelDesc.h │ │ │ ├── PolygonType.h │ │ │ ├── PrimitiveModelFactory.cpp │ │ │ ├── PrimitiveModelFactory.h │ │ │ ├── RenderDynamicMesh.cpp │ │ │ ├── RenderDynamicMesh.h │ │ │ ├── RenderMesh.cpp │ │ │ ├── RenderMesh.h │ │ │ ├── RenderMeshBatch.cpp │ │ │ ├── RenderMeshBatch.h │ │ │ ├── RenderMeshManager.cpp │ │ │ ├── RenderMeshManager.h │ │ │ ├── RenderSkinnedAnimation.cpp │ │ │ ├── RenderSkinnedAnimation.h │ │ │ ├── Skeleton.cpp │ │ │ ├── Skeleton.h │ │ │ ├── SkeletonDesc.cpp │ │ │ ├── SkeletonDesc.h │ │ │ ├── SkinnedAnimation.cpp │ │ │ ├── SkinnedAnimation.h │ │ │ ├── SkinnedAnimationGroup.cpp │ │ │ ├── SkinnedAnimationGroup.h │ │ │ ├── SmallMeshBatcher.cpp │ │ │ ├── SmallMeshBatcher.h │ │ │ ├── StaticModelComponent.cpp │ │ │ ├── StaticModelComponent.h │ │ │ ├── VertexFormat.cpp │ │ │ └── VertexFormat.h │ │ ├── Model.h │ │ ├── Particle/ │ │ │ ├── Affector/ │ │ │ │ ├── AccelerationParticleAffector.cpp │ │ │ │ ├── AccelerationParticleAffector.h │ │ │ │ ├── AccelerationParticleAffectorDef.cpp │ │ │ │ ├── AccelerationParticleAffectorDef.h │ │ │ │ ├── AngularAccelerationParticleAffector.cpp │ │ │ │ ├── AngularAccelerationParticleAffector.h │ │ │ │ ├── AngularAccelerationParticleAffectorDef.cpp │ │ │ │ ├── AngularAccelerationParticleAffectorDef.h │ │ │ │ ├── ColourOverLifetimeParticleAffector.cpp │ │ │ │ ├── ColourOverLifetimeParticleAffector.h │ │ │ │ ├── ColourOverLifetimeParticleAffectorDef.cpp │ │ │ │ ├── ColourOverLifetimeParticleAffectorDef.h │ │ │ │ ├── ParticleAffector.cpp │ │ │ │ ├── ParticleAffector.h │ │ │ │ ├── ParticleAffectorDef.cpp │ │ │ │ ├── ParticleAffectorDef.h │ │ │ │ ├── ParticleAffectorDefFactory.cpp │ │ │ │ ├── ParticleAffectorDefFactory.h │ │ │ │ ├── ScaleOverLifetimeParticleAffector.cpp │ │ │ │ ├── ScaleOverLifetimeParticleAffector.h │ │ │ │ ├── ScaleOverLifetimeParticleAffectorDef.cpp │ │ │ │ └── ScaleOverLifetimeParticleAffectorDef.h │ │ │ ├── CSParticleProvider.cpp │ │ │ ├── CSParticleProvider.h │ │ │ ├── ConcurrentParticleData.cpp │ │ │ ├── ConcurrentParticleData.h │ │ │ ├── Drawable/ │ │ │ │ ├── ParticleDrawable.cpp │ │ │ │ ├── ParticleDrawable.h │ │ │ │ ├── ParticleDrawableDef.cpp │ │ │ │ ├── ParticleDrawableDef.h │ │ │ │ ├── ParticleDrawableDefFactory.cpp │ │ │ │ ├── ParticleDrawableDefFactory.h │ │ │ │ ├── StaticBillboardParticleDrawable.cpp │ │ │ │ ├── StaticBillboardParticleDrawable.h │ │ │ │ ├── StaticBillboardParticleDrawableDef.cpp │ │ │ │ └── StaticBillboardParticleDrawableDef.h │ │ │ ├── Emitter/ │ │ │ │ ├── CircleParticleEmitter.cpp │ │ │ │ ├── CircleParticleEmitter.h │ │ │ │ ├── CircleParticleEmitterDef.cpp │ │ │ │ ├── CircleParticleEmitterDef.h │ │ │ │ ├── Cone2DParticleEmitter.cpp │ │ │ │ ├── Cone2DParticleEmitter.h │ │ │ │ ├── Cone2DParticleEmitterDef.cpp │ │ │ │ ├── Cone2DParticleEmitterDef.h │ │ │ │ ├── ConeParticleEmitter.cpp │ │ │ │ ├── ConeParticleEmitter.h │ │ │ │ ├── ConeParticleEmitterDef.cpp │ │ │ │ ├── ConeParticleEmitterDef.h │ │ │ │ ├── ParticleEmitter.cpp │ │ │ │ ├── ParticleEmitter.h │ │ │ │ ├── ParticleEmitterDef.cpp │ │ │ │ ├── ParticleEmitterDef.h │ │ │ │ ├── ParticleEmitterDefFactory.cpp │ │ │ │ ├── ParticleEmitterDefFactory.h │ │ │ │ ├── PointParticleEmitter.cpp │ │ │ │ ├── PointParticleEmitter.h │ │ │ │ ├── PointParticleEmitterDef.cpp │ │ │ │ ├── PointParticleEmitterDef.h │ │ │ │ ├── SphereParticleEmitter.cpp │ │ │ │ ├── SphereParticleEmitter.h │ │ │ │ ├── SphereParticleEmitterDef.cpp │ │ │ │ └── SphereParticleEmitterDef.h │ │ │ ├── Particle.h │ │ │ ├── ParticleEffect.cpp │ │ │ ├── ParticleEffect.h │ │ │ ├── ParticleEffectComponent.cpp │ │ │ ├── ParticleEffectComponent.h │ │ │ └── Property/ │ │ │ ├── ComponentwiseRandomConstantParticleProperty.h │ │ │ ├── ComponentwiseRandomCurveParticleProperty.h │ │ │ ├── ConstantParticleProperty.h │ │ │ ├── CurveParticleProperty.h │ │ │ ├── ParticleProperty.h │ │ │ ├── ParticlePropertyFactory.h │ │ │ ├── ParticlePropertyFactoryImpl.cpp │ │ │ ├── ParticlePropertyFactoryImpl.h │ │ │ ├── RandomConstantParticleProperty.h │ │ │ └── RandomCurveParticleProperty.h │ │ ├── Particle.h │ │ ├── RenderCommand/ │ │ │ ├── Commands/ │ │ │ │ ├── ApplyAmbientLightRenderCommand.cpp │ │ │ │ ├── ApplyAmbientLightRenderCommand.h │ │ │ │ ├── ApplyCameraRenderCommand.cpp │ │ │ │ ├── ApplyCameraRenderCommand.h │ │ │ │ ├── ApplyDirectionalLightRenderCommand.cpp │ │ │ │ ├── ApplyDirectionalLightRenderCommand.h │ │ │ │ ├── ApplyDynamicMeshRenderCommand.cpp │ │ │ │ ├── ApplyDynamicMeshRenderCommand.h │ │ │ │ ├── ApplyMaterialRenderCommand.cpp │ │ │ │ ├── ApplyMaterialRenderCommand.h │ │ │ │ ├── ApplyMeshBatchRenderCommand.cpp │ │ │ │ ├── ApplyMeshBatchRenderCommand.h │ │ │ │ ├── ApplyMeshRenderCommand.cpp │ │ │ │ ├── ApplyMeshRenderCommand.h │ │ │ │ ├── ApplyPointLightRenderCommand.cpp │ │ │ │ ├── ApplyPointLightRenderCommand.h │ │ │ │ ├── ApplySkinnedAnimationRenderCommand.cpp │ │ │ │ ├── ApplySkinnedAnimationRenderCommand.h │ │ │ │ ├── BeginRenderCommand.cpp │ │ │ │ ├── BeginRenderCommand.h │ │ │ │ ├── BeginWithTargetGroupRenderCommand.cpp │ │ │ │ ├── BeginWithTargetGroupRenderCommand.h │ │ │ │ ├── EndRenderCommand.cpp │ │ │ │ ├── EndRenderCommand.h │ │ │ │ ├── LoadCubemapRenderCommand.cpp │ │ │ │ ├── LoadCubemapRenderCommand.h │ │ │ │ ├── LoadMaterialGroupRenderCommand.cpp │ │ │ │ ├── LoadMaterialGroupRenderCommand.h │ │ │ │ ├── LoadMeshRenderCommand.cpp │ │ │ │ ├── LoadMeshRenderCommand.h │ │ │ │ ├── LoadShaderRenderCommand.cpp │ │ │ │ ├── LoadShaderRenderCommand.h │ │ │ │ ├── LoadTargetGroupRenderCommand.cpp │ │ │ │ ├── LoadTargetGroupRenderCommand.h │ │ │ │ ├── LoadTextureRenderCommand.cpp │ │ │ │ ├── LoadTextureRenderCommand.h │ │ │ │ ├── RenderInstanceRenderCommand.cpp │ │ │ │ ├── RenderInstanceRenderCommand.h │ │ │ │ ├── RestoreCubemapRenderCommand.cpp │ │ │ │ ├── RestoreCubemapRenderCommand.h │ │ │ │ ├── RestoreMeshRenderCommand.cpp │ │ │ │ ├── RestoreMeshRenderCommand.h │ │ │ │ ├── RestoreRenderTargetGroupCommand.cpp │ │ │ │ ├── RestoreRenderTargetGroupCommand.h │ │ │ │ ├── RestoreTextureRenderCommand.cpp │ │ │ │ ├── RestoreTextureRenderCommand.h │ │ │ │ ├── UnloadCubemapRenderCommand.cpp │ │ │ │ ├── UnloadCubemapRenderCommand.h │ │ │ │ ├── UnloadMaterialGroupRenderCommand.cpp │ │ │ │ ├── UnloadMaterialGroupRenderCommand.h │ │ │ │ ├── UnloadMeshRenderCommand.cpp │ │ │ │ ├── UnloadMeshRenderCommand.h │ │ │ │ ├── UnloadShaderRenderCommand.cpp │ │ │ │ ├── UnloadShaderRenderCommand.h │ │ │ │ ├── UnloadTargetGroupRenderCommand.cpp │ │ │ │ ├── UnloadTargetGroupRenderCommand.h │ │ │ │ ├── UnloadTextureRenderCommand.cpp │ │ │ │ └── UnloadTextureRenderCommand.h │ │ │ ├── RenderCommand.cpp │ │ │ ├── RenderCommand.h │ │ │ ├── RenderCommandBuffer.cpp │ │ │ ├── RenderCommandBuffer.h │ │ │ ├── RenderCommandList.cpp │ │ │ └── RenderCommandList.h │ │ ├── RenderCommand.h │ │ ├── Shader/ │ │ │ ├── CSShaderProvider.cpp │ │ │ ├── CSShaderProvider.h │ │ │ ├── RenderShader.h │ │ │ ├── RenderShaderManager.cpp │ │ │ ├── RenderShaderManager.h │ │ │ ├── RenderShaderVariables.cpp │ │ │ ├── RenderShaderVariables.h │ │ │ ├── Shader.cpp │ │ │ └── Shader.h │ │ ├── Shader.h │ │ ├── Skybox/ │ │ │ ├── SkyboxComponent.cpp │ │ │ └── SkyboxComponent.h │ │ ├── Skybox.h │ │ ├── Sprite/ │ │ │ ├── SpriteComponent.cpp │ │ │ ├── SpriteComponent.h │ │ │ ├── SpriteMeshBuilder.cpp │ │ │ └── SpriteMeshBuilder.h │ │ ├── Sprite.h │ │ ├── Target/ │ │ │ ├── RenderTargetGroup.cpp │ │ │ ├── RenderTargetGroup.h │ │ │ ├── RenderTargetGroupManager.cpp │ │ │ ├── RenderTargetGroupManager.h │ │ │ ├── TargetGroup.cpp │ │ │ └── TargetGroup.h │ │ ├── Target.h │ │ ├── Texture/ │ │ │ ├── Cubemap.cpp │ │ │ ├── Cubemap.h │ │ │ ├── CubemapProvider.cpp │ │ │ ├── CubemapProvider.h │ │ │ ├── CubemapResourceOptions.cpp │ │ │ ├── CubemapResourceOptions.h │ │ │ ├── RenderTexture.cpp │ │ │ ├── RenderTexture.h │ │ │ ├── RenderTextureManager.cpp │ │ │ ├── RenderTextureManager.h │ │ │ ├── Texture.cpp │ │ │ ├── Texture.h │ │ │ ├── TextureAtlas.cpp │ │ │ ├── TextureAtlas.h │ │ │ ├── TextureAtlasProvider.cpp │ │ │ ├── TextureAtlasProvider.h │ │ │ ├── TextureDesc.cpp │ │ │ ├── TextureDesc.h │ │ │ ├── TextureFilterMode.h │ │ │ ├── TextureProvider.cpp │ │ │ ├── TextureProvider.h │ │ │ ├── TextureResourceOptions.cpp │ │ │ ├── TextureResourceOptions.h │ │ │ ├── TextureType.h │ │ │ ├── TextureWrapMode.h │ │ │ ├── UVs.cpp │ │ │ └── UVs.h │ │ └── Texture.h │ ├── Social/ │ │ ├── Communications/ │ │ │ ├── EmailComposer.cpp │ │ │ └── EmailComposer.h │ │ ├── Communications.h │ │ └── ForwardDeclarations.h │ ├── UI/ │ │ ├── Base/ │ │ │ ├── Canvas.cpp │ │ │ ├── Canvas.h │ │ │ ├── CursorSystem.cpp │ │ │ ├── CursorSystem.h │ │ │ ├── PropertyLink.cpp │ │ │ ├── PropertyLink.h │ │ │ ├── PropertyTypes.cpp │ │ │ ├── PropertyTypes.h │ │ │ ├── UIComponent.cpp │ │ │ ├── UIComponent.h │ │ │ ├── UIComponentDesc.cpp │ │ │ ├── UIComponentDesc.h │ │ │ ├── UIComponentFactory.cpp │ │ │ ├── UIComponentFactory.h │ │ │ ├── Widget.cpp │ │ │ ├── Widget.h │ │ │ ├── WidgetDef.cpp │ │ │ ├── WidgetDef.h │ │ │ ├── WidgetDefProvider.cpp │ │ │ ├── WidgetDefProvider.h │ │ │ ├── WidgetDesc.cpp │ │ │ ├── WidgetDesc.h │ │ │ ├── WidgetFactory.cpp │ │ │ ├── WidgetFactory.h │ │ │ ├── WidgetParserUtils.cpp │ │ │ ├── WidgetParserUtils.h │ │ │ ├── WidgetTemplate.cpp │ │ │ ├── WidgetTemplate.h │ │ │ ├── WidgetTemplateProvider.cpp │ │ │ └── WidgetTemplateProvider.h │ │ ├── Base.h │ │ ├── Button/ │ │ │ ├── HighlightUIComponent.cpp │ │ │ ├── HighlightUIComponent.h │ │ │ ├── ToggleHighlightUIComponent.cpp │ │ │ └── ToggleHighlightUIComponent.h │ │ ├── Button.h │ │ ├── Drawable/ │ │ │ ├── DrawableUIComponent.cpp │ │ │ ├── DrawableUIComponent.h │ │ │ ├── NinePatchUIDrawable.cpp │ │ │ ├── NinePatchUIDrawable.h │ │ │ ├── NinePatchUIDrawableDef.cpp │ │ │ ├── NinePatchUIDrawableDef.h │ │ │ ├── StandardUIDrawable.cpp │ │ │ ├── StandardUIDrawable.h │ │ │ ├── StandardUIDrawableDef.cpp │ │ │ ├── StandardUIDrawableDef.h │ │ │ ├── ThreePatchUIDrawable.cpp │ │ │ ├── ThreePatchUIDrawable.h │ │ │ ├── ThreePatchUIDrawableDef.cpp │ │ │ ├── ThreePatchUIDrawableDef.h │ │ │ ├── UIDrawable.cpp │ │ │ ├── UIDrawable.h │ │ │ ├── UIDrawableDef.cpp │ │ │ ├── UIDrawableDef.h │ │ │ ├── UIDrawableUtils.cpp │ │ │ └── UIDrawableUtils.h │ │ ├── Drawable.h │ │ ├── ForwardDeclarations.h │ │ ├── Layout/ │ │ │ ├── GridUILayout.cpp │ │ │ ├── GridUILayout.h │ │ │ ├── GridUILayoutDef.cpp │ │ │ ├── GridUILayoutDef.h │ │ │ ├── HListUILayout.cpp │ │ │ ├── HListUILayout.h │ │ │ ├── HListUILayoutDef.cpp │ │ │ ├── HListUILayoutDef.h │ │ │ ├── LayoutDef.h │ │ │ ├── LayoutUIComponent.cpp │ │ │ ├── LayoutUIComponent.h │ │ │ ├── UILayout.cpp │ │ │ ├── UILayout.h │ │ │ ├── UILayoutDef.cpp │ │ │ ├── UILayoutDef.h │ │ │ ├── VListUILayout.cpp │ │ │ ├── VListUILayout.h │ │ │ ├── VListUILayoutDef.cpp │ │ │ └── VListUILayoutDef.h │ │ ├── Layout.h │ │ ├── ProgressBar/ │ │ │ ├── ProgressBarDirection.cpp │ │ │ ├── ProgressBarDirection.h │ │ │ ├── ProgressBarType.cpp │ │ │ ├── ProgressBarType.h │ │ │ ├── ProgressBarUIComponent.cpp │ │ │ └── ProgressBarUIComponent.h │ │ ├── ProgressBar.h │ │ ├── Slider/ │ │ │ ├── SliderDirection.cpp │ │ │ ├── SliderDirection.h │ │ │ ├── SliderUIComponent.cpp │ │ │ └── SliderUIComponent.h │ │ ├── Slider.h │ │ ├── Text/ │ │ │ ├── EditableTextUIComponent.cpp │ │ │ ├── EditableTextUIComponent.h │ │ │ ├── TextComponent.h │ │ │ ├── TextIcon.cpp │ │ │ ├── TextIcon.h │ │ │ ├── TextUIComponent.cpp │ │ │ └── TextUIComponent.h │ │ └── Text.h │ ├── Video/ │ │ ├── Base/ │ │ │ ├── CSSubtitlesProvider.cpp │ │ │ ├── CSSubtitlesProvider.h │ │ │ ├── Subtitles.cpp │ │ │ ├── Subtitles.h │ │ │ ├── VideoPlayer.cpp │ │ │ └── VideoPlayer.h │ │ ├── Base.h │ │ └── ForwardDeclarations.h │ └── Web/ │ ├── Base/ │ │ ├── WebView.cpp │ │ └── WebView.h │ ├── Base.h │ └── ForwardDeclarations.h ├── Tools/ │ ├── AndroidManifestBuilder.jar │ ├── CSAtlasBuilder.jar │ ├── CSFontBuilder.jar │ ├── CSProjectGenerator.jar │ ├── CSTextBuilder.jar │ ├── CkTool/ │ │ ├── Linux/ │ │ │ └── cktool │ │ └── OSX/ │ │ └── cktool │ ├── CkTool.jar │ ├── ColladaToCSAnim.jar │ ├── ColladaToCSModel.jar │ ├── PNGAlphaPremultiplier/ │ │ ├── PNGAlphaPremultiplierLinux │ │ └── PNGAlphaPremultiplierOSX │ ├── PNGAlphaPremultiplier.jar │ ├── PNGToCSImage.jar │ ├── Scripts/ │ │ ├── AndroidApplicationConfig.mk │ │ ├── AndroidBuildConfig.mk │ │ ├── AndroidBuildInitialise.mk │ │ ├── AndroidManifestTemplateAmazon.xml │ │ ├── AndroidManifestTemplateGooglePlay.xml │ │ ├── android-build-manifest.gradle │ │ ├── android-build-ndk.gradle │ │ ├── android-build-resources.gradle │ │ ├── android-build-variant-utils.gradle │ │ ├── android-build.gradle │ │ ├── android-execute-command.gradle │ │ ├── android-proguard-rules.pro │ │ ├── android-push-apk-expansion.gradle │ │ ├── android-settings.gradle │ │ ├── copy_ios_resources.py │ │ ├── copy_rpi_resources.py │ │ ├── copy_windows_resources.py │ │ ├── extract_headers.py │ │ ├── file_system_utils.py │ │ ├── get_file_paths_with_extensions.py │ │ ├── ninja_syntax.py │ │ └── rpi_build.py │ ├── TGAToCSImage.jar │ └── Zip.jar └── readme.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ ################################ # Visual Studio Ignore Files ################################ *.user *.sdf *.opensdf *.opendb .vs/ ################################ # XCode Ignore Files ################################ xcuserdata/ Projects/Libraries/CSBase/build *.xcscmblueprint ################################ # Android Studio Ignore Files ################################ Projects/Android/chillisource/build Projects/Android/chillisource/src/main/libs/armeabi-v7a Projects/Android/chillisource/src/main/libs/armeabi Projects/Android/chillisource/src/main/libs/arm64-v8a Projects/Android/chillisource/src/main/libs/x86 Projects/Android/chillisource/src/main/libs/x86_64 Projects/Android/playapkexpansion/build Projects/Android/playlicensing/build ################################ # Raspberry Pi Ignore Files ################################ Projects/RPi/Build Projects/RPi/Output ################################ # General Ignore Files ################################ bin/ obj/ build/ .DS_Store Thumbs.db *.pyc ================================================ FILE: CSResources/Shaders/Animated-Blinn-Base.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec2 a_texCoord; attribute highp vec4 a_weights; attribute highp vec4 a_jointIndices; //uniforms uniform highp mat4 u_wvpMat; uniform highp vec4 u_joints[100]; uniform lowp vec4 u_emissive; uniform lowp vec4 u_ambient; uniform lowp vec4 u_lightCol; //varyings varying mediump vec2 vvTexCoord; varying lowp vec4 vvColour; void main() { //Apply the first joint to the animation transforms int jointIndex = int(a_jointIndices.x + 0.5); vec4 jointVector0 = u_joints[jointIndex * 3 + 0]; vec4 jointVector1 = u_joints[jointIndex * 3 + 1]; vec4 jointVector2 = u_joints[jointIndex * 3 + 2]; mat4 jointMatrix = mat4(jointVector0.x, jointVector1.x, jointVector2.x, 0.0, jointVector0.y, jointVector1.y, jointVector2.y, 0.0, jointVector0.z, jointVector1.z, jointVector2.z, 0.0, jointVector0.w, jointVector1.w, jointVector2.w, 1.0); mat4 animationTransform = (jointMatrix * a_weights.x); //apply the second joint to the animation transforms jointIndex = int(a_jointIndices.y + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.y); //apply the third joint to the animation transforms jointIndex = int(a_jointIndices.z + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.z); //apply the fourth joint to the animation transforms jointIndex = int(a_jointIndices.w + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * (1.0 - a_weights.x - a_weights.y - a_weights.z)); //Convert the vertex from local space to projection and world space. vec4 localPosition = animationTransform * a_position; gl_Position = u_wvpMat * localPosition; //get the tex coord vvTexCoord = a_texCoord; //calculate the lighting colour vvColour = (u_emissive + (u_ambient * u_lightCol)); } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; //varyings varying mediump vec2 vvTexCoord; varying lowp vec4 vvColour; void main() { gl_FragColor = vvColour * texture2D(u_texture0, vvTexCoord); } } } ================================================ FILE: CSResources/Shaders/Animated-Blinn-Directional.csshader ================================================ // // AnimatedBlinnDirectional.csshader // ChilliSource // Created by I Copland on 29/01/2014. // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec3 a_normal; attribute mediump vec2 a_texCoord; attribute highp vec4 a_weights; attribute highp vec4 a_jointIndices; //uniforms uniform mediump vec3 u_lightDir; uniform highp mat4 u_wvpMat; uniform highp mat4 u_worldMat; uniform highp mat4 u_normalMat; uniform highp vec4 u_joints[100]; uniform highp vec3 u_cameraPos; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; void main() { //Apply the first joint to the animation transforms int jointIndex = int(a_jointIndices.x + 0.5); vec4 jointVector0 = u_joints[jointIndex * 3 + 0]; vec4 jointVector1 = u_joints[jointIndex * 3 + 1]; vec4 jointVector2 = u_joints[jointIndex * 3 + 2]; mat4 jointMatrix = mat4(jointVector0.x, jointVector1.x, jointVector2.x, 0.0, jointVector0.y, jointVector1.y, jointVector2.y, 0.0, jointVector0.z, jointVector1.z, jointVector2.z, 0.0, jointVector0.w, jointVector1.w, jointVector2.w, 1.0); mat4 animationTransform = (jointMatrix * a_weights.x); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; mat4 normalAnimationTransform = (jointMatrix * a_weights.x); //apply the second joint to the animation transforms jointIndex = int(a_jointIndices.y + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.y); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; normalAnimationTransform += (jointMatrix * a_weights.y); //apply the third joint to the animation transforms jointIndex = int(a_jointIndices.z + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.z); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; normalAnimationTransform += (jointMatrix * a_weights.z); //apply the fourth joint to the animation transforms jointIndex = int(a_jointIndices.w + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * (1.0 - a_weights.x - a_weights.y - a_weights.z)); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; normalAnimationTransform += (jointMatrix * (1.0 - a_weights.x - a_weights.y - a_weights.z)); //Convert the vertex from local space to projection and world space. vec4 localPosition = animationTransform * a_position; gl_Position = u_wvpMat * localPosition; vec4 vWorldPosition = u_worldMat * localPosition; // Calculate normal in world space vec4 localNormal = normalAnimationTransform * vec4((a_normal), 1.0); vvNormal = normalize((u_normalMat * localNormal).xyz); //calculate the half vector. vec3 vVertexToEye = normalize(u_cameraPos - vWorldPosition.xyz); vvHalfVector = normalize(-u_lightDir + vVertexToEye); //get the tex coord vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; uniform lowp vec4 u_diffuse; uniform lowp vec4 u_specular; uniform lowp vec4 u_lightCol; uniform mediump vec3 u_lightDir; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; void main() { vec3 vNormal = normalize(vvNormal); vec3 vHalfVector = normalize(vvHalfVector); //calculate the diffuse colour float fNdotL = max(dot(vNormal, -u_lightDir), 0.0); vec4 vDiffuse = u_diffuse * fNdotL; //calculate the specular colour float fNdotHV = max(dot(vNormal, vHalfVector), 0.0); float fLightSwitch = step(0.001, fNdotL); vec4 vSpecular = vec4(u_specular.xyz * pow(fNdotHV, u_specular.a) * fLightSwitch, 1.0); //calculate the final colour vec4 vColour = (vDiffuse + vSpecular) * u_lightCol; gl_FragColor = vColour * texture2D(u_texture0, vvTexCoord); } } } ================================================ FILE: CSResources/Shaders/Animated-Blinn-DirectionalShadows.csshader ================================================ // // AnimatedBlinnShadowedDirectional.csshader // ChilliSource // Created by I Copland on 29/01/2014. // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec3 a_normal; attribute mediump vec2 a_texCoord; attribute highp vec4 a_weights; attribute highp vec4 a_jointIndices; //uniforms uniform mediump vec3 u_lightDir; uniform highp mat4 u_wvpMat; uniform highp mat4 u_worldMat; uniform highp mat4 u_normalMat; uniform highp vec4 u_joints[100]; uniform highp vec3 u_cameraPos; uniform highp mat4 u_lightMat; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; varying highp vec4 vvShadowPosition; void main() { //Apply the first joint to the animation transforms int jointIndex = int(a_jointIndices.x + 0.5); vec4 jointVector0 = u_joints[jointIndex * 3 + 0]; vec4 jointVector1 = u_joints[jointIndex * 3 + 1]; vec4 jointVector2 = u_joints[jointIndex * 3 + 2]; mat4 jointMatrix = mat4(jointVector0.x, jointVector1.x, jointVector2.x, 0.0, jointVector0.y, jointVector1.y, jointVector2.y, 0.0, jointVector0.z, jointVector1.z, jointVector2.z, 0.0, jointVector0.w, jointVector1.w, jointVector2.w, 1.0); mat4 animationTransform = (jointMatrix * a_weights.x); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; mat4 normalAnimationTransform = (jointMatrix * a_weights.x); //apply the second joint to the animation transforms jointIndex = int(a_jointIndices.y + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.y); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; normalAnimationTransform += (jointMatrix * a_weights.y); //apply the third joint to the animation transforms jointIndex = int(a_jointIndices.z + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.z); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; normalAnimationTransform += (jointMatrix * a_weights.z); //apply the fourth joint to the animation transforms jointIndex = int(a_jointIndices.w + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * (1.0 - a_weights.x - a_weights.y - a_weights.z)); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; normalAnimationTransform += (jointMatrix * (1.0 - a_weights.x - a_weights.y - a_weights.z)); //Convert the vertex from local space to projection and world space. vec4 localPosition = animationTransform * a_position; gl_Position = u_wvpMat * localPosition; vec4 vWorldPosition = u_worldMat * localPosition; vvShadowPosition = u_lightMat * vWorldPosition; vvShadowPosition = (vvShadowPosition * 0.5 + 0.5); // Calculate normal in world space vec4 localNormal = normalAnimationTransform * vec4((a_normal), 1.0); vvNormal = normalize((u_normalMat * localNormal).xyz); //calculate the half vector. vec3 vVertexToEye = normalize(u_cameraPos - vWorldPosition.xyz); vvHalfVector = normalize(-u_lightDir + vVertexToEye); //get the tex coord vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; uniform highp float u_shadowTolerance; uniform highp sampler2D u_shadowMap; uniform lowp vec4 u_diffuse; uniform lowp vec4 u_specular; uniform lowp vec4 u_lightCol; uniform mediump vec3 u_lightDir; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; varying highp vec4 vvShadowPosition; void main() { vec3 vNormal = normalize(vvNormal); vec3 vHalfVector = normalize(vvHalfVector); //calculate the diffuse colour float fNdotL = max(dot(vNormal, -u_lightDir), 0.0); vec4 vDiffuse = u_diffuse * fNdotL; //calculate the specular colour float fNdotHV = max(dot(vNormal, vHalfVector), 0.0); float fLightSwitch = step(0.001, fNdotL); vec4 vSpecular = vec4(u_specular.xyz * pow(fNdotHV, u_specular.a) * fLightSwitch, 1.0); //get the shadow factor float fMapDepth = texture2D(u_shadowMap, vvShadowPosition.xy).r; float fShadowFactor = min(ceil(max((fMapDepth + u_shadowTolerance) - vvShadowPosition.z, 0.0)), 1.0); //ensure there is no shadow beyond the borders of the shadow map. float fBorderXFactor = min(abs(floor(vvShadowPosition.x)), 1.0); float fBorderYFactor = min(abs(floor(vvShadowPosition.y)), 1.0); float fBorderZFactor = min(abs(floor(vvShadowPosition.z)), 1.0); fShadowFactor = max(max(max(fShadowFactor, fBorderXFactor), fBorderYFactor), fBorderZFactor); //calculate the final colour vec4 vColour = (vDiffuse + vSpecular) * u_lightCol * fShadowFactor; gl_FragColor = vColour * texture2D(u_texture0, vvTexCoord); } } } ================================================ FILE: CSResources/Shaders/Animated-Blinn-Point.csshader ================================================ // // AnimatedBlinnPoint.csshader // ChilliSource // Created by I Copland on 29/01/2014. // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec3 a_normal; attribute mediump vec2 a_texCoord; attribute highp vec4 a_weights; attribute highp vec4 a_jointIndices; //uniforms uniform highp vec3 u_lightPos; uniform highp mat4 u_wvpMat; uniform highp mat4 u_worldMat; uniform highp mat4 u_normalMat; uniform highp vec4 u_joints[100]; uniform lowp vec3 u_cameraPos; //varyings varying mediump vec3 vvLightDir; varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; varying mediump float vfLightDistance; void main() { //Apply the first joint to the animation transforms int jointIndex = int(a_jointIndices.x + 0.5); vec4 jointVector0 = u_joints[jointIndex * 3 + 0]; vec4 jointVector1 = u_joints[jointIndex * 3 + 1]; vec4 jointVector2 = u_joints[jointIndex * 3 + 2]; mat4 jointMatrix = mat4(jointVector0.x, jointVector1.x, jointVector2.x, 0.0, jointVector0.y, jointVector1.y, jointVector2.y, 0.0, jointVector0.z, jointVector1.z, jointVector2.z, 0.0, jointVector0.w, jointVector1.w, jointVector2.w, 1.0); mat4 animationTransform = (jointMatrix * a_weights.x); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; mat4 normalAnimationTransform = (jointMatrix * a_weights.x); //apply the second joint to the animation transforms jointIndex = int(a_jointIndices.y + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.y); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; normalAnimationTransform += (jointMatrix * a_weights.y); //apply the third joint to the animation transforms jointIndex = int(a_jointIndices.z + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.z); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; normalAnimationTransform += (jointMatrix * a_weights.z); //apply the fourth joint to the animation transforms jointIndex = int(a_jointIndices.w + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * (1.0 - a_weights.x - a_weights.y - a_weights.z)); jointMatrix[3][0] = 0.0; jointMatrix[3][1] = 0.0; jointMatrix[3][2] = 0.0; normalAnimationTransform += (jointMatrix * (1.0 - a_weights.x - a_weights.y - a_weights.z)); //Convert the vertex from local space to projection and world space. vec4 localPosition = animationTransform * a_position; gl_Position = u_wvpMat * localPosition; vec4 vWorldPosition = u_worldMat * localPosition; // Calculate normal in world space vec4 localNormal = normalAnimationTransform * vec4((a_normal), 1.0); vvNormal = normalize((u_normalMat * localNormal).xyz); //calculate the light direction. vvLightDir = vWorldPosition.xyz - u_lightPos; vfLightDistance = length(vvLightDir); vvLightDir = normalize(vvLightDir); //calculate the half vector. vec3 vVertexToEye = normalize(u_cameraPos - vWorldPosition.xyz); vvHalfVector = normalize(-vvLightDir + vVertexToEye); //get the tex coord vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; uniform highp float u_shadowTolerance; uniform highp sampler2D u_shadowMap; uniform lowp vec4 u_diffuse; uniform lowp vec4 u_specular; uniform lowp vec4 u_lightCol; uniform mediump float u_attenuationConstant; uniform mediump float u_attenuationLinear; uniform mediump float u_attenuationQuadratic; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvLightDir; varying mediump vec3 vvNormal; varying mediump float vfLightDistance; varying highp vec4 vvShadowPosition; void main() { vec3 vNormal = normalize(vvNormal); vec3 vLightDir = normalize(vvLightDir); vec3 vHalfVector = normalize(vvHalfVector); //calculate the attenuation. float fAttenuation = 1.0 / (u_attenuationConstant + (u_attenuationLinear * vfLightDistance) + (u_attenuationQuadratic * vfLightDistance * vfLightDistance)); //calculate the diffuse colour float fNdotL = max(dot(vNormal, -vLightDir), 0.0); vec4 vDiffuse = u_diffuse * fNdotL; //calculate the specular colour float fNdotHV = max(dot(vNormal, vHalfVector), 0.0); float fLightSwitch = step(0.001, fNdotL); vec4 vSpecular = vec4(u_specular.xyz * pow(fNdotHV, u_specular.a) * fLightSwitch, 1.0); //calculate the final colour vec4 vColour = (vDiffuse + vSpecular) * u_lightCol; vColour.rgb *= fAttenuation; gl_FragColor = vColour * texture2D(u_texture0, vvTexCoord); } } } ================================================ FILE: CSResources/Shaders/Animated-ShadowMap.csshader ================================================ // // AnimatedDirectionalShadowMap.csshader // ChilliSource // Created by I Copland on 29/01/2014. // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute highp vec4 a_weights; attribute highp vec4 a_jointIndices; //uniforms uniform highp mat4 u_wvpMat; uniform highp vec4 u_joints[100]; //varyings varying highp float v_depth; void main() { //Apply the first joint to the animation transforms int jointIndex = int(a_jointIndices.x + 0.5); vec4 jointVector0 = u_joints[jointIndex * 3 + 0]; vec4 jointVector1 = u_joints[jointIndex * 3 + 1]; vec4 jointVector2 = u_joints[jointIndex * 3 + 2]; mat4 jointMatrix = mat4(jointVector0.x, jointVector1.x, jointVector2.x, 0.0, jointVector0.y, jointVector1.y, jointVector2.y, 0.0, jointVector0.z, jointVector1.z, jointVector2.z, 0.0, jointVector0.w, jointVector1.w, jointVector2.w, 1.0); mat4 animationTransform = (jointMatrix * a_weights.x); //apply the second joint to the animation transforms jointIndex = int(a_jointIndices.y + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.y); //apply the third joint to the animation transforms jointIndex = int(a_jointIndices.z + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.z); //apply the fourth joint to the animation transforms jointIndex = int(a_jointIndices.w + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * (1.0 - a_weights.x - a_weights.y - a_weights.z)); //Convert the vertex from local space to projection and world space. vec4 localPosition = animationTransform * a_position; gl_Position = u_wvpMat * localPosition; v_depth = gl_Position.z; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //varyings varying highp float v_depth; void main() { gl_FragColor = vec4(v_depth, v_depth, v_depth, 1.0); } } } ================================================ FILE: CSResources/Shaders/Animated-Unlit.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec2 a_texCoord; attribute mediump vec4 a_weights; attribute highp vec4 a_jointIndices; //uniforms uniform highp mat4 u_wvpMat; uniform highp vec4 u_joints[100]; //varyings varying mediump vec2 vvTexCoord; void main() { //Apply the first joint to the animation transforms int jointIndex = int(a_jointIndices.x + 0.5); vec4 jointVector0 = u_joints[jointIndex * 3 + 0]; vec4 jointVector1 = u_joints[jointIndex * 3 + 1]; vec4 jointVector2 = u_joints[jointIndex * 3 + 2]; mat4 jointMatrix = mat4(jointVector0.x, jointVector1.x, jointVector2.x, 0.0, jointVector0.y, jointVector1.y, jointVector2.y, 0.0, jointVector0.z, jointVector1.z, jointVector2.z, 0.0, jointVector0.w, jointVector1.w, jointVector2.w, 1.0); mat4 animationTransform = (jointMatrix * a_weights.x); //apply the second joint to the animation transforms jointIndex = int(a_jointIndices.y + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.y); //apply the third joint to the animation transforms jointIndex = int(a_jointIndices.z + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * a_weights.z); //apply the fourth joint to the animation transforms jointIndex = int(a_jointIndices.w + 0.5); jointVector0 = u_joints[jointIndex * 3 + 0]; jointVector1 = u_joints[jointIndex * 3 + 1]; jointVector2 = u_joints[jointIndex * 3 + 2]; jointMatrix[0][0] = jointVector0.x; jointMatrix[0][1] = jointVector1.x; jointMatrix[0][2] = jointVector2.x; jointMatrix[0][3] = 0.0; jointMatrix[1][0] = jointVector0.y; jointMatrix[1][1] = jointVector1.y; jointMatrix[1][2] = jointVector2.y; jointMatrix[1][3] = 0.0; jointMatrix[2][0] = jointVector0.z; jointMatrix[2][1] = jointVector1.z; jointMatrix[2][2] = jointVector2.z; jointMatrix[2][3] = 0.0; jointMatrix[3][0] = jointVector0.w; jointMatrix[3][1] = jointVector1.w; jointMatrix[3][2] = jointVector2.w; jointMatrix[3][3] = 1.0; animationTransform += (jointMatrix * (1.0 - a_weights.x - a_weights.y - a_weights.z)); //Convert the vertex from local space to projection and world space. gl_Position = u_wvpMat * animationTransform * a_position; //get the tex coord vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; uniform lowp vec4 u_emissive; //varyings varying mediump vec2 vvTexCoord; void main() { gl_FragColor = texture2D(u_texture0, vvTexCoord) * u_emissive; } } } ================================================ FILE: CSResources/Shaders/Skybox.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2017 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec2 a_texCoord; //uniforms uniform highp mat4 u_wvpMat; //varyings varying mediump vec3 v_texCoord; void main() { //By using'w' as 'z' we ensure that the skybox is always at the maximum depth gl_Position = (u_wvpMat * a_position).xyww; v_texCoord = normalize(a_position.xyz); } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp samplerCube u_cubemap0; //varyings varying mediump vec3 v_texCoord; void main() { gl_FragColor = textureCube(u_cubemap0, v_texCoord); } } } ================================================ FILE: CSResources/Shaders/Sprite-Unlit.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute lowp vec4 a_colour; attribute mediump vec2 a_texCoord; //uniforms uniform highp mat4 u_wvpMat; uniform lowp vec4 u_emissive; //varyings varying lowp vec4 vvColour; varying mediump vec2 vvTexCoord; void main() { gl_Position = u_wvpMat * a_position; vvColour = a_colour * u_emissive; vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; //varyings varying lowp vec4 vvColour; varying mediump vec2 vvTexCoord; void main() { gl_FragColor = texture2D(u_texture0, vvTexCoord) * vvColour; } } } ================================================ FILE: CSResources/Shaders/Sprite-UnlitStencil.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute lowp vec4 a_colour; attribute mediump vec2 a_texCoord; //uniforms uniform highp mat4 u_wvpMat; uniform lowp vec4 u_emissive; //varyings varying lowp vec4 vvColour; varying mediump vec2 vvTexCoord; void main() { gl_Position = u_wvpMat * a_position; vvColour = a_colour * u_emissive; vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; //varyings varying lowp vec4 vvColour; varying mediump vec2 vvTexCoord; void main() { gl_FragColor = texture2D(u_texture0, vvTexCoord) * vvColour; //Pick a small alpha test value for pixels that are invisble to the eye if(gl_FragColor.a < 0.05) { discard; } } } } ================================================ FILE: CSResources/Shaders/Static-Blinn-Base.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attribute attribute highp vec4 a_position; attribute mediump vec2 a_texCoord; //uniforms uniform highp mat4 u_wvpMat; uniform lowp vec4 u_emissive; uniform lowp vec4 u_ambient; uniform lowp vec4 u_lightCol; //varyings varying mediump vec2 vvTexCoord; varying lowp vec4 vvColour; void main() { //Convert the vertex from world space to projection gl_Position = u_wvpMat * a_position; //Apply the texture matrix to the texture coordinates vvTexCoord = a_texCoord; //calulate the lighting colour vvColour = (u_emissive + (u_ambient * u_lightCol)); } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; //varyings varying mediump vec2 vvTexCoord; varying lowp vec4 vvColour; void main() { gl_FragColor = vvColour * texture2D(u_texture0, vvTexCoord); } } } ================================================ FILE: CSResources/Shaders/Static-Blinn-Directional.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec3 a_normal; attribute mediump vec2 a_texCoord; //uniforms uniform mediump vec3 u_lightDir; uniform highp mat4 u_wvpMat; uniform highp mat4 u_worldMat; uniform highp mat4 u_normalMat; uniform highp vec3 u_cameraPos; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; void main() { gl_Position = u_wvpMat * a_position; vec4 vWorldPosition = u_worldMat * a_position; //calculate the normal vvNormal = (u_normalMat * vec4(a_normal, 1.0)).xyz; //calculate the half vector. vec3 vVertexToEye = normalize(u_cameraPos - vWorldPosition.xyz); vvHalfVector = normalize(-u_lightDir + vVertexToEye); //get the tex coord vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; uniform lowp vec4 u_diffuse; uniform lowp vec4 u_specular; uniform lowp vec4 u_lightCol; uniform mediump vec3 u_lightDir; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; void main() { vec3 vNormal = normalize(vvNormal); vec3 vHalfVector = normalize(vvHalfVector); //calculate the diffuse colour float fNdotL = max(dot(vNormal, -u_lightDir), 0.0); vec4 vDiffuse = u_diffuse * fNdotL; //calculate the specular colour float fNdotHV = max(dot(vNormal, vHalfVector), 0.0); float fLightSwitch = step(0.001, fNdotL); vec4 vSpecular = vec4(u_specular.xyz * pow(fNdotHV, u_specular.a) * fLightSwitch, 1.0); //calculate the final colour vec4 vColour = (vDiffuse + vSpecular) * u_lightCol; gl_FragColor = vColour * texture2D(u_texture0, vvTexCoord); } } } ================================================ FILE: CSResources/Shaders/Static-Blinn-DirectionalShadows.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec3 a_normal; attribute mediump vec2 a_texCoord; //uniforms uniform mediump vec3 u_lightDir; uniform highp mat4 u_wvpMat; uniform highp mat4 u_worldMat; uniform highp mat4 u_normalMat; uniform highp mat4 u_lightMat; uniform highp vec3 u_cameraPos; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; varying highp vec4 vvShadowPosition; void main() { gl_Position = u_wvpMat * a_position; vec4 vWorldPosition = u_worldMat * a_position; //Convert the vertex to shadow space vvShadowPosition = u_lightMat * vWorldPosition; vvShadowPosition = (vvShadowPosition * 0.5 + 0.5); //calculate the normal vvNormal = (u_normalMat * vec4(a_normal, 1.0)).xyz; //calculate the half vector. vec3 vVertexToEye = normalize(u_cameraPos - vWorldPosition.xyz); vvHalfVector = normalize(-u_lightDir + vVertexToEye); //get the tex coord vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; uniform highp float u_shadowTolerance; uniform highp sampler2D u_shadowMap; uniform lowp vec4 u_diffuse; uniform lowp vec4 u_specular; uniform lowp vec4 u_lightCol; uniform mediump vec3 u_lightDir; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; varying highp vec4 vvShadowPosition; void main() { vec3 vNormal = normalize(vvNormal); vec3 vHalfVector = normalize(vvHalfVector); //calculate the diffuse colour float fNdotL = max(dot(vNormal, -u_lightDir), 0.0); vec4 vDiffuse = u_diffuse * fNdotL; //calculate the specular colour float fNdotHV = max(dot(vNormal, vHalfVector), 0.0); float fLightSwitch = step(0.001, fNdotL); vec4 vSpecular = vec4(u_specular.xyz * pow(fNdotHV, u_specular.a) * fLightSwitch, 1.0); //calculate the shadow factor float fMapDepth = texture2D(u_shadowMap, vvShadowPosition.xy).r; float fShadowFactor = min(ceil(max((fMapDepth + u_shadowTolerance) - vvShadowPosition.z, 0.0)), 1.0); //ensure there is no shadow beyond the borders of the shadow map. float fBorderXFactor = min(abs(floor(vvShadowPosition.x)), 1.0); float fBorderYFactor = min(abs(floor(vvShadowPosition.y)), 1.0); float fBorderZFactor = min(abs(floor(vvShadowPosition.z)), 1.0); fShadowFactor = max(max(max(fShadowFactor, fBorderXFactor), fBorderYFactor), fBorderZFactor); //calculate the final colour vec4 vColour = (vDiffuse + vSpecular) * u_lightCol * fShadowFactor; gl_FragColor = vColour * texture2D(u_texture0, vvTexCoord); } } } ================================================ FILE: CSResources/Shaders/Static-Blinn-Point.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec3 a_normal; attribute mediump vec2 a_texCoord; //uniforms uniform highp vec3 u_lightPos; uniform highp mat4 u_wvpMat; uniform highp mat4 u_worldMat; uniform highp mat4 u_normalMat; uniform highp vec3 u_cameraPos; //varyings varying mediump vec3 vvLightDir; varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvNormal; varying mediump float vfLightDistance; void main() { //calculate the vertex position in world space and in clip space. gl_Position = u_wvpMat * a_position; vec4 vWorldPosition = u_worldMat * a_position; //calculate the normal vvNormal = (u_normalMat * vec4(a_normal, 1.0)).xyz; //calculate the light direction. vvLightDir = vWorldPosition.xyz - u_lightPos; vfLightDistance = length(vvLightDir); vvLightDir = normalize(vvLightDir); //calculate the half vector. vec3 vVertexToEye = normalize(u_cameraPos - vWorldPosition.xyz); vvHalfVector = normalize(-vvLightDir + vVertexToEye); //get the tex coord vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; uniform lowp vec4 u_diffuse; uniform lowp vec4 u_specular; uniform lowp vec4 u_lightCol; uniform mediump float u_attenuationConstant; uniform mediump float u_attenuationLinear; uniform mediump float u_attenuationQuadratic; //varyings varying mediump vec2 vvTexCoord; varying mediump vec3 vvHalfVector; varying mediump vec3 vvLightDir; varying mediump vec3 vvNormal; varying mediump float vfLightDistance; void main() { vec3 vNormal = normalize(vvNormal); vec3 vLightDir = normalize(vvLightDir); vec3 vHalfVector = normalize(vvHalfVector); //calculate the attenuation. float fAttenuation = 1.0 / (u_attenuationConstant + (u_attenuationLinear * vfLightDistance) + (u_attenuationQuadratic * vfLightDistance * vfLightDistance)); //calculate the diffuse colour float fNdotL = max(dot(vNormal, -vLightDir), 0.0); vec4 vDiffuse = u_diffuse * fNdotL; //calculate the specular colour float fNdotHV = max(dot(vNormal, vHalfVector), 0.0); float fLightSwitch = step(0.001, fNdotL); vec4 vSpecular = vec4(u_specular.xyz * pow(fNdotHV, u_specular.a) * fLightSwitch, 1.0); //calculate the final colour vec4 vColour = (vDiffuse + vSpecular) * u_lightCol; vColour.rgb *= fAttenuation; gl_FragColor = vColour * texture2D(u_texture0, vvTexCoord); } } } ================================================ FILE: CSResources/Shaders/Static-ShadowMap.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; //uniforms uniform highp mat4 u_wvpMat; //varyings varying highp float v_depth; void main() { gl_Position = u_wvpMat * a_position; v_depth = gl_Position.z; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //varyings varying highp float v_depth; void main() { gl_FragColor = vec4(v_depth, v_depth, v_depth, 1.0); } } } ================================================ FILE: CSResources/Shaders/Static-Unlit.csshader ================================================ // // The MIT License (MIT) // // Copyright (c) 2014 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // GLSL { VertexShader { #ifndef GL_ES #define lowp #define mediump #define highp #endif //attributes attribute highp vec4 a_position; attribute mediump vec2 a_texCoord; //uniforms uniform highp mat4 u_wvpMat; //varyings varying mediump vec2 vvTexCoord; void main() { //Convert the vertex from world space to projection gl_Position = u_wvpMat * a_position; //Apply the texture matrix to the texture coordinates vvTexCoord = a_texCoord; } } FragmentShader { #ifndef GL_ES #define lowp #define mediump #define highp #else precision lowp float; #endif //uniforms uniform lowp sampler2D u_texture0; uniform lowp vec4 u_emissive; //varyings varying mediump vec2 vvTexCoord; void main() { gl_FragColor = texture2D(u_texture0, vvTexCoord) * u_emissive; } } } ================================================ FILE: CSResources/Widgets/DefaultCursor.csui ================================================ { "Type": "Image", "Name": "CSCursor", "InputEnabled": "false", "AbsSize": "16 16", "OriginAnchor": "TopLeft", "SizePolicy": "UseWidthMaintainingAspect", "Drawable": { "TextureLocation": "ChilliSource", "TexturePath": "Textures/DefaultCursor.png", "Type": "Standard" } } ================================================ FILE: CSResources/Widgets/EditableLabel.csuidef ================================================ { "Type": "EditableLabel", "Components": [ { "Type": "Text", "Name": "Text" }, { "Type": "EditableText", "Name": "EditableText" } ], "ComponentPropertyLinks": { "EditableText": "all", "Text": { "Font": "Font", "TextColour": "TextColour", "HorizontalJustification": "HorizontalJustification", "VerticalJustification": "VerticalJustification", "AbsCharSpacingOffset": "AbsCharSpacingOffset", "AbsLineSpacingOffset": "AbsLineSpacingOffset", "LineSpacingScale": "LineSpacingScale", "MaxNumberOfLines": "MaxNumberOfLines", "TextScale": "TextScale", "MinTextAutoScale": "MinTextAutoScale", "EnableAutoTextScale": "EnableAutoTextScale" } }, "DefaultPropertyValues": { "Name": "EditableLabel", "InputConsumeEnabled": "true" } } ================================================ FILE: CSResources/Widgets/HighlightButton.csuidef ================================================ { "Type": "HighlightButton", "Components": [ { "Type": "Drawable", "Name": "Drawable" }, { "Type": "Highlight", "Name": "Highlight" } ], "ComponentPropertyLinks": { "Drawable": "none", "Highlight": "all" }, "DefaultPropertyValues": { "Name": "HighlightButton", "InputConsumeEnabled": "true" } } ================================================ FILE: CSResources/Widgets/HorizontalFillProgressBar.csuidef ================================================ { "Type": "HorizontalFillProgressBar", "Components": [ { "Type": "Drawable", "Name": "Drawable" }, { "Type": "ProgressBar", "Name": "ProgressBar", "BarWidgetName": "Bar", "BarDirection": "Horizontal", "BarType": "Fill" } ], "Children": [ { "Type": "Image", "Name": "Bar", "RelSize": "0.0 1.0", "ParentalAnchor": "MiddleLeft", "OriginAnchor": "MiddleLeft" } ], "ComponentPropertyLinks": { "Drawable": "all", "ProgressBar": { "RelBarSize": "RelBarSize", "Progress": "Progress" } }, "ChildPropertyLinks": { "Bar": { "BarDrawable": "Drawable" } }, "DefaultPropertyValues": { "Name": "HorizontalFillProgressBar" } } ================================================ FILE: CSResources/Widgets/HorizontalSlider.csuidef ================================================ { "Type": "HorizontalSlider", "Components": [ { "Type": "Drawable", "Name": "Drawable" }, { "Type": "Slider", "Name": "Slider", "SliderWidgetName": "Slider", "SliderDirection": "Horizontal" } ], "Children": [ { "Type": "Image", "Name": "Slider", "RelPosition": "0.5 0.0", "RelSize": "0.0 1.0", "SizePolicy": "UseHeightMaintainingAspect", "ParentalAnchor": "MiddleLeft", "OriginAnchor": "MiddleLeft" } ], "ComponentPropertyLinks": { "Drawable": "all", "Slider": { "SliderSize": "SliderSize", "SliderPosition": "SliderPosition" } }, "ChildPropertyLinks": { "Slider": { "SliderDrawable": "Drawable" } }, "DefaultPropertyValues": { "Name": "HorizontalSlider", "InputConsumeEnabled": "true" } } ================================================ FILE: CSResources/Widgets/HorizontalStretchProgressBar.csuidef ================================================ { "Type": "HorizontalStretchProgressBar", "Components": [ { "Type": "Drawable", "Name": "Drawable" }, { "Type": "ProgressBar", "Name": "ProgressBar", "BarWidgetName": "Bar", "BarDirection": "Horizontal", "BarType": "Stretch" } ], "Children": [ { "Type": "Image", "Name": "Bar", "RelSize": "0.0 1.0", "ParentalAnchor": "MiddleLeft", "OriginAnchor": "MiddleLeft" } ], "ComponentPropertyLinks": { "Drawable": "all", "ProgressBar": { "RelBarSize": "RelBarSize", "Progress": "Progress" } }, "ChildPropertyLinks": { "Bar": { "BarDrawable": "Drawable" } }, "DefaultPropertyValues": { "Name": "HorizontalStretchProgressBar" } } ================================================ FILE: CSResources/Widgets/Image.csuidef ================================================ { "Type": "Image", "Components": [ { "Type": "Drawable", "Name": "Drawable" } ], "ComponentPropertyLinks": { "Drawable": "all" }, "DefaultPropertyValues": { "Name": "Image" } } ================================================ FILE: CSResources/Widgets/Label.csuidef ================================================ { "Type": "Label", "Components": [ { "Type": "Text", "Name": "Text" } ], "ComponentPropertyLinks": { "Text": "all" }, "DefaultPropertyValues": { "Name": "Label" } } ================================================ FILE: CSResources/Widgets/Layout.csuidef ================================================ { "Type": "Layout", "Components": [ { "Type": "Layout", "Name": "Layout" } ], "ComponentPropertyLinks": { "Layout": "all" }, "DefaultDefaultValues": { "Name": "Layout" } } ================================================ FILE: CSResources/Widgets/ToggleButton.csuidef ================================================ { "Type": "ToggleButton", "Components": [ { "Type": "Drawable", "Name": "Drawable" }, { "Type": "ToggleHighlight", "Name": "ToggleHighlight" } ], "ComponentPropertyLinks": { "Drawable": "none", "ToggleHighlight": "all" }, "DefaultPropertyValues": { "Name": "ToggleButton", "InputConsumeEnabled": "true" } } ================================================ FILE: CSResources/Widgets/VerticalFillProgressBar.csuidef ================================================ { "Type": "VerticalFillProgressBar", "Components": [ { "Type": "Drawable", "Name": "Drawable" }, { "Type": "ProgressBar", "Name": "ProgressBar", "BarWidgetName": "Bar", "BarDirection": "Vertical", "BarType": "Fill" } ], "Children": [ { "Type": "Image", "Name": "Bar", "RelSize": "0.0 1.0", "ParentalAnchor": "MiddleLeft", "OriginAnchor": "MiddleLeft" } ], "ComponentPropertyLinks": { "Drawable": "all", "ProgressBar": { "RelBarSize": "RelBarSize", "Progress": "Progress" } }, "ChildPropertyLinks": { "Bar": { "BarDrawable": "Drawable" } }, "DefaultPropertyValues": { "Name": "VerticalFillProgressBar" } } ================================================ FILE: CSResources/Widgets/VerticalSlider.csuidef ================================================ { "Type": "VerticalSlider", "Components": [ { "Type": "Drawable", "Name": "Drawable" }, { "Type": "Slider", "Name": "Slider", "SliderWidgetName": "Slider", "SliderDirection": "Vertical" } ], "Children": [ { "Type": "Image", "Name": "Slider", "RelPosition": "0.0 0.5", "RelSize": "1.0 0.0", "SizePolicy": "UseWidthMaintainingAspect", "ParentalAnchor": "BottomCentre", "OriginAnchor": "BottomCentre" } ], "ComponentPropertyLinks": { "Drawable": "all", "Slider": { "SliderSize": "SliderSize", "SliderPosition": "SliderPosition" } }, "ChildPropertyLinks": { "Slider": { "SliderDrawable": "Drawable" } }, "DefaultPropertyValues": { "Name": "VerticalSlider", "InputConsumeEnabled": "true" } } ================================================ FILE: CSResources/Widgets/VerticalStretchProgressBar.csuidef ================================================ { "Type": "VerticalStretchProgressBar", "Components": [ { "Type": "Drawable", "Name": "Drawable" }, { "Type": "ProgressBar", "Name": "ProgressBar", "BarWidgetName": "Bar", "BarDirection": "Vertical", "BarType": "Stretch" } ], "Children": [ { "Type": "Image", "Name": "Bar", "RelSize": "0.0 1.0", "ParentalAnchor": "MiddleLeft", "OriginAnchor": "MiddleLeft" } ], "ComponentPropertyLinks": { "Drawable": "all", "ProgressBar": { "RelBarSize": "RelBarSize", "Progress": "Progress" } }, "ChildPropertLinks": { "Bar": { "BarDrawable": "Drawable" } }, "DefaultPropertyValues": { "Name": "VerticalStretchProgressBar" } } ================================================ FILE: CSResources/Widgets/Widget.csuidef ================================================ { "Type": "Widget", "DefaultPropertyValues": { "Name": "Widget" } } ================================================ FILE: Documents/ChangeLog.md ================================================ ChilliSource Change Log ======================= Version 2.2.3, ------------------------- * Fixed: Crash when minimising window on Windows caused by OpenGL continuing to render. Fix is to suspend the application when it loses focus (SFML has no minimise event). Version 2.2.2, 2017-03-27 ------------------------- * Added: Parsing and ToString methods for Integer2, Integer3 and Integer4 * Fixed: Some OpenGL analyser warnings caused by setting attributes when they don't exist in shaders * Fixed: Issues compiling under case-sensitive file system (i.e. Linux) caused by incorrectly cased includes. * Fixed: Typo in Label.csuidef which meant the default name "Label" was being ignored. Version 2.2.1, 2017-03-14 ------------------------- * HotFix: Fix for potential issue of the vertex attribute objects not being rebuilt when the context is lost on Android Version 2.2.0, 2017-03-14 ------------------------- * Removed: Render component factory. Just use the constructors of the render components instead (to replicate CreatePerspectiveCamera pass screenWidth/screenHeight for aspect ratio) * Deprecated: Support for SHA-1 * Added: SHA-256 hashing support * Changed: ContentManagementSystem now uses SHA-256 unless compiler flag CS_USE_SHA1_CHECKSUMS is enabled for legacy applications. * Changed: Performance improvement on sprites and UI by using mapbuffer or orphaning buffers rather than a blocking subbuffer call. * Changed: GLMesh (static meshes) now use vertex array objects where the extension exists. On Android this requires linking against -lEgl * Fixed: Issue with suspending on Android in debug mode sometimes causing an assert Version 2.1.4, 2017-02-28 ------------------------- * HotFix: With shadows turned on the bound texture list in the renderer was expanding each frame and causing memory leaks and performance slowdown Version 2.1.3, 2017-02-27 ------------------------- * Added: Thread safe ObjectPoolAllocator that pre allocates objects of a specific type. Now using this within the renderer to reduce allocations. * Fix: Longstanding issue where "Shinniness" was reciprocated (i.e. 1/Shinniness) in Blinn shaders rather than just Shinniness. Note this will affect existing projects. * Fix: Crash in Collada to CSModel tool if the Collada file has no materials. * Fix: Issue with Sphere::Transform not considering orientation. This meant that mesh frustum culling was broken * Fix: Tweens which play more than once will now utilise the end-delay property every time the end of the tween is reached, instead of just once. * Fix: Default background colour is now black. * Fix: CS::UniquePtr could not be moved into CS::UniquePtr * Fix: Issue where cull face was ignored in material and always set to back * Updated: SFML is now version 2.4.2, on Windows. * Updated: Cricket is now version 1.6.3. This now means that bitcode can be enabled on iOS (and is now enabled by default in newly generated projects). * Changed: Ray/Plane intersection test is no longer a member function of Plane, but now resides in ShapeIntersection along with the other intersection tests. * Changed: Where available the iOS dialogue system is backed by the newer UIAlertController rather than the deprecated UIAlertView * Changed: SetParentTransform, AddChildTransform, RemoveChildTransform and RemoveAllChildTransforms in Transform are now private and cannot be accessed outside of Entity. * Changed: iOS projects now have deployment target of iOS 8.0 Version 2.1.2, 2017-01-26 ------------------------- * Added: Tangents and Bitangents to CSModel format. Accessible in shader vertex declaration as a_tangent and a_bitangent. Model version is now 13. Please rebuild all csmodel files. * Added: Skybox support via SkyboxComponent and new Skybox material type. * Added: Gyroscope support for iOS and Android using similar system to Accelerometer. * Fix: SendToBack in Widget not working properly. Version 2.1.1, 2017-01-19 ------------------------- * Added: Additional blend modes to materials for destCol and oneMinusDestCol Version 2.1.0, 2017-01-06 ------------------------- * Added: Support for Cubemaps. Accessed in shaders as u_cubemap[N]. This required changes to the material file formats Texture element to specify a type "Texture" or "Cubemap" and renaming of "image-name" to "file-name". * Added: Support for stencil buffer (introducing new framebuffer format). * Added: Support for masking in UI using the stencil buffer (this replaces scissor regions). * Added: Render to texture support * Added: New logging macros for formatted logs CS_LOG_XXX_FMT. * Improved: Added convenience distance method to vector classes. * Other minor fixes. Version 2.0.1, 2016-07-21 ------------------------- * Hotfix for issue in GLDynamicMesh where indices were not being assigned correctly on construction Version 2.0.0, 2016-07-15 ------------------------- * Added: A new multi-threaded renderer. The previous renderer has been completely stripped out and replaced with a brand new renderer which makes much better use of multi-core devices. The new renderer also allows us to add deferred rendering support in the future. * Added: Small mesh batching. This is a major optimisation which combines small meshes into a single draw call where possible. Currently this only supports dynamic sprites but other mesh types will be added in the future. * Added: New allocator types, which allow for very efficient allocation of memory. * Added: An editable label ui widget type. * Improved: As a result of the changes for the multi-threaded renderer, the main thread is no longer the same as the system/render thread. This thread is now solely for scene management and game logic. * Improved: The task scheduler has been completely overhauled. It now supports batching of tasks, task depedancies and a number of different task types. * Improved: The ChilliSource namespaces have been significantly simplified. The sub-namespaces (For example: ChilliSource::Rendering) have been removed and all classes are now located the ChilliSource namespace. An optional CS:: alias is available, and its use is recommened. As a result of this change, some classes have been renamed, for example CSUI::Drawable is now called CS::UIDrawable. * Improved: Materials have been improved such that models with different vertex formats (for example static models and animated models) require different materials. The material type system has been simplified down to three types: Unlit, Blinn and Custom. * Improved: The FileStream API has been significantly improved. * Improved: Improved the API for manual creation of Textures and Meshes. * Improved: StaticMeshComponent and AnimatedMeshComponent have been renamed StaticModelComponent and AnimatedModelComponent, and have had their API improved. * Improved: Updated all systems to support the new threading model. Some minor API changes were required to make this work. * Improved: Key codes can now request a text description of the key the represent. * Fixed: Issues with local notifications on Android. * Fixed: Issues with video subtitles on both Android and iOS. * Fixed: A problem with keyboard presentation during text entry on Android. * Removed: Support for custom render sort predicates. This will be re-added in the future. * Removed: Cubemaps. These will be re-added in the future. * Removed: Scissor regions. These will be re-added in the future. * Removed: Render to texture support. This will be re-added soon. * Removed: Facebook support. This will be re-added soon. * Removed: Remote notifications on Android. * Removed: Mesh Batch. * And many other minor improvements and tweaks that would take too long to list. Version 1.6.0, 2016-04-01 ------------------------- * Added: 64-bit Android support. Both arm64-v8a and x86_64 can now be targetted. * Added: Support for building music and sound effect files to the default asset pipeline provided in generated projects. * Improved: Updated to Visual Studio 2015. Support for Visual Studio 2013 has been dropped, meaning we can now use additional C++11 features such as 'noexcept' and 'constexpr'. * Improved: Re-created the windows project with modern settings and improved the output build format. * Improved: Re-created the iOS projects with modern settings and fixed all warnings and errors in XCode 7. * Improved: Improved the python asset pipeline scripts provided in generated projects. * Improved: UI::Drawable properties are now accessbile. * Improved: Updated to the latest version of Cricket Audio. * Improved: Updated to a more up to date, and unmodified version of Minizip. * Improved: Updated to the latest version of SFML on windows. * Improved: Updated to the latest version of Glew on windows. * Improved: Minor updates to the Android project format. * Fixed: An issue where .DS_Store files were not being correctly omitted from the Android APK expansion file. Also added Thumbs.db ignore. * Fixed: A crash in the HTTP request system on Android. * Fixed: UI input events are no longer received for inactive states. * Fixed: Gesture input events are no longer received for inactive states. * Fixed: Android notifications are now cleared after they have been selected. * Fixed: The standardise path methods no longer break UNC paths. * Fixed: OS version is now correctly reported on Android. * Fixed: .pyc files are now correctly ignored in generated projects. * Fixed: An issue on Android where some libraries still depended on all build variants, resulting in long build times. Version 1.5.2, 2016-03-18 ------------------------- * Fixed: FileSystem::GetDirectoryPath() now correctly creates parent paths recursively on Windows. This fixes the issue where the Documents/ directory would not be created on start up in certain circumstances. Version 1.5.1, 2015-08-14 ------------------------- * Added: A new primitive shape model factory. This can be used to create boxes and planes in code. * Added: A new primitive shape entity factory. This creates new entities using shapes generated through the primitive shape model factory. * Added: Support for "multi-dex" applications on Android. This is needed if your application exceeds to 65k method limit. * Added: A new way of handling JNI callbacks from Java to Native on Android. The method should now provide a BoxedPointer, which can be used to retreive a pointer to the target native object * Improved: The Change Over Lifetime particle affector now supports 'intermediate colours', meaning it can fade through a series of different colours over the lifetime * Improved: It is now possible to get the expected size and current progress of a download using the Http Request System * Improved: Reimplemented Http Request on Android. It will no longer block the background task queue if several requests are made at the same time. * Improved: It is now possible to get the jobject from a JavaClass. * Fixed: Row and column major ordering is now the correct way round in a Grid Layout * Fixed: Materials used by the Canvas Renderer and now correctly relinquished at the end of each frame, fixing the issue where the textures could not be manually released * Fixed: An issue with the minus operator in all math vectors where the vector itself was modified rather than a copy, leading the following returning true: b = -a; return (a == b); * Fixed: Vector2::Angle now returns an absolute angle to be consistent with how Vector3::Angle() works * Fixed: A crash bug that would occur under certain conditions when using Application::Quit() on Android * Fixed: System dialogue boxes now correctly display on Windows * Fixed: The main thead id is now correctly updated during the OnDestroy() life cycle event on Android * Fixed: An issue where pushing an Apk Expansion file to device would fail becuase a directory doesn't exist. * Fixed: A crash related to WebView in Android release builds. * Fixed: An issue with clear() in the Java class DynamicByteBuffer Version 1.5.0, 2015-07-10 ------------------------- * Added: The android build pipeline now includes gradle tasks for packaging resources in the Apk Expansion file and pushing it to device. * Added: The APK expansion downloader screen can now be overridden by the user. * Added: Implemented a new, much easier to use system for handling JNI calls on Android. Native to Java calls are now all handled through JavaClass or JavaStaticClass. These include a number of sanity checks and provide more intuitive error messages. Java to Native still works as before. * Added: Implemented JavaSystem, similar to JavaClass, but specifically for andriod java classes which extend System. * Added: The android java class FileUtils now includes separate methods for reading and writing binary and text files. * Added: FileSystem now includes methods for checking if a directory exists in the cached or package DLC locations. * Added: The java tools ZipUtils now includes the ability to zip the contents of a directory. * Added: A new java tool for cross-platform zipping of directories. * Removed: The previous android expansion system has been removed. * Removed: The android Power Manager is now redundant and has been removed. * Removed: The GetAbsolutePathToFile() and GetAbsolutePathToDirectory() methods in FileSystem are no longer relevant with changes made to the system a while ago, and therefore have been removed. * Improved: Updated the android projects to Android Studio 1.2. This included updating to gradle 1.2.3, build tools version 22.0.1 and sdk version 22. * Improved: Support for Android Expansion files has been greatly improved. Google Play builds will now be automatically downloaded on startup if not already present. This occurs prior to any game code being executed so the user no longer need to handle the case where game assets do not yet exist. The downloaded expansion file is no longer unpacked meaning the app will be much smaller on disc, and a number of possible complications are avoided. A default downloader screen is provided by the engine. * Improved: The android file system implementation has been significantly overhauled. Google Play flavoured builds now refer to the main APK expansion file rather than the APK when the Package, ChilliSource or DLC storage locations are requested. Amazon builds still use the APK. * Improved: Significantly tidied up and improved the android gradle build scripts. * Improved: Restructured the Android backend. * Improved: Renamed the android java class NativeInterface and changed it so that it follows the same lifecycle rules as systems in the native side of the engine. * Improved: Renamexd JavaInterfaceUtils to JavaUtils. * Improved: Simplified the creation and destruction of file streams. Calls to FileSystem::CreateFileStream() will now either return a valid ready to use stream, or null if it failed. A stream is no longer manually closed, instead it will be automatically cleaned up when it goes out of scope. * Improved: The LVL key for Android Google Play builds should now be provided once in App.cpp, rather than being provided to each system that needs it in different ways. * Improved: It is now possible to get access to the DrawableDef in a UI::DrawableComponent. * Improved: Refactored and improved the android java StringUtils class. * Improved: Refactored the android java class IQueryableInterface. * Improved: The TaggedPathResolver now returns the input path if the path doesn't exist. This means requests to ResourcePool will print more helpful error messages. * Improved: Refactored the android VideoPlayer backend so that it uses JavaSystem instead of JavaInterface. * Improved: The android manifest builder has been updated to reflect the changes to the Android project structure. Added new option for specifying a custom APK expansion downloader view. * Improved: The project generator has been updated to include the new Android project structure changes. * Fixed: A number of inconsistencies and bugs in the Android and Windows FileSystem have been fixed. * Fixed: A FileStream referring to the Package, ChilliSource or packaged DLC storage locations on Android no longer allows write operations. * Fixed: A bug where tagged asset paths were incorrectly handled for CkBank resources has been resolved. * Deprecated: JavaInterface and _JavaInteface are both now deprecated and will be removed in the near future. Version 1.4.5, 2015-06-26 ------------------------- * Added: Additional data on IAPs can now be retreived through the Android and iOS backends for IAPSystem. * Fixed: Application and State no longer log a warning if a system couldn't be found using GetSystem<>() * Fixed: Fixed a number of fatal errors which were incorrectly reported in the PNG To CSImage tool. * Fixed: The Android build process will now correctly halt if there are compiler errors during the native build. Version 1.4.4, 2015-06-05 ------------------------- * Fixed: A crash when removing Entities with children from the scene. * Fixed: Child widgets are now correctly removed from their parent when the parent is deleted. * Fixed: An issue that would result in auto-scaling text not rendering. Version 1.4.3, 2015-05-21 ------------------------- * Removed: The GUI model and animation converter it had a number of issues and was windows specific. It will be replaced with a cross platform equivalent at some point in the future, but for now the command line tools should be used. * Fixed: A label which contains icons in the text will no longer crash if label is too small to fit one of the icons. * Fixed: Icons in labels are now correctly sized if the icon is from a texture altas. * Fixed: SetWorldTransform() in Transform now works correctly. * Fixed: An issue where Widgets could receive incorrect input events when moving. * Fixed: The Cricket Audio system now correctly works with assets in the DLC storage location. * Fixed: The Cricket Audio system, Android Video Player, Android WebView, and Android Email Composer now all work correctly with tagged assets. * Fixed: An issue in the Content Management System where some packages would re-downloaded unnecessarily. Version 1.4.2, 2015-05-01 ------------------------- * Added: Label now supports auto sizing to ensure text will fit inside the label bounds * Fixed: Issues with resolution on iPhone 6 Plus * Fixed: Changing resolution on windows in code now correctly fires the On Resolution Changed event * Fixed: It is no longer possible to try and run in fullscreen mode with an invalid resolution on Windows * Fixed: The ChilliSource android project no longer runs proguard, which was causing issues in projects which contain their own Java source * Fixed: Animated Collada files exported from Blender should now be correctly converted by the collada conversion tools Version 1.4.1, 2015-04-17 ------------------------- * Improved: Updated the ChangeLog.md to correct markdown syntax * Fixed: The project generator no longer fails if there is a ".git" directory in the ChilliSource directory * Fixed: Windows builds no longer fail during the asset copy python script if there is a space in the path name * Fixed: The view frustum is now correctly updated when the screen resolution changes. This fixed an issue with on screen objects being culled Version 1.4.0, 2015-04-03 ------------------------- * Added: Support for Android Studio. All projects created by the Project Generator now provide an Android Studio project instead of Eclipse ADT. * Added: Support for 64-bit builds to Windows and iOS projects. 64-bit Android projects will be coming soon! * Added: Double2, Double3, and Double4 math vector types. * Removed: Support for Eclipse ADT builds. Eclipse is no longer officially supported as an Android development IDE. * Improved: The widget hierarchy is now accessible through Canvas. * Improved: DrawableDef no longer requires colour and UVs in their constructor. * Improved: Restructured the Android backend to mirror the structure used for different product flavours in Android Studio. * Improved: It is now much easier to build Kindle builds. * Fixed: Sprite anchors now work correctly. * Fixed: Text now correctly changes colour when the parent widget's colour changes. * Fixed: Colour can now be pre-multiplied/divided/subtracted/added by a scalar. * Fixed: A compiler error on Windows when using the Math::Random::Generate() default parameters. * Fixed: CkBank resources are now correctly cleaned up if they still exist during the Application::OnDestroy lifecycle event. * Fixed: Projects created by the Project Generator on Windows can now be correctly built in XCode. * Fixed: IAP will no longer fail on Android if there are more than 20 available products. * Fixed: A compiler error on Windows caused by the lack of virtual destructor in the Event interfaces. * Fixed: The project generator no longer leaves git remnants in generated projects. Version 1.3.3, 2015-02-24 ------------------------- * Labels now support inclusion of Icons in text. * Improved the Facebook Post system and updated to the latest version of the Facebook SDK on both iOS and Android. * Facebook on Android is now an Android Extension. To use it add CS_ANDROIDEXTENSION_FACEBOOK to the pre-processor definitions in Android.mk and import the Facebook library project into eclipse. This can be found in the engine in the Libraries/Android/Projects/ directory. * The Google Play Services android library project is now included in the engine, and can be found in the Libraries/Android/Projects/ directory. This should be used instead of copying a new version into the workspace. * The CkAudioPlayer now has separate setters for music and effect volume. * Fixed Android compiler errors when building on a linux machine. This was caused by in-correct case in include paths. * Change errant log when failing to open file in JsonUtils. Version 1.3.2, 2015-01-23 ------------------------- * Added new tool which provides a cross platform interface for the Cricket Audio cktool. * Made a number of improvements to projects generated by the Project Generator including: improved default asset pipeline, iOS 8 launch images and icons and fixes. * Fix: Solved an issue with md5 and sha1 file hashing on Android. * Fix: RTT can be used without supplying a UI canvas. * Fix: It's now possible to have a null drawable on a ui widget. Version 1.3.1, 2015-01-09 ------------------------- * Added convenience methods to Widget Factory for building all the in-built widget types. * Added a creation method for creating Particle Effect Components to the Render Component Factory. * Fixed a crash bug on Android. Version 1.3.0, 2015-01-09 ------------------------- * Added the new UI system. * Added a new particle system. * Added a Cricket audio system. * Added a new property map for containing heterogeneous types. * Added new dynamic_array which is based on std::dynarray which was originally proposed in the C++14 standard, but was later removed to be re-added at a later date. * Added Random utilty class for thread-safe random number generation. * Added new Json utility class, which provides convenience methods for working with Json. * Improved the Tween API. * Removed several features that have been superceeded by improved implementations: The old GUI system, the old particle system, MathUtils::FRand() and Utils::ReadJson(). * Removed the reflection functionality as it was incomplete and only used by the old GUI system. * Removed Debug Stats as it relied heavily on the old GUI system. This will be re-implemented in the new system in the not too distant future. Version 1.2.1, 2014-11-17 ------------------------- * Models exported from Blender can now be converted to CSModel format using the ColladaToCSModel tool. * Improved the HTTP Request System API. Also replaced the iOS HTTP Request System internals with NSURLConnection. This resulted in removal of GetBytesRead() from the HTTP interface. * Updated iOS Facebook SDK. * ContentDownloader now allows a custom hashing delegate to be provided rather than being explicitly MD5. * ContentDownloader now defaults to using SHA-1 hash. * Fixed a bug in the font maker tool which resulted in different characters that were identical being rendered incorrectly. * Fixed a bug that prevented the font maker tool runnning on windows. * Fixed a bug with state system that could result in resume/suspend being called out of order causing an assertion. * Fix for MakeConnectableDelegate which was crashing due to implicit move. Version 1.2.0, 2014-11-07 ------------------------- * Replaced the existing Font Builder tool with a new version. Unlike the previous tool this can be run on Windows, OSX and Linux, and fonts can be generated from command line. Fonts can also have a number of effects applied including outlines, glow and drop shadows. * Font rendering has been significantly improved. This involved updating the font format so any existing fonts will need to be rebuilt. * CSModelExport is now correctly working again. * Updated the android backend for Android 5.0. * Updated the android backed to use the latest NDK build pipeline. Version 1.1.5, 2014-11-03 ------------------------- * Fixed a windows specific crash on closing an application. Version 1.1.4, 2014-10-24 ------------------------- * Changed the Application::GetSystems() method so that it returns a vector of systems rather than taking a vector of systems as an output parameter. * Added a GetSystems() method to State. * Added constant versions of system getters to Application and State. * Changed WorkerQueue to concurrent_blocking_queue and changed its API to ensure it is thread-safe. This solves the thread-safety issues with the TaskScheduler. * Fixed issue with missing includes in the Vector classes and StandardMacros.h. Version 1.1.3, 2014-10-20 ------------------------- * Project generator will now error if the output directory is inside ChilliSource. This was causing recursive file copy issues when copying ChilliSource to the project directory. Version 1.1.2, 2014-10-16 ------------------------- * Added CSProjectGenerator, a tool for generating new ChilliSource project. Version 1.1.1, 2014-10-10 ------------------------- * All App Systems now correctly receive life cycle events prior to States. * Simplified the command line interface for the ColladaToCSModel and ColladaToCSAnim tools and re-added the ability to change coordinate system handedness. * Updated the package name in all java code from com.chillisource.* to com.chilliworks.chillisource.* * Fixed a bug in Colour::Clamp() where by default alpha was clamping between 1 and 1 rather than 0 and 1. * Swapped the parameters in Timer::OpenConnection() to be more lambda friendly. * Fixed typos in the documentation for the CSAtlas Builder. Version 1.1.0, 2014-09-26: ------------------------- * Replaced the gesture system. * UDIDs on Android are now generated from the Google Play Services Advertising Id when building for Google Play. This requires the inclusion of the Goole Play Services library in all Android projects. * Adding accessor to Tween for getting the parametric T value * The GUI System no longer allows consumption of moved events. * The Pointer System no longer has a filtered version of OnPointerMoved() as this event cannot be filtered. * The engine is no longer built with CS_ENABLE_DEBUGSTATS enabled in debug mode. App projects should also remove this flag. * Scene::Remove() is no longer public, entities must be removed from the scene using RemoveFromParent(). * Attempting to add a widget to the scene with a parent which is not in the scene will result in an assert. * Fixed bug in TexturePacker algorithm which caused padding to break for atlases and fonts. * Fixed iOS 8 issues with Push and Local Notifications. * Added new concurrent vector which is thread-safe and allows additions and removals while iterating. * Fixed an issue with Android context restoration. * Fixed a bug where Scene::RemoveAllEntities() would assert if there was an entity with a parent in the scene. ================================================ FILE: Documents/RPi_GettingStarted.md ================================================ # ChilliSource: Getting Started on Raspberry Pi Exciting news - you can now use ChilliSource to create both 2D and 3D games for the Raspberry Pi! ChilliSource brings the features of a professional game engine to a $30 computer the size of a credit card. This tutorial will walk you through how to build a ChilliSource game for Raspberry Pi and covers the caveats of Pi development. Please let us know if you encounter any issues or if there are any new features you would like to see. We have tested apps running on a Raspberry Pi 3 model B with Raspbian "Jessie" (we also have used libraries from "Jessie"). Apps may work on other Raspberry Pi models and OS versions but we have yet to test. ## Requirements - Raspberry Pi 3, Model B - [Raspbian "Jessie"](https://www.raspberrypi.org/downloads/raspbian/) - [Ninja build](https://ninja-build.org/) - Python 2.7+ - GNU g++ ## Missing Features This is an experimental platform and due to this, and the Pi hardware/software, there are some features of ChilliSource that cannot be used on the Pi. Some of the missing features will be added as part of the continued development of ChilliSource Pi, others will only be added if and when they are supported by the 3rd party libraries we use or by the Pi hardware itself. - Framebuffer MSAA: In development. - Shadows: *The Pi GPU does not support the GL depth texture extension that we require for shadows. So as with some Android devices shadows are disabled* - Cricket Audio: *Cricket currently have no library for Raspberry Pi (although they do have a Linux library). Feel free to make requests to them for RPi support. In the meantime you can always plug in a different audio library or use OpenAL* - System Dialogue Boxes: *Unlike on Windows the Pi display does not work in conjunction with the window manager and therefore always renders on top of the OS. Any displayed dialogue boxes would be obscured. We are waiting on better integration between the VideoCore window and X11.* - Video rendering: *This has not been looked into yet but will probably encounter the same issues as with dialogue boxes.* - Web View: *This has not been looked into yet but will probably encounter the same issues as with dialogue boxes.* ## Pi Setup ### GPU Memory By default the Pi allocates the GPU 64 MB of memory. This is enough for games with few textures but anything more advances will require additional resources. We recommend allocating at least 256 MB. The allocated memory can be changed in *Preferences > Raspberry Pi Configuration > Performance > GPU Memory*. ### Ninja Ninja is a cross platform build system that we use to create ChilliSource applications. You can download binaries [here](https://ninja-build.org/) or alternatively install it through a package manager. On the Raspberry Pi Ninja can be installed by opening a terminal and typing: "sudo apt-get install ninja-build". NOTE: For the build script to work, Ninja must be added to the path so that typing "ninja" into a terminal executes Ninja. ### Compiler and Linker By default we use g++ to compile and link. This is usually preinstalled on your Raspberry Pi (as is Python which is required by the build script). ## Compiling The build process uses the built in g++ compiler and linker. If you are creating a game from scratch using the project generator then you will already have the build scripts required for Raspberry Pi development. If you have an existing game that you want to build for the Pi then you can use the sample build script (*build.py*) from [CSTest](https://github.com/ChilliWorks/CSTest) or [CSPong](https://github.com/ChilliWorks/CSSamples). By default the build script is setup to build on the Raspberry Pi itself so make sure your project is on the Pi. Navigate to */Projects/RPi/* in terminal and type "python build.py debug" to start building (you can replace "debug" with "release" to build in release mode). The script will generate an exe and the required assets in an Output folder in the same directory. If you want to clean the build type "python build.py debug|release clean". NOTE: Make sure you have installed Ninja prior to running the build script. ### Cross Compiling Compiling on the Pi can be tedious so it is probably worth setting up a cross compile toolchain that allows you to compile the exe on a different machine and simply copy the *Output* folder to the Pi. We recommend downloading one of the following prebuilt toolchains depending on your development platform: - [Windows](http://sysprogs.com/files/gnutoolchains/raspberry/raspberry-gcc4.9.2-r4.exe) - [Mac OS](https://www.jaredwolff.com/toolchains/rpi-xtools-201402102110.dmg.zip) - [Linux](https://github.com/raspberrypi/tools) Once you have downloaded the toolchains simply change the variables at the top of *build.py* to point to the cross compiler, archiver and linker instead. NOTES: - If you are compiling on Windows using the downloaded Ninja binary you will need to add Ninja to the PATH environment variable. - The default build script limits the number of jobs that Ninja will do in parallel to two (if you don't restrict Ninja it will crash the Pi). If you are cross compiling then feel free to remove this restriction (by setting NUM_JOBS=None in *build.py*) to speed up build times. ### Libraries At the moment all the libraries required for building to the Pi have been harvested from Raspbian "Jessie" itself. In the future these will be compiled from source as part of the toolchain allowing us to better support other Pi models. ## App Configuration You will need to edit your App.config JSON file to add the following to the main root: ``` "RPi": { "CursorType": "NonSystem", "WindowDisplayMode": "Windowed" } ``` The display mode tells ChilliSource whether to start your game "Windowed" or whether to start it "Fullscreen". NOTE: If you start the game fullscreen make sure you have some way of calling CS::Application::Get()->Quit() as the window will have no close button. The cursor type is required if you want to see a mouse cursor. The OpenGL ES display window always renders on top of the OS and therefore obscures the system mouse cursor. Setting the cursor type to "NonSystem" will render a software cursor (NOTE: The cursor is just a UI widget and can be configured to suit your game). If you want to hide the cursor completely just set the cursor type to "None". ## Running your Game If you want to see debug output from your application you should run it from terminal by navigating to the location of your app in terminal and then typing "./AppName" to execute. If you wish to run your app without debug output simply double-click the icon. NOTE: If you cannot run the app due to "Permission denied" you may need to make it executable by typing "chmod +x AppName" into a terminal. ## Debugging You can debug "debug" builds on the Pi using gdb (provided you are using the g++/gcc compiler). You will probably want to read up on how to use gdb from the terminal; for example if you want to grab the stack trace of a crash run the app in the following way: ``` gdb ./AppName catch throw run ``` libCrypto will throw an exception (which is expected apparently) that will stop the debugger so you need to skip that: ``` signal SIGILL ``` Once the crash is triggered type: ``` bt ``` This will display the call stack. ## Gamepad/Controllers As part of the new Raspberry Pi backend we've also added support for gamepads/controllers to both Raspberry Pi and Windows. Checkout the CSRunner sample project for a more in-depth example but here's the main code required: ``` auto gamepadSystem = CS::Application::Get()->GetSystem(); if(gamepadSystem != nullptr) { gamepadSystem->SetDefaultActionMapping(k_moveGamepadAction, CS::GamepadAxis::k_y); gamepadSystem->SetActionMapping(k_moveGamepadAction, CS::GamepadMappings::PS4::k_name, CS::GamepadMappings::PS4::k_dpadY, true); gamepadSystem->SetActionMapping(k_moveGamepadAction, CS::GamepadMappings::PS4::k_name, CS::GamepadMappings::PS4::k_lStickY); m_gamepadAxisEventConnection = gamepadSystem->GetMappedAxisPositionChangedEvent().OpenConnection([=](const CS::Gamepad& gamepad, f64 timestamp, u32 actionId, f32 position) { //AXIS MOVED }); m_gamepadButtonEventConnection = gamepadSystem->GetMappedButtonPressureChangedEvent().OpenConnection([=](const CS::Gamepad& gamepad, f64 timestamp, u32 actionId, f32 pressure) { //BUTTON PRESSURE CHANGED }); } ``` ## Next Steps There isn't much more to say other than have fun and let us know how you get on. ================================================ FILE: LICENSE ================================================ The MIT License (MIT) Copyright (c) 2017 Tag Games Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: Libraries/Core/Android/Headers/SHA1/HMAC_SHA1.h ================================================ /* 100% free public domain implementation of the HMAC-SHA1 algorithm by Chien-Chung, Chung (Jim Chung) */ #ifndef __HMAC_SHA1_H__ #define __HMAC_SHA1_H__ #include "SHA1.h" typedef unsigned char BYTE ; class CHMAC_SHA1 : public CSHA1 { private: BYTE m_ipad[64]; BYTE m_opad[64]; char * szReport ; char * SHA1_Key ; char * AppendBuf1 ; char * AppendBuf2 ; public: enum { SHA1_DIGEST_LENGTH = 20, SHA1_BLOCK_SIZE = 64, HMAC_BUF_LEN = 4096 } ; CHMAC_SHA1() :szReport(new char[HMAC_BUF_LEN]), AppendBuf1(new char[HMAC_BUF_LEN]), AppendBuf2(new char[HMAC_BUF_LEN]), SHA1_Key(new char[HMAC_BUF_LEN]) {} ~CHMAC_SHA1() { delete[] szReport ; delete[] AppendBuf1 ; delete[] AppendBuf2 ; delete[] SHA1_Key ; } void HMAC_SHA1(BYTE *text, int text_len, BYTE *key, int key_len, BYTE *digest); }; #endif /* __HMAC_SHA1_H__ */ ================================================ FILE: Libraries/Core/Android/Headers/SHA1/SHA1.h ================================================ /* 100% free public domain implementation of the SHA-1 algorithm by Dominik Reichl Web: http://www.dominik-reichl.de/ Version 2.1 - 2012-06-19 - Deconstructor (resetting internal variables) is now only implemented if SHA1_WIPE_VARIABLES is defined (which is the default). - Renamed inclusion guard to contain a GUID. - Demo application is now using C++/STL objects and functions. - Unicode build of the demo application now outputs the hashes of both the ANSI and Unicode representations of strings. - Various other demo application improvements. Version 2.0 - 2012-06-14 - Added 'limits.h' include. - Renamed inclusion guard and macros for compliancy (names beginning with an underscore are reserved). Version 1.9 - 2011-11-10 - Added Unicode test vectors. - Improved support for hashing files using the HashFile method that are larger than 4 GB. - Improved file hashing performance (by using a larger buffer). - Disabled unnecessary compiler warnings. - Internal variables are now private. Version 1.8 - 2009-03-16 - Converted project files to Visual Studio 2008 format. - Added Unicode support for HashFile utility method. - Added support for hashing files using the HashFile method that are larger than 2 GB. - HashFile now returns an error code instead of copying an error message into the output buffer. - GetHash now returns an error code and validates the input parameter. - Added ReportHashStl STL utility method. - Added REPORT_HEX_SHORT reporting mode. - Improved Linux compatibility of test program. Version 1.7 - 2006-12-21 - Fixed buffer underrun warning that appeared when compiling with Borland C Builder (thanks to Rex Bloom and Tim Gallagher for the patch). - Breaking change: ReportHash writes the final hash to the start of the buffer, i.e. it's not appending it to the string anymore. - Made some function parameters const. - Added Visual Studio 2005 project files to demo project. Version 1.6 - 2005-02-07 (thanks to Howard Kapustein for patches) - You can set the endianness in your files, no need to modify the header file of the CSHA1 class anymore. - Aligned data support. - Made support/compilation of the utility functions (ReportHash and HashFile) optional (useful when bytes count, for example in embedded environments). Version 1.5 - 2005-01-01 - 64-bit compiler compatibility added. - Made variable wiping optional (define SHA1_WIPE_VARIABLES). - Removed unnecessary variable initializations. - ROL32 improvement for the Microsoft compiler (using _rotl). Version 1.4 - 2004-07-22 - CSHA1 now compiles fine with GCC 3.3 under Mac OS X (thanks to Larry Hastings). Version 1.3 - 2003-08-17 - Fixed a small memory bug and made a buffer array a class member to ensure correct working when using multiple CSHA1 class instances at one time. Version 1.2 - 2002-11-16 - Borlands C++ compiler seems to have problems with string addition using sprintf. Fixed the bug which caused the digest report function not to work properly. CSHA1 is now Borland compatible. Version 1.1 - 2002-10-11 - Removed two unnecessary header file includes and changed BOOL to bool. Fixed some minor bugs in the web page contents. Version 1.0 - 2002-06-20 - First official release. ================ Test Vectors ================ SHA1("abc" in ANSI) = A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D SHA1("abc" in Unicode LE) = 9F04F41A 84851416 2050E3D6 8C1A7ABB 441DC2B5 SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" in ANSI) = 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" in Unicode LE) = 51D7D876 9AC72C40 9C5B0E3F 69C60ADC 9A039014 SHA1(A million repetitions of "a" in ANSI) = 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F SHA1(A million repetitions of "a" in Unicode LE) = C4609560 A108A0C6 26AA7F2B 38A65566 739353C5 */ #ifndef SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 #define SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 #if !defined(SHA1_UTILITY_FUNCTIONS) && !defined(SHA1_NO_UTILITY_FUNCTIONS) #define SHA1_UTILITY_FUNCTIONS #endif #if !defined(SHA1_STL_FUNCTIONS) && !defined(SHA1_NO_STL_FUNCTIONS) #define SHA1_STL_FUNCTIONS #if !defined(SHA1_UTILITY_FUNCTIONS) #error STL functions require SHA1_UTILITY_FUNCTIONS. #endif #endif #include #include #ifdef SHA1_UTILITY_FUNCTIONS #include #include #endif #ifdef SHA1_STL_FUNCTIONS #include #endif #ifdef _MSC_VER #include #endif // You can define the endian mode in your files without modifying the SHA-1 // source files. Just #define SHA1_LITTLE_ENDIAN or #define SHA1_BIG_ENDIAN // in your files, before including the SHA1.h header file. If you don't // define anything, the class defaults to little endian. #if !defined(SHA1_LITTLE_ENDIAN) && !defined(SHA1_BIG_ENDIAN) #define SHA1_LITTLE_ENDIAN #endif // If you want variable wiping, #define SHA1_WIPE_VARIABLES, if not, // #define SHA1_NO_WIPE_VARIABLES. If you don't define anything, it // defaults to wiping. #if !defined(SHA1_WIPE_VARIABLES) && !defined(SHA1_NO_WIPE_VARIABLES) #define SHA1_WIPE_VARIABLES #endif #if defined(SHA1_HAS_TCHAR) #include #else #ifdef _MSC_VER #include #else #ifndef TCHAR #define TCHAR char #endif #ifndef _T #define _T(__x) (__x) #define _tmain main #define _tprintf printf #define _getts gets #define _tcslen strlen #define _tfopen fopen #define _tcscpy strcpy #define _tcscat strcat #define _sntprintf snprintf #endif #endif #endif /////////////////////////////////////////////////////////////////////////// // Define variable types #ifndef UINT_8 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_8 unsigned __int8 #else // !_MSC_VER #define UINT_8 unsigned char #endif // _MSC_VER #endif #ifndef UINT_32 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_32 unsigned __int32 #else // !_MSC_VER #if (ULONG_MAX == 0xFFFFFFFFUL) #define UINT_32 unsigned long #else #define UINT_32 unsigned int #endif #endif // _MSC_VER #endif // UINT_32 #ifndef INT_64 #ifdef _MSC_VER // Compiling with Microsoft compiler #define INT_64 __int64 #else // !_MSC_VER #define INT_64 long long #endif // _MSC_VER #endif // INT_64 #ifndef UINT_64 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_64 unsigned __int64 #else // !_MSC_VER #define UINT_64 unsigned long long #endif // _MSC_VER #endif // UINT_64 /////////////////////////////////////////////////////////////////////////// // Declare SHA-1 workspace typedef union { UINT_8 c[64]; UINT_32 l[16]; } SHA1_WORKSPACE_BLOCK; class CSHA1 { public: #ifdef SHA1_UTILITY_FUNCTIONS // Different formats for ReportHash(Stl) enum REPORT_TYPE { REPORT_HEX = 0, REPORT_DIGIT = 1, REPORT_HEX_SHORT = 2 }; #endif // Constructor and destructor CSHA1(); #ifdef SHA1_WIPE_VARIABLES ~CSHA1(); #endif void Reset(); // Hash in binary data and strings void Update(const UINT_8* pbData, UINT_32 uLen); #ifdef SHA1_UTILITY_FUNCTIONS // Hash in file contents bool HashFile(const TCHAR* tszFileName); #endif // Finalize hash; call it before using ReportHash(Stl) void Final(); #ifdef SHA1_UTILITY_FUNCTIONS bool ReportHash(TCHAR* tszReport, REPORT_TYPE rtReportType = REPORT_HEX) const; #endif #ifdef SHA1_STL_FUNCTIONS bool ReportHashStl(std::basic_string& strOut, REPORT_TYPE rtReportType = REPORT_HEX) const; #endif // Get the raw message digest (20 bytes) bool GetHash(UINT_8* pbDest20) const; private: // Private SHA-1 transformation void Transform(UINT_32* pState, const UINT_8* pBuffer); // Member variables UINT_32 m_state[5]; UINT_32 m_count[2]; UINT_32 m_reserved0[1]; // Memory alignment padding UINT_8 m_buffer[64]; UINT_8 m_digest[20]; UINT_32 m_reserved1[3]; // Memory alignment padding UINT_8 m_workspace[64]; SHA1_WORKSPACE_BLOCK* m_block; // SHA1 pointer to the byte array above }; #endif // SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 ================================================ FILE: Libraries/Core/Android/Headers/SHA256/sha256.h ================================================ // ////////////////////////////////////////////////////////// // sha256.h // Copyright (c) 2014,2015 Stephan Brumme. All rights reserved. // see http://create.stephan-brumme.com/disclaimer.html // #pragma once //#include "hash.h" #include // define fixed size integer types #ifdef _MSC_VER // Windows typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; #else // GCC #include #endif /// compute SHA256 hash /** Usage: SHA256 sha256; std::string myHash = sha256("Hello World"); // std::string std::string myHash2 = sha256("How are you", 11); // arbitrary data, 11 bytes // or in a streaming fashion: SHA256 sha256; while (more data available) sha256.add(pointer to fresh data, number of new bytes); std::string myHash3 = sha256.getHash(); */ class SHA256 //: public Hash { public: /// split into 64 byte blocks (=> 512 bits), hash is 32 bytes long enum { BlockSize = 512 / 8, HashBytes = 32 }; /// same as reset() SHA256(); /// compute SHA256 of a memory block std::string operator()(const void* data, size_t numBytes); /// compute SHA256 of a string, excluding final zero std::string operator()(const std::string& text); /// add arbitrary number of bytes void add(const void* data, size_t numBytes); /// return latest hash as 64 hex characters std::string getHash(); /// return latest hash as bytes void getHash(unsigned char buffer[HashBytes]); /// restart void reset(); private: /// process 64 bytes void processBlock(const void* data); /// process everything left in the internal buffer void processBuffer(); /// size of processed data in bytes uint64_t m_numBytes; /// valid bytes in m_buffer size_t m_bufferSize; /// bytes not processed yet uint8_t m_buffer[BlockSize]; enum { HashValues = HashBytes / 4 }; /// hash, stored as integers uint32_t m_hash[HashValues]; }; ================================================ FILE: Libraries/Core/Android/Headers/aes/aes.h ================================================ /* The MIT License Copyright (C) 2011 Zilong Tan (labytan@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* * aes.h * * @version 3.0 (December 2000) * * Optimised ANSI C code for the Rijndael cipher (now AES) * * @author Vincent Rijmen * @author Antoon Bosselaers * @author Paulo Barreto * * This code is hereby placed in the public domain. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __ULIB_AES_H #define __ULIB_AES_H #include #define AES_MAXNR 14 #define AES_BLOCK_SIZE 16 struct aes_key_st { uint32_t rd_key[4 *(AES_MAXNR + 1)]; int rounds; }; typedef struct aes_key_st AES_KEY; #ifdef __cplusplus extern "C" { #endif /* bits can be 128, 192 or 256 */ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); /* in/out can be the same for ECB encryption/decryption */ void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); void AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); /* in/out can be the same */ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, unsigned long nblock, const AES_KEY *key); /* in/out MUST be DIFFERENT */ void AES_cbc_decrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, unsigned long nblock, const AES_KEY *key); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/Android/Headers/base64/base64.h ================================================ #include std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_decode(std::string const& s); ================================================ FILE: Libraries/Core/Android/Headers/json/assertions.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED #define CPPTL_JSON_ASSERTIONS_H_INCLUDED #include #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) #if JSON_USE_EXCEPTION #include #define JSON_ASSERT(condition) \ assert(condition); // @todo <= change this into an exception throw #define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message); #else // JSON_USE_EXCEPTION #define JSON_ASSERT(condition) assert(condition); // The call to assert() will show the failure message in debug builds. In // release bugs we write to invalid memory in order to crash hard, so that a // debugger or crash reporter gets the chance to take over. We still call exit() // afterward in order to tell the compiler that this macro doesn't return. #define JSON_FAIL_MESSAGE(message) \ { \ assert(false &&message); \ strcpy(reinterpret_cast(666), message); \ exit(123); \ } #endif #define JSON_ASSERT_MESSAGE(condition, message) \ if (!(condition)) { \ JSON_FAIL_MESSAGE(message) \ } #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED ================================================ FILE: Libraries/Core/Android/Headers/json/autolink.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_AUTOLINK_H_INCLUDED #define JSON_AUTOLINK_H_INCLUDED #include "config.h" #ifdef JSON_IN_CPPTL #include #endif #if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \ !defined(JSON_IN_CPPTL) #define CPPTL_AUTOLINK_NAME "json" #undef CPPTL_AUTOLINK_DLL #ifdef JSON_DLL #define CPPTL_AUTOLINK_DLL #endif #include "autolink.h" #endif #endif // JSON_AUTOLINK_H_INCLUDED ================================================ FILE: Libraries/Core/Android/Headers/json/config.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_CONFIG_H_INCLUDED #define JSON_CONFIG_H_INCLUDED /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 /// If defined, indicates that json may leverage CppTL library //# define JSON_USE_CPPTL 1 /// If defined, indicates that cpptl vector based map should be used instead of /// std::map /// as Value container. //# define JSON_USE_CPPTL_SMALLMAP 1 /// If defined, indicates that Json specific container should be used /// (hash table & simple deque container with customizable allocator). /// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 //# define JSON_VALUE_USE_INTERNAL_MAP 1 /// Force usage of standard new/malloc based allocator instead of memory pool /// based allocator. /// The memory pools allocator used optimization (initializing Value and /// ValueInternalLink /// as if it was a POD) that may cause some validation tool to report errors. /// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. //# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 // If non-zero, the library uses exceptions to report bad input instead of C // assertion macros. The default is to use exceptions. #ifndef JSON_USE_EXCEPTION #define JSON_USE_EXCEPTION 1 #endif /// If defined, indicates that the source file is amalgated /// to prevent private header inclusion. /// Remarks: it is automatically defined in the generated amalgated header. // #define JSON_IS_AMALGAMATION #ifdef JSON_IN_CPPTL #include #ifndef JSON_USE_CPPTL #define JSON_USE_CPPTL 1 #endif #endif #ifdef JSON_IN_CPPTL #define JSON_API CPPTL_API #elif defined(JSON_DLL_BUILD) #if defined(_MSC_VER) #define JSON_API __declspec(dllexport) #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING #endif // if defined(_MSC_VER) #elif defined(JSON_DLL) #if defined(_MSC_VER) #define JSON_API __declspec(dllimport) #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING #endif // if defined(_MSC_VER) #endif // ifdef JSON_IN_CPPTL #if !defined(JSON_API) #define JSON_API #endif // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for // integer // Storages, and 64 bits integer support is disabled. // #define JSON_NO_INT64 1 #if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 // Microsoft Visual Studio 6 only support conversion from __int64 to double // (no conversion from unsigned __int64). #define JSON_USE_INT64_DOUBLE_CONVERSION 1 // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' // characters in the debug information) // All projects I've ever seen with VS6 were using this globally (not bothering // with pragma push/pop). #pragma warning(disable : 4786) #endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 #if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 /// Indicates that the following function is deprecated. #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) #endif #if !defined(JSONCPP_DEPRECATED) #define JSONCPP_DEPRECATED(message) #endif // if !defined(JSONCPP_DEPRECATED) namespace Json { typedef int Int; typedef unsigned int UInt; #if defined(JSON_NO_INT64) typedef int LargestInt; typedef unsigned int LargestUInt; #undef JSON_HAS_INT64 #else // if defined(JSON_NO_INT64) // For Microsoft Visual use specific types as long long is not supported #if defined(_MSC_VER) // Microsoft Visual Studio typedef __int64 Int64; typedef unsigned __int64 UInt64; #else // if defined(_MSC_VER) // Other platforms, use long long typedef long long int Int64; typedef unsigned long long int UInt64; #endif // if defined(_MSC_VER) typedef Int64 LargestInt; typedef UInt64 LargestUInt; #define JSON_HAS_INT64 #endif // if defined(JSON_NO_INT64) } // end namespace Json #endif // JSON_CONFIG_H_INCLUDED ================================================ FILE: Libraries/Core/Android/Headers/json/features.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_FEATURES_H_INCLUDED #define CPPTL_JSON_FEATURES_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { /** \brief Configuration passed to reader and writer. * This configuration object can be used to force the Reader or Writer * to behave in a standard conforming way. */ class JSON_API Features { public: /** \brief A configuration that allows all features and assumes all strings * are UTF-8. * - C & C++ comments are allowed * - Root object can be any JSON value * - Assumes Value strings are encoded in UTF-8 */ static Features all(); /** \brief A configuration that is strictly compatible with the JSON * specification. * - Comments are forbidden. * - Root object must be either an array or an object value. * - Assumes Value strings are encoded in UTF-8 */ static Features strictMode(); /** \brief Initialize the configuration like JsonConfig::allFeatures; */ Features(); /// \c true if comments are allowed. Default: \c true. bool allowComments_; /// \c true if root must be either an array or an object value. Default: \c /// false. bool strictRoot_; /// \c true if dropped null placeholders are allowed. Default: \c false. bool allowDroppedNullPlaceholders_; /// \c true if numeric object key are allowed. Default: \c false. bool allowNumericKeys_; }; } // namespace Json #endif // CPPTL_JSON_FEATURES_H_INCLUDED ================================================ FILE: Libraries/Core/Android/Headers/json/forwards.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_FORWARDS_H_INCLUDED #define JSON_FORWARDS_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { // writer.h class FastWriter; class StyledWriter; // reader.h class Reader; // features.h class Features; // value.h typedef unsigned int ArrayIndex; class StaticString; class Path; class PathArgument; class Value; class ValueIteratorBase; class ValueIterator; class ValueConstIterator; #ifdef JSON_VALUE_USE_INTERNAL_MAP class ValueMapAllocator; class ValueInternalLink; class ValueInternalArray; class ValueInternalMap; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP } // namespace Json #endif // JSON_FORWARDS_H_INCLUDED ================================================ FILE: Libraries/Core/Android/Headers/json/json.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_JSON_H_INCLUDED #define JSON_JSON_H_INCLUDED #include "autolink.h" #include "value.h" #include "reader.h" #include "writer.h" #include "features.h" #endif // JSON_JSON_H_INCLUDED ================================================ FILE: Libraries/Core/Android/Headers/json/json_batchallocator.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED #define JSONCPP_BATCHALLOCATOR_H_INCLUDED #include #include #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION namespace Json { /* Fast memory allocator. * * This memory allocator allocates memory for a batch of object (specified by * the page size, the number of object in each page). * * It does not allow the destruction of a single object. All the allocated * objects can be destroyed at once. The memory can be either released or reused * for future allocation. * * The in-place new operator must be used to construct the object using the * pointer returned by allocate. */ template class BatchAllocator { public: BatchAllocator(unsigned int objectsPerPage = 255) : freeHead_(0), objectsPerPage_(objectsPerPage) { // printf( "Size: %d => %s\n", sizeof(AllocatedType), // typeid(AllocatedType).name() ); assert(sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *)); // We must be able to store a slist in the // object free space. assert(objectsPerPage >= 16); batches_ = allocateBatch(0); // allocated a dummy page currentBatch_ = batches_; } ~BatchAllocator() { for (BatchInfo *batch = batches_; batch;) { BatchInfo *nextBatch = batch->next_; free(batch); batch = nextBatch; } } /// allocate space for an array of objectPerAllocation object. /// @warning it is the responsability of the caller to call objects /// constructors. AllocatedType *allocate() { if (freeHead_) // returns node from free list. { AllocatedType *object = freeHead_; freeHead_ = *(AllocatedType **)object; return object; } if (currentBatch_->used_ == currentBatch_->end_) { currentBatch_ = currentBatch_->next_; while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_) currentBatch_ = currentBatch_->next_; if (!currentBatch_) // no free batch found, allocate a new one { currentBatch_ = allocateBatch(objectsPerPage_); currentBatch_->next_ = batches_; // insert at the head of the list batches_ = currentBatch_; } } AllocatedType *allocated = currentBatch_->used_; currentBatch_->used_ += objectPerAllocation; return allocated; } /// Release the object. /// @warning it is the responsability of the caller to actually destruct the /// object. void release(AllocatedType *object) { assert(object != 0); *(AllocatedType **)object = freeHead_; freeHead_ = object; } private: struct BatchInfo { BatchInfo *next_; AllocatedType *used_; AllocatedType *end_; AllocatedType buffer_[objectPerAllocation]; }; // disabled copy constructor and assignement operator. BatchAllocator(const BatchAllocator &); void operator=(const BatchAllocator &); static BatchInfo *allocateBatch(unsigned int objectsPerPage) { const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; BatchInfo *batch = static_cast(malloc(mallocSize)); batch->next_ = 0; batch->used_ = batch->buffer_; batch->end_ = batch->buffer_ + objectsPerPage; return batch; } BatchInfo *batches_; BatchInfo *currentBatch_; /// Head of a single linked list within the allocated space of freeed object AllocatedType *freeHead_; unsigned int objectsPerPage_; }; } // namespace Json #endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION #endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED // vim: et ts=2 sts=2 sw=2 tw=0 ================================================ FILE: Libraries/Core/Android/Headers/json/json_internalarray.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueArrayAllocator::~ValueArrayAllocator() { } // ////////////////////////////////////////////////////////////////// // class DefaultValueArrayAllocator // ////////////////////////////////////////////////////////////////// #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destructArray( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; #else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray(); // placement new return array; } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray( other ); // placement new return array; } virtual void destructArray( ValueInternalArray *array ) { if ( array ) { array->~ValueInternalArray(); arraysAllocator_.release( array ); } } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( pagesAllocator_.allocate() ); } virtual void releaseArrayPage( Value *value ) { if ( value ) pagesAllocator_.release( value ); } private: BatchAllocator arraysAllocator_; BatchAllocator pagesAllocator_; }; #endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR static ValueArrayAllocator *&arrayAllocator() { static DefaultValueArrayAllocator defaultAllocator; static ValueArrayAllocator *arrayAllocator = &defaultAllocator; return arrayAllocator; } static struct DummyArrayAllocatorInitializer { DummyArrayAllocatorInitializer() { arrayAllocator(); // ensure arrayAllocator() statics are initialized before main(). } } dummyArrayAllocatorInitializer; // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// bool ValueInternalArray::equals( const IteratorState &x, const IteratorState &other ) { return x.array_ == other.array_ && x.currentItemIndex_ == other.currentItemIndex_ && x.currentPageIndex_ == other.currentPageIndex_; } void ValueInternalArray::increment( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ != it.array_->size_, "ValueInternalArray::increment(): moving iterator beyond end" ); ++(it.currentItemIndex_); if ( it.currentItemIndex_ == itemsPerPage ) { it.currentItemIndex_ = 0; ++(it.currentPageIndex_); } } void ValueInternalArray::decrement( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && it.currentPageIndex_ == it.array_->pages_ && it.currentItemIndex_ == 0, "ValueInternalArray::decrement(): moving iterator beyond end" ); if ( it.currentItemIndex_ == 0 ) { it.currentItemIndex_ = itemsPerPage-1; --(it.currentPageIndex_); } else { --(it.currentItemIndex_); } } Value & ValueInternalArray::unsafeDereference( const IteratorState &it ) { return (*(it.currentPageIndex_))[it.currentItemIndex_]; } Value & ValueInternalArray::dereference( const IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ < it.array_->size_, "ValueInternalArray::dereference(): dereferencing invalid iterator" ); return unsafeDereference( it ); } void ValueInternalArray::makeBeginIterator( IteratorState &it ) const { it.array_ = const_cast( this ); it.currentItemIndex_ = 0; it.currentPageIndex_ = pages_; } void ValueInternalArray::makeIterator( IteratorState &it, ArrayIndex index ) const { it.array_ = const_cast( this ); it.currentItemIndex_ = index % itemsPerPage; it.currentPageIndex_ = pages_ + index / itemsPerPage; } void ValueInternalArray::makeEndIterator( IteratorState &it ) const { makeIterator( it, size_ ); } ValueInternalArray::ValueInternalArray() : pages_( 0 ) , size_( 0 ) , pageCount_( 0 ) { } ValueInternalArray::ValueInternalArray( const ValueInternalArray &other ) : pages_( 0 ) , size_( other.size_ ) , pageCount_( 0 ) { PageIndex minNewPages = other.size_ / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); IteratorState itOther; other.makeBeginIterator( itOther ); Value *value; for ( ArrayIndex index = 0; index < size_; ++index, increment(itOther) ) { if ( index % itemsPerPage == 0 ) { PageIndex pageIndex = index / itemsPerPage; value = arrayAllocator()->allocateArrayPage(); pages_[pageIndex] = value; } new (value) Value( dereference( itOther ) ); } } ValueInternalArray & ValueInternalArray::operator=(ValueInternalArray other) { swap(other); return *this; } ValueInternalArray::~ValueInternalArray() { // destroy all constructed items IteratorState it; IteratorState itEnd; makeBeginIterator( it); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } // release all pages PageIndex lastPageIndex = size_ / itemsPerPage; for ( PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); // release pages index arrayAllocator()->releaseArrayPageIndex( pages_, pageCount_ ); } void ValueInternalArray::swap( ValueInternalArray &other ) { Value **tempPages = pages_; pages_ = other.pages_; other.pages_ = tempPages; ArrayIndex tempSize = size_; size_ = other.size_; other.size_ = tempSize; PageIndex tempPageCount = pageCount_; pageCount_ = other.pageCount_; other.pageCount_ = tempPageCount; } void ValueInternalArray::clear() { ValueInternalArray dummy; swap( dummy ); } void ValueInternalArray::resize( ArrayIndex newSize ) { if ( newSize == 0 ) clear(); else if ( newSize < size_ ) { IteratorState it; IteratorState itEnd; makeIterator( it, newSize ); makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage; PageIndex lastPageIndex = size_ / itemsPerPage; for ( ; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); size_ = newSize; } else if ( newSize > size_ ) resolveReference( newSize ); } void ValueInternalArray::makeIndexValid( ArrayIndex index ) { // Need to enlarge page index ? if ( index >= pageCount_ * itemsPerPage ) { PageIndex minNewPages = (index + 1) / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); } // Need to allocate new pages ? ArrayIndex nextPageIndex = (size_ % itemsPerPage) != 0 ? size_ - (size_%itemsPerPage) + itemsPerPage : size_; if ( nextPageIndex <= index ) { PageIndex pageIndex = nextPageIndex / itemsPerPage; PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1; for ( ; pageToAllocate-- > 0; ++pageIndex ) pages_[pageIndex] = arrayAllocator()->allocateArrayPage(); } // Initialize all new entries IteratorState it; IteratorState itEnd; makeIterator( it, size_ ); size_ = index + 1; makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); new (value) Value(); // Construct a default value using placement new } } Value & ValueInternalArray::resolveReference( ArrayIndex index ) { if ( index >= size_ ) makeIndexValid( index ); return pages_[index/itemsPerPage][index%itemsPerPage]; } Value * ValueInternalArray::find( ArrayIndex index ) const { if ( index >= size_ ) return 0; return &(pages_[index/itemsPerPage][index%itemsPerPage]); } ValueInternalArray::ArrayIndex ValueInternalArray::size() const { return size_; } int ValueInternalArray::distance( const IteratorState &x, const IteratorState &y ) { return indexOf(y) - indexOf(x); } ValueInternalArray::ArrayIndex ValueInternalArray::indexOf( const IteratorState &iterator ) { if ( !iterator.array_ ) return ArrayIndex(-1); return ArrayIndex( (iterator.currentPageIndex_ - iterator.array_->pages_) * itemsPerPage + iterator.currentItemIndex_ ); } int ValueInternalArray::compare( const ValueInternalArray &other ) const { int sizeDiff( size_ - other.size_ ); if ( sizeDiff != 0 ) return sizeDiff; for ( ArrayIndex index =0; index < size_; ++index ) { int diff = pages_[index/itemsPerPage][index%itemsPerPage].compare( other.pages_[index/itemsPerPage][index%itemsPerPage] ); if ( diff != 0 ) return diff; } return 0; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/Android/Headers/json/json_internalmap.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalMap // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// /** \internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) ); * This optimization is used by the fast allocator. */ ValueInternalLink::ValueInternalLink() : previous_( 0 ) , next_( 0 ) { } ValueInternalLink::~ValueInternalLink() { for ( int index =0; index < itemPerLink; ++index ) { if ( !items_[index].isItemAvailable() ) { if ( !items_[index].isMemberNameStatic() ) free( keys_[index] ); } else break; } } ValueMapAllocator::~ValueMapAllocator() { } #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; #else /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap(); // placement new return map; } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap( other ); // placement new return map; } virtual void destructMap( ValueInternalMap *map ) { if ( map ) { map->~ValueInternalMap(); mapsAllocator_.release( map ); } } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { ValueInternalLink *link = linksAllocator_.allocate(); memset( link, 0, sizeof(ValueInternalLink) ); return link; } virtual void releaseMapLink( ValueInternalLink *link ) { link->~ValueInternalLink(); linksAllocator_.release( link ); } private: BatchAllocator mapsAllocator_; BatchAllocator linksAllocator_; }; #endif static ValueMapAllocator *&mapAllocator() { static DefaultValueMapAllocator defaultAllocator; static ValueMapAllocator *mapAllocator = &defaultAllocator; return mapAllocator; } static struct DummyMapAllocatorInitializer { DummyMapAllocatorInitializer() { mapAllocator(); // ensure mapAllocator() statics are initialized before main(). } } dummyMapAllocatorInitializer; // h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32. /* use linked list hash map. buckets array is a container. linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124) value have extra state: valid, available, deleted */ ValueInternalMap::ValueInternalMap() : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { } ValueInternalMap::ValueInternalMap( const ValueInternalMap &other ) : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { reserve( other.itemCount_ ); IteratorState it; IteratorState itEnd; other.makeBeginIterator( it ); other.makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { bool isStatic; const char *memberName = key( it, isStatic ); const Value &aValue = value( it ); resolveReference(memberName, isStatic) = aValue; } } ValueInternalMap & ValueInternalMap::operator=(ValueInternalMap other) { swap(other); return *this; } ValueInternalMap::~ValueInternalMap() { if ( buckets_ ) { for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex ) { ValueInternalLink *link = buckets_[bucketIndex].next_; while ( link ) { ValueInternalLink *linkToRelease = link; link = link->next_; mapAllocator()->releaseMapLink( linkToRelease ); } } mapAllocator()->releaseMapBuckets( buckets_ ); } } void ValueInternalMap::swap( ValueInternalMap &other ) { ValueInternalLink *tempBuckets = buckets_; buckets_ = other.buckets_; other.buckets_ = tempBuckets; ValueInternalLink *tempTailLink = tailLink_; tailLink_ = other.tailLink_; other.tailLink_ = tempTailLink; BucketIndex tempBucketsSize = bucketsSize_; bucketsSize_ = other.bucketsSize_; other.bucketsSize_ = tempBucketsSize; BucketIndex tempItemCount = itemCount_; itemCount_ = other.itemCount_; other.itemCount_ = tempItemCount; } void ValueInternalMap::clear() { ValueInternalMap dummy; swap( dummy ); } ValueInternalMap::BucketIndex ValueInternalMap::size() const { return itemCount_; } bool ValueInternalMap::reserveDelta( BucketIndex growth ) { return reserve( itemCount_ + growth ); } bool ValueInternalMap::reserve( BucketIndex newItemCount ) { if ( !buckets_ && newItemCount > 0 ) { buckets_ = mapAllocator()->allocateMapBuckets( 1 ); bucketsSize_ = 1; tailLink_ = &buckets_[0]; } // BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink; return true; } const Value * ValueInternalMap::find( const char *key ) const { if ( !bucketsSize_ ) return 0; HashKey hashedKey = hash( key ); BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( const ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; current = current->next_ ) { for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return 0; if ( strcmp( key, current->keys_[index] ) == 0 ) return ¤t->items_[index]; } } return 0; } Value * ValueInternalMap::find( const char *key ) { const ValueInternalMap *constThis = this; return const_cast( constThis->find( key ) ); } Value & ValueInternalMap::resolveReference( const char *key, bool isStatic ) { HashKey hashedKey = hash( key ); if ( bucketsSize_ ) { BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink **previous = 0; BucketIndex index; for ( ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; previous = ¤t->next_, current = current->next_ ) { for ( index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return setNewItem( key, isStatic, current, index ); if ( strcmp( key, current->keys_[index] ) == 0 ) return current->items_[index]; } } } reserveDelta( 1 ); return unsafeAdd( key, isStatic, hashedKey ); } void ValueInternalMap::remove( const char *key ) { HashKey hashedKey = hash( key ); if ( !bucketsSize_ ) return; BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( ValueInternalLink *link = &buckets_[bucketIndex]; link != 0; link = link->next_ ) { BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) return; if ( strcmp( key, link->keys_[index] ) == 0 ) { doActualRemove( link, index, bucketIndex ); return; } } } } void ValueInternalMap::doActualRemove( ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex ) { // find last item of the bucket and swap it with the 'removed' one. // set removed items flags to 'available'. // if last page only contains 'available' items, then desallocate it (it's empty) ValueInternalLink *&lastLink = getLastLinkInBucket( index ); BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1 for ( ; lastItemIndex < ValueInternalLink::itemPerLink; ++lastItemIndex ) // may be optimized with dicotomic search { if ( lastLink->items_[lastItemIndex].isItemAvailable() ) break; } BucketIndex lastUsedIndex = lastItemIndex - 1; Value *valueToDelete = &link->items_[index]; Value *valueToPreserve = &lastLink->items_[lastUsedIndex]; if ( valueToDelete != valueToPreserve ) valueToDelete->swap( *valueToPreserve ); if ( lastUsedIndex == 0 ) // page is now empty { // remove it from bucket linked list and delete it. ValueInternalLink *linkPreviousToLast = lastLink->previous_; if ( linkPreviousToLast != 0 ) // can not deleted bucket link. { mapAllocator()->releaseMapLink( lastLink ); linkPreviousToLast->next_ = 0; lastLink = linkPreviousToLast; } } else { Value dummy; valueToPreserve->swap( dummy ); // restore deleted to default Value. valueToPreserve->setItemUsed( false ); } --itemCount_; } ValueInternalLink *& ValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex ) { if ( bucketIndex == bucketsSize_ - 1 ) return tailLink_; ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_; if ( !previous ) previous = &buckets_[bucketIndex]; return previous; } Value & ValueInternalMap::setNewItem( const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index ) { char *duplicatedKey = makeMemberName( key ); ++itemCount_; link->keys_[index] = duplicatedKey; link->items_[index].setItemUsed(); link->items_[index].setMemberNameIsStatic( isStatic ); return link->items_[index]; // items already default constructed. } Value & ValueInternalMap::unsafeAdd( const char *key, bool isStatic, HashKey hashedKey ) { JSON_ASSERT_MESSAGE( bucketsSize_ > 0, "ValueInternalMap::unsafeAdd(): internal logic error." ); BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex ); ValueInternalLink *link = previousLink; BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) break; } if ( index == ValueInternalLink::itemPerLink ) // need to add a new page { ValueInternalLink *newLink = mapAllocator()->allocateMapLink(); index = 0; link->next_ = newLink; previousLink = newLink; link = newLink; } return setNewItem( key, isStatic, link, index ); } ValueInternalMap::HashKey ValueInternalMap::hash( const char *key ) const { HashKey hash = 0; while ( *key ) hash += *key++ * 37; return hash; } int ValueInternalMap::compare( const ValueInternalMap &other ) const { int sizeDiff( itemCount_ - other.itemCount_ ); if ( sizeDiff != 0 ) return sizeDiff; // Strict order guaranty is required. Compare all keys FIRST, then compare values. IteratorState it; IteratorState itEnd; makeBeginIterator( it ); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { if ( !other.find( key( it ) ) ) return 1; } // All keys are equals, let's compare values makeBeginIterator( it ); for ( ; !equals(it,itEnd); increment(it) ) { const Value *otherValue = other.find( key( it ) ); int valueDiff = value(it).compare( *otherValue ); if ( valueDiff != 0 ) return valueDiff; } return 0; } void ValueInternalMap::makeBeginIterator( IteratorState &it ) const { it.map_ = const_cast( this ); it.bucketIndex_ = 0; it.itemIndex_ = 0; it.link_ = buckets_; } void ValueInternalMap::makeEndIterator( IteratorState &it ) const { it.map_ = const_cast( this ); it.bucketIndex_ = bucketsSize_; it.itemIndex_ = 0; it.link_ = 0; } bool ValueInternalMap::equals( const IteratorState &x, const IteratorState &other ) { return x.map_ == other.map_ && x.bucketIndex_ == other.bucketIndex_ && x.link_ == other.link_ && x.itemIndex_ == other.itemIndex_; } void ValueInternalMap::incrementBucket( IteratorState &iterator ) { ++iterator.bucketIndex_; JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_, "ValueInternalMap::increment(): attempting to iterate beyond end." ); if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ ) iterator.link_ = 0; else iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]); iterator.itemIndex_ = 0; } void ValueInternalMap::increment( IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterator using invalid iterator." ); ++iterator.itemIndex_; if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink ) { JSON_ASSERT_MESSAGE( iterator.link_ != 0, "ValueInternalMap::increment(): attempting to iterate beyond end." ); iterator.link_ = iterator.link_->next_; if ( iterator.link_ == 0 ) incrementBucket( iterator ); } else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() ) { incrementBucket( iterator ); } } void ValueInternalMap::decrement( IteratorState &iterator ) { if ( iterator.itemIndex_ == 0 ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterate using invalid iterator." ); if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] ) { JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, "Attempting to iterate beyond beginning." ); --(iterator.bucketIndex_); } iterator.link_ = iterator.link_->previous_; iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1; } } const char * ValueInternalMap::key( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->keys_[iterator.itemIndex_]; } const char * ValueInternalMap::key( const IteratorState &iterator, bool &isStatic ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic(); return iterator.link_->keys_[iterator.itemIndex_]; } Value & ValueInternalMap::value( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->items_[iterator.itemIndex_]; } int ValueInternalMap::distance( const IteratorState &x, const IteratorState &y ) { int offset = 0; IteratorState it = x; while ( !equals( it, y ) ) increment( it ); return offset; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/Android/Headers/json/json_tool.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED /* This header provides common string manipulation support, such as UTF-8, * portable conversion from/to string... * * It is an internal header that must not be exposed. */ namespace Json { /// Converts a unicode code-point to UTF-8. static inline std::string codePointToUTF8(unsigned int cp) { std::string result; // based on description from http://en.wikipedia.org/wiki/UTF-8 if (cp <= 0x7f) { result.resize(1); result[0] = static_cast(cp); } else if (cp <= 0x7FF) { result.resize(2); result[1] = static_cast(0x80 | (0x3f & cp)); result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); } else if (cp <= 0xFFFF) { result.resize(3); result[2] = static_cast(0x80 | (0x3f & cp)); result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); } else if (cp <= 0x10FFFF) { result.resize(4); result[3] = static_cast(0x80 | (0x3f & cp)); result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); } return result; } /// Returns true if ch is a control character (in range [0,32[). static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } enum { /// Constant that specify the size of the buffer that must be passed to /// uintToString. uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 }; // Defines a char buffer for use with uintToString(). typedef char UIntToStringBuffer[uintToStringBufferSize]; /** Converts an unsigned integer to string. * @param value Unsigned interger to convert to string * @param current Input/Output string buffer. * Must have at least uintToStringBufferSize chars free. */ static inline void uintToString(LargestUInt value, char *¤t) { *--current = 0; do { *--current = char(value % 10) + '0'; value /= 10; } while (value != 0); } /** Change ',' to '.' everywhere in buffer. * * We had a sophisticated way, but it did not work in WinCE. * @see https://github.com/open-source-parsers/jsoncpp/pull/9 */ static inline void fixNumericLocale(char* begin, char* end) { while (begin < end) { if (*begin == ',') { *begin = '.'; } ++begin; } } } // namespace Json { #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED // vim: et ts=2 sts=2 sw=2 tw=0 ================================================ FILE: Libraries/Core/Android/Headers/json/json_valueiterator.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIteratorBase // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIteratorBase::ValueIteratorBase() #ifndef JSON_VALUE_USE_INTERNAL_MAP : current_() , isNull_( true ) { } #else : isArray_( true ) , isNull_( true ) { iterator_.array_ = ValueInternalArray::IteratorState(); } #endif #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator ¤t ) : current_( current ) , isNull_( false ) { } #else ValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state ) : isArray_( true ) { iterator_.array_ = state; } ValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state ) : isArray_( false ) { iterator_.map_ = state; } #endif Value & ValueIteratorBase::deref() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP return current_->second; #else if ( isArray_ ) return ValueInternalArray::dereference( iterator_.array_ ); return ValueInternalMap::value( iterator_.map_ ); #endif } void ValueIteratorBase::increment() { #ifndef JSON_VALUE_USE_INTERNAL_MAP ++current_; #else if ( isArray_ ) ValueInternalArray::increment( iterator_.array_ ); ValueInternalMap::increment( iterator_.map_ ); #endif } void ValueIteratorBase::decrement() { #ifndef JSON_VALUE_USE_INTERNAL_MAP --current_; #else if ( isArray_ ) ValueInternalArray::decrement( iterator_.array_ ); ValueInternalMap::decrement( iterator_.map_ ); #endif } ValueIteratorBase::difference_type ValueIteratorBase::computeDistance( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP # ifdef JSON_USE_CPPTL_SMALLMAP return current_ - other.current_; # else // Iterator for null value are initialized using the default // constructor, which initialize current_ to the default // std::map::iterator. As begin() and end() are two instance // of the default std::map::iterator, they can not be compared. // To allow this, we handle this comparison specifically. if ( isNull_ && other.isNull_ ) { return 0; } // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL, // which is the one used by default). // Using a portable hand-made version for non random iterator instead: // return difference_type( std::distance( current_, other.current_ ) ); difference_type myDistance = 0; for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it ) { ++myDistance; } return myDistance; # endif #else if ( isArray_ ) return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ ); #endif } bool ValueIteratorBase::isEqual( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP if ( isNull_ ) { return other.isNull_; } return current_ == other.current_; #else if ( isArray_ ) return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ ); #endif } void ValueIteratorBase::copy( const SelfType &other ) { #ifndef JSON_VALUE_USE_INTERNAL_MAP current_ = other.current_; isNull_ = other.isNull_; #else if ( isArray_ ) iterator_.array_ = other.iterator_.array_; iterator_.map_ = other.iterator_.map_; #endif } Value ValueIteratorBase::key() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( czstring.c_str() ) { if ( czstring.isStaticString() ) return Value( StaticString( czstring.c_str() ) ); return Value( czstring.c_str() ); } return Value( czstring.index() ); #else if ( isArray_ ) return Value( ValueInternalArray::indexOf( iterator_.array_ ) ); bool isStatic; const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic ); if ( isStatic ) return Value( StaticString( memberName ) ); return Value( memberName ); #endif } UInt ValueIteratorBase::index() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( !czstring.c_str() ) return czstring.index(); return Value::UInt( -1 ); #else if ( isArray_ ) return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) ); return Value::UInt( -1 ); #endif } const char * ValueIteratorBase::memberName() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const char *name = (*current_).first.c_str(); return name ? name : ""; #else if ( !isArray_ ) return ValueInternalMap::key( iterator_.map_ ); return ""; #endif } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueConstIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueConstIterator::ValueConstIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueConstIterator & ValueConstIterator::operator =( const ValueIteratorBase &other ) { copy( other ); return *this; } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIterator::ValueIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIterator::ValueIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueIterator::ValueIterator( const ValueConstIterator &other ) : ValueIteratorBase( other ) { } ValueIterator::ValueIterator( const ValueIterator &other ) : ValueIteratorBase( other ) { } ValueIterator & ValueIterator::operator =( const SelfType &other ) { copy( other ); return *this; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/Android/Headers/json/reader.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_READER_H_INCLUDED #define CPPTL_JSON_READER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "features.h" #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include #include #include // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) namespace Json { /** \brief Unserialize a JSON document into a *Value. * */ class JSON_API Reader { public: typedef char Char; typedef const Char *Location; /** \brief An error tagged with where in the JSON text it was encountered. * * The offsets give the [start, limit) range of bytes within the text. Note * that this is bytes, not codepoints. * */ struct StructuredError { size_t offset_start; size_t offset_limit; std::string message; }; /** \brief Constructs a Reader allowing all features * for parsing. */ Reader(); /** \brief Constructs a Reader allowing the specified feature set * for parsing. */ Reader(const Features &features); /** \brief Read a Value from a JSON * document. * \param document UTF-8 encoded string containing the document to read. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them * back during * serialization, \c false to discard comments. * This parameter is ignored if * Features::allowComments_ * is \c false. * \return \c true if the document was successfully parsed, \c false if an * error occurred. */ bool parse(const std::string &document, Value &root, bool collectComments = true); /** \brief Read a Value from a JSON document. * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the document to read. * \param endDoc Pointer on the end of the UTF-8 encoded string of the document to read. \ Must be >= beginDoc. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them back during * serialization, \c false to discard comments. * This parameter is ignored if Features::allowComments_ * is \c false. * \return \c true if the document was successfully parsed, \c false if an error occurred. */ bool parse(const char *beginDoc, const char *endDoc, Value &root, bool collectComments = true); /// \brief Parse from input stream. /// \see Json::operator>>(std::istream&, Json::Value&). bool parse(std::istream &is, Value &root, bool collectComments = true); /** \brief Returns a user friendly string that list errors in the parsed * document. * \return Formatted error message with the list of errors with their location * in * the parsed document. An empty string is returned if no error * occurred * during parsing. * \deprecated Use getFormattedErrorMessages() instead (typo fix). */ JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead") std::string getFormatedErrorMessages() const; /** \brief Returns a user friendly string that list errors in the parsed * document. * \return Formatted error message with the list of errors with their location * in * the parsed document. An empty string is returned if no error * occurred * during parsing. */ std::string getFormattedErrorMessages() const; /** \brief Returns a vector of structured erros encounted while parsing. * \return A (possibly empty) vector of StructuredError objects. Currently * only one error can be returned, but the caller should tolerate * multiple * errors. This can occur if the parser recovers from a non-fatal * parse error and then encounters additional errors. */ std::vector getStructuredErrors() const; private: enum TokenType { tokenEndOfStream = 0, tokenObjectBegin, tokenObjectEnd, tokenArrayBegin, tokenArrayEnd, tokenString, tokenNumber, tokenTrue, tokenFalse, tokenNull, tokenArraySeparator, tokenMemberSeparator, tokenComment, tokenError }; class Token { public: TokenType type_; Location start_; Location end_; }; class ErrorInfo { public: Token token_; std::string message_; Location extra_; }; typedef std::deque Errors; bool expectToken(TokenType type, Token &token, const char *message); bool readToken(Token &token); void skipSpaces(); bool match(Location pattern, int patternLength); bool readComment(); bool readCStyleComment(); bool readCppStyleComment(); bool readString(); void readNumber(); bool readValue(); bool readObject(Token &token); bool readArray(Token &token); bool decodeNumber(Token &token); bool decodeNumber(Token &token, Value &decoded); bool decodeString(Token &token); bool decodeString(Token &token, std::string &decoded); bool decodeDouble(Token &token); bool decodeDouble(Token &token, Value &decoded); bool decodeUnicodeCodePoint(Token &token, Location ¤t, Location end, unsigned int &unicode); bool decodeUnicodeEscapeSequence(Token &token, Location ¤t, Location end, unsigned int &unicode); bool addError(const std::string &message, Token &token, Location extra = 0); bool recoverFromError(TokenType skipUntilToken); bool addErrorAndRecover(const std::string &message, Token &token, TokenType skipUntilToken); void skipUntilSpace(); Value ¤tValue(); Char getNextChar(); void getLocationLineAndColumn(Location location, int &line, int &column) const; std::string getLocationLineAndColumn(Location location) const; void addComment(Location begin, Location end, CommentPlacement placement); void skipCommentTokens(Token &token); typedef std::stack Nodes; Nodes nodes_; Errors errors_; std::string document_; Location begin_; Location end_; Location current_; Location lastValueEnd_; Value *lastValue_; std::string commentsBefore_; Features features_; bool collectComments_; }; /** \brief Read from 'sin' into 'root'. Always keep comments from the input JSON. This can be used to read a file into a particular sub-object. For example: \code Json::Value root; cin >> root["dir"]["file"]; cout << root; \endcode Result: \verbatim { "dir": { "file": { // The input stream JSON would be nested here. } } } \endverbatim \throw std::exception on parse error. \see Json::operator<<() */ JSON_API std::istream &operator>>(std::istream &, Value &); } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // CPPTL_JSON_READER_H_INCLUDED ================================================ FILE: Libraries/Core/Android/Headers/json/value.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_H_INCLUDED #define CPPTL_JSON_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include #ifndef JSON_USE_CPPTL_SMALLMAP #include #else #include #endif #ifdef JSON_USE_CPPTL #include #endif // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) /** \brief JSON (JavaScript Object Notation). */ namespace Json { /** \brief Type of the value held by a Value object. */ enum ValueType { nullValue = 0, ///< 'null' value intValue, ///< signed integer value uintValue, ///< unsigned integer value realValue, ///< double value stringValue, ///< UTF-8 string value booleanValue, ///< bool value arrayValue, ///< array value (ordered list) objectValue ///< object value (collection of name/value pairs). }; enum CommentPlacement { commentBefore = 0, ///< a comment placed on the line before a value commentAfterOnSameLine, ///< a comment just after a value on the same line commentAfter, ///< a comment on the line after a value (only make sense for /// root value) numberOfCommentPlacement }; //# ifdef JSON_USE_CPPTL // typedef CppTL::AnyEnumerator EnumMemberNames; // typedef CppTL::AnyEnumerator EnumValues; //# endif /** \brief Lightweight wrapper to tag static string. * * Value constructor and objectValue member assignement takes advantage of the * StaticString and avoid the cost of string duplication when storing the * string or the member name. * * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ class JSON_API StaticString { public: explicit StaticString(const char *czstring) : str_(czstring) {} operator const char *() const { return str_; } const char *c_str() const { return str_; } private: const char *str_; }; /** \brief Represents a JSON value. * * This class is a discriminated union wrapper that can represents a: * - signed integer [range: Value::minInt - Value::maxInt] * - unsigned integer (range: 0 - Value::maxUInt) * - double * - UTF-8 string * - boolean * - 'null' * - an ordered list of Value * - collection of name/value pairs (javascript object) * * The type of the held value is represented by a #ValueType and * can be obtained using type(). * * values of an #objectValue or #arrayValue can be accessed using operator[]() *methods. * Non const methods will automatically create the a #nullValue element * if it does not exist. * The sequence of an #arrayValue will be automatically resize and initialized * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. * * The get() methods can be used to obtanis default value in the case the *required element * does not exist. * * It is possible to iterate over the list of a #objectValue values using * the getMemberNames() method. */ class JSON_API Value { friend class ValueIteratorBase; #ifdef JSON_VALUE_USE_INTERNAL_MAP friend class ValueInternalLink; friend class ValueInternalMap; #endif public: typedef std::vector Members; typedef ValueIterator iterator; typedef ValueConstIterator const_iterator; typedef Json::UInt UInt; typedef Json::Int Int; #if defined(JSON_HAS_INT64) typedef Json::UInt64 UInt64; typedef Json::Int64 Int64; #endif // defined(JSON_HAS_INT64) typedef Json::LargestInt LargestInt; typedef Json::LargestUInt LargestUInt; typedef Json::ArrayIndex ArrayIndex; static const Value& null; /// Minimum signed integer value that can be stored in a Json::Value. static const LargestInt minLargestInt; /// Maximum signed integer value that can be stored in a Json::Value. static const LargestInt maxLargestInt; /// Maximum unsigned integer value that can be stored in a Json::Value. static const LargestUInt maxLargestUInt; /// Minimum signed int value that can be stored in a Json::Value. static const Int minInt; /// Maximum signed int value that can be stored in a Json::Value. static const Int maxInt; /// Maximum unsigned int value that can be stored in a Json::Value. static const UInt maxUInt; #if defined(JSON_HAS_INT64) /// Minimum signed 64 bits int value that can be stored in a Json::Value. static const Int64 minInt64; /// Maximum signed 64 bits int value that can be stored in a Json::Value. static const Int64 maxInt64; /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. static const UInt64 maxUInt64; #endif // defined(JSON_HAS_INT64) private: #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION #ifndef JSON_VALUE_USE_INTERNAL_MAP class CZString { public: enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy }; CZString(ArrayIndex index); CZString(const char *cstr, DuplicationPolicy allocate); CZString(const CZString &other); ~CZString(); CZString &operator=(CZString other); bool operator<(const CZString &other) const; bool operator==(const CZString &other) const; ArrayIndex index() const; const char *c_str() const; bool isStaticString() const; private: void swap(CZString &other); const char *cstr_; ArrayIndex index_; }; public: #ifndef JSON_USE_CPPTL_SMALLMAP typedef std::map ObjectValues; #else typedef CppTL::SmallMap ObjectValues; #endif // ifndef JSON_USE_CPPTL_SMALLMAP #endif // ifndef JSON_VALUE_USE_INTERNAL_MAP #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION public: /** \brief Create a default Value of the given type. This is a very useful constructor. To create an empty array, pass arrayValue. To create an empty object, pass objectValue. Another Value can then be set to this one by assignment. This is useful since clear() and resize() will not alter types. Examples: \code Json::Value null_value; // null Json::Value arr_value(Json::arrayValue); // [] Json::Value obj_value(Json::objectValue); // {} \endcode */ Value(ValueType type = nullValue); Value(Int value); Value(UInt value); #if defined(JSON_HAS_INT64) Value(Int64 value); Value(UInt64 value); #endif // if defined(JSON_HAS_INT64) Value(double value); Value(const char *value); Value(const char *beginValue, const char *endValue); /** \brief Constructs a value from a static string. * Like other value string constructor but do not duplicate the string for * internal storage. The given string must remain alive after the call to this * constructor. * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * \endcode */ Value(const StaticString &value); Value(const std::string &value); #ifdef JSON_USE_CPPTL Value(const CppTL::ConstString &value); #endif Value(bool value); Value(const Value &other); ~Value(); Value &operator=(Value other); /// Swap values. /// \note Currently, comments are intentionally not swapped, for /// both logic and efficiency. void swap(Value &other); ValueType type() const; bool operator<(const Value &other) const; bool operator<=(const Value &other) const; bool operator>=(const Value &other) const; bool operator>(const Value &other) const; bool operator==(const Value &other) const; bool operator!=(const Value &other) const; int compare(const Value &other) const; const char *asCString() const; std::string asString() const; #ifdef JSON_USE_CPPTL CppTL::ConstString asConstString() const; #endif Int asInt() const; UInt asUInt() const; #if defined(JSON_HAS_INT64) Int64 asInt64() const; UInt64 asUInt64() const; #endif // if defined(JSON_HAS_INT64) LargestInt asLargestInt() const; LargestUInt asLargestUInt() const; float asFloat() const; double asDouble() const; bool asBool() const; bool isNull() const; bool isBool() const; bool isInt() const; bool isInt64() const; bool isUInt() const; bool isUInt64() const; bool isIntegral() const; bool isDouble() const; bool isNumeric() const; bool isString() const; bool isArray() const; bool isObject() const; bool isConvertibleTo(ValueType other) const; /// Number of values in array or object ArrayIndex size() const; /// \brief Return true if empty array, empty object, or null; /// otherwise, false. bool empty() const; /// Return isNull() bool operator!() const; /// Remove all object members and array elements. /// \pre type() is arrayValue, objectValue, or nullValue /// \post type() is unchanged void clear(); /// Resize the array to size elements. /// New elements are initialized to null. /// May only be called on nullValue or arrayValue. /// \pre type() is arrayValue or nullValue /// \post type() is arrayValue void resize(ArrayIndex size); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are /// inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) Value &operator[](ArrayIndex index); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are /// inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) Value &operator[](int index); /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) const Value &operator[](ArrayIndex index) const; /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) const Value &operator[](int index) const; /// If the array contains at least index+1 elements, returns the element /// value, /// otherwise returns defaultValue. Value get(ArrayIndex index, const Value &defaultValue) const; /// Return true if index < size(). bool isValidIndex(ArrayIndex index) const; /// \brief Append value to array at the end. /// /// Equivalent to jsonvalue[jsonvalue.size()] = value; Value &append(const Value &value); /// Access an object value by name, create a null member if it does not exist. Value &operator[](const char *key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const char *key) const; /// Access an object value by name, create a null member if it does not exist. Value &operator[](const std::string &key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const std::string &key) const; /** \brief Access an object value by name, create a null member if it does not exist. * If the object as no entry for that name, then the member name used to store * the new entry is not duplicated. * Example of use: * \code * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ Value &operator[](const StaticString &key); #ifdef JSON_USE_CPPTL /// Access an object value by name, create a null member if it does not exist. Value &operator[](const CppTL::ConstString &key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const CppTL::ConstString &key) const; #endif /// Return the member named key if it exist, defaultValue otherwise. Value get(const char *key, const Value &defaultValue) const; /// Return the member named key if it exist, defaultValue otherwise. Value get(const std::string &key, const Value &defaultValue) const; #ifdef JSON_USE_CPPTL /// Return the member named key if it exist, defaultValue otherwise. Value get(const CppTL::ConstString &key, const Value &defaultValue) const; #endif /// \brief Remove and return the named member. /// /// Do nothing if it did not exist. /// \return the removed Value, or null. /// \pre type() is objectValue or nullValue /// \post type() is unchanged Value removeMember(const char *key); /// Same as removeMember(const char*) Value removeMember(const std::string &key); /// Return true if the object has a member named key. bool isMember(const char *key) const; /// Return true if the object has a member named key. bool isMember(const std::string &key) const; #ifdef JSON_USE_CPPTL /// Return true if the object has a member named key. bool isMember(const CppTL::ConstString &key) const; #endif /// \brief Return a list of the member names. /// /// If null, return an empty list. /// \pre type() is objectValue or nullValue /// \post if type() was nullValue, it remains nullValue Members getMemberNames() const; //# ifdef JSON_USE_CPPTL // EnumMemberNames enumMemberNames() const; // EnumValues enumValues() const; //# endif /// Comments must be //... or /* ... */ void setComment(const char *comment, CommentPlacement placement); /// Comments must be //... or /* ... */ void setComment(const std::string &comment, CommentPlacement placement); bool hasComment(CommentPlacement placement) const; /// Include delimiters and embedded newlines. std::string getComment(CommentPlacement placement) const; std::string toStyledString() const; const_iterator begin() const; const_iterator end() const; iterator begin(); iterator end(); // Accessors for the [start, limit) range of bytes within the JSON text from // which this value was parsed, if any. void setOffsetStart(size_t start); void setOffsetLimit(size_t limit); size_t getOffsetStart() const; size_t getOffsetLimit() const; private: Value &resolveReference(const char *key, bool isStatic); #ifdef JSON_VALUE_USE_INTERNAL_MAP inline bool isItemAvailable() const { return itemIsUsed_ == 0; } inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; } inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; } inline void setMemberNameIsStatic(bool isStatic) { memberNameIsStatic_ = isStatic ? 1 : 0; } #endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP private: struct CommentInfo { CommentInfo(); ~CommentInfo(); void setComment(const char *text); char *comment_; }; // struct MemberNamesTransform //{ // typedef const char *result_type; // const char *operator()( const CZString &name ) const // { // return name.c_str(); // } //}; union ValueHolder { LargestInt int_; LargestUInt uint_; double real_; bool bool_; char *string_; #ifdef JSON_VALUE_USE_INTERNAL_MAP ValueInternalArray *array_; ValueInternalMap *map_; #else ObjectValues *map_; #endif } value_; ValueType type_ : 8; int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. #ifdef JSON_VALUE_USE_INTERNAL_MAP unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. #endif CommentInfo *comments_; // [start, limit) byte offsets in the source JSON text from which this Value // was extracted. size_t start_; size_t limit_; }; /** \brief Experimental and untested: represents an element of the "path" to * access a node. */ class JSON_API PathArgument { public: friend class Path; PathArgument(); PathArgument(ArrayIndex index); PathArgument(const char *key); PathArgument(const std::string &key); private: enum Kind { kindNone = 0, kindIndex, kindKey }; std::string key_; ArrayIndex index_; Kind kind_; }; /** \brief Experimental and untested: represents a "path" to access a node. * * Syntax: * - "." => root node * - ".[n]" => elements at index 'n' of root node (an array value) * - ".name" => member named 'name' of root node (an object value) * - ".name1.name2.name3" * - ".[0][1][2].name1[3]" * - ".%" => member name is provided as parameter * - ".[%]" => index is provied as parameter */ class JSON_API Path { public: Path(const std::string &path, const PathArgument &a1 = PathArgument(), const PathArgument &a2 = PathArgument(), const PathArgument &a3 = PathArgument(), const PathArgument &a4 = PathArgument(), const PathArgument &a5 = PathArgument()); const Value &resolve(const Value &root) const; Value resolve(const Value &root, const Value &defaultValue) const; /// Creates the "path" to access the specified node and returns a reference on /// the node. Value &make(Value &root) const; private: typedef std::vector InArgs; typedef std::vector Args; void makePath(const std::string &path, const InArgs &in); void addPathInArg(const std::string &path, const InArgs &in, InArgs::const_iterator &itInArg, PathArgument::Kind kind); void invalidPath(const std::string &path, int location); Args args_; }; #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief Allocator to customize Value internal map. * Below is an example of a simple implementation (default implementation actually * use memory pool for speed). * \code class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; * \endcode */ class JSON_API ValueMapAllocator { public: virtual ~ValueMapAllocator(); virtual ValueInternalMap *newMap() = 0; virtual ValueInternalMap *newMapCopy(const ValueInternalMap &other) = 0; virtual void destructMap(ValueInternalMap *map) = 0; virtual ValueInternalLink *allocateMapBuckets(unsigned int size) = 0; virtual void releaseMapBuckets(ValueInternalLink *links) = 0; virtual ValueInternalLink *allocateMapLink() = 0; virtual void releaseMapLink(ValueInternalLink *link) = 0; }; /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). * \internal previous_ & next_ allows for bidirectional traversal. */ class JSON_API ValueInternalLink { public: enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. enum InternalFlags { flagAvailable = 0, flagUsed = 1 }; ValueInternalLink(); ~ValueInternalLink(); Value items_[itemPerLink]; char *keys_[itemPerLink]; ValueInternalLink *previous_; ValueInternalLink *next_; }; /** \brief A linked page based hash-table implementation used internally by *Value. * \internal ValueInternalMap is a tradional bucket based hash-table, with a *linked * list in each bucket to handle collision. There is an addional twist in that * each node of the collision linked list is a page containing a fixed amount of * value. This provides a better compromise between memory usage and speed. * * Each bucket is made up of a chained list of ValueInternalLink. The last * link of a given bucket can be found in the 'previous_' field of the following *bucket. * The last link of the last bucket is stored in tailLink_ as it has no *following bucket. * Only the last link of a bucket may contains 'available' item. The last link *always * contains at least one element unless is it the bucket one very first link. */ class JSON_API ValueInternalMap { friend class ValueIteratorBase; friend class Value; public: typedef unsigned int HashKey; typedef unsigned int BucketIndex; #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState { IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {} ValueInternalMap *map_; ValueInternalLink *link_; BucketIndex itemIndex_; BucketIndex bucketIndex_; }; #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalMap(); ValueInternalMap(const ValueInternalMap &other); ValueInternalMap &operator=(ValueInternalMap other); ~ValueInternalMap(); void swap(ValueInternalMap &other); BucketIndex size() const; void clear(); bool reserveDelta(BucketIndex growth); bool reserve(BucketIndex newItemCount); const Value *find(const char *key) const; Value *find(const char *key); Value &resolveReference(const char *key, bool isStatic); void remove(const char *key); void doActualRemove(ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex); ValueInternalLink *&getLastLinkInBucket(BucketIndex bucketIndex); Value &setNewItem(const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index); Value &unsafeAdd(const char *key, bool isStatic, HashKey hashedKey); HashKey hash(const char *key) const; int compare(const ValueInternalMap &other) const; private: void makeBeginIterator(IteratorState &it) const; void makeEndIterator(IteratorState &it) const; static bool equals(const IteratorState &x, const IteratorState &other); static void increment(IteratorState &iterator); static void incrementBucket(IteratorState &iterator); static void decrement(IteratorState &iterator); static const char *key(const IteratorState &iterator); static const char *key(const IteratorState &iterator, bool &isStatic); static Value &value(const IteratorState &iterator); static int distance(const IteratorState &x, const IteratorState &y); private: ValueInternalLink *buckets_; ValueInternalLink *tailLink_; BucketIndex bucketsSize_; BucketIndex itemCount_; }; /** \brief A simplified deque implementation used internally by Value. * \internal * It is based on a list of fixed "page", each page contains a fixed number of *items. * Instead of using a linked-list, a array of pointer is used for fast item *look-up. * Look-up for an element is as follow: * - compute page index: pageIndex = itemIndex / itemsPerPage * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] * * Insertion is amortized constant time (only the array containing the index of *pointers * need to be reallocated when items are appended). */ class JSON_API ValueInternalArray { friend class Value; friend class ValueIteratorBase; public: enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. typedef Value::ArrayIndex ArrayIndex; typedef unsigned int PageIndex; #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState // Must be a POD { IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {} ValueInternalArray *array_; Value **currentPageIndex_; unsigned int currentItemIndex_; }; #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalArray(); ValueInternalArray(const ValueInternalArray &other); ValueInternalArray &operator=(ValueInternalArray other); ~ValueInternalArray(); void swap(ValueInternalArray &other); void clear(); void resize(ArrayIndex newSize); Value &resolveReference(ArrayIndex index); Value *find(ArrayIndex index) const; ArrayIndex size() const; int compare(const ValueInternalArray &other) const; private: static bool equals(const IteratorState &x, const IteratorState &other); static void increment(IteratorState &iterator); static void decrement(IteratorState &iterator); static Value &dereference(const IteratorState &iterator); static Value &unsafeDereference(const IteratorState &iterator); static int distance(const IteratorState &x, const IteratorState &y); static ArrayIndex indexOf(const IteratorState &iterator); void makeBeginIterator(IteratorState &it) const; void makeEndIterator(IteratorState &it) const; void makeIterator(IteratorState &it, ArrayIndex index) const; void makeIndexValid(ArrayIndex index); Value **pages_; ArrayIndex size_; PageIndex pageCount_; }; /** \brief Experimental: do not use. Allocator to customize Value internal array. * Below is an example of a simple implementation (actual implementation use * memory pool). \code class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destruct( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); if ( !newIndexes ) throw std::bad_alloc(); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; \endcode */ class JSON_API ValueArrayAllocator { public: virtual ~ValueArrayAllocator(); virtual ValueInternalArray *newArray() = 0; virtual ValueInternalArray *newArrayCopy(const ValueInternalArray &other) = 0; virtual void destructArray(ValueInternalArray *array) = 0; /** \brief Reallocate array page index. * Reallocates an array of pointer on each page. * \param indexes [input] pointer on the current index. May be \c NULL. * [output] pointer on the new index of at least * \a minNewIndexCount pages. * \param indexCount [input] current number of pages in the index. * [output] number of page the reallocated index can handle. * \b MUST be >= \a minNewIndexCount. * \param minNewIndexCount Minimum number of page the new index must be able * to * handle. */ virtual void reallocateArrayPageIndex(Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount) = 0; virtual void releaseArrayPageIndex(Value **indexes, ValueInternalArray::PageIndex indexCount) = 0; virtual Value *allocateArrayPage() = 0; virtual void releaseArrayPage(Value *value) = 0; }; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief base class for Value iterators. * */ class JSON_API ValueIteratorBase { public: typedef std::bidirectional_iterator_tag iterator_category; typedef unsigned int size_t; typedef int difference_type; typedef ValueIteratorBase SelfType; ValueIteratorBase(); #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIteratorBase(const Value::ObjectValues::iterator ¤t); #else ValueIteratorBase(const ValueInternalArray::IteratorState &state); ValueIteratorBase(const ValueInternalMap::IteratorState &state); #endif bool operator==(const SelfType &other) const { return isEqual(other); } bool operator!=(const SelfType &other) const { return !isEqual(other); } difference_type operator-(const SelfType &other) const { return computeDistance(other); } /// Return either the index or the member name of the referenced value as a /// Value. Value key() const; /// Return the index of the referenced Value. -1 if it is not an arrayValue. UInt index() const; /// Return the member name of the referenced Value. "" if it is not an /// objectValue. const char *memberName() const; protected: Value &deref() const; void increment(); void decrement(); difference_type computeDistance(const SelfType &other) const; bool isEqual(const SelfType &other) const; void copy(const SelfType &other); private: #ifndef JSON_VALUE_USE_INTERNAL_MAP Value::ObjectValues::iterator current_; // Indicates that iterator is for a null value. bool isNull_; #else union { ValueInternalArray::IteratorState array_; ValueInternalMap::IteratorState map_; } iterator_; bool isArray_; #endif }; /** \brief const iterator for object and array value. * */ class JSON_API ValueConstIterator : public ValueIteratorBase { friend class Value; public: typedef const Value value_type; typedef unsigned int size_t; typedef int difference_type; typedef const Value &reference; typedef const Value *pointer; typedef ValueConstIterator SelfType; ValueConstIterator(); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueConstIterator(const Value::ObjectValues::iterator ¤t); #else ValueConstIterator(const ValueInternalArray::IteratorState &state); ValueConstIterator(const ValueInternalMap::IteratorState &state); #endif public: SelfType &operator=(const ValueIteratorBase &other); SelfType operator++(int) { SelfType temp(*this); ++*this; return temp; } SelfType operator--(int) { SelfType temp(*this); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator*() const { return deref(); } }; /** \brief Iterator for object and array value. */ class JSON_API ValueIterator : public ValueIteratorBase { friend class Value; public: typedef Value value_type; typedef unsigned int size_t; typedef int difference_type; typedef Value &reference; typedef Value *pointer; typedef ValueIterator SelfType; ValueIterator(); ValueIterator(const ValueConstIterator &other); ValueIterator(const ValueIterator &other); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIterator(const Value::ObjectValues::iterator ¤t); #else ValueIterator(const ValueInternalArray::IteratorState &state); ValueIterator(const ValueInternalMap::IteratorState &state); #endif public: SelfType &operator=(const SelfType &other); SelfType operator++(int) { SelfType temp(*this); ++*this; return temp; } SelfType operator--(int) { SelfType temp(*this); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator*() const { return deref(); } }; } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // CPPTL_JSON_H_INCLUDED ================================================ FILE: Libraries/Core/Android/Headers/json/writer.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_WRITER_H_INCLUDED #define JSON_WRITER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) namespace Json { class Value; /** \brief Abstract class for writers. */ class JSON_API Writer { public: virtual ~Writer(); virtual std::string write(const Value &root) = 0; }; /** \brief Outputs a Value in JSON format *without formatting (not human friendly). * * The JSON document is written in a single line. It is not intended for 'human' *consumption, * but may be usefull to support feature such as RPC where bandwith is limited. * \sa Reader, Value */ class JSON_API FastWriter : public Writer { public: FastWriter(); virtual ~FastWriter() {} void enableYAMLCompatibility(); /** \brief Drop the "null" string from the writer's output for nullValues. * Strictly speaking, this is not valid JSON. But when the output is being * fed to a browser's Javascript, it makes for smaller output and the * browser can handle the output just fine. */ void dropNullPlaceholders(); void omitEndingLineFeed(); public: // overridden from Writer virtual std::string write(const Value &root); private: void writeValue(const Value &value); std::string document_; bool yamlCompatiblityEnabled_; bool dropNullPlaceholders_; bool omitEndingLineFeed_; }; /** \brief Writes a Value in JSON format in a *human friendly way. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per *line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value *types, * and all the values fit on one lines, then print the array on a single *line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their *#CommentPlacement. * * \sa Reader, Value, Value::setComment() */ class JSON_API StyledWriter : public Writer { public: StyledWriter(); virtual ~StyledWriter() {} public: // overridden from Writer /** \brief Serialize a Value in JSON format. * \param root Value to serialize. * \return String containing the JSON document that represents the root value. */ virtual std::string write(const Value &root); private: void writeValue(const Value &value); void writeArrayValue(const Value &value); bool isMultineArray(const Value &value); void pushValue(const std::string &value); void writeIndent(); void writeWithIndent(const std::string &value); void indent(); void unindent(); void writeCommentBeforeValue(const Value &root); void writeCommentAfterValueOnSameLine(const Value &root); bool hasCommentForValue(const Value &value); static std::string normalizeEOL(const std::string &text); typedef std::vector ChildValues; ChildValues childValues_; std::string document_; std::string indentString_; int rightMargin_; int indentSize_; bool addChildValues_; }; /** \brief Writes a Value in JSON format in a human friendly way, to a stream rather than to a string. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value types, * and all the values fit on one lines, then print the array on a single line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their #CommentPlacement. * * \param indentation Each level will be indented by this amount extra. * \sa Reader, Value, Value::setComment() */ class JSON_API StyledStreamWriter { public: StyledStreamWriter(std::string indentation = "\t"); ~StyledStreamWriter() {} public: /** \brief Serialize a Value in JSON format. * \param out Stream to write to. (Can be ostringstream, e.g.) * \param root Value to serialize. * \note There is no point in deriving from Writer, since write() should not * return a value. */ void write(std::ostream &out, const Value &root); private: void writeValue(const Value &value); void writeArrayValue(const Value &value); bool isMultineArray(const Value &value); void pushValue(const std::string &value); void writeIndent(); void writeWithIndent(const std::string &value); void indent(); void unindent(); void writeCommentBeforeValue(const Value &root); void writeCommentAfterValueOnSameLine(const Value &root); bool hasCommentForValue(const Value &value); static std::string normalizeEOL(const std::string &text); typedef std::vector ChildValues; ChildValues childValues_; std::ostream *document_; std::string indentString_; int rightMargin_; std::string indentation_; bool addChildValues_; }; #if defined(JSON_HAS_INT64) std::string JSON_API valueToString(Int value); std::string JSON_API valueToString(UInt value); #endif // if defined(JSON_HAS_INT64) std::string JSON_API valueToString(LargestInt value); std::string JSON_API valueToString(LargestUInt value); std::string JSON_API valueToString(double value); std::string JSON_API valueToString(bool value); std::string JSON_API valueToQuotedString(const char *value); /// \brief Output using the StyledStreamWriter. /// \see Json::operator>>() JSON_API std::ostream &operator<<(std::ostream &, const Value &root); } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // JSON_WRITER_H_INCLUDED ================================================ FILE: Libraries/Core/Android/Headers/md5/md5.h ================================================ /* MD5 converted to C++ class by Frank Thilo (thilo@unix-ag.org) for bzflag (http://www.bzflag.org) based on: md5.h and md5.c reference implementation of RFC 1321 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #ifndef BZF_MD5_H #define BZF_MD5_H #include #include // a small class for calculating MD5 hashes of strings or byte arrays // it is not meant to be fast or secure // // usage: 1) feed it blocks of uchars with update() // 2) finalize() // 3) get hexdigest() string // or // MD5(std::string).hexdigest() // // assumes that char is 8 bit and int is 32 bit class MD5 { public: typedef unsigned int size_type; // must be 32bit MD5(); MD5(const std::string& text); void update(const unsigned char *buf, size_type length); void update(const char *buf, size_type length); MD5& finalize(); std::string hexdigest() const; friend std::ostream& operator<<(std::ostream&, MD5 md5); std::string binarydigest() const {return std::string(reinterpret_cast(digest), 16);} //Ian Copland, 09/06/2014: added accessor for the raw digest. private: void init(); typedef unsigned char uint1; // 8bit typedef unsigned int uint4; // 32bit enum {blocksize = 64}; // VC6 won't eat a const static int here void transform(const uint1 block[blocksize]); static void decode(uint4 output[], const uint1 input[], size_type len); static void encode(uint1 output[], const uint4 input[], size_type len); bool finalized; uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk uint4 count[2]; // 64bit counter for number of bits (lo, hi) uint4 state[4]; // digest so far uint1 digest[16]; // the result // low level logic operations static inline uint4 F(uint4 x, uint4 y, uint4 z); static inline uint4 G(uint4 x, uint4 y, uint4 z); static inline uint4 H(uint4 x, uint4 y, uint4 z); static inline uint4 I(uint4 x, uint4 y, uint4 z); static inline uint4 rotate_left(uint4 x, int n); static inline void FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); }; std::string md5(const std::string str); #endif ================================================ FILE: Libraries/Core/Android/Headers/minizip/crypt.h ================================================ /* crypt.h -- base code for crypt/uncrypt ZIPfile Version 1.01e, February 12th, 2005 Copyright (C) 1998-2005 Gilles Vollant This code is a modified version of crypting code in Infozip distribution The encryption/decryption parts of this source code (as opposed to the non-echoing password parts) were originally written in Europe. The whole source package can be freely distributed, including from the USA. (Prior to January 2000, re-export from the US was a violation of US law.) This encryption code is a direct transcription of the algorithm from Roger Schlafly, described by Phil Katz in the file appnote.txt. This file (appnote.txt) is distributed with the PKZIP program (even in the version without encryption capabilities). If you don't need crypting in your application, just define symbols NOCRYPT and NOUNCRYPT. This code support the "Traditional PKWARE Encryption". The new AES encryption added on Zip format by Winzip (see the page http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong Encryption is not supported. */ #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) /*********************************************************************** * Return the next byte in the pseudo-random sequence */ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) { unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); } /*********************************************************************** * Update the encryption keys with the next byte of plain text */ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) { (*(pkeys+0)) = CRC32((*(pkeys+0)), c); (*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; { register int keyshift = (int)((*(pkeys+1)) >> 24); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); } return c; } /*********************************************************************** * Initialize the encryption keys and the random header according to * the given password. */ static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) { *(pkeys+0) = 305419896L; *(pkeys+1) = 591751049L; *(pkeys+2) = 878082192L; while (*passwd != '\0') { update_keys(pkeys,pcrc_32_tab,(int)*passwd); passwd++; } } #define zdecode(pkeys,pcrc_32_tab,c) \ (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) #define zencode(pkeys,pcrc_32_tab,c,t) \ (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED #define RAND_HEAD_LEN 12 /* "last resort" source for second part of crypt seed pattern */ # ifndef ZCR_SEED2 # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ # endif static int crypthead(const char* passwd, /* password string */ unsigned char* buf, /* where to write header */ int bufSize, unsigned long* pkeys, const unsigned long* pcrc_32_tab, unsigned long crcForCrypting) { int n; /* index in random header */ int t; /* temporary */ int c; /* random byte */ unsigned char header[RAND_HEAD_LEN-2]; /* random header */ static unsigned calls = 0; /* ensure different random header each time */ if (bufSize> 7) & 0xff; header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); } /* Encrypt random header (last two bytes is high word of crc) */ init_keys(passwd, pkeys, pcrc_32_tab); for (n = 0; n < RAND_HEAD_LEN-2; n++) { buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); } buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); return n; } #endif ================================================ FILE: Libraries/Core/Android/Headers/minizip/ioapi.h ================================================ /* ioapi.h -- IO base function header for compress/uncompress .zip part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt Changes Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. More if/def section may be needed to support other platforms Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. (but you should use iowin32.c for windows instead) */ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H #if (!defined(_WIN32)) && (!defined(WIN32)) // Linux needs this to support file operation on files larger then 4+GB // But might need better if/def to select just the platforms that needs them. #ifndef __USE_FILE_OFFSET64 #define __USE_FILE_OFFSET64 #endif #ifndef __USE_LARGEFILE64 #define __USE_LARGEFILE64 #endif #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif #ifndef _FILE_OFFSET_BIT #define _FILE_OFFSET_BIT 64 #endif #endif #include #include #include "zlib.h" #if defined(USE_FILE32API) #define fopen64 fopen #define ftello64 ftell #define fseeko64 fseek #else #ifdef _MSC_VER #define fopen64 fopen #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) #define ftello64 _ftelli64 #define fseeko64 _fseeki64 #else // old MSC #define ftello64 ftell #define fseeko64 fseek #endif #endif #endif /* #ifndef ZPOS64_T #ifdef _WIN32 #define ZPOS64_T fpos_t #else #include #define ZPOS64_T uint64_t #endif #endif */ #ifdef HAVE_MINIZIP64_CONF_H #include "mz64conf.h" #endif /* a type choosen by DEFINE */ #ifdef HAVE_64BIT_INT_CUSTOM typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; #else #ifdef HAS_STDINT_H #include "stdint.h" typedef uint64_t ZPOS64_T; #else #if defined(_MSC_VER) || defined(__BORLANDC__) typedef unsigned __int64 ZPOS64_T; #else typedef unsigned long long int ZPOS64_T; #endif #endif #endif #ifdef __cplusplus extern "C" { #endif #define ZLIB_FILEFUNC_SEEK_CUR (1) #define ZLIB_FILEFUNC_SEEK_END (2) #define ZLIB_FILEFUNC_SEEK_SET (0) #define ZLIB_FILEFUNC_MODE_READ (1) #define ZLIB_FILEFUNC_MODE_WRITE (2) #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) #define ZLIB_FILEFUNC_MODE_EXISTING (4) #define ZLIB_FILEFUNC_MODE_CREATE (8) #ifndef ZCALLBACK #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) #define ZCALLBACK CALLBACK #else #define ZCALLBACK #endif #endif typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); /* here is the "old" 32 bits structure structure */ typedef struct zlib_filefunc_def_s { open_file_func zopen_file; read_file_func zread_file; write_file_func zwrite_file; tell_file_func ztell_file; seek_file_func zseek_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; } zlib_filefunc_def; typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); typedef struct zlib_filefunc64_def_s { open64_file_func zopen64_file; read_file_func zread_file; write_file_func zwrite_file; tell64_file_func ztell64_file; seek64_file_func zseek64_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; } zlib_filefunc64_def; void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); /* now internal definition, only for zip.c and unzip.h */ typedef struct zlib_filefunc64_32_def_s { zlib_filefunc64_def zfile_func64; open_file_func zopen32_file; tell_file_func ztell32_file; seek_file_func zseek32_file; } zlib_filefunc64_32_def; #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) //#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) //#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/Android/Headers/minizip/mztools.h ================================================ /* Additional tools for Minizip Code: Xavier Roche '2004 License: Same as ZLIB (www.gzip.org) */ #ifndef _zip_tools_H #define _zip_tools_H #ifdef __cplusplus extern "C" { #endif #ifndef _ZLIB_H #include "zlib.h" #endif #include "unzip.h" /* Repair a ZIP file (missing central directory) file: file to recover fileOut: output file after recovery fileOutTmp: temporary file name used for recovery */ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char* fileOutTmp, uLong* nRecovered, uLong* bytesRecovered); #endif ================================================ FILE: Libraries/Core/Android/Headers/minizip/unzip.h ================================================ /* unzip.h -- IO for uncompress .zip files using zlib Version 1.1, February 14h, 2010 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications of Unzip for Zip64 Copyright (C) 2007-2008 Even Rouault Modifications for Zip64 support on both zip and unzip Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt --------------------------------------------------------------------------------- Condition of use and distribution are the same than zlib : This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- Changes See header of unzip64.c */ #ifndef _unz64_H #define _unz64_H #ifdef __cplusplus extern "C" { #endif #ifndef _ZLIB_H #include "zlib.h" #endif #ifndef _ZLIBIOAPI_H #include "ioapi.h" #endif #ifdef HAVE_BZIP2 #include "bzlib.h" #endif #define Z_BZIP2ED 12 #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ typedef struct TagunzFile__ { int unused; } unzFile__; typedef unzFile__ *unzFile; #else typedef voidp unzFile; #endif #define UNZ_OK (0) #define UNZ_END_OF_LIST_OF_FILE (-100) #define UNZ_ERRNO (Z_ERRNO) #define UNZ_EOF (0) #define UNZ_PARAMERROR (-102) #define UNZ_BADZIPFILE (-103) #define UNZ_INTERNALERROR (-104) #define UNZ_CRCERROR (-105) /* tm_unz contain date/time info */ typedef struct tm_unz_s { uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mon; /* months since January - [0,11] */ uInt tm_year; /* years - [1980..2044] */ } tm_unz; /* unz_global_info structure contain global data about the ZIPfile These data comes from the end of central dir */ typedef struct unz_global_info64_s { ZPOS64_T number_entry; /* total number of entries in the central dir on this disk */ uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info64; typedef struct unz_global_info_s { uLong number_entry; /* total number of entries in the central dir on this disk */ uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info; /* unz_file_info contain information about a file in the zipfile */ typedef struct unz_file_info64_s { uLong version; /* version made by 2 bytes */ uLong version_needed; /* version needed to extract 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */ uLong compression_method; /* compression method 2 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong crc; /* crc-32 4 bytes */ ZPOS64_T compressed_size; /* compressed size 8 bytes */ ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ uLong size_filename; /* filename length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */ uLong disk_num_start; /* disk number start 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info64; typedef struct unz_file_info_s { uLong version; /* version made by 2 bytes */ uLong version_needed; /* version needed to extract 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */ uLong compression_method; /* compression method 2 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong crc; /* crc-32 4 bytes */ uLong compressed_size; /* compressed size 4 bytes */ uLong uncompressed_size; /* uncompressed size 4 bytes */ uLong size_filename; /* filename length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */ uLong disk_num_start; /* disk number start 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info; extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, const char* fileName2, int iCaseSensitivity)); /* Compare two filename (fileName1,fileName2). If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi or strcasecmp) If iCaseSenisivity = 0, case sensitivity is defaut of your operating system (like 1 on Unix, 2 on Windows) */ extern unzFile ZEXPORT unzOpen OF((const char *path)); extern unzFile ZEXPORT unzOpen64 OF((const void *path)); /* Open a Zip file. path contain the full pathname (by example, on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip". If the zipfile cannot be opened (file don't exist or in not valid), the return value is NULL. Else, the return value is a unzFile Handle, usable with other function of this unzip package. the "64" function take a const void* pointer, because the path is just the value passed to the open64_file_func callback. Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* does not describe the reality */ extern unzFile ZEXPORT unzOpen2 OF((const char *path, zlib_filefunc_def* pzlib_filefunc_def)); /* Open a Zip file, like unzOpen, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, zlib_filefunc64_def* pzlib_filefunc_def)); /* Open a Zip file, like unz64Open, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ extern int ZEXPORT unzClose OF((unzFile file)); /* Close a ZipFile opened with unzipOpen. If there is files inside the .Zip opened with unzOpenCurrentFile (see later), these files MUST be closed with unzipCloseCurrentFile before call unzipClose. return UNZ_OK if there is no problem. */ extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, unz_global_info *pglobal_info)); extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, unz_global_info64 *pglobal_info)); /* Write info about the ZipFile in the *pglobal_info structure. No preparation of the structure is needed return UNZ_OK if there is no problem. */ extern int ZEXPORT unzGetGlobalComment OF((unzFile file, char *szComment, uLong uSizeBuf)); /* Get the global comment string of the ZipFile, in the szComment buffer. uSizeBuf is the size of the szComment buffer. return the number of byte copied or an error code <0 */ /***************************************************************************/ /* Unzip package allow you browse the directory of the zipfile */ extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); /* Set the current file of the zipfile to the first file. return UNZ_OK if there is no problem */ extern int ZEXPORT unzGoToNextFile OF((unzFile file)); /* Set the current file of the zipfile to the next file. return UNZ_OK if there is no problem return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. */ extern int ZEXPORT unzLocateFile OF((unzFile file, const char *szFileName, int iCaseSensitivity)); /* Try locate the file szFileName in the zipfile. For the iCaseSensitivity signification, see unzStringFileNameCompare return value : UNZ_OK if the file is found. It becomes the current file. UNZ_END_OF_LIST_OF_FILE if the file is not found */ /* ****************************************** */ /* Ryan supplied functions */ /* unz_file_info contain information about a file in the zipfile */ typedef struct unz_file_pos_s { uLong pos_in_zip_directory; /* offset in zip file directory */ uLong num_of_file; /* # of file */ } unz_file_pos; extern int ZEXPORT unzGetFilePos( unzFile file, unz_file_pos* file_pos); extern int ZEXPORT unzGoToFilePos( unzFile file, unz_file_pos* file_pos); typedef struct unz64_file_pos_s { ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ ZPOS64_T num_of_file; /* # of file */ } unz64_file_pos; extern int ZEXPORT unzGetFilePos64( unzFile file, unz64_file_pos* file_pos); extern int ZEXPORT unzGoToFilePos64( unzFile file, const unz64_file_pos* file_pos); /* ****************************************** */ extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, unz_file_info64 *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)); extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, unz_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)); /* Get Info about the current file if pfile_info!=NULL, the *pfile_info structure will contain somes info about the current file if szFileName!=NULL, the filemane string will be copied in szFileName (fileNameBufferSize is the size of the buffer) if extraField!=NULL, the extra field information will be copied in extraField (extraFieldBufferSize is the size of the buffer). This is the Central-header version of the extra field if szComment!=NULL, the comment string of the file will be copied in szComment (commentBufferSize is the size of the buffer) */ /** Addition for GDAL : START */ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); /** Addition for GDAL : END */ /***************************************************************************/ /* for reading the content of the current zipfile, you can open it, read data from it, and close it (you can close it before reading all the file) */ extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); /* Open for reading data the current file in the zipfile. If there is no error, the return value is UNZ_OK. */ extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, const char* password)); /* Open for reading data the current file in the zipfile. password is a crypting password If there is no error, the return value is UNZ_OK. */ extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, int* method, int* level, int raw)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 *method will receive method of compression, *level will receive level of compression note : you can set level parameter as NULL (if you did not want known level, but you CANNOT set method parameter as NULL */ extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, int* method, int* level, int raw, const char* password)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 *method will receive method of compression, *level will receive level of compression note : you can set level parameter as NULL (if you did not want known level, but you CANNOT set method parameter as NULL */ extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); /* Close the file in zip opened with unzOpenCurrentFile Return UNZ_CRCERROR if all the file was read but the CRC is not good */ extern int ZEXPORT unzReadCurrentFile OF((unzFile file, voidp buf, unsigned len)); /* Read bytes from the current file (opened by unzOpenCurrentFile) buf contain buffer where data must be copied len the size of buf. return the number of byte copied if somes bytes are copied return 0 if the end of file was reached return <0 with error code if there is an error (UNZ_ERRNO for IO error, or zLib error for uncompress error) */ extern z_off_t ZEXPORT unztell OF((unzFile file)); extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); /* Give the current position in uncompressed data */ extern int ZEXPORT unzeof OF((unzFile file)); /* return 1 if the end of file was reached, 0 elsewhere */ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, voidp buf, unsigned len)); /* Read extra field from the current file (opened by unzOpenCurrentFile) This is the local-header version of the extra field (sometimes, there is more info in the local-header version than in the central-header) if buf==NULL, it return the size of the local extra field if buf!=NULL, len is the size of the buffer, the extra header is copied in buf. the return value is the number of bytes copied in buf, or (if <0) the error code */ /***************************************************************************/ /* Get the current file offset */ extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); extern uLong ZEXPORT unzGetOffset (unzFile file); /* Set the current file offset */ extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); #ifdef __cplusplus } #endif #endif /* _unz64_H */ ================================================ FILE: Libraries/Core/Android/Headers/minizip/zip.h ================================================ /* zip.h -- IO on .zip files using zlib Version 1.1, February 14h, 2010 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt --------------------------------------------------------------------------- Condition of use and distribution are the same than zlib : This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------- Changes See header of zip.h */ #ifndef _zip12_H #define _zip12_H #ifdef __cplusplus extern "C" { #endif //#define HAVE_BZIP2 #ifndef _ZLIB_H #include "zlib.h" #endif #ifndef _ZLIBIOAPI_H #include "ioapi.h" #endif #ifdef HAVE_BZIP2 #include "bzlib.h" #endif #define Z_BZIP2ED 12 #if defined(STRICTZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ typedef struct TagzipFile__ { int unused; } zipFile__; typedef zipFile__ *zipFile; #else typedef voidp zipFile; #endif #define ZIP_OK (0) #define ZIP_EOF (0) #define ZIP_ERRNO (Z_ERRNO) #define ZIP_PARAMERROR (-102) #define ZIP_BADZIPFILE (-103) #define ZIP_INTERNALERROR (-104) #ifndef DEF_MEM_LEVEL # if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 # else # define DEF_MEM_LEVEL MAX_MEM_LEVEL # endif #endif /* default memLevel */ /* tm_zip contain date/time info */ typedef struct tm_zip_s { uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mon; /* months since January - [0,11] */ uInt tm_year; /* years - [1980..2044] */ } tm_zip; typedef struct { tm_zip tmz_date; /* date in understandable format */ uLong dosDate; /* if dos_date == 0, tmu_date is used */ /* uLong flag; */ /* general purpose bit flag 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ } zip_fileinfo; typedef const char* zipcharpc; #define APPEND_STATUS_CREATE (0) #define APPEND_STATUS_CREATEAFTER (1) #define APPEND_STATUS_ADDINZIP (2) extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); /* Create a zipfile. pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip". if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip will be created at the end of the file. (useful if the file contain a self extractor code) if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will add files in existing zip (be sure you don't add file that doesn't exist) If the zipfile cannot be opened, the return value is NULL. Else, the return value is a zipFile Handle, usable with other function of this zip package. */ /* Note : there is no delete function into a zipfile. If you want delete file into a zipfile, you must open a zipfile, and create another Of couse, you can use RAW reading and writing to copy the file you did not want delte */ extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc_def)); extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def)); extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level)); extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int zip64)); /* Open a file in the ZIP for writing. filename : the filename in zip (if NULL, '-' without quote will be used *zipfi contain supplemental information if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local contains the extrafield data the the local header if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global contains the extrafield data the the local header if comment != NULL, comment contain the comment string method contain the compression method (0 for store, Z_DEFLATED for deflate) level contain the level of compression (can be Z_DEFAULT_COMPRESSION) zip64 is set to 1 if a zip64 extended information block should be added to the local file header. this MUST be '1' if the uncompressed size is >= 0xffffffff. */ extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw)); extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int zip64)); /* Same than zipOpenNewFileInZip, except if raw=1, we write raw file */ extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting)); extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, int zip64 )); /* Same than zipOpenNewFileInZip2, except windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 password : crypting password (NULL for no crypting) crcForCrypting : crc of file to compress (needed for crypting) */ extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase )); extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64 )); /* Same than zipOpenNewFileInZip4, except versionMadeBy : value for Version made by field flag : value for flag field (compression level info will be added) */ extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, const void* buf, unsigned len)); /* Write data in the zipfile */ extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); /* Close the current file in the zipfile */ extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, uLong uncompressed_size, uLong crc32)); extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, ZPOS64_T uncompressed_size, uLong crc32)); /* Close the current file in the zipfile, for file opened with parameter raw=1 in zipOpenNewFileInZip2 uncompressed_size and crc32 are value for the uncompressed size */ extern int ZEXPORT zipClose OF((zipFile file, const char* global_comment)); /* Close the zipfile */ extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); /* zipRemoveExtraInfoBlock - Added by Mathias Svensson Remove extra information block from a extra information data for the local file header or central directory header It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode. 0x0001 is the signature header for the ZIP64 extra information blocks usage. Remove ZIP64 Extra information from a central director extra field data zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001); Remove ZIP64 Extra information from a Local File Header extra field data zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001); */ #ifdef __cplusplus } #endif #endif /* _zip64_H */ ================================================ FILE: Libraries/Core/Android/Headers/png/png.h ================================================ /* png.h - header file for PNG reference library * * libpng version 1.6.10 - March 6, 2014 * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license (See LICENSE, below) * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.97, January 1998, through 1.6.10 - March 6, 2014: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: * * Due to various miscommunications, unforeseen code incompatibilities * and occasional factors outside the authors' control, version numbering * on the library has not always been consistent and straightforward. * The following table summarizes matters since version 0.89c, which was * the first widely used release: * * source png.h png.h shared-lib * version string int version * ------- ------ ----- ---------- * 0.89c "1.0 beta 3" 0.89 89 1.0.89 * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] * 0.97c 0.97 97 2.0.97 * 0.98 0.98 98 2.0.98 * 0.99 0.99 98 2.0.99 * 0.99a-m 0.99 99 2.0.99 * 1.00 1.00 100 2.1.0 [100 should be 10000] * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] * 1.0.1 png.h string is 10001 2.1.0 * 1.0.1a-e identical to the 10002 from here on, the shared library * 1.0.2 source version) 10002 is 2.V where V is the source code * 1.0.2a-b 10003 version, except as noted. * 1.0.3 10003 * 1.0.3a-d 10004 * 1.0.4 10004 * 1.0.4a-f 10005 * 1.0.5 (+ 2 patches) 10005 * 1.0.5a-d 10006 * 1.0.5e-r 10100 (not source compatible) * 1.0.5s-v 10006 (not binary compatible) * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) * 1.0.6d-f 10007 (still binary incompatible) * 1.0.6g 10007 * 1.0.6h 10007 10.6h (testing xy.z so-numbering) * 1.0.6i 10007 10.6i * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) * 1.0.7 1 10007 (still compatible) * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 * 1.0.8rc1 1 10008 2.1.0.8rc1 * 1.0.8 1 10008 2.1.0.8 * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 * 1.0.9rc1 1 10009 2.1.0.9rc1 * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 * 1.0.9rc2 1 10009 2.1.0.9rc2 * 1.0.9 1 10009 2.1.0.9 * 1.0.10beta1 1 10010 2.1.0.10beta1 * 1.0.10rc1 1 10010 2.1.0.10rc1 * 1.0.10 1 10010 2.1.0.10 * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 * 1.0.11rc1 1 10011 2.1.0.11rc1 * 1.0.11 1 10011 2.1.0.11 * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 * 1.0.12rc1 2 10012 2.1.0.12rc1 * 1.0.12 2 10012 2.1.0.12 * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 * 1.2.0rc1 3 10200 3.1.2.0rc1 * 1.2.0 3 10200 3.1.2.0 * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 * 1.2.1 3 10201 3.1.2.1 * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 * 1.0.13 10 10013 10.so.0.1.0.13 * 1.2.2 12 10202 12.so.0.1.2.2 * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 * 1.2.3 12 10203 12.so.0.1.2.3 * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 * 1.0.14 10 10014 10.so.0.1.0.14 * 1.2.4 13 10204 12.so.0.1.2.4 * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 * 1.0.15 10 10015 10.so.0.1.0.15 * 1.2.5 13 10205 12.so.0.1.2.5 * 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 * 1.0.16 10 10016 10.so.0.1.0.16 * 1.2.6 13 10206 12.so.0.1.2.6 * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 * 1.0.17rc1 10 10017 12.so.0.1.0.17rc1 * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 * 1.0.17 10 10017 12.so.0.1.0.17 * 1.2.7 13 10207 12.so.0.1.2.7 * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 * 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5 * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 * 1.0.18 10 10018 12.so.0.1.0.18 * 1.2.8 13 10208 12.so.0.1.2.8 * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 * 1.2.9beta4-11 13 10209 12.so.0.9[.0] * 1.2.9rc1 13 10209 12.so.0.9[.0] * 1.2.9 13 10209 12.so.0.9[.0] * 1.2.10beta1-7 13 10210 12.so.0.10[.0] * 1.2.10rc1-2 13 10210 12.so.0.10[.0] * 1.2.10 13 10210 12.so.0.10[.0] * 1.4.0beta1-5 14 10400 14.so.0.0[.0] * 1.2.11beta1-4 13 10211 12.so.0.11[.0] * 1.4.0beta7-8 14 10400 14.so.0.0[.0] * 1.2.11 13 10211 12.so.0.11[.0] * 1.2.12 13 10212 12.so.0.12[.0] * 1.4.0beta9-14 14 10400 14.so.0.0[.0] * 1.2.13 13 10213 12.so.0.13[.0] * 1.4.0beta15-36 14 10400 14.so.0.0[.0] * 1.4.0beta37-87 14 10400 14.so.14.0[.0] * 1.4.0rc01 14 10400 14.so.14.0[.0] * 1.4.0beta88-109 14 10400 14.so.14.0[.0] * 1.4.0rc02-08 14 10400 14.so.14.0[.0] * 1.4.0 14 10400 14.so.14.0[.0] * 1.4.1beta01-03 14 10401 14.so.14.1[.0] * 1.4.1rc01 14 10401 14.so.14.1[.0] * 1.4.1beta04-12 14 10401 14.so.14.1[.0] * 1.4.1 14 10401 14.so.14.1[.0] * 1.4.2 14 10402 14.so.14.2[.0] * 1.4.3 14 10403 14.so.14.3[.0] * 1.4.4 14 10404 14.so.14.4[.0] * 1.5.0beta01-58 15 10500 15.so.15.0[.0] * 1.5.0rc01-07 15 10500 15.so.15.0[.0] * 1.5.0 15 10500 15.so.15.0[.0] * 1.5.1beta01-11 15 10501 15.so.15.1[.0] * 1.5.1rc01-02 15 10501 15.so.15.1[.0] * 1.5.1 15 10501 15.so.15.1[.0] * 1.5.2beta01-03 15 10502 15.so.15.2[.0] * 1.5.2rc01-03 15 10502 15.so.15.2[.0] * 1.5.2 15 10502 15.so.15.2[.0] * 1.5.3beta01-10 15 10503 15.so.15.3[.0] * 1.5.3rc01-02 15 10503 15.so.15.3[.0] * 1.5.3beta11 15 10503 15.so.15.3[.0] * 1.5.3 [omitted] * 1.5.4beta01-08 15 10504 15.so.15.4[.0] * 1.5.4rc01 15 10504 15.so.15.4[.0] * 1.5.4 15 10504 15.so.15.4[.0] * 1.5.5beta01-08 15 10505 15.so.15.5[.0] * 1.5.5rc01 15 10505 15.so.15.5[.0] * 1.5.5 15 10505 15.so.15.5[.0] * 1.5.6beta01-07 15 10506 15.so.15.6[.0] * 1.5.6rc01-03 15 10506 15.so.15.6[.0] * 1.5.6 15 10506 15.so.15.6[.0] * 1.5.7beta01-05 15 10507 15.so.15.7[.0] * 1.5.7rc01-03 15 10507 15.so.15.7[.0] * 1.5.7 15 10507 15.so.15.7[.0] * 1.6.0beta01-40 16 10600 16.so.16.0[.0] * 1.6.0rc01-08 16 10600 16.so.16.0[.0] * 1.6.0 16 10600 16.so.16.0[.0] * 1.6.1beta01-09 16 10601 16.so.16.1[.0] * 1.6.1rc01 16 10601 16.so.16.1[.0] * 1.6.1 16 10601 16.so.16.1[.0] * 1.6.2beta01 16 10602 16.so.16.2[.0] * 1.6.2rc01-06 16 10602 16.so.16.2[.0] * 1.6.2 16 10602 16.so.16.2[.0] * 1.6.3beta01-11 16 10603 16.so.16.3[.0] * 1.6.3rc01 16 10603 16.so.16.3[.0] * 1.6.3 16 10603 16.so.16.3[.0] * 1.6.4beta01-02 16 10604 16.so.16.4[.0] * 1.6.4rc01 16 10604 16.so.16.4[.0] * 1.6.4 16 10604 16.so.16.4[.0] * 1.6.5 16 10605 16.so.16.5[.0] * 1.6.6 16 10606 16.so.16.6[.0] * 1.6.7beta01-04 16 10607 16.so.16.7[.0] * 1.6.7rc01-03 16 10607 16.so.16.7[.0] * 1.6.7 16 10607 16.so.16.7[.0] * 1.6.8beta01-02 16 10608 16.so.16.8[.0] * 1.6.8rc01-02 16 10608 16.so.16.8[.0] * 1.6.8 16 10608 16.so.16.8[.0] * 1.6.9beta01-04 16 10609 16.so.16.9[.0] * 1.6.9rc01-02 16 10609 16.so.16.9[.0] * 1.6.9 16 10609 16.so.16.9[.0] * 1.6.10beta01-03 16 10610 16.so.16.10[.0] * 1.6.10betarc01-04 16 10610 16.so.16.10[.0] * 1.6.10beta 16 10610 16.so.16.10[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The * PNG_LIBPNG_VER macro, which is not used within libpng but is available * for applications, is an unsigned integer of the form xyyzz corresponding * to the source version x.y.z (leading zeros in y and z). Beta versions * were given the previous public release number plus a letter, until * version 1.0.6j; from then on they were given the upcoming public * release number plus "betaNN" or "rcNN". * * Binary incompatibility exists only when applications make direct access * to the info_ptr or png_ptr members through png.h, and the compiled * application is loaded with a different version of the library. * * DLLNUM will change each time there are forward or backward changes * in binary compatibility (e.g., when a new feature is added). * * See libpng-manual.txt or libpng.3 for more information. The PNG * specification is available as a W3C Recommendation and as an ISO * Specification, defines should NOT be changed. */ #define PNG_INFO_gAMA 0x0001 #define PNG_INFO_sBIT 0x0002 #define PNG_INFO_cHRM 0x0004 #define PNG_INFO_PLTE 0x0008 #define PNG_INFO_tRNS 0x0010 #define PNG_INFO_bKGD 0x0020 #define PNG_INFO_hIST 0x0040 #define PNG_INFO_pHYs 0x0080 #define PNG_INFO_oFFs 0x0100 #define PNG_INFO_tIME 0x0200 #define PNG_INFO_pCAL 0x0400 #define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ #define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ #define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using * the routines for other purposes. */ typedef struct png_row_info_struct { png_uint_32 width; /* width of row */ png_size_t rowbytes; /* number of bytes in row */ png_byte color_type; /* color type of row */ png_byte bit_depth; /* bit depth of row */ png_byte channels; /* number of channels (1, 2, 3, or 4) */ png_byte pixel_depth; /* bits per pixel (depth * channels) */ } png_row_info; typedef png_row_info * png_row_infop; typedef png_row_info * * png_row_infopp; /* These are the function types for the I/O functions and for the functions * that allow the user to override the default I/O functions with his or her * own. The png_error_ptr type should match that of user-supplied warning * and error functions, while the png_rw_ptr type should match that of the * user read/write data functions. Note that the 'write' function must not * modify the buffer it is passed. The 'read' function, on the other hand, is * expected to return the read data in the buffer. */ typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp)); typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t)); typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp)); typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32, int)); typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32, int)); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); /* The following callback receives png_uint_32 row_number, int pass for the * png_bytep data of the row. When transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ typedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep, png_uint_32, int)); #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) typedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop, png_bytep)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp, png_unknown_chunkp)); #endif #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED /* not used anywhere */ /* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */ #endif #ifdef PNG_SETJMP_SUPPORTED /* This must match the function definition in , and the application * must include this before png.h to obtain the definition of jmp_buf. The * function is required to be PNG_NORETURN, but this is not checked. If the * function does return the application will crash via an abort() or similar * system level call. * * If you get a warning here while building the library you may need to make * changes to ensure that pnglibconf.h records the calling convention used by * your compiler. This may be very difficult - try using a different compiler * to build the library! */ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef); #endif /* Transform masks for the high-level interface */ #define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ #define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ #define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ #define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ #define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ #define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ #define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ #define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ #define PNG_TRANSFORM_BGR 0x0080 /* read and write */ #define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ #define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ #define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only */ /* Added to libpng-1.2.34 */ #define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER #define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ /* Added to libpng-1.4.0 */ #define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ /* Added to libpng-1.5.4 */ #define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ #define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ /* Flags for MNG supported features */ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 #define PNG_FLAG_MNG_FILTER_64 0x04 #define PNG_ALL_MNG_FEATURES 0x05 /* NOTE: prior to 1.5 these functions had no 'API' style declaration, * this allowed the zlib default functions to be used on Windows * platforms. In 1.5 the zlib default malloc (which just calls malloc and * ignores the first argument) should be completely compatible with the * following. */ typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp, png_alloc_size_t)); typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp)); /* Section 3: exported functions * Here are the function definitions most commonly used. This is not * the place to find out how to use libpng. See libpng-manual.txt for the * full explanation, see example.c for the summary. This just provides * a simple one line description of the use of each function. * * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in * pngconf.h and in the *.dfn files in the scripts directory. * * PNG_EXPORT(ordinal, type, name, (args)); * * ordinal: ordinal that is used while building * *.def files. The ordinal value is only * relevant when preprocessing png.h with * the *.dfn files for building symbol table * entries, and are removed by pngconf.h. * type: return type of the function * name: function name * args: function arguments, with types * * When we wish to append attributes to a function prototype we use * the PNG_EXPORTA() macro instead. * * PNG_EXPORTA(ordinal, type, name, (args), attributes); * * ordinal, type, name, and args: same as in PNG_EXPORT(). * attributes: function attributes */ /* Returns the version number of the library */ PNG_EXPORT(1, png_uint_32, png_access_version_number, (void)); /* Tell lib we have already handled the first magic bytes. * Handling more than 8 bytes from the beginning of the file is an error. */ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes)); /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a * PNG file. Returns zero if the supplied bytes match the 8-byte PNG * signature, and non-zero otherwise. Having num_to_check == 0 or * start > 7 will always fail (ie return non-zero). */ PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start, png_size_t num_to_check)); /* Simple signature checking function. This is the same as calling * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). */ #define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n)) /* Allocate and initialize png_ptr struct for reading, and any other memory. */ PNG_EXPORTA(4, png_structp, png_create_read_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); /* Allocate and initialize png_ptr struct for writing, and any other memory */ PNG_EXPORTA(5, png_structp, png_create_write_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size, (png_const_structrp png_ptr)); PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr, png_size_t size)); /* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp * match up. */ #ifdef PNG_SETJMP_SUPPORTED /* This function returns the jmp_buf built in to *png_ptr. It must be * supplied with an appropriate 'longjmp' function to use on that jmp_buf * unless the default error function is overridden in which case NULL is * acceptable. The size of the jmp_buf is checked against the actual size * allocated by the library - the call will return NULL on a mismatch * indicating an ABI mismatch. */ PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr, png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)); # define png_jmpbuf(png_ptr) \ (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf)))) #else # define png_jmpbuf(png_ptr) \ (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) #endif /* This function should be used by libpng applications in place of * longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it * will use it; otherwise it will call PNG_ABORT(). This function was * added in libpng-1.5.0. */ PNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val), PNG_NORETURN); #ifdef PNG_READ_SUPPORTED /* Reset the compression stream */ PNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED); #endif /* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(11, png_structp, png_create_read_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); PNG_EXPORTA(12, png_structp, png_create_write_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); #endif /* Write the PNG file signature. */ PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr)); /* Write a PNG chunk - size, type, (optional) data, CRC. */ PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep chunk_name, png_const_bytep data, png_size_t length)); /* Write the start of a PNG chunk - length and chunk name. */ PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr, png_const_bytep chunk_name, png_uint_32 length)); /* Write the data of a PNG chunk started with png_write_chunk_start(). */ PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr, png_const_bytep data, png_size_t length)); /* Finish a chunk started with png_write_chunk_start() (includes CRC). */ PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr)); /* Allocate and initialize the info structure */ PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr), PNG_ALLOCATED); /* DEPRECATED: this function allowed init structures to be created using the * default allocation method (typically malloc). Use is deprecated in 1.6.0 and * the API will be removed in the future. */ PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr, png_size_t png_info_struct_size), PNG_DEPRECATED); /* Writes all the PNG information before the image. */ PNG_EXPORT(20, void, png_write_info_before_PLTE, (png_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(21, void, png_write_info, (png_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the information before the actual image data. */ PNG_EXPORT(22, void, png_read_info, (png_structrp png_ptr, png_inforp info_ptr)); #endif #ifdef PNG_TIME_RFC1123_SUPPORTED /* Convert to a US string format: there is no localization support in this * routine. The original implementation used a 29 character buffer in * png_struct, this will be removed in future versions. */ #if PNG_LIBPNG_VER < 10700 /* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */ PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr, png_const_timep ptime),PNG_DEPRECATED); #endif PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29], png_const_timep ptime)); #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Convert from a struct tm to png_time */ PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime, const struct tm * ttime)); /* Convert from time_t to png_time. Uses gmtime() */ PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime)); #endif /* PNG_CONVERT_tIME_SUPPORTED */ #ifdef PNG_READ_EXPAND_SUPPORTED /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ PNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr)); PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr)); PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr)); PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr)); #endif #ifdef PNG_READ_EXPAND_16_SUPPORTED /* Expand to 16-bit channels, forces conversion of palette to RGB and expansion * of a tRNS chunk if present. */ PNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr)); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) /* Use blue, green, red order for pixels. */ PNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr)); #endif #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED /* Expand the grayscale to 24-bit RGB if necessary. */ PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr)); #endif #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED /* Reduce RGB to grayscale. */ #define PNG_ERROR_ACTION_NONE 1 #define PNG_ERROR_ACTION_WARN 2 #define PNG_ERROR_ACTION_ERROR 3 #define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr, int error_action, double red, double green)) PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr, int error_action, png_fixed_point red, png_fixed_point green)) PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp png_ptr)); #endif #ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth, png_colorp palette)); #endif #ifdef PNG_READ_ALPHA_MODE_SUPPORTED /* How the alpha channel is interpreted - this affects how the color channels * of a PNG file are returned to the calling application when an alpha channel, * or a tRNS chunk in a palette file, is present. * * This has no effect on the way pixels are written into a PNG output * datastream. The color samples in a PNG datastream are never premultiplied * with the alpha samples. * * The default is to return data according to the PNG specification: the alpha * channel is a linear measure of the contribution of the pixel to the * corresponding composited pixel, and the color channels are unassociated * (not premultiplied). The gamma encoded color channels must be scaled * according to the contribution and to do this it is necessary to undo * the encoding, scale the color values, perform the composition and reencode * the values. This is the 'PNG' mode. * * The alternative is to 'associate' the alpha with the color information by * storing color channel values that have been scaled by the alpha. * image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes * (the latter being the two common names for associated alpha color channels). * * For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha * value is equal to the maximum value. * * The final choice is to gamma encode the alpha channel as well. This is * broken because, in practice, no implementation that uses this choice * correctly undoes the encoding before handling alpha composition. Use this * choice only if other serious errors in the software or hardware you use * mandate it; the typical serious error is for dark halos to appear around * opaque areas of the composited PNG image because of arithmetic overflow. * * The API function png_set_alpha_mode specifies which of these choices to use * with an enumerated 'mode' value and the gamma of the required output: */ #define PNG_ALPHA_PNG 0 /* according to the PNG standard */ #define PNG_ALPHA_STANDARD 1 /* according to Porter/Duff */ #define PNG_ALPHA_ASSOCIATED 1 /* as above; this is the normal practice */ #define PNG_ALPHA_PREMULTIPLIED 1 /* as above */ #define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ #define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode, double output_gamma)) PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr, int mode, png_fixed_point output_gamma)) #endif #if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) /* The output_gamma value is a screen gamma in libpng terminology: it expresses * how to decode the output values, not how they are encoded. */ #define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */ #define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */ #define PNG_GAMMA_sRGB 220000 /* Television standards--matches sRGB gamma */ #define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */ #endif /* The following are examples of calls to png_set_alpha_mode to achieve the * required overall gamma correction and, where necessary, alpha * premultiplication. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * This is the default libpng handling of the alpha channel - it is not * pre-multiplied into the color components. In addition the call states * that the output is for a sRGB system and causes all PNG files without gAMA * chunks to be assumed to be encoded using sRGB. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * In this case the output is assumed to be something like an sRGB conformant * display preceeded by a power-law lookup table of power 1.45. This is how * early Mac systems behaved. * * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); * This is the classic Jim Blinn approach and will work in academic * environments where everything is done by the book. It has the shortcoming * of assuming that input PNG data with no gamma information is linear - this * is unlikely to be correct unless the PNG files where generated locally. * Most of the time the output precision will be so low as to show * significant banding in dark areas of the image. * * png_set_expand_16(pp); * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB); * This is a somewhat more realistic Jim Blinn inspired approach. PNG files * are assumed to have the sRGB encoding if not marked with a gamma value and * the output is always 16 bits per component. This permits accurate scaling * and processing of the data. If you know that your input PNG files were * generated locally you might need to replace PNG_DEFAULT_sRGB with the * correct value for your system. * * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB); * If you just need to composite the PNG image onto an existing background * and if you control the code that does this you can use the optimization * setting. In this case you just copy completely opaque pixels to the * output. For pixels that are not completely transparent (you just skip * those) you do the composition math using png_composite or png_composite_16 * below then encode the resultant 8-bit or 16-bit values to match the output * encoding. * * Other cases * If neither the PNG nor the standard linear encoding work for you because * of the software or hardware you use then you have a big problem. The PNG * case will probably result in halos around the image. The linear encoding * will probably result in a washed out, too bright, image (it's actually too * contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably * substantially reduce the halos. Alternatively try: * * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB); * This option will also reduce the halos, but there will be slight dark * halos round the opaque parts of the image where the background is light. * In the OPTIMIZED mode the halos will be light halos where the background * is dark. Take your pick - the halos are unavoidable unless you can get * your hardware/software fixed! (The OPTIMIZED approach is slightly * faster.) * * When the default gamma of PNG files doesn't match the output gamma. * If you have PNG files with no gamma information png_set_alpha_mode allows * you to provide a default gamma, but it also sets the ouput gamma to the * matching value. If you know your PNG files have a gamma that doesn't * match the output you can take advantage of the fact that * png_set_alpha_mode always sets the output gamma but only sets the PNG * default if it is not already set: * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * The first call sets both the default and the output gamma values, the * second call overrides the output gamma without changing the default. This * is easier than achieving the same effect with png_set_gamma. You must use * PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will * fire if more than one call to png_set_alpha_mode and png_set_background is * made in the same read operation, however multiple calls with PNG_ALPHA_PNG * are ignored. */ #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED PNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) PNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) /* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler, int flags)); /* The values of the PNG_FILLER_ defines should NOT be changed */ # define PNG_FILLER_BEFORE 0 # define PNG_FILLER_AFTER 1 /* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, png_uint_32 filler, int flags)); #endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) /* Swap bytes in 16-bit depth files. */ PNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ PNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) /* Swap packing order of pixels in bytes. */ PNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) /* Converts files to legal bit depths. */ PNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p true_bits)); #endif #if defined(PNG_READ_INTERLACING_SUPPORTED) || \ defined(PNG_WRITE_INTERLACING_SUPPORTED) /* Have the code handle the interlacing. Returns the number of passes. * MUST be called before png_read_update_info or png_start_read_image, * otherwise it will not have the desired effect. Note that it is still * necessary to call png_read_row or png_read_rows png_get_image_height * times for each pass. */ PNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) /* Invert monochrome files */ PNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr)); #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED /* Handle alpha and tRNS by replacing with a background color. Prior to * libpng-1.5.4 this API must not be called before the PNG file header has been * read. Doing so will result in unexpected behavior and possible warnings or * errors if the PNG file contains a bKGD chunk. */ PNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma)) PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, png_fixed_point background_gamma)) #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED # define PNG_BACKGROUND_GAMMA_UNKNOWN 0 # define PNG_BACKGROUND_GAMMA_SCREEN 1 # define PNG_BACKGROUND_GAMMA_FILE 2 # define PNG_BACKGROUND_GAMMA_UNIQUE 3 #endif #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED /* Scale a 16-bit depth file down to 8-bit, accurately. */ PNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED #define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */ /* Strip the second byte of information from a 16-bit depth file. */ PNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED /* Turn on quantizing, and reduce the palette to the number of colors * available. */ PNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr, png_colorp palette, int num_palette, int maximum_colors, png_const_uint_16p histogram, int full_quantize)); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* The threshold on gamma processing is configurable but hard-wired into the * library. The following is the floating point variant. */ #define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001) /* Handle gamma correction. Screen_gamma=(display_exponent). * NOTE: this API simply sets the screen and file gamma values. It will * therefore override the value for gamma in a PNG file if it is called after * the file header has been read - use with care - call before reading the PNG * file for best results! * * These routines accept the same gamma values as png_set_alpha_mode (described * above). The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either * API (floating point or fixed.) Notice, however, that the 'file_gamma' value * is the inverse of a 'screen gamma' value. */ PNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr, double screen_gamma, double override_file_gamma)) PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr, png_fixed_point screen_gamma, png_fixed_point override_file_gamma)) #endif #ifdef PNG_WRITE_FLUSH_SUPPORTED /* Set how many lines between output flushes - 0 for no flushing */ PNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows)); /* Flush the current PNG output buffer */ PNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr)); #endif /* Optional update palette with requested transformations */ PNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr)); /* Optional call to update the users info structure */ PNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read one or more rows of image data. */ PNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read a row of data. */ PNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row, png_bytep display_row)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the whole image into memory at once. */ PNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image)); #endif /* Write a row of image data */ PNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr, png_const_bytep row)); /* Write a few rows of image data: (*row) is not written; however, the type * is declared as writeable to maintain compatibility with previous versions * of libpng and to allow the 'display_row' array from read_rows to be passed * unchanged to write_rows. */ PNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows)); /* Write the image data */ PNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image)); /* Write the end of the PNG file. */ PNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the end of the PNG file. */ PNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr)); #endif /* Free any memory associated with the png_info_struct */ PNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr, png_infopp info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); /* Set the libpng method of handling chunk CRC errors */ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, int ancil_action)); /* Values for png_set_crc_action() say how to handle CRC errors in * ancillary and critical chunks, and whether to use the data contained * therein. Note that it is impossible to "discard" data in a critical * chunk. For versions prior to 0.90, the action was always error/quit, * whereas in version 0.90 and later, the action for CRC errors in ancillary * chunks is warn/discard. These values should NOT be changed. * * value action:critical action:ancillary */ #define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ #define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ #define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ #define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ #define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ #define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ /* These functions give the user control over the scan-line filtering in * libpng and the compression methods used by zlib. These functions are * mainly useful for testing, as the defaults should work with most users. * Those users who are tight on memory or want faster performance at the * expense of compression can modify them. See the compression library * header file (zlib.h) for an explination of the compression functions. */ /* Set the filtering method(s) used by libpng. Currently, the only valid * value for "method" is 0. */ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, int filters)); /* Flags for png_set_filter() to say which filters to use. The flags * are chosen so that they don't conflict with real filter types * below, in case they are supplied instead of the #defined constants. * These values should NOT be changed. */ #define PNG_NO_FILTERS 0x00 #define PNG_FILTER_NONE 0x08 #define PNG_FILTER_SUB 0x10 #define PNG_FILTER_UP 0x20 #define PNG_FILTER_AVG 0x40 #define PNG_FILTER_PAETH 0x80 #define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ PNG_FILTER_AVG | PNG_FILTER_PAETH) /* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. * These defines should NOT be changed. */ #define PNG_FILTER_VALUE_NONE 0 #define PNG_FILTER_VALUE_SUB 1 #define PNG_FILTER_VALUE_UP 2 #define PNG_FILTER_VALUE_AVG 3 #define PNG_FILTER_VALUE_PAETH 4 #define PNG_FILTER_VALUE_LAST 5 #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */ /* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ * defines, either the default (minimum-sum-of-absolute-differences), or * the experimental method (weighted-minimum-sum-of-absolute-differences). * * Weights are factors >= 1.0, indicating how important it is to keep the * filter type consistent between rows. Larger numbers mean the current * filter is that many times as likely to be the same as the "num_weights" * previous filters. This is cumulative for each previous row with a weight. * There needs to be "num_weights" values in "filter_weights", or it can be * NULL if the weights aren't being specified. Weights have no influence on * the selection of the first row filter. Well chosen weights can (in theory) * improve the compression for a given image. * * Costs are factors >= 1.0 indicating the relative decoding costs of a * filter type. Higher costs indicate more decoding expense, and are * therefore less likely to be selected over a filter with lower computational * costs. There needs to be a value in "filter_costs" for each valid filter * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't * setting the costs. Costs try to improve the speed of decompression without * unduly increasing the compressed image size. * * A negative weight or cost indicates the default value is to be used, and * values in the range [0.0, 1.0) indicate the value is to remain unchanged. * The default values for both weights and costs are currently 1.0, but may * change if good general weighting/cost heuristics can be found. If both * the weights and costs are set to 1.0, this degenerates the WEIGHTED method * to the UNWEIGHTED method, but with added encoding time/computation. */ PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_doublep filter_weights, png_const_doublep filter_costs)) PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_fixed_point_p filter_weights, png_const_fixed_point_p filter_costs)) #endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ /* Heuristic used for row filter selection. These defines should NOT be * changed. */ #define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ #define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ #define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ #define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ #ifdef PNG_WRITE_SUPPORTED /* Set the library compression level. Currently, valid values range from * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 * (0 - no compression, 9 - "maximal" compression). Note that tests have * shown that zlib compression levels 3-6 usually perform as well as level 9 * for PNG images, and do considerably fewer caclulations. In the future, * these values may not correspond directly to the zlib compression levels. */ PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr, int method)); #endif #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED /* Also set zlib parameters for compressing non-IDAT chunks */ PNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr, int method)); #endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */ /* These next functions are called for input/output, memory, and error * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, * and call standard C I/O routines such as fread(), fwrite(), and * fprintf(). These functions can be made to use other I/O routines * at run time for those applications that need to handle I/O in a * different manner by calling png_set_???_fn(). See libpng-manual.txt for * more information. */ #ifdef PNG_STDIO_SUPPORTED /* Initialize the input/output for the PNG file to the default functions. */ PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp)); #endif /* Replace the (error and abort), and warning functions with user * supplied functions. If no messages are to be printed you must still * write and use replacement functions. The replacement error_fn should * still do a longjmp to the last setjmp location if you are using this * method of error handling. If error_fn or warning_fn is NULL, the * default function will be used. */ PNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); /* Return the user pointer associated with the error functions */ PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr)); /* Replace the default data output functions with a user supplied one(s). * If buffered output is not used, then output_flush_fn can be set to NULL. * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time * output_flush_fn will be ignored (and thus can be NULL). * It is probably a mistake to use NULL for output_flush_fn if * write_data_fn is not also NULL unless you have built libpng with * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's * default flush function, which uses the standard *FILE structure, will * be used. */ PNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); /* Replace the default data input function with a user supplied one. */ PNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)); /* Return the user pointer associated with the I/O functions */ PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr)); PNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr, png_read_status_ptr read_row_fn)); PNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr, png_write_status_ptr write_row_fn)); #ifdef PNG_USER_MEM_SUPPORTED /* Replace the default memory allocation functions with user supplied one(s). */ PNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); /* Return the user pointer associated with the memory functions */ PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn)); #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn)); #endif #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED PNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels)); /* Return the user pointer associated with the user transform functions */ PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED /* Return information about the row currently being processed. Note that these * APIs do not fail but will return unexpected results if called outside a user * transform callback. Also note that when transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp)); PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp)); #endif #ifdef PNG_READ_USER_CHUNKS_SUPPORTED /* This callback is called only for *unknown* chunks. If * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known * chunks to be treated as unknown, however in this case the callback must do * any processing required by the chunk (e.g. by calling the appropriate * png_set_ APIs.) * * There is no write support - on write, by default, all the chunks in the * 'unknown' list are written in the specified position. * * The integer return from the callback function is interpreted thus: * * negative: An error occured, png_chunk_error will be called. * zero: The chunk was not handled, the chunk will be saved. A critical * chunk will cause an error at this point unless it is to be saved. * positive: The chunk was handled, libpng will ignore/discard it. * * See "INTERACTION WTIH USER CHUNK CALLBACKS" below for important notes about * how this behavior will change in libpng 1.7 */ PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED /* Sets the function callbacks for the push reader, and a pointer to a * user-defined structure available to the callback functions. */ PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr, png_voidp progressive_ptr, png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn)); /* Returns the user pointer associated with the push read functions */ PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, (png_const_structrp png_ptr)); /* Function to be called when data becomes available */ PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr, png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size)); /* A function which may be called *only* within png_process_data to stop the * processing of any more data. The function returns the number of bytes * remaining, excluding any that libpng has cached internally. A subsequent * call to png_process_data must supply these bytes again. If the argument * 'save' is set to true the routine will first save all the pending data and * will always return 0. */ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save)); /* A function which may be called *only* outside (after) a call to * png_process_data. It returns the number of bytes of data to skip in the * input. Normally it will return 0, but if it returns a non-zero value the * application must skip than number of bytes of input data and pass the * following data to the next call to png_process_data. */ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp)); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Function that combines rows. 'new_row' is a flag that should come from * the callback and be non-NULL if anything needs to be done; the library * stores its own version of the new data internally and ignores the passed * in value. */ PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr, png_bytep old_row, png_const_bytep new_row)); #endif /* PNG_READ_INTERLACING_SUPPORTED */ #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.4.0 */ PNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.2.4 */ PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Frees a pointer allocated by png_malloc() */ PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr)); /* Free data that was allocated internally */ PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 free_me, int num)); /* Reassign responsibility for freeing existing data, whether allocated * by libpng or by the application; this works on the png_info structure passed * in, it does not change the state for other png_info structures. * * It is unlikely that this function works correctly as of 1.6.0 and using it * may result either in memory leaks or double free of allocated data. */ PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr, png_inforp info_ptr, int freer, png_uint_32 mask)); /* Assignments for png_data_freer */ #define PNG_DESTROY_WILL_FREE_DATA 1 #define PNG_SET_WILL_FREE_DATA 1 #define PNG_USER_WILL_FREE_DATA 2 /* Flags for png_ptr->free_me and info_ptr->free_me */ #define PNG_FREE_HIST 0x0008 #define PNG_FREE_ICCP 0x0010 #define PNG_FREE_SPLT 0x0020 #define PNG_FREE_ROWS 0x0040 #define PNG_FREE_PCAL 0x0080 #define PNG_FREE_SCAL 0x0100 #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED # define PNG_FREE_UNKN 0x0200 #endif /* PNG_FREE_LIST 0x0400 removed in 1.6.0 because it is ignored */ #define PNG_FREE_PLTE 0x1000 #define PNG_FREE_TRNS 0x2000 #define PNG_FREE_TEXT 0x4000 #define PNG_FREE_ALL 0x7fff #define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED); PNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr, png_voidp ptr), PNG_DEPRECATED); #endif #ifdef PNG_ERROR_TEXT_SUPPORTED /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); /* The same, but the chunk name is prepended to the error string. */ PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); #else /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN); # define png_error(s1,s2) png_err(s1) # define png_chunk_error(s1,s2) png_err(s1) #endif #ifdef PNG_WARNINGS_SUPPORTED /* Non-fatal error in libpng. Can continue, but may have a problem. */ PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); /* Non-fatal error in libpng, chunk name is prepended to message. */ PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); #else # define png_warning(s1,s2) ((void)(s1)) # define png_chunk_warning(s1,s2) ((void)(s1)) #endif #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Benign error in libpng. Can continue, but may have a problem. * User can choose whether to handle as a fatal error or as a warning. */ PNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #ifdef PNG_READ_SUPPORTED /* Same, chunk name is prepended to message (only during read) */ PNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #endif PNG_EXPORT(109, void, png_set_benign_errors, (png_structrp png_ptr, int allowed)); #else # ifdef PNG_ALLOW_BENIGN_ERRORS # define png_benign_error png_warning # define png_chunk_benign_error png_chunk_warning # else # define png_benign_error png_error # define png_chunk_benign_error png_chunk_error # endif #endif /* The png_set_ functions are for storing values in the png_info_struct. * Similarly, the png_get_ calls are used to read values from the * png_info_struct, either storing the parameters in the passed variables, or * setting pointers into the png_info_struct where the data is stored. The * png_get_ functions return a non-zero value if the data was available * in info_ptr, or return zero and do not change any of the parameters if the * data was not available. * * These functions should be used instead of directly accessing png_info * to avoid problems with future changes in the size and internal layout of * png_info_struct. */ /* Returns "flag" if chunk data is valid in info_ptr. */ PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 flag)); /* Returns number of bytes needed to hold a transformed row. */ PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* Returns row_pointers, which is an array of pointers to scanlines that was * returned from png_read_png(). */ PNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Set row_pointers, which is an array of pointers to scanlines for use * by png_write_png(). */ PNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytepp row_pointers)); #endif /* Returns number of color channels in image. */ PNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_EASY_ACCESS_SUPPORTED /* Returns image width in pixels. */ PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image height in pixels. */ PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image bit_depth. */ PNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image color_type. */ PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image filter_type. */ PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image interlace_type. */ PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image compression_type. */ PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image resolution in pixels per meter, from pHYs chunk data. */ PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns pixel aspect ratio, computed from pHYs chunk data. */ PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio, (png_const_structrp png_ptr, png_const_inforp info_ptr)) PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(128, png_int_32, png_get_x_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(129, png_int_32, png_get_y_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif /* PNG_EASY_ACCESS_SUPPORTED */ #ifdef PNG_READ_SUPPORTED /* Returns pointer to signature string read from PNG header */ PNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_16p *background)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_16p background)); #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y)) PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z, double *green_X, double *green_Y, double *green_Z, double *blue_X, double *blue_Y, double *blue_Z)) PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_white_x, png_fixed_point *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)) PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_red_X, png_fixed_point *int_red_Y, png_fixed_point *int_red_Z, png_fixed_point *int_green_X, png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, png_fixed_point *int_blue_Z)) #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y)) PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr, png_inforp info_ptr, double red_X, double red_Y, double red_Z, double green_X, double green_Y, double green_Z, double blue_X, double blue_Y, double blue_Z)) PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, png_fixed_point int_blue_y)) PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y, png_fixed_point int_red_Z, png_fixed_point int_green_X, png_fixed_point int_green_Y, png_fixed_point int_green_Z, png_fixed_point int_blue_X, png_fixed_point int_blue_Y, png_fixed_point int_blue_Z)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *file_gamma)) PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_file_gamma)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr, png_inforp info_ptr, double file_gamma)) PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_file_gamma)) #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_16p *hist)); #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist)); #endif PNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method)); PNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_method, int compression_method, int filter_method)); #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)); #endif #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr, png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); #endif PNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr, png_inforp info_ptr, png_colorp *palette, int *num_palette)); PNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette)); #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_8p *sig_bit)); #endif #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_8p sig_bit)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *file_srgb_intent)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_charpp name, int *compression_type, png_bytepp profile, png_uint_32 *proflen)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp name, int compression_type, png_const_bytep profile, png_uint_32 proflen)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_sPLT_tpp entries)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_sPLT_tp entries, int nentries)); #endif #ifdef PNG_TEXT_SUPPORTED /* png_get_text also returns the number of text chunks in *num_text */ PNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_textp *text_ptr, int *num_text)); #endif /* Note while png_set_text() will accept a structure whose text, * language, and translated keywords are NULL pointers, the structure * returned by png_get_text will always contain regular * zero-terminated C strings. They might be empty strings but * they will never be NULL pointers. */ #ifdef PNG_TEXT_SUPPORTED PNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_timep *mod_time)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_timep mod_time)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr, png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans, png_const_color_16p trans_color)); #endif #ifdef PNG_sCAL_SUPPORTED PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, double *width, double *height)) #if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \ defined(PNG_FLOATING_POINT_SUPPORTED) /* NOTE: this API is currently implemented using floating point arithmetic, * consequently it can only be used on systems with floating point support. * In any case the range of values supported by png_fixed_point is small and it * is highly recommended that png_get_sCAL_s be used instead. */ PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_fixed_point *width, png_fixed_point *height)) #endif PNG_EXPORT(169, png_uint_32, png_get_sCAL_s, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); PNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, double width, double height)) PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_fixed_point width, png_fixed_point height)) PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_const_charp swidth, png_const_charp sheight)); #endif /* PNG_sCAL_SUPPORTED */ #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED /* Provide the default handling for all unknown chunks or, optionally, for * specific unknown chunks. * * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was * ignored and the default was used, the per-chunk setting only had an effect on * write. If you wish to have chunk-specific handling on read in code that must * work on earlier versions you must use a user chunk callback to specify the * desired handling (keep or discard.) * * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below. The * parameter is interpreted as follows: * * READ: * PNG_HANDLE_CHUNK_AS_DEFAULT: * Known chunks: do normal libpng processing, do not keep the chunk (but * see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED) * Unknown chunks: for a specific chunk use the global default, when used * as the default discard the chunk data. * PNG_HANDLE_CHUNK_NEVER: * Discard the chunk data. * PNG_HANDLE_CHUNK_IF_SAFE: * Keep the chunk data if the chunk is not critical else raise a chunk * error. * PNG_HANDLE_CHUNK_ALWAYS: * Keep the chunk data. * * If the chunk data is saved it can be retrieved using png_get_unknown_chunks, * below. Notice that specifying "AS_DEFAULT" as a global default is equivalent * to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks * it simply resets the behavior to the libpng default. * * INTERACTION WTIH USER CHUNK CALLBACKS: * The per-chunk handling is always used when there is a png_user_chunk_ptr * callback and the callback returns 0; the chunk is then always stored *unless* * it is critical and the per-chunk setting is other than ALWAYS. Notice that * the global default is *not* used in this case. (In effect the per-chunk * value is incremented to at least IF_SAFE.) * * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and * per-chunk defaults will be honored. If you want to preserve the current * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE * as the default - if you don't do this libpng 1.6 will issue a warning. * * If you want unhandled unknown chunks to be discarded in libpng 1.6 and * earlier simply return '1' (handled). * * PNG_HANDLE_AS_UNKNOWN_SUPPORTED: * If this is *not* set known chunks will always be handled by libpng and * will never be stored in the unknown chunk list. Known chunks listed to * png_set_keep_unknown_chunks will have no effect. If it is set then known * chunks listed with a keep other than AS_DEFAULT will *never* be processed * by libpng, in addition critical chunks must either be processed by the * callback or saved. * * The IHDR and IEND chunks must not be listed. Because this turns off the * default handling for chunks that would otherwise be recognized the * behavior of libpng transformations may well become incorrect! * * WRITE: * When writing chunks the options only apply to the chunks specified by * png_set_unknown_chunks (below), libpng will *always* write known chunks * required by png_set_ calls and will always write the core critical chunks * (as required for PLTE). * * Each chunk in the png_set_unknown_chunks list is looked up in the * png_set_keep_unknown_chunks list to find the keep setting, this is then * interpreted as follows: * * PNG_HANDLE_CHUNK_AS_DEFAULT: * Write safe-to-copy chunks and write other chunks if the global * default is set to _ALWAYS, otherwise don't write this chunk. * PNG_HANDLE_CHUNK_NEVER: * Do not write the chunk. * PNG_HANDLE_CHUNK_IF_SAFE: * Write the chunk if it is safe-to-copy, otherwise do not write it. * PNG_HANDLE_CHUNK_ALWAYS: * Write the chunk. * * Note that the default behavior is effectively the opposite of the read case - * in read unknown chunks are not stored by default, in write they are written * by default. Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different * - on write the safe-to-copy bit is checked, on read the critical bit is * checked and on read if the chunk is critical an error will be raised. * * num_chunks: * =========== * If num_chunks is positive, then the "keep" parameter specifies the manner * for handling only those chunks appearing in the chunk_list array, * otherwise the chunk list array is ignored. * * If num_chunks is 0 the "keep" parameter specifies the default behavior for * unknown chunks, as described above. * * If num_chunks is negative, then the "keep" parameter specifies the manner * for handling all unknown chunks plus all chunks recognized by libpng * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to * be processed by libpng. */ PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks)); /* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; * the result is therefore true (non-zero) if special handling is required, * false for the default handling. */ PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr, png_const_bytep chunk_name)); #endif #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)); /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added * unknowns to the location currently stored in the png_struct. This is * invariably the wrong value on write. To fix this call the following API * for each chunk in the list with the correct location. If you know your * code won't be compiled on earlier versions you can rely on * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing * the correct thing. */ PNG_EXPORT(175, void, png_set_unknown_chunk_location, (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location)); PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_unknown_chunkpp entries)); #endif /* Png_free_data() will turn off the "valid" flag for anything it frees. * If you need to turn it off for a chunk that your application has freed, * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr, png_inforp info_ptr, int mask)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* The "params" pointer is currently not used and is for future expansion. */ #ifdef PNG_SEQUENTIAL_READ_SUPPORTED PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #ifdef PNG_WRITE_SUPPORTED PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #endif PNG_EXPORT(180, png_const_charp, png_get_copyright, (png_const_structrp png_ptr)); PNG_EXPORT(181, png_const_charp, png_get_header_ver, (png_const_structrp png_ptr)); PNG_EXPORT(182, png_const_charp, png_get_header_version, (png_const_structrp png_ptr)); PNG_EXPORT(183, png_const_charp, png_get_libpng_ver, (png_const_structrp png_ptr)); #ifdef PNG_MNG_FEATURES_SUPPORTED PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr, png_uint_32 mng_features_permitted)); #endif /* For use in png_set_keep_unknown, added to version 1.2.6 */ #define PNG_HANDLE_CHUNK_AS_DEFAULT 0 #define PNG_HANDLE_CHUNK_NEVER 1 #define PNG_HANDLE_CHUNK_IF_SAFE 2 #define PNG_HANDLE_CHUNK_ALWAYS 3 #define PNG_HANDLE_CHUNK_LAST 4 /* Strip the prepended error numbers ("#nnn ") from error and warning * messages before passing them to the error or warning handler. */ #ifdef PNG_ERROR_NUMBERS_SUPPORTED PNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr, png_uint_32 strip_mode)); #endif /* Added in libpng-1.2.6 */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED PNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); PNG_EXPORT(187, png_uint_32, png_get_user_width_max, (png_const_structrp png_ptr)); PNG_EXPORT(188, png_uint_32, png_get_user_height_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.0 */ PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)); PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.1 */ PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr, png_alloc_size_t user_chunk_cache_max)); PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max, (png_const_structrp png_ptr)); #endif #if defined(PNG_INCH_CONVERSIONS_SUPPORTED) PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_FP_EXPORT(196, float, png_get_x_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif # ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); # endif /* PNG_pHYs_SUPPORTED */ #endif /* PNG_INCH_CONVERSIONS_SUPPORTED */ /* Added in libpng-1.4.0 */ #ifdef PNG_IO_STATE_SUPPORTED PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr)); /* Removed from libpng 1.6; use png_get_io_chunk_type. */ PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr), PNG_DEPRECATED) PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, (png_const_structrp png_ptr)); /* The flags returned by png_get_io_state() are the following: */ # define PNG_IO_NONE 0x0000 /* no I/O at this moment */ # define PNG_IO_READING 0x0001 /* currently reading */ # define PNG_IO_WRITING 0x0002 /* currently writing */ # define PNG_IO_SIGNATURE 0x0010 /* currently at the file signature */ # define PNG_IO_CHUNK_HDR 0x0020 /* currently at the chunk header */ # define PNG_IO_CHUNK_DATA 0x0040 /* currently at the chunk data */ # define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */ # define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */ # define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */ #endif /* ?PNG_IO_STATE_SUPPORTED */ /* Interlace support. The following macros are always defined so that if * libpng interlace handling is turned off the macros may be used to handle * interlaced images within the application. */ #define PNG_INTERLACE_ADAM7_PASSES 7 /* Two macros to return the first row and first column of the original, * full, image which appears in a given pass. 'pass' is in the range 0 * to 6 and the result is in the range 0 to 7. */ #define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7) #define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7) /* A macro to return the offset between pixels in the output row for a pair of * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that * follows. Note that ROW_OFFSET is the offset from one row to the next whereas * COL_OFFSET is from one column to the next, within a row. */ #define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8) #define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1)) /* Two macros to help evaluate the number of rows or columns in each * pass. This is expressed as a shift - effectively log2 of the number or * rows or columns in each 8x8 tile of the original image. */ #define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) #define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) /* Hence two macros to determine the number of rows or columns in a given * pass of an image given its height or width. In fact these macros may * return non-zero even though the sub-image is empty, because the other * dimension may be empty for a small image. */ #define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) #define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) /* For the reader row callbacks (both progressive and sequential) it is * necessary to find the row in the output image given a row in an interlaced * image, so two more macros: */ #define PNG_ROW_FROM_PASS_ROW(y_in, pass) \ (((y_in)<>(((7-(off))-(pass))<<2)) & 0xF) | \ ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0)) #define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) #define PNG_COL_IN_INTERLACE_PASS(x, pass) \ ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED /* With these routines we avoid an integer divide, which will be slower on * most machines. However, it does take more operations than the corresponding * divide method, so it may be slower on a few RISC systems. There are two * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. * * Note that the rounding factors are NOT supposed to be the same! 128 and * 32768 are correct for the NODIV code; 127 and 32767 are correct for the * standard method. * * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] */ /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ # define png_composite(composite, fg, alpha, bg) \ { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ * (png_uint_16)(alpha) \ + (png_uint_16)(bg)*(png_uint_16)(255 \ - (png_uint_16)(alpha)) + 128); \ (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } # define png_composite_16(composite, fg, alpha, bg) \ { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ * (png_uint_32)(alpha) \ + (png_uint_32)(bg)*(65535 \ - (png_uint_32)(alpha)) + 32768); \ (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } #else /* Standard method using integer division */ # define png_composite(composite, fg, alpha, bg) \ (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ 127) / 255) # define png_composite_16(composite, fg, alpha, bg) \ (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ 32767) / 65535) #endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ #ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf)); PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf)); PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf)); #endif PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr, png_const_bytep buf)); /* No png_get_int_16 -- may be added if there's a real need for it. */ /* Place a 32-bit number into a buffer in PNG byte order (big-endian). */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i)); #endif #ifdef PNG_SAVE_INT_32_SUPPORTED PNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i)); #endif /* Place a 16-bit number into a buffer in PNG byte order. * The parameter is declared unsigned int, not png_uint_16, * just to avoid potential problems on pre-ANSI C compilers. */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); /* No png_save_int_16 -- may be added if there's a real need for it. */ #endif #ifdef PNG_USE_READ_MACROS /* Inline macros to do direct reads of bytes from the input buffer. * The png_get_int_32() routine assumes we are using two's complement * format for negative values, which is almost certainly true. */ # define PNG_get_uint_32(buf) \ (((png_uint_32)(*(buf)) << 24) + \ ((png_uint_32)(*((buf) + 1)) << 16) + \ ((png_uint_32)(*((buf) + 2)) << 8) + \ ((png_uint_32)(*((buf) + 3)))) /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the * function) incorrectly returned a value of type png_uint_32. */ # define PNG_get_uint_16(buf) \ ((png_uint_16) \ (((unsigned int)(*(buf)) << 8) + \ ((unsigned int)(*((buf) + 1))))) # define PNG_get_int_32(buf) \ ((png_int_32)((*(buf) & 0x80) \ ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \ : (png_int_32)png_get_uint_32(buf))) /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, * but defining a macro name prefixed with PNG_PREFIX. */ # ifndef PNG_PREFIX # define png_get_uint_32(buf) PNG_get_uint_32(buf) # define png_get_uint_16(buf) PNG_get_uint_16(buf) # define png_get_int_32(buf) PNG_get_int_32(buf) # endif #else # ifdef PNG_PREFIX /* No macros; revert to the (redefined) function */ # define PNG_get_uint_32 (png_get_uint_32) # define PNG_get_uint_16 (png_get_uint_16) # define PNG_get_int_32 (png_get_int_32) # endif #endif /******************************************************************************* * SIMPLIFIED API ******************************************************************************* * * Please read the documentation in libpng-manual.txt (TODO: write said * documentation) if you don't understand what follows. * * The simplified API hides the details of both libpng and the PNG file format * itself. It allows PNG files to be read into a very limited number of * in-memory bitmap formats or to be written from the same formats. If these * formats do not accomodate your needs then you can, and should, use the more * sophisticated APIs above - these support a wide variety of in-memory formats * and a wide variety of sophisticated transformations to those formats as well * as a wide variety of APIs to manipulate ancillary information. * * To read a PNG file using the simplified API: * * 1) Declare a 'png_image' structure (see below) on the stack and set the * version field to PNG_IMAGE_VERSION. * 2) Call the appropriate png_image_begin_read... function. * 3) Set the png_image 'format' member to the required sample format. * 4) Allocate a buffer for the image and, if required, the color-map. * 5) Call png_image_finish_read to read the image and, if required, the * color-map into your buffers. * * There are no restrictions on the format of the PNG input itself; all valid * color types, bit depths, and interlace methods are acceptable, and the * input image is transformed as necessary to the requested in-memory format * during the png_image_finish_read() step. The only caveat is that if you * request a color-mapped image from a PNG that is full-color or makes * complex use of an alpha channel the transformation is extremely lossy and the * result may look terrible. * * To write a PNG file using the simplified API: * * 1) Declare a 'png_image' structure on the stack and memset() it to all zero. * 2) Initialize the members of the structure that describe the image, setting * the 'format' member to the format of the image samples. * 3) Call the appropriate png_image_write... function with a pointer to the * image and, if necessary, the color-map to write the PNG data. * * png_image is a structure that describes the in-memory format of an image * when it is being read or defines the in-memory format of an image that you * need to write: */ #define PNG_IMAGE_VERSION 1 typedef struct png_control *png_controlp; typedef struct { png_controlp opaque; /* Initialize to NULL, free with png_image_free */ png_uint_32 version; /* Set to PNG_IMAGE_VERSION */ png_uint_32 width; /* Image width in pixels (columns) */ png_uint_32 height; /* Image height in pixels (rows) */ png_uint_32 format; /* Image format as defined below */ png_uint_32 flags; /* A bit mask containing informational flags */ png_uint_32 colormap_entries; /* Number of entries in the color-map */ /* In the event of an error or warning the following field will be set to a * non-zero value and the 'message' field will contain a '\0' terminated * string with the libpng error or warning message. If both warnings and * an error were encountered, only the error is recorded. If there * are multiple warnings, only the first one is recorded. * * The upper 30 bits of this value are reserved, the low two bits contain * a value as follows: */ # define PNG_IMAGE_WARNING 1 # define PNG_IMAGE_ERROR 2 /* * The result is a two bit code such that a value more than 1 indicates * a failure in the API just called: * * 0 - no warning or error * 1 - warning * 2 - error * 3 - error preceded by warning */ # define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1) png_uint_32 warning_or_error; char message[64]; } png_image, *png_imagep; /* The samples of the image have one to four channels whose components have * original values in the range 0 to 1.0: * * 1: A single gray or luminance channel (G). * 2: A gray/luminance channel and an alpha channel (GA). * 3: Three red, green, blue color channels (RGB). * 4: Three color channels and an alpha channel (RGBA). * * The components are encoded in one of two ways: * * a) As a small integer, value 0..255, contained in a single byte. For the * alpha channel the original value is simply value/255. For the color or * luminance channels the value is encoded according to the sRGB specification * and matches the 8-bit format expected by typical display devices. * * The color/gray channels are not scaled (pre-multiplied) by the alpha * channel and are suitable for passing to color management software. * * b) As a value in the range 0..65535, contained in a 2-byte integer. All * channels can be converted to the original value by dividing by 65535; all * channels are linear. Color channels use the RGB encoding (RGB end-points) of * the sRGB specification. This encoding is identified by the * PNG_FORMAT_FLAG_LINEAR flag below. * * When the simplified API needs to convert between sRGB and linear colorspaces, * the actual sRGB transfer curve defined in the sRGB specification (see the * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 * approximation used elsewhere in libpng. * * When an alpha channel is present it is expected to denote pixel coverage * of the color or luminance channels and is returned as an associated alpha * channel: the color/gray channels are scaled (pre-multiplied) by the alpha * value. * * The samples are either contained directly in the image data, between 1 and 8 * bytes per pixel according to the encoding, or are held in a color-map indexed * by bytes in the image data. In the case of a color-map the color-map entries * are individual samples, encoded as above, and the image data has one byte per * pixel to select the relevant sample from the color-map. */ /* PNG_FORMAT_* * * #defines to be used in png_image::format. Each #define identifies a * particular layout of sample data and, if present, alpha values. There are * separate defines for each of the two component encodings. * * A format is built up using single bit flag values. All combinations are * valid. Formats can be built up from the flag values or you can use one of * the predefined values below. When testing formats always use the FORMAT_FLAG * macros to test for individual features - future versions of the library may * add new flags. * * When reading or writing color-mapped images the format should be set to the * format of the entries in the color-map then png_image_{read,write}_colormap * called to read or write the color-map and set the format correctly for the * image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! * * NOTE: libpng can be built with particular features disabled, if you see * compiler errors because the definition of one of the following flags has been * compiled out it is because libpng does not have the required support. It is * possible, however, for the libpng configuration to enable the format on just * read or just write; in that case you may see an error at run time. You can * guard against this by checking for the definition of the appropriate * "_SUPPORTED" macro, one of: * * PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED */ #define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ #define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ #define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2 byte channels else 1 byte */ #define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ #ifdef PNG_FORMAT_BGR_SUPPORTED # define PNG_FORMAT_FLAG_BGR 0x10U /* BGR colors, else order is RGB */ #endif #ifdef PNG_FORMAT_AFIRST_SUPPORTED # define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */ #endif /* Commonly used formats have predefined macros. * * First the single byte (sRGB) formats: */ #define PNG_FORMAT_GRAY 0 #define PNG_FORMAT_GA PNG_FORMAT_FLAG_ALPHA #define PNG_FORMAT_AG (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_RGB PNG_FORMAT_FLAG_COLOR #define PNG_FORMAT_BGR (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR) #define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST) /* Then the linear 2-byte formats. When naming these "Y" is used to * indicate a luminance (gray) channel. */ #define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR #define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR) #define PNG_FORMAT_LINEAR_RGB_ALPHA \ (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA) /* With color-mapped formats the image data is one byte for each pixel, the byte * is an index into the color-map which is formatted as above. To obtain a * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP * to one of the above definitions, or you can use one of the definitions below. */ #define PNG_FORMAT_RGB_COLORMAP (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGR_COLORMAP (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP) /* PNG_IMAGE macros * * These are convenience macros to derive information from a png_image * structure. The PNG_IMAGE_SAMPLE_ macros return values appropriate to the * actual image sample values - either the entries in the color-map or the * pixels in the image. The PNG_IMAGE_PIXEL_ macros return corresponding values * for the pixels and will always return 1 for color-mapped formats. The * remaining macros return information about the rows in the image and the * complete image. * * NOTE: All the macros that take a png_image::format parameter are compile time * constants if the format parameter is, itself, a constant. Therefore these * macros can be used in array declarations and case labels where required. * Similarly the macros are also pre-processor constants (sizeof is not used) so * they can be used in #if tests. * * First the information about the samples. */ #define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\ (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1) /* Return the total number of channels in a given format: 1..4 */ #define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\ ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1) /* Return the size in bytes of a single component of a pixel or color-map * entry (as appropriate) in the image: 1 or 2. */ #define PNG_IMAGE_SAMPLE_SIZE(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)) /* This is the size of the sample data for one sample. If the image is * color-mapped it is the size of one color-map entry (and image pixels are * one byte in size), otherwise it is the size of one image pixel. */ #define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256) /* The maximum size of the color-map required by the format expressed in a * count of components. This can be used to compile-time allocate a * color-map: * * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)]; * * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)]; * * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the * information from one of the png_image_begin_read_ APIs and dynamically * allocate the required memory. */ /* Corresponding information about the pixels */ #define PNG_IMAGE_PIXEL_(test,fmt)\ (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt)) #define PNG_IMAGE_PIXEL_CHANNELS(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt) /* The number of separate channels (components) in a pixel; 1 for a * color-mapped image. */ #define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt) /* The size, in bytes, of each component in a pixel; 1 for a color-mapped * image. */ #define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt) /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */ /* Information about the whole row, or whole image */ #define PNG_IMAGE_ROW_STRIDE(image)\ (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width) /* Return the total number of components in a single row of the image; this * is the minimum 'row stride', the minimum count of components between each * row. For a color-mapped image this is the minimum number of bytes in a * row. */ #define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\ (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride)) /* Return the size, in bytes, of an image buffer given a png_image and a row * stride - the number of components to leave space for in each row. */ #define PNG_IMAGE_SIZE(image)\ PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image)) /* Return the size, in bytes, of the image in memory given just a png_image; * the row stride is the minimum stride required for the image. */ #define PNG_IMAGE_COLORMAP_SIZE(image)\ (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries) /* Return the size, in bytes, of the color-map of this image. If the image * format is not a color-map format this will return a size sufficient for * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if * you don't want to allocate a color-map in this case. */ /* PNG_IMAGE_FLAG_* * * Flags containing additional information about the image are held in the * 'flags' field of png_image. */ #define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01 /* This indicates the the RGB values of the in-memory bitmap do not * correspond to the red, green and blue end-points defined by sRGB. */ #define PNG_IMAGE_FLAG_FAST 0x02 /* On write emphasise speed over compression; the resultant PNG file will be * larger but will be produced significantly faster, particular for large * images. Do not use this option for images which will be distributed, only * used it when producing intermediate files that will be read back in * repeatedly. For a typical 24-bit image the option will double the read * speed at the cost of increasing the image size by 25%, however for many * more compressible images the PNG file can be 10 times larger with only a * slight speed gain. */ #define PNG_IMAGE_FLAG_16BIT_sRGB 0x04 /* On read if the image is a 16-bit per component image and there is no gAMA * or sRGB chunk assume that the components are sRGB encoded. Notice that * images output by the simplified API always have gamma information; setting * this flag only affects the interpretation of 16-bit images from an * external source. It is recommended that the application expose this flag * to the user; the user can normally easily recognize the difference between * linear and sRGB encoding. This flag has no effect on write - the data * passed to the write APIs must have the correct encoding (as defined * above.) * * If the flag is not set (the default) input 16-bit per component data is * assumed to be linear. * * NOTE: the flag can only be set after the png_image_begin_read_ call, * because that call initializes the 'flags' field. */ #ifdef PNG_SIMPLIFIED_READ_SUPPORTED /* READ APIs * --------- * * The png_image passed to the read APIs must have been initialized by setting * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.) */ #ifdef PNG_STDIO_SUPPORTED PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image, const char *file_name)); /* The named file is opened for read and the image header is filled in * from the PNG header in the file. */ PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image, FILE* file)); /* The PNG header is read from the stdio FILE object. */ #endif /* PNG_STDIO_SUPPORTED */ PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image, png_const_voidp memory, png_size_t size)); /* The PNG header is read from the given memory buffer. */ PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image, png_const_colorp background, void *buffer, png_int_32 row_stride, void *colormap)); /* Finish reading the image into the supplied buffer and clean up the * png_image structure. * * row_stride is the step, in byte or 2-byte units as appropriate, * between adjacent rows. A positive stride indicates that the top-most row * is first in the buffer - the normal top-down arrangement. A negative * stride indicates that the bottom-most row is first in the buffer. * * background need only be supplied if an alpha channel must be removed from * a png_byte format and the removal is to be done by compositing on a solid * color; otherwise it may be NULL and any composition will be done directly * onto the buffer. The value is an sRGB color to use for the background, * for grayscale output the green channel is used. * * background must be supplied when an alpha channel must be removed from a * single byte color-mapped output format, in other words if: * * 1) The original format from png_image_begin_read_from_* had * PNG_FORMAT_FLAG_ALPHA set. * 2) The format set by the application does not. * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and * PNG_FORMAT_FLAG_LINEAR *not* set. * * For linear output removing the alpha channel is always done by compositing * on black and background is ignored. * * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set. It must * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE. * image->colormap_entries will be updated to the actual number of entries * written to the colormap; this may be less than the original value. */ PNG_EXPORT(238, void, png_image_free, (png_imagep image)); /* Free any data allocated by libpng in image->opaque, setting the pointer to * NULL. May be called at any time after the structure is initialized. */ #endif /* PNG_SIMPLIFIED_READ_SUPPORTED */ #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED #ifdef PNG_STDIO_SUPPORTED /* WRITE APIS * ---------- * For write you must initialize a png_image structure to describe the image to * be written. To do this use memset to set the whole structure to 0 then * initialize fields describing your image. * * version: must be set to PNG_IMAGE_VERSION * opaque: must be initialized to NULL * width: image width in pixels * height: image height in rows * format: the format of the data (image and color-map) you wish to write * flags: set to 0 unless one of the defined flags applies; set * PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB * values do not correspond to the colors in sRGB. * colormap_entries: set to the number of entries in the color-map (0 to 256) */ PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image, const char *file, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the named file. */ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, int convert_to_8_bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the given (FILE*). */ /* With both write APIs if image is in one of the linear formats with 16-bit * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG * gamma encoded according to the sRGB specification, otherwise a 16-bit linear * encoded PNG file is written. * * With color-mapped data formats the colormap parameter point to a color-map * with at least image->colormap_entries encoded in the specified format. If * the format is linear the written PNG color-map will be converted to sRGB * regardless of the convert_to_8_bit flag. * * With all APIs row_stride is handled as in the read APIs - it is the spacing * from one row to the next in component sized units (1 or 2 bytes) and if * negative indicates a bottom-up row layout in the buffer. * * Note that the write API does not support interlacing or sub-8-bit pixels. */ #endif /* PNG_STDIO_SUPPORTED */ #endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */ /******************************************************************************* * END OF SIMPLIFIED API ******************************************************************************/ #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED PNG_EXPORT(242, void, png_set_check_for_invalid_index, (png_structrp png_ptr, int allowed)); # ifdef PNG_GET_PALETTE_MAX_SUPPORTED PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, png_const_infop info_ptr)); # endif #endif /* CHECK_FOR_INVALID_INDEX */ /******************************************************************************* * IMPLEMENTATION OPTIONS ******************************************************************************* * * Support for arbitrary implementation-specific optimizations. The API allows * particular options to be turned on or off. 'Option' is the number of the * option and 'onoff' is 0 (off) or non-0 (on). The value returned is given * by the PNG_OPTION_ defines below. * * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions, * are detected at run time, however sometimes it may be impossible * to do this in user mode, in which case it is necessary to discover * the capabilities in an OS specific way. Such capabilities are * listed here when libpng has support for them and must be turned * ON by the application if present. * * SOFTWARE: sometimes software optimizations actually result in performance * decrease on some architectures or systems, or with some sets of * PNG images. 'Software' options allow such optimizations to be * selected at run time. */ #ifdef PNG_SET_OPTION_SUPPORTED #ifdef PNG_ARM_NEON_API_SUPPORTED # define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */ #endif #define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */ #define PNG_OPTION_NEXT 4 /* Next option - numbers must be even */ /* Return values: NOTE: there are four values and 'off' is *not* zero */ #define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ #define PNG_OPTION_INVALID 1 /* Option number out of range */ #define PNG_OPTION_OFF 2 #define PNG_OPTION_ON 3 PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, int onoff)); #endif /******************************************************************************* * END OF HARDWARE OPTIONS ******************************************************************************/ /* Maintainer: Put new public prototypes here ^, in libpng.3, and project * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt */ /* The last ordinal number (this is the *last* one already used; the next * one to use is one more than this.) Maintainer, remember to add an entry to * scripts/symbols.def as well. */ #ifdef PNG_EXPORT_LAST_ORDINAL PNG_EXPORT_LAST_ORDINAL(244); #endif #ifdef __cplusplus } #endif #endif /* PNG_VERSION_INFO_ONLY */ /* Do not put anything past this line */ #endif /* PNG_H */ ================================================ FILE: Libraries/Core/Android/Headers/png/pngconf.h ================================================ /* pngconf.h - machine configurable file for libpng * * libpng version 1.6.10 - March 6, 2014 * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h * */ /* Any machine specific code is near the front of this file, so if you * are configuring libpng for a machine, you may want to read the section * starting here down to where it starts to typedef png_color, png_text, * and png_info. */ #ifndef PNGCONF_H #define PNGCONF_H /* To do: Do all of this in scripts/pnglibconf.dfa */ #ifdef PNG_SAFE_LIMITS_SUPPORTED # ifdef PNG_USER_WIDTH_MAX # undef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 1000000L # endif # ifdef PNG_USER_HEIGHT_MAX # undef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 1000000L # endif # ifdef PNG_USER_CHUNK_MALLOC_MAX # undef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 4000000L # endif # ifdef PNG_USER_CHUNK_CACHE_MAX # undef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 128 # endif #endif #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C * compiler for correct compilation. The following header files are required by * the standard. If your compiler doesn't provide these header files, or they * do not match the standard, you will need to provide/improve them. */ #include #include /* Library header files. These header files are all defined by ISOC90; libpng * expects conformant implementations, however, an ISOC90 conformant system need * not provide these header files if the functionality cannot be implemented. * In this case it will be necessary to disable the relevant parts of libpng in * the build of pnglibconf.h. * * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not * include this unnecessary header file. */ #ifdef PNG_STDIO_SUPPORTED /* Required for the definition of FILE: */ # include #endif #ifdef PNG_SETJMP_SUPPORTED /* Required for the definition of jmp_buf and the declaration of longjmp: */ # include #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Required for struct tm: */ # include #endif #endif /* PNG_BUILDING_SYMBOL_TABLE */ /* Prior to 1.6.0 it was possible to turn off 'const' in declarations using * PNG_NO_CONST; this is no longer supported except for data declarations which * apparently still cause problems in 2011 on some compilers. */ #define PNG_CONST const /* backward compatibility only */ /* This controls optimization of the reading of 16 and 32 bit values * from PNG files. It can be set on a per-app-file basis - it * just changes whether a macro is used when the function is called. * The library builder sets the default; if read functions are not * built into the library the macro implementation is forced on. */ #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED # define PNG_USE_READ_MACROS #endif #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) # if PNG_DEFAULT_READ_MACROS # define PNG_USE_READ_MACROS # endif #endif /* COMPILER SPECIFIC OPTIONS. * * These options are provided so that a variety of difficult compilers * can be used. Some are fixed at build time (e.g. PNG_API_RULE * below) but still have compiler specific implementations, others * may be changed on a per-file basis when compiling against libpng. */ /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect * against legacy (pre ISOC90) compilers that did not understand function * prototypes. It is not required for modern C compilers. */ #ifndef PNGARG # define PNGARG(arglist) arglist #endif /* Function calling conventions. * ============================= * Normally it is not necessary to specify to the compiler how to call * a function - it just does it - however on x86 systems derived from * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems * and some others) there are multiple ways to call a function and the * default can be changed on the compiler command line. For this reason * libpng specifies the calling convention of every exported function and * every function called via a user supplied function pointer. This is * done in this file by defining the following macros: * * PNGAPI Calling convention for exported functions. * PNGCBAPI Calling convention for user provided (callback) functions. * PNGCAPI Calling convention used by the ANSI-C library (required * for longjmp callbacks and sometimes used internally to * specify the calling convention for zlib). * * These macros should never be overridden. If it is necessary to * change calling convention in a private build this can be done * by setting PNG_API_RULE (which defaults to 0) to one of the values * below to select the correct 'API' variants. * * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. * This is correct in every known environment. * PNG_API_RULE=1 Use the operating system convention for PNGAPI and * the 'C' calling convention (from PNGCAPI) for * callbacks (PNGCBAPI). This is no longer required * in any known environment - if it has to be used * please post an explanation of the problem to the * libpng mailing list. * * These cases only differ if the operating system does not use the C * calling convention, at present this just means the above cases * (x86 DOS/Windows sytems) and, even then, this does not apply to * Cygwin running on those systems. * * Note that the value must be defined in pnglibconf.h so that what * the application uses to call the library matches the conventions * set when building the library. */ /* Symbol export * ============= * When building a shared library it is almost always necessary to tell * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' * is used to mark the symbols. On some systems these symbols can be * extracted at link time and need no special processing by the compiler, * on other systems the symbols are flagged by the compiler and just * the declaration requires a special tag applied (unfortunately) in a * compiler dependent way. Some systems can do either. * * A small number of older systems also require a symbol from a DLL to * be flagged to the program that calls it. This is a problem because * we do not know in the header file included by application code that * the symbol will come from a shared library, as opposed to a statically * linked one. For this reason the application must tell us by setting * the magic flag PNG_USE_DLL to turn on the special processing before * it includes png.h. * * Four additional macros are used to make this happen: * * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from * the build or imported if PNG_USE_DLL is set - compiler * and system specific. * * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to * 'type', compiler specific. * * PNG_DLL_EXPORT Set to the magic to use during a libpng build to * make a symbol exported from the DLL. Not used in the * public header files; see pngpriv.h for how it is used * in the libpng build. * * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come * from a DLL - used to define PNG_IMPEXP when * PNG_USE_DLL is set. */ /* System specific discovery. * ========================== * This code is used at build time to find PNG_IMPEXP, the API settings * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL * import processing is possible. On Windows systems it also sets * compiler-specific macros to the values required to change the calling * conventions of the various functions. */ #if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or * MinGW on any architecture currently supported by Windows. Also includes * Watcom builds but these need special treatment because they are not * compatible with GCC or Visual C because of different calling conventions. */ # if PNG_API_RULE == 2 /* If this line results in an error, either because __watcall is not * understood or because of a redefine just below you cannot use *this* * build of the library with the compiler you are using. *This* build was * build using Watcom and applications must also be built using Watcom! */ # define PNGCAPI __watcall # endif # if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) # define PNGCAPI __cdecl # if PNG_API_RULE == 1 /* If this line results in an error __stdcall is not understood and * PNG_API_RULE should not have been set to '1'. */ # define PNGAPI __stdcall # endif # else /* An older compiler, or one not detected (erroneously) above, * if necessary override on the command line to get the correct * variants for the compiler. */ # ifndef PNGCAPI # define PNGCAPI _cdecl # endif # if PNG_API_RULE == 1 && !defined(PNGAPI) # define PNGAPI _stdcall # endif # endif /* compiler/api */ /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) # error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed" # endif # if (defined(_MSC_VER) && _MSC_VER < 800) ||\ (defined(__BORLANDC__) && __BORLANDC__ < 0x500) /* older Borland and MSC * compilers used '__export' and required this to be after * the type. */ # ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP # endif # define PNG_DLL_EXPORT __export # else /* newer compiler */ # define PNG_DLL_EXPORT __declspec(dllexport) # ifndef PNG_DLL_IMPORT # define PNG_DLL_IMPORT __declspec(dllimport) # endif # endif /* compiler */ #else /* !Windows */ # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) # define PNGAPI _System # else /* !Windows/x86 && !OS/2 */ /* Use the defaults, or define PNG*API on the command line (but * this will have to be done for every compile!) */ # endif /* other system, !OS/2 */ #endif /* !Windows/x86 */ /* Now do all the defaulting . */ #ifndef PNGCAPI # define PNGCAPI #endif #ifndef PNGCBAPI # define PNGCBAPI PNGCAPI #endif #ifndef PNGAPI # define PNGAPI PNGCAPI #endif /* PNG_IMPEXP may be set on the compilation system command line or (if not set) * then in an internal header file when building the library, otherwise (when * using the library) it is set here. */ #ifndef PNG_IMPEXP # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) /* This forces use of a DLL, disallowing static linking */ # define PNG_IMPEXP PNG_DLL_IMPORT # endif # ifndef PNG_IMPEXP # define PNG_IMPEXP # endif #endif /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat * 'attributes' as a storage class - the attributes go at the start of the * function definition, and attributes are always appended regardless of the * compiler. This considerably simplifies these macros but may cause problems * if any compilers both need function attributes and fail to handle them as * a storage class (this is unlikely.) */ #ifndef PNG_FUNCTION # define PNG_FUNCTION(type, name, args, attributes) attributes type name args #endif #ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type #endif /* The ordinal value is only relevant when preprocessing png.h for symbol * table entries, so we discard it here. See the .dfn files in the * scripts directory. */ #ifndef PNG_EXPORTA # define PNG_EXPORTA(ordinal, type, name, args, attributes)\ PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \ extern attributes) #endif /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, * so make something non-empty to satisfy the requirement: */ #define PNG_EMPTY /*empty list*/ #define PNG_EXPORT(ordinal, type, name, args)\ PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) /* Use PNG_REMOVED to comment out a removed interface. */ #ifndef PNG_REMOVED # define PNG_REMOVED(ordinal, type, name, args, attributes) #endif #ifndef PNG_CALLBACK # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args) #endif /* Support for compiler specific function attributes. These are used * so that where compiler support is available incorrect use of API * functions in png.h will generate compiler warnings. * * Added at libpng-1.2.41. */ #ifndef PNG_NO_PEDANTIC_WARNINGS # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED # define PNG_PEDANTIC_WARNINGS_SUPPORTED # endif #endif #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED /* Support for compiler specific function attributes. These are used * so that where compiler support is available, incorrect use of API * functions in png.h will generate compiler warnings. Added at libpng * version 1.2.41. Disabling these removes the warnings but may also produce * less efficient code. */ # if defined(__clang__) /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ # if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # if !defined(PNG_NORETURN) && __has_attribute(__noreturn__) # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__) # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__) # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # if !defined(PNG_PRIVATE) # ifdef __has_extension # if __has_extension(attribute_unavailable_with_message) # define PNG_PRIVATE __attribute__((__unavailable__(\ "This function is not exported by libpng."))) # endif # endif # endif # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # elif defined(__GNUC__) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # ifndef PNG_NORETURN # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if __GNUC__ >= 3 # ifndef PNG_ALLOCATED # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # ifndef PNG_PRIVATE # if 0 /* Doesn't work so we use deprecated instead*/ # define PNG_PRIVATE \ __attribute__((warning("This function is not exported by libpng."))) # else # define PNG_PRIVATE \ __attribute__((__deprecated__)) # endif # endif # if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */ # endif /* __GNUC__ >= 3 */ # elif defined(_MSC_VER) && (_MSC_VER >= 1300) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* not supported */ # endif # ifndef PNG_NORETURN # define PNG_NORETURN __declspec(noreturn) # endif # ifndef PNG_ALLOCATED # if (_MSC_VER >= 1400) # define PNG_ALLOCATED __declspec(restrict) # endif # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __declspec(deprecated) # endif # ifndef PNG_PRIVATE # define PNG_PRIVATE __declspec(deprecated) # endif # ifndef PNG_RESTRICT # if (_MSC_VER >= 1400) # define PNG_RESTRICT __restrict # endif # endif # elif defined(__WATCOMC__) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif #endif /* PNG_PEDANTIC_WARNINGS */ #ifndef PNG_DEPRECATED # define PNG_DEPRECATED /* Use of this function is deprecated */ #endif #ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* The result of this function must be checked */ #endif #ifndef PNG_NORETURN # define PNG_NORETURN /* This function does not return */ #endif #ifndef PNG_ALLOCATED # define PNG_ALLOCATED /* The result of the function is new memory */ #endif #ifndef PNG_PRIVATE # define PNG_PRIVATE /* This is a private libpng function */ #endif #ifndef PNG_RESTRICT # define PNG_RESTRICT /* The C99 "restrict" feature */ #endif #ifndef PNG_FP_EXPORT /* A floating point API. */ # ifdef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No floating point APIs */ # define PNG_FP_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_FIXED_EXPORT /* A fixed point API. */ # ifdef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No fixed point APIs */ # define PNG_FIXED_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_BUILDING_SYMBOL_TABLE /* Some typedefs to get us started. These should be safe on most of the common * platforms. * * png_uint_32 and png_int_32 may, currently, be larger than required to hold a * 32-bit value however this is not normally advisable. * * png_uint_16 and png_int_16 should always be two bytes in size - this is * verified at library build time. * * png_byte must always be one byte in size. * * The checks below use constants from limits.h, as defined by the ISOC90 * standard. */ #if CHAR_BIT == 8 && UCHAR_MAX == 255 typedef unsigned char png_byte; #else # error "libpng requires 8 bit bytes" #endif #if INT_MIN == -32768 && INT_MAX == 32767 typedef int png_int_16; #elif SHRT_MIN == -32768 && SHRT_MAX == 32767 typedef short png_int_16; #else # error "libpng requires a signed 16 bit type" #endif #if UINT_MAX == 65535 typedef unsigned int png_uint_16; #elif USHRT_MAX == 65535 typedef unsigned short png_uint_16; #else # error "libpng requires an unsigned 16 bit type" #endif #if INT_MIN < -2147483646 && INT_MAX > 2147483646 typedef int png_int_32; #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 typedef long int png_int_32; #else # error "libpng requires a signed 32 bit (or more) type" #endif #if UINT_MAX > 4294967294 typedef unsigned int png_uint_32; #elif ULONG_MAX > 4294967294 typedef unsigned long int png_uint_32; #else # error "libpng requires an unsigned 32 bit (or more) type" #endif /* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however, * requires an ISOC90 compiler and relies on consistent behavior of sizeof. */ typedef size_t png_size_t; typedef ptrdiff_t png_ptrdiff_t; /* libpng needs to know the maximum value of 'size_t' and this controls the * definition of png_alloc_size_t, below. This maximum value of size_t limits * but does not control the maximum allocations the library makes - there is * direct application control of this through png_set_user_limits(). */ #ifndef PNG_SMALL_SIZE_T /* Compiler specific tests for systems where size_t is known to be less than * 32 bits (some of these systems may no longer work because of the lack of * 'far' support; see above.) */ # if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ (defined(_MSC_VER) && defined(MAXSEG_64K)) # define PNG_SMALL_SIZE_T # endif #endif /* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to * png_alloc_size_t are not necessary; in fact, it is recommended not to use * them at all so that the compiler can complain when something turns out to be * problematic. * * Casts in the other direction (from png_alloc_size_t to png_size_t or * png_uint_32) should be explicitly applied; however, we do not expect to * encounter practical situations that require such conversions. * * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than * 4294967295 - i.e. less than the maximum value of png_uint_32. */ #ifdef PNG_SMALL_SIZE_T typedef png_uint_32 png_alloc_size_t; #else typedef png_size_t png_alloc_size_t; #endif /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler * implementations of Intel CPU specific support of user-mode segmented address * spaces, where 16-bit pointers address more than 65536 bytes of memory using * separate 'segment' registers. The implementation requires two different * types of pointer (only one of which includes the segment value.) * * If required this support is available in version 1.2 of libpng and may be * available in versions through 1.5, although the correctness of the code has * not been verified recently. */ /* Typedef for floating-point numbers that are converted to fixed-point with a * multiple of 100,000, e.g., gamma */ typedef png_int_32 png_fixed_point; /* Add typedefs for pointers */ typedef void * png_voidp; typedef const void * png_const_voidp; typedef png_byte * png_bytep; typedef const png_byte * png_const_bytep; typedef png_uint_32 * png_uint_32p; typedef const png_uint_32 * png_const_uint_32p; typedef png_int_32 * png_int_32p; typedef const png_int_32 * png_const_int_32p; typedef png_uint_16 * png_uint_16p; typedef const png_uint_16 * png_const_uint_16p; typedef png_int_16 * png_int_16p; typedef const png_int_16 * png_const_int_16p; typedef char * png_charp; typedef const char * png_const_charp; typedef png_fixed_point * png_fixed_point_p; typedef const png_fixed_point * png_const_fixed_point_p; typedef png_size_t * png_size_tp; typedef const png_size_t * png_const_size_tp; #ifdef PNG_STDIO_SUPPORTED typedef FILE * png_FILE_p; #endif #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * png_doublep; typedef const double * png_const_doublep; #endif /* Pointers to pointers; i.e. arrays */ typedef png_byte * * png_bytepp; typedef png_uint_32 * * png_uint_32pp; typedef png_int_32 * * png_int_32pp; typedef png_uint_16 * * png_uint_16pp; typedef png_int_16 * * png_int_16pp; typedef const char * * png_const_charpp; typedef char * * png_charpp; typedef png_fixed_point * * png_fixed_point_pp; #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * * png_doublepp; #endif /* Pointers to pointers to pointers; i.e., pointer to array */ typedef char * * * png_charppp; #endif /* PNG_BUILDING_SYMBOL_TABLE */ #endif /* PNGCONF_H */ ================================================ FILE: Libraries/Core/Android/Headers/png/pngdebug.h ================================================ /* pngdebug.h - Debugging macros for libpng, also used in pngtest.c * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.8 [December 19, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* Define PNG_DEBUG at compile time for debugging information. Higher * numbers for PNG_DEBUG mean more debugging information. This has * only been added since version 0.95 so it is not implemented throughout * libpng yet, but more support will be added as needed. * * png_debug[1-2]?(level, message ,arg{0-2}) * Expands to a statement (either a simple expression or a compound * do..while(0) statement) that outputs a message with parameter * substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG * is undefined, 0 or 1 every png_debug expands to a simple expression * (actually ((void)0)). * * level: level of detail of message, starting at 0. A level 'n' * message is preceded by 'n' 3-space indentations (not implemented * on Microsoft compilers unless PNG_DEBUG_FILE is also * defined, to allow debug DLL compilation with no standard IO). * message: a printf(3) style text string. A trailing '\n' is added * to the message. * arg: 0 to 2 arguments for printf(3) style substitution in message. */ #ifndef PNGDEBUG_H #define PNGDEBUG_H /* These settings control the formatting of messages in png.c and pngerror.c */ /* Moved to pngdebug.h at 1.5.0 */ # ifndef PNG_LITERAL_SHARP # define PNG_LITERAL_SHARP 0x23 # endif # ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET # define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b # endif # ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET # define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d # endif # ifndef PNG_STRING_NEWLINE # define PNG_STRING_NEWLINE "\n" # endif #ifdef PNG_DEBUG # if (PNG_DEBUG > 0) # if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) # include # if (PNG_DEBUG > 1) # ifndef _DEBUG # define _DEBUG # endif # ifndef png_debug # define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) # endif # endif # else /* PNG_DEBUG_FILE || !_MSC_VER */ # ifndef PNG_STDIO_SUPPORTED # include /* not included yet */ # endif # ifndef PNG_DEBUG_FILE # define PNG_DEBUG_FILE stderr # endif /* PNG_DEBUG_FILE */ # if (PNG_DEBUG > 1) # ifdef __STDC__ # ifndef png_debug # define png_debug(l,m) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \ } while (0) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \ } while (0) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\ } while (0) # endif # else /* __STDC __ */ # ifndef png_debug # define png_debug(l,m) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format); \ } while (0) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format,p1); \ } while (0) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format,p1,p2); \ } while (0) # endif # endif /* __STDC __ */ # endif /* (PNG_DEBUG > 1) */ # endif /* _MSC_VER */ # endif /* (PNG_DEBUG > 0) */ #endif /* PNG_DEBUG */ #ifndef png_debug # define png_debug(l, m) ((void)0) #endif #ifndef png_debug1 # define png_debug1(l, m, p1) ((void)0) #endif #ifndef png_debug2 # define png_debug2(l, m, p1, p2) ((void)0) #endif #endif /* PNGDEBUG_H */ ================================================ FILE: Libraries/Core/Android/Headers/png/pnginfo.h ================================================ /* pnginfo.h - header file for PNG reference library * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.1 [March 28, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* png_info is a structure that holds the information in a PNG file so * that the application can find out the characteristics of the image. * If you are reading the file, this structure will tell you what is * in the PNG file. If you are writing the file, fill in the information * you want to put into the PNG file, using png_set_*() functions, then * call png_write_info(). * * The names chosen should be very close to the PNG specification, so * consult that document for information about the meaning of each field. * * With libpng < 0.95, it was only possible to directly set and read the * the values in the png_info_struct, which meant that the contents and * order of the values had to remain fixed. With libpng 0.95 and later, * however, there are now functions that abstract the contents of * png_info_struct from the application, so this makes it easier to use * libpng with dynamic libraries, and even makes it possible to use * libraries that don't have all of the libpng ancillary chunk-handing * functionality. In libpng-1.5.0 this was moved into a separate private * file that is not visible to applications. * * The following members may have allocated storage attached that should be * cleaned up before the structure is discarded: palette, trans, text, * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these * are automatically freed when the info structure is deallocated, if they were * allocated internally by libpng. This behavior can be changed by means * of the png_data_freer() function. * * More allocation details: all the chunk-reading functions that * change these members go through the corresponding png_set_* * functions. A function to clear these members is available: see * png_free_data(). The png_set_* functions do not depend on being * able to point info structure members to any of the storage they are * passed (they make their own copies), EXCEPT that the png_set_text * functions use the same storage passed to them in the text_ptr or * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns * functions do not make their own copies. */ #ifndef PNGINFO_H #define PNGINFO_H struct png_info_def { /* The following are necessary for every PNG file */ png_uint_32 width; /* width of image in pixels (from IHDR) */ png_uint_32 height; /* height of image in pixels (from IHDR) */ png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ png_size_t rowbytes; /* bytes needed to hold an untransformed row */ png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ /* The following three should have been named *_method not *_type */ png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ /* The following are set by png_set_IHDR, called from the application on * write, but the are never actually used by the write code. */ png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ png_byte pixel_depth; /* number of bits per pixel */ png_byte spare_byte; /* to align the data, and for future use */ #ifdef PNG_READ_SUPPORTED /* This is never set during write */ png_byte signature[8]; /* magic bytes read by libpng from start of file */ #endif /* The rest of the data is optional. If you are reading, check the * valid field to see if the information in these are valid. If you * are writing, set the valid field to those chunks you want written, * and initialize the appropriate fields below. */ #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) /* png_colorspace only contains 'flags' if neither GAMMA or COLORSPACE are * defined. When COLORSPACE is switched on all the colorspace-defining * chunks should be enabled, when GAMMA is switched on all the gamma-defining * chunks should be enabled. If this is not done it becomes possible to read * inconsistent PNG files and assign a probably incorrect interpretation to * the information. (In other words, by carefully choosing which chunks to * recognize the system configuration can select an interpretation for PNG * files containing ambiguous data and this will result in inconsistent * behavior between different libpng builds!) */ png_colorspace colorspace; #endif #ifdef PNG_iCCP_SUPPORTED /* iCCP chunk data. */ png_charp iccp_name; /* profile name */ png_bytep iccp_profile; /* International Color Consortium profile data */ png_uint_32 iccp_proflen; /* ICC profile data length */ #endif #ifdef PNG_TEXT_SUPPORTED /* The tEXt, and zTXt chunks contain human-readable textual data in * uncompressed, compressed, and optionally compressed forms, respectively. * The data in "text" is an array of pointers to uncompressed, * null-terminated C strings. Each chunk has a keyword that describes the * textual data contained in that chunk. Keywords are not required to be * unique, and the text string may be empty. Any number of text chunks may * be in an image. */ int num_text; /* number of comments read or comments to write */ int max_text; /* current size of text array */ png_textp text; /* array of comments read or comments to write */ #endif /* PNG_TEXT_SUPPORTED */ #ifdef PNG_tIME_SUPPORTED /* The tIME chunk holds the last time the displayed image data was * modified. See the png_time struct for the contents of this struct. */ png_time mod_time; #endif #ifdef PNG_sBIT_SUPPORTED /* The sBIT chunk specifies the number of significant high-order bits * in the pixel data. Values are in the range [1, bit_depth], and are * only specified for the channels in the pixel data. The contents of * the low-order bits is not specified. Data is valid if * (valid & PNG_INFO_sBIT) is non-zero. */ png_color_8 sig_bit; /* significant bits in color channels */ #endif #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ defined(PNG_READ_BACKGROUND_SUPPORTED) /* The tRNS chunk supplies transparency data for paletted images and * other image types that don't need a full alpha channel. There are * "num_trans" transparency values for a paletted image, stored in the * same order as the palette colors, starting from index 0. Values * for the data are in the range [0, 255], ranging from fully transparent * to fully opaque, respectively. For non-paletted images, there is a * single color specified that should be treated as fully transparent. * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. */ png_bytep trans_alpha; /* alpha values for paletted image */ png_color_16 trans_color; /* transparent color for non-palette image */ #endif #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) /* The bKGD chunk gives the suggested image background color if the * display program does not have its own background color and the image * is needs to composited onto a background before display. The colors * in "background" are normally in the same color space/depth as the * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. */ png_color_16 background; #endif #ifdef PNG_oFFs_SUPPORTED /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards * and downwards from the top-left corner of the display, page, or other * application-specific co-ordinate space. See the PNG_OFFSET_ defines * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. */ png_int_32 x_offset; /* x offset on page */ png_int_32 y_offset; /* y offset on page */ png_byte offset_unit_type; /* offset units type */ #endif #ifdef PNG_pHYs_SUPPORTED /* The pHYs chunk gives the physical pixel density of the image for * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. */ png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ png_uint_32 y_pixels_per_unit; /* vertical pixel density */ png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ #endif #ifdef PNG_hIST_SUPPORTED /* The hIST chunk contains the relative frequency or importance of the * various palette entries, so that a viewer can intelligently select a * reduced-color palette, if required. Data is an array of "num_palette" * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) * is non-zero. */ png_uint_16p hist; #endif #ifdef PNG_pCAL_SUPPORTED /* The pCAL chunk describes a transformation between the stored pixel * values and original physical data values used to create the image. * The integer range [0, 2^bit_depth - 1] maps to the floating-point * range given by [pcal_X0, pcal_X1], and are further transformed by a * (possibly non-linear) transformation function given by "pcal_type" * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ * defines below, and the PNG-Group's PNG extensions document for a * complete description of the transformations and how they should be * implemented, and for a description of the ASCII parameter strings. * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. */ png_charp pcal_purpose; /* pCAL chunk description string */ png_int_32 pcal_X0; /* minimum value */ png_int_32 pcal_X1; /* maximum value */ png_charp pcal_units; /* Latin-1 string giving physical units */ png_charpp pcal_params; /* ASCII strings containing parameter values */ png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ png_byte pcal_nparams; /* number of parameters given in pcal_params */ #endif /* New members added in libpng-1.0.6 */ png_uint_32 free_me; /* flags items libpng is responsible for freeing */ #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED /* Storage for unknown chunks that the library doesn't recognize. */ png_unknown_chunkp unknown_chunks; /* The type of this field is limited by the type of * png_struct::user_chunk_cache_max, else overflow can occur. */ int unknown_chunks_num; #endif #ifdef PNG_sPLT_SUPPORTED /* Data on sPLT chunks (there may be more than one). */ png_sPLT_tp splt_palettes; int splt_palettes_num; /* Match type returned by png_get API */ #endif #ifdef PNG_sCAL_SUPPORTED /* The sCAL chunk describes the actual physical dimensions of the * subject matter of the graphic. The chunk contains a unit specification * a byte value, and two ASCII strings representing floating-point * values. The values are width and height corresponsing to one pixel * in the image. Data values are valid if (valid & PNG_INFO_sCAL) is * non-zero. */ png_byte scal_unit; /* unit of physical scale */ png_charp scal_s_width; /* string containing height */ png_charp scal_s_height; /* string containing width */ #endif #ifdef PNG_INFO_IMAGE_SUPPORTED /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */ /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ png_bytepp row_pointers; /* the image bits */ #endif }; #endif /* PNGINFO_H */ ================================================ FILE: Libraries/Core/Android/Headers/png/pnglibconf.h ================================================ /* libpng 1.6.10 STANDARD API DEFINITION */ /* pnglibconf.h - library build configuration */ /* Libpng version 1.6.10 - March 6, 2014 */ /* Copyright (c) 1998-2013 Glenn Randers-Pehrson */ /* This code is released under the libpng license. */ /* For conditions of distribution and use, see the disclaimer */ /* and license in png.h */ /* pnglibconf.h */ /* Machine generated file: DO NOT EDIT */ /* Derived from: scripts/pnglibconf.dfa */ #ifndef PNGLCONF_H #define PNGLCONF_H /* options */ #define PNG_16BIT_SUPPORTED #define PNG_ALIGNED_MEMORY_SUPPORTED /*#undef PNG_ARM_NEON_API_SUPPORTED*/ /*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/ #define PNG_BENIGN_ERRORS_SUPPORTED #define PNG_BENIGN_READ_ERRORS_SUPPORTED /*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/ #define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED #define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_COLORSPACE_SUPPORTED #define PNG_CONSOLE_IO_SUPPORTED #define PNG_CONVERT_tIME_SUPPORTED #define PNG_EASY_ACCESS_SUPPORTED /*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ #define PNG_ERROR_TEXT_SUPPORTED #define PNG_FIXED_POINT_SUPPORTED #define PNG_FLOATING_ARITHMETIC_SUPPORTED #define PNG_FLOATING_POINT_SUPPORTED #define PNG_FORMAT_AFIRST_SUPPORTED #define PNG_FORMAT_BGR_SUPPORTED #define PNG_GAMMA_SUPPORTED #define PNG_GET_PALETTE_MAX_SUPPORTED #define PNG_HANDLE_AS_UNKNOWN_SUPPORTED #define PNG_INCH_CONVERSIONS_SUPPORTED #define PNG_INFO_IMAGE_SUPPORTED #define PNG_IO_STATE_SUPPORTED #define PNG_MNG_FEATURES_SUPPORTED #define PNG_POINTER_INDEXING_SUPPORTED #define PNG_PROGRESSIVE_READ_SUPPORTED #define PNG_READ_16BIT_SUPPORTED #define PNG_READ_ALPHA_MODE_SUPPORTED #define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED #define PNG_READ_BACKGROUND_SUPPORTED #define PNG_READ_BGR_SUPPORTED #define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_READ_COMPOSITE_NODIV_SUPPORTED #define PNG_READ_COMPRESSED_TEXT_SUPPORTED #define PNG_READ_EXPAND_16_SUPPORTED #define PNG_READ_EXPAND_SUPPORTED #define PNG_READ_FILLER_SUPPORTED #define PNG_READ_GAMMA_SUPPORTED #define PNG_READ_GET_PALETTE_MAX_SUPPORTED #define PNG_READ_GRAY_TO_RGB_SUPPORTED #define PNG_READ_INTERLACING_SUPPORTED #define PNG_READ_INT_FUNCTIONS_SUPPORTED #define PNG_READ_INVERT_ALPHA_SUPPORTED #define PNG_READ_INVERT_SUPPORTED #define PNG_READ_OPT_PLTE_SUPPORTED #define PNG_READ_PACKSWAP_SUPPORTED #define PNG_READ_PACK_SUPPORTED #define PNG_READ_QUANTIZE_SUPPORTED #define PNG_READ_RGB_TO_GRAY_SUPPORTED #define PNG_READ_SCALE_16_TO_8_SUPPORTED #define PNG_READ_SHIFT_SUPPORTED #define PNG_READ_STRIP_16_TO_8_SUPPORTED #define PNG_READ_STRIP_ALPHA_SUPPORTED #define PNG_READ_SUPPORTED #define PNG_READ_SWAP_ALPHA_SUPPORTED #define PNG_READ_SWAP_SUPPORTED #define PNG_READ_TEXT_SUPPORTED #define PNG_READ_TRANSFORMS_SUPPORTED #define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED #define PNG_READ_USER_CHUNKS_SUPPORTED #define PNG_READ_USER_TRANSFORM_SUPPORTED #define PNG_READ_bKGD_SUPPORTED #define PNG_READ_cHRM_SUPPORTED #define PNG_READ_gAMA_SUPPORTED #define PNG_READ_hIST_SUPPORTED #define PNG_READ_iCCP_SUPPORTED #define PNG_READ_iTXt_SUPPORTED #define PNG_READ_oFFs_SUPPORTED #define PNG_READ_pCAL_SUPPORTED #define PNG_READ_pHYs_SUPPORTED #define PNG_READ_sBIT_SUPPORTED #define PNG_READ_sCAL_SUPPORTED #define PNG_READ_sPLT_SUPPORTED #define PNG_READ_sRGB_SUPPORTED #define PNG_READ_tEXt_SUPPORTED #define PNG_READ_tIME_SUPPORTED #define PNG_READ_tRNS_SUPPORTED #define PNG_READ_zTXt_SUPPORTED /*#undef PNG_SAFE_LIMITS_SUPPORTED*/ #define PNG_SAVE_INT_32_SUPPORTED #define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SEQUENTIAL_READ_SUPPORTED #define PNG_SETJMP_SUPPORTED #define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED #define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED #define PNG_SET_OPTION_SUPPORTED #define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SET_USER_LIMITS_SUPPORTED #define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED #define PNG_SIMPLIFIED_READ_BGR_SUPPORTED #define PNG_SIMPLIFIED_READ_SUPPORTED #define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED #define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED #define PNG_SIMPLIFIED_WRITE_SUPPORTED #define PNG_STDIO_SUPPORTED #define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_TEXT_SUPPORTED #define PNG_TIME_RFC1123_SUPPORTED #define PNG_UNKNOWN_CHUNKS_SUPPORTED #define PNG_USER_CHUNKS_SUPPORTED #define PNG_USER_LIMITS_SUPPORTED #define PNG_USER_MEM_SUPPORTED #define PNG_USER_TRANSFORM_INFO_SUPPORTED #define PNG_USER_TRANSFORM_PTR_SUPPORTED #define PNG_WARNINGS_SUPPORTED #define PNG_WRITE_16BIT_SUPPORTED #define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED #define PNG_WRITE_BGR_SUPPORTED #define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED #define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED #define PNG_WRITE_FILLER_SUPPORTED #define PNG_WRITE_FILTER_SUPPORTED #define PNG_WRITE_FLUSH_SUPPORTED #define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED #define PNG_WRITE_INTERLACING_SUPPORTED #define PNG_WRITE_INT_FUNCTIONS_SUPPORTED #define PNG_WRITE_INVERT_ALPHA_SUPPORTED #define PNG_WRITE_INVERT_SUPPORTED #define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED #define PNG_WRITE_PACKSWAP_SUPPORTED #define PNG_WRITE_PACK_SUPPORTED #define PNG_WRITE_SHIFT_SUPPORTED #define PNG_WRITE_SUPPORTED #define PNG_WRITE_SWAP_ALPHA_SUPPORTED #define PNG_WRITE_SWAP_SUPPORTED #define PNG_WRITE_TEXT_SUPPORTED #define PNG_WRITE_TRANSFORMS_SUPPORTED #define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_WRITE_USER_TRANSFORM_SUPPORTED #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED #define PNG_WRITE_bKGD_SUPPORTED #define PNG_WRITE_cHRM_SUPPORTED #define PNG_WRITE_gAMA_SUPPORTED #define PNG_WRITE_hIST_SUPPORTED #define PNG_WRITE_iCCP_SUPPORTED #define PNG_WRITE_iTXt_SUPPORTED #define PNG_WRITE_oFFs_SUPPORTED #define PNG_WRITE_pCAL_SUPPORTED #define PNG_WRITE_pHYs_SUPPORTED #define PNG_WRITE_sBIT_SUPPORTED #define PNG_WRITE_sCAL_SUPPORTED #define PNG_WRITE_sPLT_SUPPORTED #define PNG_WRITE_sRGB_SUPPORTED #define PNG_WRITE_tEXt_SUPPORTED #define PNG_WRITE_tIME_SUPPORTED #define PNG_WRITE_tRNS_SUPPORTED #define PNG_WRITE_zTXt_SUPPORTED #define PNG_bKGD_SUPPORTED #define PNG_cHRM_SUPPORTED #define PNG_gAMA_SUPPORTED #define PNG_hIST_SUPPORTED #define PNG_iCCP_SUPPORTED #define PNG_iTXt_SUPPORTED #define PNG_oFFs_SUPPORTED #define PNG_pCAL_SUPPORTED #define PNG_pHYs_SUPPORTED #define PNG_sBIT_SUPPORTED #define PNG_sCAL_SUPPORTED #define PNG_sPLT_SUPPORTED #define PNG_sRGB_SUPPORTED #define PNG_tEXt_SUPPORTED #define PNG_tIME_SUPPORTED #define PNG_tRNS_SUPPORTED #define PNG_zTXt_SUPPORTED /* end of options */ /* settings */ #define PNG_API_RULE 0 #define PNG_CALLOC_SUPPORTED #define PNG_COST_SHIFT 3 #define PNG_DEFAULT_READ_MACROS 1 #define PNG_GAMMA_THRESHOLD_FIXED 5000 #define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE #define PNG_INFLATE_BUF_SIZE 1024 #define PNG_MAX_GAMMA_8 11 #define PNG_QUANTIZE_BLUE_BITS 5 #define PNG_QUANTIZE_GREEN_BITS 5 #define PNG_QUANTIZE_RED_BITS 5 #define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1) #define PNG_TEXT_Z_DEFAULT_STRATEGY 0 #define PNG_WEIGHT_SHIFT 8 #define PNG_ZBUF_SIZE 8192 #define PNG_ZLIB_VERNUM 0 /* unknown */ #define PNG_Z_DEFAULT_COMPRESSION (-1) #define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0 #define PNG_Z_DEFAULT_STRATEGY 1 #define PNG_sCAL_PRECISION 5 #define PNG_sRGB_PROFILE_CHECKS 2 /* end of settings */ #endif /* PNGLCONF_H */ ================================================ FILE: Libraries/Core/Android/Headers/png/pngpriv.h ================================================ /* pngpriv.h - private declarations for use inside libpng * * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.10 [March 6, 2014] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* The symbols declared in this file (including the functions declared * as extern) are PRIVATE. They are not part of the libpng public * interface, and are not recommended for use by regular applications. * Some of them may become public in the future; others may stay private, * change in an incompatible way, or even disappear. * Although the libpng users are not forbidden to include this header, * they should be well aware of the issues that may arise from doing so. */ #ifndef PNGPRIV_H #define PNGPRIV_H /* Feature Test Macros. The following are defined here to ensure that correctly * implemented libraries reveal the APIs libpng needs to build and hide those * that are not needed and potentially damaging to the compilation. * * Feature Test Macros must be defined before any system header is included (see * POSIX 1003.1 2.8.2 "POSIX Symbols." * * These macros only have an effect if the operating system supports either * POSIX 1003.1 or C99, or both. On other operating systems (particularly * Windows/Visual Studio) there is no effect; the OS specific tests below are * still required (as of 2011-05-02.) */ #define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */ #ifndef PNG_VERSION_INFO_ONLY /* Standard library headers not required by png.h: */ # include # include #endif #define PNGLIB_BUILD /*libpng is being built, not used*/ /* If HAVE_CONFIG_H is defined during the build then the build system must * provide an appropriate "config.h" file on the include path. The header file * must provide definitions as required below (search for "HAVE_CONFIG_H"); * see configure.ac for more details of the requirements. The macro * "PNG_NO_CONFIG_H" is provided for maintainers to test for dependencies on * 'configure'; define this macro to prevent the configure build including the * configure generated config.h. Libpng is expected to compile without *any* * special build system support on a reasonably ANSI-C compliant system. */ #if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) # include /* Pick up the definition of 'restrict' from config.h if it was read: */ # define PNG_RESTRICT restrict #endif /* To support symbol prefixing it is necessary to know *before* including png.h * whether the fixed point (and maybe other) APIs are exported, because if they * are not internal definitions may be required. This is handled below just * before png.h is included, but load the configuration now if it is available. */ #ifndef PNGLCONF_H # include "pnglibconf.h" #endif /* Local renames may change non-exported API functions from png.h */ #if defined(PNG_PREFIX) && !defined(PNGPREFIX_H) # include "pngprefix.h" #endif #ifdef PNG_USER_CONFIG # include "pngusr.h" /* These should have been defined in pngusr.h */ # ifndef PNG_USER_PRIVATEBUILD # define PNG_USER_PRIVATEBUILD "Custom libpng build" # endif # ifndef PNG_USER_DLLFNAME_POSTFIX # define PNG_USER_DLLFNAME_POSTFIX "Cb" # endif #endif /* Compile time options. * ===================== * In a multi-arch build the compiler may compile the code several times for the * same object module, producing different binaries for different architectures. * When this happens configure-time setting of the target host options cannot be * done and this interferes with the handling of the ARM NEON optimizations, and * possibly other similar optimizations. Put additional tests here; in general * this is needed when the same option can be changed at both compile time and * run time depending on the target OS (i.e. iOS vs Android.) * * NOTE: symbol prefixing does not pass $(CFLAGS) to the preprocessor, because * this is not possible with certain compilers (Oracle SUN OS CC), as a result * it is necessary to ensure that all extern functions that *might* be used * regardless of $(CFLAGS) get declared in this file. The test on __ARM_NEON__ * below is one example of this behavior because it is controlled by the * presence or not of -mfpu=neon on the GCC command line, it is possible to do * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely * do this. */ #ifndef PNG_ARM_NEON_OPT /* ARM NEON optimizations are being controlled by the compiler settings, * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon * with GCC) then the compiler will define __ARM_NEON__ and we can rely * unconditionally on NEON instructions not crashing, otherwise we must * disable use of NEON instructions. * * NOTE: at present these optimizations depend on 'ALIGNED_MEMORY', so they * can only be turned on automatically if that is supported too. If * PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail * to compile with an appropriate #error if ALIGNED_MEMORY has been turned * off. */ # if defined(__ARM_NEON__) && defined(PNG_ALIGNED_MEMORY_SUPPORTED) # define PNG_ARM_NEON_OPT 2 # else # define PNG_ARM_NEON_OPT 0 # endif #endif #if PNG_ARM_NEON_OPT > 0 /* NEON optimizations are to be at least considered by libpng, so enable the * callbacks to do this. */ # define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon /* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used * if possible - if __ARM_NEON__ is set and the compiler version is not known * to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can * be: * * 1 The intrinsics code (the default with __ARM_NEON__) * 2 The hand coded assembler (the default without __ARM_NEON__) * * It is possible to set PNG_ARM_NEON_IMPLEMENTATION in CPPFLAGS, however * this is *NOT* supported and may cease to work even after a minor revision * to libpng. It *is* valid to do this for testing purposes, e.g. speed * testing or a new compiler, but the results should be communicated to the * libpng implementation list for incorporation in the next minor release. */ # ifndef PNG_ARM_NEON_IMPLEMENTATION # ifdef __ARM_NEON__ # if defined(__clang__) /* At present it is unknown by the libpng developers which versions * of clang support the intrinsics, however some or perhaps all * versions do not work with the assembler so this may be * irrelevant, so just use the default (do nothing here.) */ # elif defined(__GNUC__) /* GCC 4.5.4 NEON support is known to be broken. 4.6.3 is known to * work, so if this *is* GCC, or G++, look for a version >4.5 */ # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) # define PNG_ARM_NEON_IMPLEMENTATION 2 # endif /* no GNUC support */ # endif /* __GNUC__ */ # else /* !defined __ARM_NEON__ */ /* The 'intrinsics' code simply won't compile without this -mfpu=neon: */ # define PNG_ARM_NEON_IMPLEMENTATION 2 # endif /* __ARM_NEON__ */ # endif /* !defined PNG_ARM_NEON_IMPLEMENTATION */ # ifndef PNG_ARM_NEON_IMPLEMENTATION /* Use the intrinsics code by default. */ # define PNG_ARM_NEON_IMPLEMENTATION 1 # endif #endif /* PNG_ARM_NEON_OPT > 0 */ /* Is this a build of a DLL where compilation of the object modules requires * different preprocessor settings to those required for a simple library? If * so PNG_BUILD_DLL must be set. * * If libpng is used inside a DLL but that DLL does not export the libpng APIs * PNG_BUILD_DLL must not be set. To avoid the code below kicking in build a * static library of libpng then link the DLL against that. */ #ifndef PNG_BUILD_DLL # ifdef DLL_EXPORT /* This is set by libtool when files are compiled for a DLL; libtool * always compiles twice, even on systems where it isn't necessary. Set * PNG_BUILD_DLL in case it is necessary: */ # define PNG_BUILD_DLL # else # ifdef _WINDLL /* This is set by the Microsoft Visual Studio IDE in projects that * build a DLL. It can't easily be removed from those projects (it * isn't visible in the Visual Studio UI) so it is a fairly reliable * indication that PNG_IMPEXP needs to be set to the DLL export * attributes. */ # define PNG_BUILD_DLL # else # ifdef __DLL__ /* This is set by the Borland C system when compiling for a DLL * (as above.) */ # define PNG_BUILD_DLL # else /* Add additional compiler cases here. */ # endif # endif # endif #endif /* Setting PNG_BUILD_DLL if required */ /* See pngconf.h for more details: the builder of the library may set this on * the command line to the right thing for the specific compilation system or it * may be automagically set above (at present we know of no system where it does * need to be set on the command line.) * * PNG_IMPEXP must be set here when building the library to prevent pngconf.h * setting it to the "import" setting for a DLL build. */ #ifndef PNG_IMPEXP # ifdef PNG_BUILD_DLL # define PNG_IMPEXP PNG_DLL_EXPORT # else /* Not building a DLL, or the DLL doesn't require specific export * definitions. */ # define PNG_IMPEXP # endif #endif /* No warnings for private or deprecated functions in the build: */ #ifndef PNG_DEPRECATED # define PNG_DEPRECATED #endif #ifndef PNG_PRIVATE # define PNG_PRIVATE #endif /* Symbol preprocessing support. * * To enable listing global, but internal, symbols the following macros should * always be used to declare an extern data or function object in this file. */ #ifndef PNG_INTERNAL_DATA # define PNG_INTERNAL_DATA(type, name, array) extern type name array #endif #ifndef PNG_INTERNAL_FUNCTION # define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\ extern PNG_FUNCTION(type, name, args, PNG_EMPTY attributes) #endif #ifndef PNG_INTERNAL_CALLBACK # define PNG_INTERNAL_CALLBACK(type, name, args, attributes)\ extern PNG_FUNCTION(type, (PNGCBAPI name), args, PNG_EMPTY attributes) #endif /* If floating or fixed point APIs are disabled they may still be compiled * internally. To handle this make sure they are declared as the appropriate * internal extern function (otherwise the symbol prefixing stuff won't work and * the functions will be used without definitions.) * * NOTE: although all the API functions are declared here they are not all * actually built! Because the declarations are still made it is necessary to * fake out types that they depend on. */ #ifndef PNG_FP_EXPORT # ifndef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); # ifndef PNG_VERSION_INFO_ONLY typedef struct png_incomplete png_double; typedef png_double* png_doublep; typedef const png_double* png_const_doublep; typedef png_double** png_doublepp; # endif # endif #endif #ifndef PNG_FIXED_EXPORT # ifndef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); # endif #endif #include "png.h" /* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */ #ifndef PNG_DLL_EXPORT # define PNG_DLL_EXPORT #endif /* SECURITY and SAFETY: * * By default libpng is built without any internal limits on image size, * individual heap (png_malloc) allocations or the total amount of memory used. * If PNG_SAFE_LIMITS_SUPPORTED is defined, however, the limits below are used * (unless individually overridden). These limits are believed to be fairly * safe, but builders of secure systems should verify the values against the * real system capabilities. */ #ifdef PNG_SAFE_LIMITS_SUPPORTED /* 'safe' limits */ # ifndef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 1000000 # endif # ifndef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 1000000 # endif # ifndef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 128 # endif # ifndef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 8000000 # endif #else /* values for no limits */ # ifndef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 0x7fffffff # endif # ifndef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 0x7fffffff # endif # ifndef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 0 # endif # ifndef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 0 # endif #endif /* Moved to pngpriv.h at libpng-1.5.0 */ /* NOTE: some of these may have been used in external applications as * these definitions were exposed in pngconf.h prior to 1.5. */ /* If you are running on a machine where you cannot allocate more * than 64K of memory at once, uncomment this. While libpng will not * normally need that much memory in a chunk (unless you load up a very * large file), zlib needs to know how big of a chunk it can use, and * libpng thus makes sure to check any memory allocation to verify it * will fit into memory. * * zlib provides 'MAXSEG_64K' which, if defined, indicates the * same limit and pngconf.h (already included) sets the limit * if certain operating systems are detected. */ #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) # define PNG_MAX_MALLOC_64K #endif #ifndef PNG_UNUSED /* Unused formal parameter warnings are silenced using the following macro * which is expected to have no bad effects on performance (optimizing * compilers will probably remove it entirely). Note that if you replace * it with something other than whitespace, you must include the terminating * semicolon. */ # define PNG_UNUSED(param) (void)param; #endif /* Just a little check that someone hasn't tried to define something * contradictory. */ #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) # undef PNG_ZBUF_SIZE # define PNG_ZBUF_SIZE 65536L #endif /* If warnings or errors are turned off the code is disabled or redirected here. * From 1.5.4 functions have been added to allow very limited formatting of * error and warning messages - this code will also be disabled here. */ #ifdef PNG_WARNINGS_SUPPORTED # define PNG_WARNING_PARAMETERS(p) png_warning_parameters p; #else # define png_warning_parameter(p,number,string) ((void)0) # define png_warning_parameter_unsigned(p,number,format,value) ((void)0) # define png_warning_parameter_signed(p,number,format,value) ((void)0) # define png_formatted_warning(pp,p,message) ((void)(pp)) # define PNG_WARNING_PARAMETERS(p) #endif #ifndef PNG_ERROR_TEXT_SUPPORTED # define png_fixed_error(s1,s2) png_err(s1) #endif /* C allows up-casts from (void*) to any pointer and (const void*) to any * pointer to a const object. C++ regards this as a type error and requires an * explicit, static, cast and provides the static_cast<> rune to ensure that * const is not cast away. */ #ifdef __cplusplus # define png_voidcast(type, value) static_cast(value) # define png_constcast(type, value) const_cast(value) # define png_aligncast(type, value) \ static_cast(static_cast(value)) # define png_aligncastconst(type, value) \ static_cast(static_cast(value)) #else # define png_voidcast(type, value) (value) # define png_constcast(type, value) ((type)(value)) # define png_aligncast(type, value) ((void*)(value)) # define png_aligncastconst(type, value) ((const void*)(value)) #endif /* __cplusplus */ /* Some fixed point APIs are still required even if not exported because * they get used by the corresponding floating point APIs. This magic * deals with this: */ #ifdef PNG_FIXED_POINT_SUPPORTED # define PNGFAPI PNGAPI #else # define PNGFAPI /* PRIVATE */ #endif #ifndef PNG_VERSION_INFO_ONLY /* Other defines specific to compilers can go here. Try to keep * them inside an appropriate ifdef/endif pair for portability. */ #if defined(PNG_FLOATING_POINT_SUPPORTED) ||\ defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) /* png.c requires the following ANSI-C constants if the conversion of * floating point to ASCII is implemented therein: * * DBL_DIG Maximum number of decimal digits (can be set to any constant) * DBL_MIN Smallest normalized fp number (can be set to an arbitrary value) * DBL_MAX Maximum floating point number (can be set to an arbitrary value) */ # include # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) /* We need to check that hasn't already been included earlier * as it seems it doesn't agree with , yet we should really use * if possible. */ # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) # include # endif # else # include # endif # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) /* Amiga SAS/C: We must include builtin FPU functions when compiling using * MATH=68881 */ # include # endif #endif /* This provides the non-ANSI (far) memory allocation routines. */ #if defined(__TURBOC__) && defined(__MSDOS__) # include # include #endif #if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \ defined(_WIN32) || defined(__WIN32__) # include /* defines _WINDOWS_ macro */ #endif #endif /* PNG_VERSION_INFO_ONLY */ /* Moved here around 1.5.0beta36 from pngconf.h */ /* Users may want to use these so they are not private. Any library * functions that are passed far data must be model-independent. */ /* Memory model/platform independent fns */ #ifndef PNG_ABORT # ifdef _WINDOWS_ # define PNG_ABORT() ExitProcess(0) # else # define PNG_ABORT() abort() # endif #endif /* These macros may need to be architecture dependent. */ #define PNG_ALIGN_NONE 0 /* do not use data alignment */ #define PNG_ALIGN_ALWAYS 1 /* assume unaligned accesses are OK */ #ifdef offsetof # define PNG_ALIGN_OFFSET 2 /* use offsetof to determine alignment */ #else # define PNG_ALIGN_OFFSET -1 /* prevent the use of this */ #endif #define PNG_ALIGN_SIZE 3 /* use sizeof to determine alignment */ #ifndef PNG_ALIGN_TYPE /* Default to using aligned access optimizations and requiring alignment to a * multiple of the data type size. Override in a compiler specific fashion * if necessary by inserting tests here: */ # define PNG_ALIGN_TYPE PNG_ALIGN_SIZE #endif #if PNG_ALIGN_TYPE == PNG_ALIGN_SIZE /* This is used because in some compiler implementations non-aligned * structure members are supported, so the offsetof approach below fails. * Set PNG_ALIGN_SIZE=0 for compiler combinations where unaligned access * is good for performance. Do not do this unless you have tested the result * and understand it. */ # define png_alignof(type) (sizeof (type)) #else # if PNG_ALIGN_TYPE == PNG_ALIGN_OFFSET # define png_alignof(type) offsetof(struct{char c; type t;}, t) # else # if PNG_ALIGN_TYPE == PNG_ALIGN_ALWAYS # define png_alignof(type) (1) # endif /* Else leave png_alignof undefined to prevent use thereof */ # endif #endif /* This implicitly assumes alignment is always to a power of 2. */ #ifdef png_alignof # define png_isaligned(ptr, type)\ ((((const char*)ptr-(const char*)0) & (png_alignof(type)-1)) == 0) #else # define png_isaligned(ptr, type) 0 #endif /* End of memory model/platform independent support */ /* End of 1.5.0beta36 move from pngconf.h */ /* CONSTANTS and UTILITY MACROS * These are used internally by libpng and not exposed in the API */ /* Various modes of operation. Note that after an init, mode is set to * zero automatically when the structure is created. Three of these * are defined in png.h because they need to be visible to applications * that call png_set_unknown_chunk(). */ /* #define PNG_HAVE_IHDR 0x01 (defined in png.h) */ /* #define PNG_HAVE_PLTE 0x02 (defined in png.h) */ #define PNG_HAVE_IDAT 0x04 /* #define PNG_AFTER_IDAT 0x08 (defined in png.h) */ #define PNG_HAVE_IEND 0x10 /* 0x20 (unused) */ /* 0x40 (unused) */ /* 0x80 (unused) */ #define PNG_HAVE_CHUNK_HEADER 0x100 #define PNG_WROTE_tIME 0x200 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400 #define PNG_BACKGROUND_IS_GRAY 0x800 #define PNG_HAVE_PNG_SIGNATURE 0x1000 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ /* 0x4000 (unused) */ #define PNG_IS_READ_STRUCT 0x8000 /* Else is a write struct */ /* Flags for the transformations the PNG library does on the image data */ #define PNG_BGR 0x0001 #define PNG_INTERLACE 0x0002 #define PNG_PACK 0x0004 #define PNG_SHIFT 0x0008 #define PNG_SWAP_BYTES 0x0010 #define PNG_INVERT_MONO 0x0020 #define PNG_QUANTIZE 0x0040 #define PNG_COMPOSE 0x0080 /* Was PNG_BACKGROUND */ #define PNG_BACKGROUND_EXPAND 0x0100 #define PNG_EXPAND_16 0x0200 /* Added to libpng 1.5.2 */ #define PNG_16_TO_8 0x0400 /* Becomes 'chop' in 1.5.4 */ #define PNG_RGBA 0x0800 #define PNG_EXPAND 0x1000 #define PNG_GAMMA 0x2000 #define PNG_GRAY_TO_RGB 0x4000 #define PNG_FILLER 0x8000 #define PNG_PACKSWAP 0x10000 #define PNG_SWAP_ALPHA 0x20000 #define PNG_STRIP_ALPHA 0x40000 #define PNG_INVERT_ALPHA 0x80000 #define PNG_USER_TRANSFORM 0x100000 #define PNG_RGB_TO_GRAY_ERR 0x200000 #define PNG_RGB_TO_GRAY_WARN 0x400000 #define PNG_RGB_TO_GRAY 0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */ #define PNG_ENCODE_ALPHA 0x800000 /* Added to libpng-1.5.4 */ #define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */ #define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */ #define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */ /* 0x8000000 unused */ /* 0x10000000 unused */ /* 0x20000000 unused */ /* 0x40000000 unused */ /* Flags for png_create_struct */ #define PNG_STRUCT_PNG 0x0001 #define PNG_STRUCT_INFO 0x0002 /* Scaling factor for filter heuristic weighting calculations */ #define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) #define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) /* Flags for the png_ptr->flags rather than declaring a byte for each one */ #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 #define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002 /* Added to libpng-1.6.0 */ /* 0x0004 unused */ #define PNG_FLAG_ZSTREAM_ENDED 0x0008 /* Added to libpng-1.6.0 */ /* 0x0010 unused */ /* 0x0020 unused */ #define PNG_FLAG_ROW_INIT 0x0040 #define PNG_FLAG_FILLER_AFTER 0x0080 #define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 #define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 #define PNG_FLAG_CRC_CRITICAL_USE 0x0400 #define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 #define PNG_FLAG_ASSUME_sRGB 0x1000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_OPTIMIZE_ALPHA 0x2000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_DETECT_UNINITIALIZED 0x4000 /* Added to libpng-1.5.4 */ /* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000 */ /* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000 */ #define PNG_FLAG_LIBRARY_MISMATCH 0x20000 #define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000 #define PNG_FLAG_STRIP_ERROR_TEXT 0x80000 #define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000 /* Added to libpng-1.4.0 */ #define PNG_FLAG_APP_WARNINGS_WARN 0x200000 /* Added to libpng-1.6.0 */ #define PNG_FLAG_APP_ERRORS_WARN 0x400000 /* Added to libpng-1.6.0 */ /* 0x800000 unused */ /* 0x1000000 unused */ /* 0x2000000 unused */ /* 0x4000000 unused */ /* 0x8000000 unused */ /* 0x10000000 unused */ /* 0x20000000 unused */ /* 0x40000000 unused */ #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ PNG_FLAG_CRC_ANCILLARY_NOWARN) #define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ PNG_FLAG_CRC_CRITICAL_IGNORE) #define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ PNG_FLAG_CRC_CRITICAL_MASK) /* Save typing and make code easier to understand */ #define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ abs((int)((c1).green) - (int)((c2).green)) + \ abs((int)((c1).blue) - (int)((c2).blue))) /* Added to libpng-1.6.0: scale a 16-bit value in the range 0..65535 to 0..255 * by dividing by 257 *with rounding*. This macro is exact for the given range. * See the discourse in pngrtran.c png_do_scale_16_to_8. The values in the * macro were established by experiment (modifying the added value). The macro * has a second variant that takes a value already scaled by 255 and divides by * 65535 - this has a maximum error of .502. Over the range 0..65535*65535 it * only gives off-by-one errors and only for 0.5% (1 in 200) of the values. */ #define PNG_DIV65535(v24) (((v24) + 32895) >> 16) #define PNG_DIV257(v16) PNG_DIV65535((png_uint_32)(v16) * 255) /* Added to libpng-1.2.6 JB */ #define PNG_ROWBYTES(pixel_bits, width) \ ((pixel_bits) >= 8 ? \ ((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \ (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) ) /* PNG_OUT_OF_RANGE returns true if value is outside the range * ideal-delta..ideal+delta. Each argument is evaluated twice. * "ideal" and "delta" should be constants, normally simple * integers, "value" a variable. Added to libpng-1.2.6 JB */ #define PNG_OUT_OF_RANGE(value, ideal, delta) \ ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) /* Conversions between fixed and floating point, only defined if * required (to make sure the code doesn't accidentally use float * when it is supposedly disabled.) */ #ifdef PNG_FLOATING_POINT_SUPPORTED /* The floating point conversion can't overflow, though it can and * does lose accuracy relative to the original fixed point value. * In practice this doesn't matter because png_fixed_point only * stores numbers with very low precision. The png_ptr and s * arguments are unused by default but are there in case error * checking becomes a requirement. */ #define png_float(png_ptr, fixed, s) (.00001 * (fixed)) /* The fixed point conversion performs range checking and evaluates * its argument multiple times, so must be used with care. The * range checking uses the PNG specification values for a signed * 32 bit fixed point value except that the values are deliberately * rounded-to-zero to an integral value - 21474 (21474.83 is roughly * (2^31-1) * 100000). 's' is a string that describes the value being * converted. * * NOTE: this macro will raise a png_error if the range check fails, * therefore it is normally only appropriate to use this on values * that come from API calls or other sources where an out of range * error indicates a programming error, not a data error! * * NOTE: by default this is off - the macro is not used - because the * function call saves a lot of code. */ #ifdef PNG_FIXED_POINT_MACRO_SUPPORTED #define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\ ((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0)) #endif /* else the corresponding function is defined below, inside the scope of the * cplusplus test. */ #endif /* Constants for known chunk types. If you need to add a chunk, define the name * here. For historical reasons these constants have the form png_; i.e. * the prefix is lower case. Please use decimal values as the parameters to * match the ISO PNG specification and to avoid relying on the C locale * interpretation of character values. * * Prior to 1.5.6 these constants were strings, as of 1.5.6 png_uint_32 values * are computed and a new macro (PNG_STRING_FROM_CHUNK) added to allow a string * to be generated if required. * * PNG_32b correctly produces a value shifted by up to 24 bits, even on * architectures where (int) is only 16 bits. */ #define PNG_32b(b,s) ((png_uint_32)(b) << (s)) #define PNG_U32(b1,b2,b3,b4) \ (PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0)) /* Constants for known chunk types. * * MAINTAINERS: If you need to add a chunk, define the name here. * For historical reasons these constants have the form png_; i.e. * the prefix is lower case. Please use decimal values as the parameters to * match the ISO PNG specification and to avoid relying on the C locale * interpretation of character values. Please keep the list sorted. * * Notice that PNG_U32 is used to define a 32-bit value for the 4 byte chunk * type. In fact the specification does not express chunk types this way, * however using a 32-bit value means that the chunk type can be read from the * stream using exactly the same code as used for a 32-bit unsigned value and * can be examined far more efficiently (using one arithmetic compare). * * Prior to 1.5.6 the chunk type constants were expressed as C strings. The * libpng API still uses strings for 'unknown' chunks and a macro, * PNG_STRING_FROM_CHUNK, allows a string to be generated if required. Notice * that for portable code numeric values must still be used; the string "IHDR" * is not portable and neither is PNG_U32('I', 'H', 'D', 'R'). * * In 1.7.0 the definitions will be made public in png.h to avoid having to * duplicate the same definitions in application code. */ #define png_IDAT PNG_U32( 73, 68, 65, 84) #define png_IEND PNG_U32( 73, 69, 78, 68) #define png_IHDR PNG_U32( 73, 72, 68, 82) #define png_PLTE PNG_U32( 80, 76, 84, 69) #define png_bKGD PNG_U32( 98, 75, 71, 68) #define png_cHRM PNG_U32( 99, 72, 82, 77) #define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */ #define png_gAMA PNG_U32(103, 65, 77, 65) #define png_gIFg PNG_U32(103, 73, 70, 103) #define png_gIFt PNG_U32(103, 73, 70, 116) /* deprecated */ #define png_gIFx PNG_U32(103, 73, 70, 120) #define png_hIST PNG_U32(104, 73, 83, 84) #define png_iCCP PNG_U32(105, 67, 67, 80) #define png_iTXt PNG_U32(105, 84, 88, 116) #define png_oFFs PNG_U32(111, 70, 70, 115) #define png_pCAL PNG_U32(112, 67, 65, 76) #define png_pHYs PNG_U32(112, 72, 89, 115) #define png_sBIT PNG_U32(115, 66, 73, 84) #define png_sCAL PNG_U32(115, 67, 65, 76) #define png_sPLT PNG_U32(115, 80, 76, 84) #define png_sRGB PNG_U32(115, 82, 71, 66) #define png_sTER PNG_U32(115, 84, 69, 82) #define png_tEXt PNG_U32(116, 69, 88, 116) #define png_tIME PNG_U32(116, 73, 77, 69) #define png_tRNS PNG_U32(116, 82, 78, 83) #define png_zTXt PNG_U32(122, 84, 88, 116) /* The following will work on (signed char*) strings, whereas the get_uint_32 * macro will fail on top-bit-set values because of the sign extension. */ #define PNG_CHUNK_FROM_STRING(s)\ PNG_U32(0xff&(s)[0], 0xff&(s)[1], 0xff&(s)[2], 0xff&(s)[3]) /* This uses (char), not (png_byte) to avoid warnings on systems where (char) is * signed and the argument is a (char[]) This macro will fail miserably on * systems where (char) is more than 8 bits. */ #define PNG_STRING_FROM_CHUNK(s,c)\ (void)(((char*)(s))[0]=(char)((c)>>24), ((char*)(s))[1]=(char)((c)>>16),\ ((char*)(s))[2]=(char)((c)>>8), ((char*)(s))[3]=(char)((c))) /* Do the same but terminate with a null character. */ #define PNG_CSTRING_FROM_CHUNK(s,c)\ (void)(PNG_STRING_FROM_CHUNK(s,c), ((char*)(s))[4] = 0) /* Test on flag values as defined in the spec (section 5.4): */ #define PNG_CHUNK_ANCILLARY(c) (1 & ((c) >> 29)) #define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c)) #define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21)) #define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13)) #define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5)) /* Gamma values (new at libpng-1.5.4): */ #define PNG_GAMMA_MAC_OLD 151724 /* Assume '1.8' is really 2.2/1.45! */ #define PNG_GAMMA_MAC_INVERSE 65909 #define PNG_GAMMA_sRGB_INVERSE 45455 /* Almost everything below is C specific; the #defines above can be used in * non-C code (so long as it is C-preprocessed) the rest of this stuff cannot. */ #ifndef PNG_VERSION_INFO_ONLY #include "pngstruct.h" #include "pnginfo.h" /* Validate the include paths - the include path used to generate pnglibconf.h * must match that used in the build, or we must be using pnglibconf.h.prebuilt: */ #if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM # error ZLIB_VERNUM != PNG_ZLIB_VERNUM \ "-I (include path) error: see the notes in pngpriv.h" /* This means that when pnglibconf.h was built the copy of zlib.h that it * used is not the same as the one being used here. Because the build of * libpng makes decisions to use inflateInit2 and inflateReset2 based on the * zlib version number and because this affects handling of certain broken * PNG files the -I directives must match. * * The most likely explanation is that you passed a -I in CFLAGS, this will * not work; all the preprocessor directories and in particular all the -I * directives must be in CPPFLAGS. */ #endif /* This is used for 16 bit gamma tables -- only the top level pointers are * const; this could be changed: */ typedef const png_uint_16p * png_const_uint_16pp; /* Added to libpng-1.5.7: sRGB conversion tables */ #if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) #ifdef PNG_SIMPLIFIED_READ_SUPPORTED PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]); /* Convert from an sRGB encoded value 0..255 to a 16-bit linear value, * 0..65535. This table gives the closest 16-bit answers (no errors). */ #endif PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]); PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]); #define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\ ((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8)) /* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB * encoded value with maximum error 0.646365. Note that the input is not a * 16-bit value; it has been multiplied by 255! */ #endif /* PNG_SIMPLIFIED_READ/WRITE */ /* Inhibit C++ name-mangling for libpng functions but not for system calls. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Internal functions; these are not exported from a DLL however because they * are used within several of the C source files they have to be C extern. * * All of these functions must be declared with PNG_INTERNAL_FUNCTION. */ /* Zlib support */ #define PNG_UNEXPECTED_ZLIB_RETURN (-7) PNG_INTERNAL_FUNCTION(void, png_zstream_error,(png_structrp png_ptr, int ret), PNG_EMPTY); /* Used by the zlib handling functions to ensure that z_stream::msg is always * set before they return. */ #ifdef PNG_WRITE_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_free_buffer_list,(png_structrp png_ptr, png_compression_bufferp *list),PNG_EMPTY); /* Free the buffer list used by the compressed write code. */ #endif #if defined(PNG_FLOATING_POINT_SUPPORTED) && \ !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \ (defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \ defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \ (defined(PNG_sCAL_SUPPORTED) && \ defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)) PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr, double fp, png_const_charp text),PNG_EMPTY); #endif /* Check the user version string for compatibility, returns false if the version * numbers aren't compatible. */ PNG_INTERNAL_FUNCTION(int,png_user_version_check,(png_structrp png_ptr, png_const_charp user_png_ver),PNG_EMPTY); /* Internal base allocator - no messages, NULL on failure to allocate. This * does, however, call the application provided allocator and that could call * png_error (although that would be a bug in the application implementation.) */ PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED); #if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\ defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) /* Internal array allocator, outputs no error or warning messages on failure, * just returns NULL. */ PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_array,(png_const_structrp png_ptr, int nelements, size_t element_size),PNG_ALLOCATED); /* The same but an existing array is extended by add_elements. This function * also memsets the new elements to 0 and copies the old elements. The old * array is not freed or altered. */ PNG_INTERNAL_FUNCTION(png_voidp,png_realloc_array,(png_const_structrp png_ptr, png_const_voidp array, int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED); #endif /* text, sPLT or unknown chunks */ /* Magic to create a struct when there is no struct to call the user supplied * memory allocators. Because error handling has not been set up the memory * handlers can't safely call png_error, but this is an obscure and undocumented * restriction so libpng has to assume that the 'free' handler, at least, might * call png_error. */ PNG_INTERNAL_FUNCTION(png_structp,png_create_png_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED); /* Free memory from internal libpng struct */ PNG_INTERNAL_FUNCTION(void,png_destroy_png_struct,(png_structrp png_ptr), PNG_EMPTY); /* Free an allocated jmp_buf (always succeeds) */ PNG_INTERNAL_FUNCTION(void,png_free_jmpbuf,(png_structrp png_ptr),PNG_EMPTY); /* Function to allocate memory for zlib. PNGAPI is disallowed. */ PNG_INTERNAL_FUNCTION(voidpf,png_zalloc,(voidpf png_ptr, uInt items, uInt size), PNG_ALLOCATED); /* Function to free memory for zlib. PNGAPI is disallowed. */ PNG_INTERNAL_FUNCTION(void,png_zfree,(voidpf png_ptr, voidpf ptr),PNG_EMPTY); /* Next four functions are used internally as callbacks. PNGCBAPI is required * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3, changed to * PNGCBAPI at 1.5.0 */ PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_read_data,(png_structp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_push_fill_buffer,(png_structp png_ptr, png_bytep buffer, png_size_t length),PNG_EMPTY); #endif PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_write_data,(png_structp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); #ifdef PNG_WRITE_FLUSH_SUPPORTED # ifdef PNG_STDIO_SUPPORTED PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_flush,(png_structp png_ptr), PNG_EMPTY); # endif #endif /* Reset the CRC variable */ PNG_INTERNAL_FUNCTION(void,png_reset_crc,(png_structrp png_ptr),PNG_EMPTY); /* Write the "data" buffer to whatever output you are using */ PNG_INTERNAL_FUNCTION(void,png_write_data,(png_structrp png_ptr, png_const_bytep data, png_size_t length),PNG_EMPTY); /* Read and check the PNG file signature */ PNG_INTERNAL_FUNCTION(void,png_read_sig,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); /* Read the chunk header (length + type name) */ PNG_INTERNAL_FUNCTION(png_uint_32,png_read_chunk_header,(png_structrp png_ptr), PNG_EMPTY); /* Read data from whatever input you are using into the "data" buffer */ PNG_INTERNAL_FUNCTION(void,png_read_data,(png_structrp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); /* Read bytes into buf, and update png_ptr->crc */ PNG_INTERNAL_FUNCTION(void,png_crc_read,(png_structrp png_ptr, png_bytep buf, png_uint_32 length),PNG_EMPTY); /* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ PNG_INTERNAL_FUNCTION(int,png_crc_finish,(png_structrp png_ptr, png_uint_32 skip),PNG_EMPTY); /* Read the CRC from the file and compare it to the libpng calculated CRC */ PNG_INTERNAL_FUNCTION(int,png_crc_error,(png_structrp png_ptr),PNG_EMPTY); /* Calculate the CRC over a section of data. Note that we are only * passing a maximum of 64K on systems that have this as a memory limit, * since this is the maximum buffer size we can specify. */ PNG_INTERNAL_FUNCTION(void,png_calculate_crc,(png_structrp png_ptr, png_const_bytep ptr, png_size_t length),PNG_EMPTY); #ifdef PNG_WRITE_FLUSH_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_flush,(png_structrp png_ptr),PNG_EMPTY); #endif /* Write various chunks */ /* Write the IHDR chunk, and update the png_struct with the necessary * information. */ PNG_INTERNAL_FUNCTION(void,png_write_IHDR,(png_structrp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int compression_method, int filter_method, int interlace_method),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_write_PLTE,(png_structrp png_ptr, png_const_colorp palette, png_uint_32 num_pal),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_compress_IDAT,(png_structrp png_ptr, png_const_bytep row_data, png_alloc_size_t row_data_length, int flush), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_write_IEND,(png_structrp png_ptr),PNG_EMPTY); #ifdef PNG_WRITE_gAMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_gAMA_fixed,(png_structrp png_ptr, png_fixed_point file_gamma),PNG_EMPTY); #endif #ifdef PNG_WRITE_sBIT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sBIT,(png_structrp png_ptr, png_const_color_8p sbit, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_cHRM_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr, const png_xy *xy), PNG_EMPTY); /* The xy value must have been previously validated */ #endif #ifdef PNG_WRITE_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr, int intent),PNG_EMPTY); #endif #ifdef PNG_WRITE_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr, png_const_charp name, png_const_bytep profile), PNG_EMPTY); /* The profile must have been previously validated for correctness, the * length comes from the first four bytes. Only the base, deflate, * compression is supported. */ #endif #ifdef PNG_WRITE_sPLT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sPLT,(png_structrp png_ptr, png_const_sPLT_tp palette),PNG_EMPTY); #endif #ifdef PNG_WRITE_tRNS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tRNS,(png_structrp png_ptr, png_const_bytep trans, png_const_color_16p values, int number, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_bKGD_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_bKGD,(png_structrp png_ptr, png_const_color_16p values, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_hIST_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_hIST,(png_structrp png_ptr, png_const_uint_16p hist, int num_hist),PNG_EMPTY); #endif /* Chunks that have keywords */ #ifdef PNG_WRITE_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len),PNG_EMPTY); #endif #ifdef PNG_WRITE_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len, int compression),PNG_EMPTY); #endif #ifdef PNG_WRITE_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_iTXt,(png_structrp png_ptr, int compression, png_const_charp key, png_const_charp lang, png_const_charp lang_key, png_const_charp text),PNG_EMPTY); #endif #ifdef PNG_TEXT_SUPPORTED /* Added at version 1.0.14 and 1.2.4 */ PNG_INTERNAL_FUNCTION(int,png_set_text_2,(png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text),PNG_EMPTY); #endif #ifdef PNG_WRITE_oFFs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_oFFs,(png_structrp png_ptr, png_int_32 x_offset, png_int_32 y_offset, int unit_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_pCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_pCAL,(png_structrp png_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params),PNG_EMPTY); #endif #ifdef PNG_WRITE_pHYs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_pHYs,(png_structrp png_ptr, png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, int unit_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_tIME_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tIME,(png_structrp png_ptr, png_const_timep mod_time),PNG_EMPTY); #endif #ifdef PNG_WRITE_sCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sCAL_s,(png_structrp png_ptr, int unit, png_const_charp width, png_const_charp height),PNG_EMPTY); #endif /* Called when finished processing a row of data */ PNG_INTERNAL_FUNCTION(void,png_write_finish_row,(png_structrp png_ptr), PNG_EMPTY); /* Internal use only. Called before first row of data */ PNG_INTERNAL_FUNCTION(void,png_write_start_row,(png_structrp png_ptr), PNG_EMPTY); /* Combine a row of data, dealing with alpha, etc. if requested. 'row' is an * array of png_ptr->width pixels. If the image is not interlaced or this * is the final pass this just does a memcpy, otherwise the "display" flag * is used to determine whether to copy pixels that are not in the current pass. * * Because 'png_do_read_interlace' (below) replicates pixels this allows this * function to achieve the documented 'blocky' appearance during interlaced read * if display is 1 and the 'sparkle' appearance, where existing pixels in 'row' * are not changed if they are not in the current pass, when display is 0. * * 'display' must be 0 or 1, otherwise the memcpy will be done regardless. * * The API always reads from the png_struct row buffer and always assumes that * it is full width (png_do_read_interlace has already been called.) * * This function is only ever used to write to row buffers provided by the * caller of the relevant libpng API and the row must have already been * transformed by the read transformations. * * The PNG_USE_COMPILE_TIME_MASKS option causes generation of pre-computed * bitmasks for use within the code, otherwise runtime generated masks are used. * The default is compile time masks. */ #ifndef PNG_USE_COMPILE_TIME_MASKS # define PNG_USE_COMPILE_TIME_MASKS 1 #endif PNG_INTERNAL_FUNCTION(void,png_combine_row,(png_const_structrp png_ptr, png_bytep row, int display),PNG_EMPTY); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Expand an interlaced row: the 'row_info' describes the pass data that has * been read in and must correspond to the pixels in 'row', the pixels are * expanded (moved apart) in 'row' to match the final layout, when doing this * the pixels are *replicated* to the intervening space. This is essential for * the correct operation of png_combine_row, above. */ PNG_INTERNAL_FUNCTION(void,png_do_read_interlace,(png_row_infop row_info, png_bytep row, int pass, png_uint_32 transformations),PNG_EMPTY); #endif /* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ #ifdef PNG_WRITE_INTERLACING_SUPPORTED /* Grab pixels out of a row for an interlaced pass */ PNG_INTERNAL_FUNCTION(void,png_do_write_interlace,(png_row_infop row_info, png_bytep row, int pass),PNG_EMPTY); #endif /* Unfilter a row: check the filter value before calling this, there is no point * calling it for PNG_FILTER_VALUE_NONE. */ PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); /* Choose the best filter to use and filter the row data */ PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr, png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY); /* Read 'avail_out' bytes of data from the IDAT stream. If the output buffer * is NULL the function checks, instead, for the end of the stream. In this * case a benign error will be issued if the stream end is not found or if * extra data has to be consumed. */ PNG_INTERNAL_FUNCTION(void,png_read_finish_IDAT,(png_structrp png_ptr), PNG_EMPTY); /* This cleans up when the IDAT LZ stream does not end when the last image * byte is read; there is still some pending input. */ PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr), PNG_EMPTY); /* Finish a row while reading, dealing with interlacing passes, etc. */ #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ /* Initialize the row buffers, etc. */ PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY); #ifdef PNG_READ_TRANSFORMS_SUPPORTED /* Optional call to update the users info structure */ PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); #endif /* Shared transform functions, defined in pngtran.c */ #if defined(PNG_WRITE_FILLER_SUPPORTED) || \ defined(PNG_READ_STRIP_ALPHA_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info, png_bytep row, int at_start),PNG_EMPTY); #endif #ifdef PNG_16BIT_SUPPORTED #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_swap,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_packswap,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif /* The following decodes the appropriate chunks, and does error correction, * then calls the appropriate callback for the chunk if it is valid. */ /* Decode the IHDR chunk */ PNG_INTERNAL_FUNCTION(void,png_handle_IHDR,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_PLTE,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_IEND,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #ifdef PNG_READ_bKGD_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_bKGD,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_cHRM_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_gAMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_hIST_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_hIST,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_iCCP,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif /* PNG_READ_iCCP_SUPPORTED */ #ifdef PNG_READ_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_iTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_oFFs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_oFFs,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_pCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_pCAL,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_pHYs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_pHYs,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sBIT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sBIT,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sCAL,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sPLT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sPLT,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif /* PNG_READ_sPLT_SUPPORTED */ #ifdef PNG_READ_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sRGB,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tEXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tIME_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tIME,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tRNS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tRNS,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY); /* This is the function that gets called for unknown chunks. The 'keep' * argument is either non-zero for a known chunk that has been set to be * handled as unknown or zero for an unknown chunk. By default the function * just skips the chunk or errors out if it is critical. */ #if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\ defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) PNG_INTERNAL_FUNCTION(int,png_chunk_unknown_handling, (png_const_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY); /* Exactly as the API png_handle_as_unknown() except that the argument is a * 32-bit chunk name, not a string. */ #endif /* READ_UNKNOWN_CHUNKS || HANDLE_AS_UNKNOWN */ /* Handle the transformations for reading and writing */ #ifdef PNG_READ_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_do_read_transformations,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_do_write_transformations,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #ifdef PNG_READ_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_init_read_transformations,(png_structrp png_ptr), PNG_EMPTY); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_read_chunk,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_sig,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_crc_skip,(png_structrp png_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_crc_finish,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr, png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_IDAT,(png_structrp png_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_process_IDAT_data,(png_structrp png_ptr, png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_handle_unknown,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr, png_bytep row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr), PNG_EMPTY); # ifdef PNG_READ_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_tEXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_tEXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif # ifdef PNG_READ_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_zTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_zTXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif # ifdef PNG_READ_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_iTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ /* Added at libpng version 1.6.0 */ #ifdef PNG_GAMMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_fixed_point gAMA), PNG_EMPTY); /* Set the colorspace gamma with a value provided by the application or by * the gAMA chunk on read. The value will override anything set by an ICC * profile. */ PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); /* Synchronize the info 'valid' flags with the colorspace */ PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); /* Copy the png_struct colorspace to the info_struct and call the above to * synchronize the flags. Checks for NULL info_ptr and does nothing. */ #endif /* Added at libpng version 1.4.0 */ #ifdef PNG_COLORSPACE_SUPPORTED /* These internal functions are for maintaining the colorspace structure within * a png_info or png_struct (or, indeed, both). */ PNG_INTERNAL_FUNCTION(int,png_colorspace_set_chromaticities, (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy, int preferred), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_colorspace_set_endpoints, (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_XYZ *XYZ, int preferred), PNG_EMPTY); #ifdef PNG_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(int,png_colorspace_set_sRGB,(png_const_structrp png_ptr, png_colorspacerp colorspace, int intent), PNG_EMPTY); /* This does set the colorspace gAMA and cHRM values too, but doesn't set the * flags to write them, if it returns false there was a problem and an error * message has already been output (but the colorspace may still need to be * synced to record the invalid flag). */ #endif /* sRGB */ #ifdef PNG_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, int color_type), PNG_EMPTY); /* The 'name' is used for information only */ /* Routines for checking parts of an ICC profile. */ PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile /* first 132 bytes only */, int color_type), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_icc_check_tag_table,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile /* header plus whole tag table */), PNG_EMPTY); #ifdef PNG_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_icc_set_sRGB,( png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_bytep profile, uLong adler), PNG_EMPTY); /* 'adler' is the Adler32 checksum of the uncompressed profile data. It may * be zero to indicate that it is not available. It is used, if provided, * as a fast check on the profile when checking to see if it is sRGB. */ #endif #endif /* iCCP */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_colorspace_set_rgb_coefficients, (png_structrp png_ptr), PNG_EMPTY); /* Set the rgb_to_gray coefficients from the colorspace Y values */ #endif /* READ_RGB_TO_GRAY */ #endif /* COLORSPACE */ /* Added at libpng version 1.4.0 */ PNG_INTERNAL_FUNCTION(void,png_check_IHDR,(png_const_structrp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type),PNG_EMPTY); /* Added at libpng version 1.5.10 */ #if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_check_palette_indexes, (png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN); #endif /* Puts 'string' into 'buffer' at buffer[pos], taking care never to overwrite * the end. Always leaves the buffer nul terminated. Never errors out (and * there is no error code.) */ PNG_INTERNAL_FUNCTION(size_t,png_safecat,(png_charp buffer, size_t bufsize, size_t pos, png_const_charp string),PNG_EMPTY); /* Various internal functions to handle formatted warning messages, currently * only implemented for warnings. */ #if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_TIME_RFC1123_SUPPORTED) /* Utility to dump an unsigned value into a buffer, given a start pointer and * and end pointer (which should point just *beyond* the end of the buffer!) * Returns the pointer to the start of the formatted string. This utility only * does unsigned values. */ PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start, png_charp end, int format, png_alloc_size_t number),PNG_EMPTY); /* Convenience macro that takes an array: */ #define PNG_FORMAT_NUMBER(buffer,format,number) \ png_format_number(buffer, buffer + (sizeof buffer), format, number) /* Suggested size for a number buffer (enough for 64 bits and a sign!) */ #define PNG_NUMBER_BUFFER_SIZE 24 /* These are the integer formats currently supported, the name is formed from * the standard printf(3) format string. */ #define PNG_NUMBER_FORMAT_u 1 /* chose unsigned API! */ #define PNG_NUMBER_FORMAT_02u 2 #define PNG_NUMBER_FORMAT_d 1 /* chose signed API! */ #define PNG_NUMBER_FORMAT_02d 2 #define PNG_NUMBER_FORMAT_x 3 #define PNG_NUMBER_FORMAT_02x 4 #define PNG_NUMBER_FORMAT_fixed 5 /* choose the signed API */ #endif #ifdef PNG_WARNINGS_SUPPORTED /* New defines and members adding in libpng-1.5.4 */ # define PNG_WARNING_PARAMETER_SIZE 32 # define PNG_WARNING_PARAMETER_COUNT 8 /* Maximum 9; see pngerror.c */ /* An l-value of this type has to be passed to the APIs below to cache the * values of the parameters to a formatted warning message. */ typedef char png_warning_parameters[PNG_WARNING_PARAMETER_COUNT][ PNG_WARNING_PARAMETER_SIZE]; PNG_INTERNAL_FUNCTION(void,png_warning_parameter,(png_warning_parameters p, int number, png_const_charp string),PNG_EMPTY); /* Parameters are limited in size to PNG_WARNING_PARAMETER_SIZE characters, * including the trailing '\0'. */ PNG_INTERNAL_FUNCTION(void,png_warning_parameter_unsigned, (png_warning_parameters p, int number, int format, png_alloc_size_t value), PNG_EMPTY); /* Use png_alloc_size_t because it is an unsigned type as big as any we * need to output. Use the following for a signed value. */ PNG_INTERNAL_FUNCTION(void,png_warning_parameter_signed, (png_warning_parameters p, int number, int format, png_int_32 value), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_formatted_warning,(png_const_structrp png_ptr, png_warning_parameters p, png_const_charp message),PNG_EMPTY); /* 'message' follows the X/Open approach of using @1, @2 to insert * parameters previously supplied using the above functions. Errors in * specifying the parameters will simply result in garbage substitutions. */ #endif #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Application errors (new in 1.6); use these functions (declared below) for * errors in the parameters or order of API function calls on read. The * 'warning' should be used for an error that can be handled completely; the * 'error' for one which can be handled safely but which may lose application * information or settings. * * By default these both result in a png_error call prior to release, while in a * released version the 'warning' is just a warning. However if the application * explicitly disables benign errors (explicitly permitting the code to lose * information) they both turn into warnings. * * If benign errors aren't supported they end up as the corresponding base call * (png_warning or png_error.) */ PNG_INTERNAL_FUNCTION(void,png_app_warning,(png_const_structrp png_ptr, png_const_charp message),PNG_EMPTY); /* The application provided invalid parameters to an API function or called * an API function at the wrong time, libpng can completely recover. */ PNG_INTERNAL_FUNCTION(void,png_app_error,(png_const_structrp png_ptr, png_const_charp message),PNG_EMPTY); /* As above but libpng will ignore the call, or attempt some other partial * recovery from the error. */ #else # define png_app_warning(pp,s) png_warning(pp,s) # define png_app_error(pp,s) png_error(pp,s) #endif PNG_INTERNAL_FUNCTION(void,png_chunk_report,(png_const_structrp png_ptr, png_const_charp message, int error),PNG_EMPTY); /* Report a recoverable issue in chunk data. On read this is used to report * a problem found while reading a particular chunk and the * png_chunk_benign_error or png_chunk_warning function is used as * appropriate. On write this is used to report an error that comes from * data set via an application call to a png_set_ API and png_app_error or * png_app_warning is used as appropriate. * * The 'error' parameter must have one of the following values: */ #define PNG_CHUNK_WARNING 0 /* never an error */ #define PNG_CHUNK_WRITE_ERROR 1 /* an error only on write */ #define PNG_CHUNK_ERROR 2 /* always an error */ /* ASCII to FP interfaces, currently only implemented if sCAL * support is required. */ #if defined(PNG_sCAL_SUPPORTED) /* MAX_DIGITS is actually the maximum number of characters in an sCAL * width or height, derived from the precision (number of significant * digits - a build time settable option) and assumptions about the * maximum ridiculous exponent. */ #define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/) #ifdef PNG_FLOATING_POINT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_ascii_from_fp,(png_const_structrp png_ptr, png_charp ascii, png_size_t size, double fp, unsigned int precision), PNG_EMPTY); #endif /* FLOATING_POINT */ #ifdef PNG_FIXED_POINT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr, png_charp ascii, png_size_t size, png_fixed_point fp),PNG_EMPTY); #endif /* FIXED_POINT */ #endif /* sCAL */ #if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) /* An internal API to validate the format of a floating point number. * The result is the index of the next character. If the number is * not valid it will be the index of a character in the supposed number. * * The format of a number is defined in the PNG extensions specification * and this API is strictly conformant to that spec, not anyone elses! * * The format as a regular expression is: * * [+-]?[0-9]+.?([Ee][+-]?[0-9]+)? * * or: * * [+-]?.[0-9]+(.[0-9]+)?([Ee][+-]?[0-9]+)? * * The complexity is that either integer or fraction must be present and the * fraction is permitted to have no digits only if the integer is present. * * NOTE: The dangling E problem. * There is a PNG valid floating point number in the following: * * PNG floating point numbers are not greedy. * * Working this out requires *TWO* character lookahead (because of the * sign), the parser does not do this - it will fail at the 'r' - this * doesn't matter for PNG sCAL chunk values, but it requires more care * if the value were ever to be embedded in something more complex. Use * ANSI-C strtod if you need the lookahead. */ /* State table for the parser. */ #define PNG_FP_INTEGER 0 /* before or in integer */ #define PNG_FP_FRACTION 1 /* before or in fraction */ #define PNG_FP_EXPONENT 2 /* before or in exponent */ #define PNG_FP_STATE 3 /* mask for the above */ #define PNG_FP_SAW_SIGN 4 /* Saw +/- in current state */ #define PNG_FP_SAW_DIGIT 8 /* Saw a digit in current state */ #define PNG_FP_SAW_DOT 16 /* Saw a dot in current state */ #define PNG_FP_SAW_E 32 /* Saw an E (or e) in current state */ #define PNG_FP_SAW_ANY 60 /* Saw any of the above 4 */ /* These three values don't affect the parser. They are set but not used. */ #define PNG_FP_WAS_VALID 64 /* Preceding substring is a valid fp number */ #define PNG_FP_NEGATIVE 128 /* A negative number, including "-0" */ #define PNG_FP_NONZERO 256 /* A non-zero value */ #define PNG_FP_STICKY 448 /* The above three flags */ /* This is available for the caller to store in 'state' if required. Do not * call the parser after setting it (the parser sometimes clears it.) */ #define PNG_FP_INVALID 512 /* Available for callers as a distinct value */ /* Result codes for the parser (boolean - true meants ok, false means * not ok yet.) */ #define PNG_FP_MAYBE 0 /* The number may be valid in the future */ #define PNG_FP_OK 1 /* The number is valid */ /* Tests on the sticky non-zero and negative flags. To pass these checks * the state must also indicate that the whole number is valid - this is * achieved by testing PNG_FP_SAW_DIGIT (see the implementation for why this * is equivalent to PNG_FP_OK above.) */ #define PNG_FP_NZ_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NEGATIVE | PNG_FP_NONZERO) /* NZ_MASK: the string is valid and a non-zero negative value */ #define PNG_FP_Z_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NONZERO) /* Z MASK: the string is valid and a non-zero value. */ /* PNG_FP_SAW_DIGIT: the string is valid. */ #define PNG_FP_IS_ZERO(state) (((state) & PNG_FP_Z_MASK) == PNG_FP_SAW_DIGIT) #define PNG_FP_IS_POSITIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_Z_MASK) #define PNG_FP_IS_NEGATIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_NZ_MASK) /* The actual parser. This can be called repeatedly. It updates * the index into the string and the state variable (which must * be initialized to 0). It returns a result code, as above. There * is no point calling the parser any more if it fails to advance to * the end of the string - it is stuck on an invalid character (or * terminated by '\0'). * * Note that the pointer will consume an E or even an E+ and then leave * a 'maybe' state even though a preceding integer.fraction is valid. * The PNG_FP_WAS_VALID flag indicates that a preceding substring was * a valid number. It's possible to recover from this by calling * the parser again (from the start, with state 0) but with a string * that omits the last character (i.e. set the size to the index of * the problem character.) This has not been tested within libpng. */ PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string, png_size_t size, int *statep, png_size_tp whereami),PNG_EMPTY); /* This is the same but it checks a complete string and returns true * only if it just contains a floating point number. As of 1.5.4 this * function also returns the state at the end of parsing the number if * it was valid (otherwise it returns 0.) This can be used for testing * for negative or zero values using the sticky flag. */ PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string, png_size_t size),PNG_EMPTY); #endif /* pCAL || sCAL */ #if defined(PNG_GAMMA_SUPPORTED) ||\ defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED) /* Added at libpng version 1.5.0 */ /* This is a utility to provide a*times/div (rounded) and indicate * if there is an overflow. The result is a boolean - false (0) * for overflow, true (1) if no overflow, in which case *res * holds the result. */ PNG_INTERNAL_FUNCTION(int,png_muldiv,(png_fixed_point_p res, png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY); #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED) /* Same deal, but issue a warning on overflow and return 0. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_muldiv_warn, (png_const_structrp png_ptr, png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY); #endif #ifdef PNG_GAMMA_SUPPORTED /* Calculate a reciprocal - used for gamma values. This returns * 0 if the argument is 0 in order to maintain an undefined value; * there are no warnings. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal,(png_fixed_point a), PNG_EMPTY); #ifdef PNG_READ_GAMMA_SUPPORTED /* The same but gives a reciprocal of the product of two fixed point * values. Accuracy is suitable for gamma calculations but this is * not exact - use png_muldiv for that. Only required at present on read. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal2,(png_fixed_point a, png_fixed_point b),PNG_EMPTY); #endif /* Return true if the gamma value is significantly different from 1.0 */ PNG_INTERNAL_FUNCTION(int,png_gamma_significant,(png_fixed_point gamma_value), PNG_EMPTY); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* Internal fixed point gamma correction. These APIs are called as * required to convert single values - they don't need to be fast, * they are not used when processing image pixel values. * * While the input is an 'unsigned' value it must actually be the * correct bit value - 0..255 or 0..65535 as required. */ PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_correct,(png_structrp png_ptr, unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_16bit_correct,(unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(png_byte,png_gamma_8bit_correct,(unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_destroy_gamma_table,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_build_gamma_table,(png_structrp png_ptr, int bit_depth),PNG_EMPTY); #endif /* SIMPLIFIED READ/WRITE SUPPORT */ #if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) /* The internal structure that png_image::opaque points to. */ typedef struct png_control { png_structp png_ptr; png_infop info_ptr; png_voidp error_buf; /* Always a jmp_buf at present. */ png_const_bytep memory; /* Memory buffer. */ png_size_t size; /* Size of the memory buffer. */ unsigned int for_write :1; /* Otherwise it is a read structure */ unsigned int owned_file :1; /* We own the file in io_ptr */ } png_control; /* Return the pointer to the jmp_buf from a png_control: necessary because C * does not reveal the type of the elements of jmp_buf. */ #ifdef __cplusplus # define png_control_jmp_buf(pc) (((jmp_buf*)((pc)->error_buf))[0]) #else # define png_control_jmp_buf(pc) ((pc)->error_buf) #endif /* Utility to safely execute a piece of libpng code catching and logging any * errors that might occur. Returns true on success, false on failure (either * of the function or as a result of a png_error.) */ PNG_INTERNAL_CALLBACK(void,png_safe_error,(png_structp png_ptr, png_const_charp error_message),PNG_NORETURN); #ifdef PNG_WARNINGS_SUPPORTED PNG_INTERNAL_CALLBACK(void,png_safe_warning,(png_structp png_ptr, png_const_charp warning_message),PNG_EMPTY); #else # define png_safe_warning 0/*dummy argument*/ #endif PNG_INTERNAL_FUNCTION(int,png_safe_execute,(png_imagep image, int (*function)(png_voidp), png_voidp arg),PNG_EMPTY); /* Utility to log an error; this also cleans up the png_image; the function * always returns 0 (false). */ PNG_INTERNAL_FUNCTION(int,png_image_error,(png_imagep image, png_const_charp error_message),PNG_EMPTY); #ifndef PNG_SIMPLIFIED_READ_SUPPORTED /* png_image_free is used by the write code but not exported */ PNG_INTERNAL_FUNCTION(void, png_image_free, (png_imagep image), PNG_EMPTY); #endif /* !SIMPLIFIED_READ */ #endif /* SIMPLIFIED READ/WRITE */ /* These are initialization functions for hardware specific PNG filter * optimizations; list these here then select the appropriate one at compile * time using the macro PNG_FILTER_OPTIMIZATIONS. If the macro is not defined * the generic code is used. */ #ifdef PNG_FILTER_OPTIMIZATIONS PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); /* Just declare the optimization that will be used */ #else /* List *all* the possible optimizations here - this branch is required if * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing. */ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); #endif /* Maintainer: Put new private prototypes here ^ */ #include "pngdebug.h" #ifdef __cplusplus } #endif #endif /* PNG_VERSION_INFO_ONLY */ #endif /* PNGPRIV_H */ ================================================ FILE: Libraries/Core/Android/Headers/png/pngstruct.h ================================================ /* pngstruct.h - header file for PNG reference library * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.1 [March 28, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* The structure that holds the information to read and write PNG files. * The only people who need to care about what is inside of this are the * people who will be modifying the library for their own special needs. * It should NOT be accessed directly by an application. */ #ifndef PNGSTRUCT_H #define PNGSTRUCT_H /* zlib.h defines the structure z_stream, an instance of which is included * in this structure and is required for decompressing the LZ compressed * data in PNG files. */ #ifndef ZLIB_CONST /* We must ensure that zlib uses 'const' in declarations. */ # define ZLIB_CONST #endif #include "zlib.h" #ifdef const /* zlib.h sometimes #defines const to nothing, undo this. */ # undef const #endif /* zlib.h has mediocre z_const use before 1.2.6, this stuff is for compatibility * with older builds. */ #if ZLIB_VERNUM < 0x1260 # define PNGZ_MSG_CAST(s) png_constcast(char*,s) # define PNGZ_INPUT_CAST(b) png_constcast(png_bytep,b) #else # define PNGZ_MSG_CAST(s) (s) # define PNGZ_INPUT_CAST(b) (b) #endif /* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib * can handle at once. This type need be no larger than 16 bits (so maximum of * 65535), this define allows us to discover how big it is, but limited by the * maximuum for png_size_t. The value can be overriden in a library build * (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably * lower value (e.g. 255 works). A lower value may help memory usage (slightly) * and may even improve performance on some systems (and degrade it on others.) */ #ifndef ZLIB_IO_MAX # define ZLIB_IO_MAX ((uInt)-1) #endif #ifdef PNG_WRITE_SUPPORTED /* The type of a compression buffer list used by the write code. */ typedef struct png_compression_buffer { struct png_compression_buffer *next; png_byte output[1]; /* actually zbuf_size */ } png_compression_buffer, *png_compression_bufferp; #define PNG_COMPRESSION_BUFFER_SIZE(pp)\ (offsetof(png_compression_buffer, output) + (pp)->zbuffer_size) #endif /* Colorspace support; structures used in png_struct, png_info and in internal * functions to hold and communicate information about the color space. * * PNG_COLORSPACE_SUPPORTED is only required if the application will perform * colorspace corrections, otherwise all the colorspace information can be * skipped and the size of libpng can be reduced (significantly) by compiling * out the colorspace support. */ #ifdef PNG_COLORSPACE_SUPPORTED /* The chromaticities of the red, green and blue colorants and the chromaticity * of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)). */ typedef struct png_xy { png_fixed_point redx, redy; png_fixed_point greenx, greeny; png_fixed_point bluex, bluey; png_fixed_point whitex, whitey; } png_xy; /* The same data as above but encoded as CIE XYZ values. When this data comes * from chromaticities the sum of the Y values is assumed to be 1.0 */ typedef struct png_XYZ { png_fixed_point red_X, red_Y, red_Z; png_fixed_point green_X, green_Y, green_Z; png_fixed_point blue_X, blue_Y, blue_Z; } png_XYZ; #endif /* COLORSPACE */ #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) /* A colorspace is all the above plus, potentially, profile information, * however at present libpng does not use the profile internally so it is only * stored in the png_info struct (if iCCP is supported.) The rendering intent * is retained here and is checked. * * The file gamma encoding information is also stored here and gamma correction * is done by libpng, whereas color correction must currently be done by the * application. */ typedef struct png_colorspace { #ifdef PNG_GAMMA_SUPPORTED png_fixed_point gamma; /* File gamma */ #endif #ifdef PNG_COLORSPACE_SUPPORTED png_xy end_points_xy; /* End points as chromaticities */ png_XYZ end_points_XYZ; /* End points as CIE XYZ colorant values */ png_uint_16 rendering_intent; /* Rendering intent of a profile */ #endif /* Flags are always defined to simplify the code. */ png_uint_16 flags; /* As defined below */ } png_colorspace, * PNG_RESTRICT png_colorspacerp; typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp; /* General flags for the 'flags' field */ #define PNG_COLORSPACE_HAVE_GAMMA 0x0001 #define PNG_COLORSPACE_HAVE_ENDPOINTS 0x0002 #define PNG_COLORSPACE_HAVE_INTENT 0x0004 #define PNG_COLORSPACE_FROM_gAMA 0x0008 #define PNG_COLORSPACE_FROM_cHRM 0x0010 #define PNG_COLORSPACE_FROM_sRGB 0x0020 #define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040 #define PNG_COLORSPACE_MATCHES_sRGB 0x0080 /* exact match on profile */ #define PNG_COLORSPACE_INVALID 0x8000 #define PNG_COLORSPACE_CANCEL(flags) (0xffff ^ (flags)) #endif /* COLORSPACE || GAMMA */ struct png_struct_def { #ifdef PNG_SETJMP_SUPPORTED jmp_buf jmp_buf_local; /* New name in 1.6.0 for jmp_buf in png_struct */ png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */ jmp_buf *jmp_buf_ptr; /* passed to longjmp_fn */ size_t jmp_buf_size; /* size of the above, if allocated */ #endif png_error_ptr error_fn; /* function for printing errors and aborting */ #ifdef PNG_WARNINGS_SUPPORTED png_error_ptr warning_fn; /* function for printing warnings */ #endif png_voidp error_ptr; /* user supplied struct for error functions */ png_rw_ptr write_data_fn; /* function for writing output data */ png_rw_ptr read_data_fn; /* function for reading input data */ png_voidp io_ptr; /* ptr to application struct for I/O functions */ #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED png_user_transform_ptr read_user_transform_fn; /* user read transform */ #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED png_user_transform_ptr write_user_transform_fn; /* user write transform */ #endif /* These were added in libpng-1.0.2 */ #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) png_voidp user_transform_ptr; /* user supplied struct for user transform */ png_byte user_transform_depth; /* bit depth of user transformed pixels */ png_byte user_transform_channels; /* channels in user transformed pixels */ #endif #endif png_uint_32 mode; /* tells us where we are in the PNG file */ png_uint_32 flags; /* flags indicating various things to libpng */ png_uint_32 transformations; /* which transformations to perform */ png_uint_32 zowner; /* ID (chunk type) of zstream owner, 0 if none */ z_stream zstream; /* decompression structure */ #ifdef PNG_WRITE_SUPPORTED png_compression_bufferp zbuffer_list; /* Created on demand during write */ uInt zbuffer_size; /* size of the actual buffer */ int zlib_level; /* holds zlib compression level */ int zlib_method; /* holds zlib compression method */ int zlib_window_bits; /* holds zlib compression window bits */ int zlib_mem_level; /* holds zlib compression memory level */ int zlib_strategy; /* holds zlib compression strategy */ #endif /* Added at libpng 1.5.4 */ #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED int zlib_text_level; /* holds zlib compression level */ int zlib_text_method; /* holds zlib compression method */ int zlib_text_window_bits; /* holds zlib compression window bits */ int zlib_text_mem_level; /* holds zlib compression memory level */ int zlib_text_strategy; /* holds zlib compression strategy */ #endif /* End of material added at libpng 1.5.4 */ /* Added at libpng 1.6.0 */ #ifdef PNG_WRITE_SUPPORTED int zlib_set_level; /* Actual values set into the zstream on write */ int zlib_set_method; int zlib_set_window_bits; int zlib_set_mem_level; int zlib_set_strategy; #endif png_uint_32 width; /* width of image in pixels */ png_uint_32 height; /* height of image in pixels */ png_uint_32 num_rows; /* number of rows in current pass */ png_uint_32 usr_width; /* width of row at start of write */ png_size_t rowbytes; /* size of row in bytes */ png_uint_32 iwidth; /* width of current interlaced row in pixels */ png_uint_32 row_number; /* current row in interlace pass */ png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */ png_bytep prev_row; /* buffer to save previous (unfiltered) row. * This is a pointer into big_prev_row */ png_bytep row_buf; /* buffer to save current (unfiltered) row. * This is a pointer into big_row_buf */ #ifdef PNG_WRITE_SUPPORTED png_bytep sub_row; /* buffer to save "sub" row when filtering */ png_bytep up_row; /* buffer to save "up" row when filtering */ png_bytep avg_row; /* buffer to save "avg" row when filtering */ png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ #endif png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */ png_uint_32 idat_size; /* current IDAT size for read */ png_uint_32 crc; /* current chunk CRC value */ png_colorp palette; /* palette from the input file */ png_uint_16 num_palette; /* number of color entries in palette */ /* Added at libpng-1.5.10 */ #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED int num_palette_max; /* maximum palette index found in IDAT */ #endif png_uint_16 num_trans; /* number of transparency values */ png_byte compression; /* file compression type (always 0) */ png_byte filter; /* file filter type (always 0) */ png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ png_byte pass; /* current interlace pass (0 - 6) */ png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ png_byte color_type; /* color type of file */ png_byte bit_depth; /* bit depth of file */ png_byte usr_bit_depth; /* bit depth of users row: write only */ png_byte pixel_depth; /* number of bits per pixel */ png_byte channels; /* number of channels in file */ #ifdef PNG_WRITE_SUPPORTED png_byte usr_channels; /* channels at start of write: write only */ #endif png_byte sig_bytes; /* magic bytes read/written from start of file */ png_byte maximum_pixel_depth; /* pixel depth used for the row buffers */ png_byte transformed_pixel_depth; /* pixel depth after read/write transforms */ #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) png_uint_16 filler; /* filler bytes for pixel expansion */ #endif #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ defined(PNG_READ_ALPHA_MODE_SUPPORTED) png_byte background_gamma_type; png_fixed_point background_gamma; png_color_16 background; /* background color in screen gamma space */ #ifdef PNG_READ_GAMMA_SUPPORTED png_color_16 background_1; /* background normalized to gamma 1.0 */ #endif #endif /* PNG_bKGD_SUPPORTED */ #ifdef PNG_WRITE_FLUSH_SUPPORTED png_flush_ptr output_flush_fn; /* Function for flushing output */ png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ png_uint_32 flush_rows; /* number of rows written since last flush */ #endif #ifdef PNG_READ_GAMMA_SUPPORTED int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */ png_bytep gamma_table; /* gamma table for 8-bit depth files */ png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) png_bytep gamma_from_1; /* converts from 1.0 to screen */ png_bytep gamma_to_1; /* converts from file to 1.0 */ png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) png_color_8 sig_bit; /* significant bits in each available channel */ #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) png_color_8 shift; /* shift for significant bit tranformation */ #endif #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) png_bytep trans_alpha; /* alpha values for paletted files */ png_color_16 trans_color; /* transparent color for non-paletted files */ #endif png_read_status_ptr read_row_fn; /* called after each row is decoded */ png_write_status_ptr write_row_fn; /* called after each row is encoded */ #ifdef PNG_PROGRESSIVE_READ_SUPPORTED png_progressive_info_ptr info_fn; /* called after header data fully read */ png_progressive_row_ptr row_fn; /* called after a prog. row is decoded */ png_progressive_end_ptr end_fn; /* called after image is complete */ png_bytep save_buffer_ptr; /* current location in save_buffer */ png_bytep save_buffer; /* buffer for previously read data */ png_bytep current_buffer_ptr; /* current location in current_buffer */ png_bytep current_buffer; /* buffer for recently used data */ png_uint_32 push_length; /* size of current input chunk */ png_uint_32 skip_length; /* bytes to skip in input data */ png_size_t save_buffer_size; /* amount of data now in save_buffer */ png_size_t save_buffer_max; /* total size of save_buffer */ png_size_t buffer_size; /* total amount of available input data */ png_size_t current_buffer_size; /* amount of data now in current_buffer */ int process_mode; /* what push library is currently doing */ int cur_palette; /* current push library palette index */ #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) /* For the Borland special 64K segment handler */ png_bytepp offset_table_ptr; png_bytep offset_table; png_uint_16 offset_table_number; png_uint_16 offset_table_count; png_uint_16 offset_table_count_free; #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED png_bytep palette_lookup; /* lookup table for quantizing */ png_bytep quantize_index; /* index translation for palette files */ #endif #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED png_byte heuristic_method; /* heuristic for row filter selection */ png_byte num_prev_filters; /* number of weights for previous rows */ png_bytep prev_filters; /* filter type(s) of previous row(s) */ png_uint_16p filter_weights; /* weight(s) for previous line(s) */ png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ png_uint_16p filter_costs; /* relative filter calculation cost */ png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ #endif /* Options */ #ifdef PNG_SET_OPTION_SUPPORTED png_byte options; /* On/off state (up to 4 options) */ #endif #if PNG_LIBPNG_VER < 10700 /* To do: remove this from libpng-1.7 */ #ifdef PNG_TIME_RFC1123_SUPPORTED char time_buffer[29]; /* String to hold RFC 1123 time text */ #endif #endif /* New members added in libpng-1.0.6 */ png_uint_32 free_me; /* flags items libpng is responsible for freeing */ #ifdef PNG_USER_CHUNKS_SUPPORTED png_voidp user_chunk_ptr; #ifdef PNG_READ_USER_CHUNKS_SUPPORTED png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ #endif #endif #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED int unknown_default; /* As PNG_HANDLE_* */ unsigned int num_chunk_list; /* Number of entries in the list */ png_bytep chunk_list; /* List of png_byte[5]; the textual chunk name * followed by a PNG_HANDLE_* byte */ #endif /* New members added in libpng-1.0.3 */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED png_byte rgb_to_gray_status; /* Added in libpng 1.5.5 to record setting of coefficients: */ png_byte rgb_to_gray_coefficients_set; /* These were changed from png_byte in libpng-1.0.6 */ png_uint_16 rgb_to_gray_red_coeff; png_uint_16 rgb_to_gray_green_coeff; /* deleted in 1.5.5: rgb_to_gray_blue_coeff; */ #endif /* New member added in libpng-1.0.4 (renamed in 1.0.9) */ #if defined(PNG_MNG_FEATURES_SUPPORTED) /* Changed from png_byte to png_uint_32 at version 1.2.0 */ png_uint_32 mng_features_permitted; #endif /* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ #ifdef PNG_MNG_FEATURES_SUPPORTED png_byte filter_type; #endif /* New members added in libpng-1.2.0 */ /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ #ifdef PNG_USER_MEM_SUPPORTED png_voidp mem_ptr; /* user supplied struct for mem functions */ png_malloc_ptr malloc_fn; /* function for allocating memory */ png_free_ptr free_fn; /* function for freeing memory */ #endif /* New member added in libpng-1.0.13 and 1.2.0 */ png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ #ifdef PNG_READ_QUANTIZE_SUPPORTED /* The following three members were added at version 1.0.14 and 1.2.4 */ png_bytep quantize_sort; /* working sort array */ png_bytep index_to_palette; /* where the original index currently is in the palette */ png_bytep palette_to_index; /* which original index points to this palette color */ #endif /* New members added in libpng-1.0.16 and 1.2.6 */ png_byte compression_type; #ifdef PNG_USER_LIMITS_SUPPORTED png_uint_32 user_width_max; png_uint_32 user_height_max; /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown * chunks that can be stored (0 means unlimited). */ png_uint_32 user_chunk_cache_max; /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk * can occupy when decompressed. 0 means unlimited. */ png_alloc_size_t user_chunk_malloc_max; #endif /* New member added in libpng-1.0.25 and 1.2.17 */ #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED /* Temporary storage for unknown chunk that the library doesn't recognize, * used while reading the chunk. */ png_unknown_chunk unknown_chunk; #endif /* New member added in libpng-1.2.26 */ png_size_t old_big_row_buf_size; #ifdef PNG_READ_SUPPORTED /* New member added in libpng-1.2.30 */ png_bytep read_buffer; /* buffer for reading chunk data */ png_alloc_size_t read_buffer_size; /* current size of the buffer */ #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED uInt IDAT_read_size; /* limit on read buffer size for IDAT */ #endif #ifdef PNG_IO_STATE_SUPPORTED /* New member added in libpng-1.4.0 */ png_uint_32 io_state; #endif /* New member added in libpng-1.5.6 */ png_bytep big_prev_row; /* New member added in libpng-1.5.7 */ void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info, png_bytep row, png_const_bytep prev_row); #ifdef PNG_READ_SUPPORTED #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) png_colorspace colorspace; #endif #endif }; #endif /* PNGSTRUCT_H */ ================================================ FILE: Libraries/Core/Android/Headers/rapidxml/rapidxml.hpp ================================================ #ifndef RAPIDXML_HPP_INCLUDED #define RAPIDXML_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml.hpp This file contains rapidxml parser and DOM implementation // If standard library is disabled, user must provide implementations of required functions and typedefs #if !defined(RAPIDXML_NO_STDLIB) #include // For std::size_t #include // For assert #include // For placement new #endif // On MSVC, disable "conditional expression is constant" warning (level 4). // This warning is almost impossible to avoid with certain types of templated code #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4127) // Conditional expression is constant #endif /////////////////////////////////////////////////////////////////////////// // RAPIDXML_PARSE_ERROR #if defined(RAPIDXML_NO_EXCEPTIONS) #define RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); } namespace rapidxml { //! When exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, //! this function is called to notify user about the error. //! It must be defined by the user. //!

//! This function cannot return. If it does, the results are undefined. //!

//! A very simple definition might look like that: //!
    //! void %rapidxml::%parse_error_handler(const char *what, void *where)
    //! {
    //!     std::cout << "Parse error: " << what << "\n";
    //!     std::abort();
    //! }
    //! 
//! \param what Human readable description of the error. //! \param where Pointer to character data where error was detected. void parse_error_handler(const char *what, void *where); } #else #include // For std::exception #define RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where) namespace rapidxml { //! Parse error exception. //! This exception is thrown by the parser when an error occurs. //! Use what() function to get human-readable error message. //! Use where() function to get a pointer to position within source text where error was detected. //!

//! If throwing exceptions by the parser is undesirable, //! it can be disabled by defining RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included. //! This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception. //! This function must be defined by the user. //!

//! This class derives from std::exception class. class parse_error: public std::exception { public: //! Constructs parse error parse_error(const char *what, void *where) : m_what(what) , m_where(where) { } //! Gets human readable description of error. //! \return Pointer to null terminated description of the error. virtual const char *what() const throw() { return m_what; } //! Gets pointer to character data where error happened. //! Ch should be the same as char type of xml_document that produced the error. //! \return Pointer to location within the parsed string where error occured. template Ch *where() const { return reinterpret_cast(m_where); } private: const char *m_what; void *m_where; }; } #endif /////////////////////////////////////////////////////////////////////////// // Pool sizes #ifndef RAPIDXML_STATIC_POOL_SIZE // Size of static memory block of memory_pool. // Define RAPIDXML_STATIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. // No dynamic memory allocations are performed by memory_pool until static memory is exhausted. #define RAPIDXML_STATIC_POOL_SIZE (64 * 1024) #endif #ifndef RAPIDXML_DYNAMIC_POOL_SIZE // Size of dynamic memory block of memory_pool. // Define RAPIDXML_DYNAMIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. // After the static block is exhausted, dynamic blocks with approximately this size are allocated by memory_pool. #define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024) #endif #ifndef RAPIDXML_ALIGNMENT // Memory allocation alignment. // Define RAPIDXML_ALIGNMENT before including rapidxml.hpp if you want to override the default value, which is the size of pointer. // All memory allocations for nodes, attributes and strings will be aligned to this value. // This must be a power of 2 and at least 1, otherwise memory_pool will not work. #define RAPIDXML_ALIGNMENT sizeof(void *) #endif namespace rapidxml { // Forward declarations template class xml_node; template class xml_attribute; template class xml_document; //! Enumeration listing all node types produced by the parser. //! Use xml_node::type() function to query node type. enum node_type { node_document, //!< A document node. Name and value are empty. node_element, //!< An element node. Name contains element name. Value contains text of first data node. node_data, //!< A data node. Name is empty. Value contains data text. node_cdata, //!< A CDATA node. Name is empty. Value contains data text. node_comment, //!< A comment node. Name is empty. Value contains comment text. node_declaration, //!< A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes. node_doctype, //!< A DOCTYPE node. Name is empty. Value contains DOCTYPE text. node_pi //!< A PI node. Name contains target. Value contains instructions. }; /////////////////////////////////////////////////////////////////////// // Parsing flags //! Parse flag instructing the parser to not create data nodes. //! Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_data_nodes = 0x1; //! Parse flag instructing the parser to not use text of first data node as a value of parent element. //! Can be combined with other flags by use of | operator. //! Note that child data nodes of element node take precendence over its value when printing. //! That is, if element has one or more child data nodes and a value, the value will be ignored. //! Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements. //!

//! See xml_document::parse() function. const int parse_no_element_values = 0x2; //! Parse flag instructing the parser to not place zero terminators after strings in the source text. //! By default zero terminators are placed, modifying source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_string_terminators = 0x4; //! Parse flag instructing the parser to not translate entities in the source text. //! By default entities are translated, modifying source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_entity_translation = 0x8; //! Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters. //! By default, UTF-8 handling is enabled. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_utf8 = 0x10; //! Parse flag instructing the parser to create XML declaration node. //! By default, declaration node is not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_declaration_node = 0x20; //! Parse flag instructing the parser to create comments nodes. //! By default, comment nodes are not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_comment_nodes = 0x40; //! Parse flag instructing the parser to create DOCTYPE node. //! By default, doctype node is not created. //! Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_doctype_node = 0x80; //! Parse flag instructing the parser to create PI nodes. //! By default, PI nodes are not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_pi_nodes = 0x100; //! Parse flag instructing the parser to validate closing tag names. //! If not set, name inside closing tag is irrelevant to the parser. //! By default, closing tags are not validated. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_validate_closing_tags = 0x200; //! Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes. //! By default, whitespace is not trimmed. //! This flag does not cause the parser to modify source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_trim_whitespace = 0x400; //! Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character. //! Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag. //! By default, whitespace is not normalized. //! If this flag is specified, source text will be modified. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_normalize_whitespace = 0x800; // Compound flags //! Parse flags which represent default behaviour of the parser. //! This is always equal to 0, so that all other flags can be simply ored together. //! Normally there is no need to inconveniently disable flags by anding with their negated (~) values. //! This also means that meaning of each flag is a negation of the default setting. //! For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is enabled by default, //! and using the flag will disable it. //!

//! See xml_document::parse() function. const int parse_default = 0; //! A combination of parse flags that forbids any modifications of the source text. //! This also results in faster parsing. However, note that the following will occur: //!
    //!
  • names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends
  • //!
  • entities will not be translated
  • //!
  • whitespace will not be normalized
  • //!
//! See xml_document::parse() function. const int parse_non_destructive = parse_no_string_terminators | parse_no_entity_translation; //! A combination of parse flags resulting in fastest possible parsing, without sacrificing important data. //!

//! See xml_document::parse() function. const int parse_fastest = parse_non_destructive | parse_no_data_nodes; //! A combination of parse flags resulting in largest amount of data being extracted. //! This usually results in slowest parsing. //!

//! See xml_document::parse() function. const int parse_full = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags; /////////////////////////////////////////////////////////////////////// // Internals //! \cond internal namespace internal { // Struct that contains lookup tables for the parser // It must be a template to allow correct linking (because it has static data members, which are defined in a header file). template struct lookup_tables { static const unsigned char lookup_whitespace[256]; // Whitespace table static const unsigned char lookup_node_name[256]; // Node name table static const unsigned char lookup_text[256]; // Text table static const unsigned char lookup_text_pure_no_ws[256]; // Text table static const unsigned char lookup_text_pure_with_ws[256]; // Text table static const unsigned char lookup_attribute_name[256]; // Attribute name table static const unsigned char lookup_attribute_data_1[256]; // Attribute data table with single quote static const unsigned char lookup_attribute_data_1_pure[256]; // Attribute data table with single quote static const unsigned char lookup_attribute_data_2[256]; // Attribute data table with double quotes static const unsigned char lookup_attribute_data_2_pure[256]; // Attribute data table with double quotes static const unsigned char lookup_digits[256]; // Digits static const unsigned char lookup_upcase[256]; // To uppercase conversion table for ASCII characters }; // Find length of the string template inline std::size_t measure(const Ch *p) { const Ch *tmp = p; while (*tmp) ++tmp; return tmp - p; } // Compare strings for equality template inline bool compare(const Ch *p1, std::size_t size1, const Ch *p2, std::size_t size2, bool case_sensitive) { if (size1 != size2) return false; if (case_sensitive) { for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) if (*p1 != *p2) return false; } else { for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) if (lookup_tables<0>::lookup_upcase[static_cast(*p1)] != lookup_tables<0>::lookup_upcase[static_cast(*p2)]) return false; } return true; } } //! \endcond /////////////////////////////////////////////////////////////////////// // Memory pool //! This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation. //! In most cases, you will not need to use this class directly. //! However, if you need to create nodes manually or modify names/values of nodes, //! you are encouraged to use memory_pool of relevant xml_document to allocate the memory. //! Not only is this faster than allocating them by using new operator, //! but also their lifetime will be tied to the lifetime of document, //! possibly simplyfing memory management. //!

//! Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. //! You can also call allocate_string() function to allocate strings. //! Such strings can then be used as names or values of nodes without worrying about their lifetime. //! Note that there is no free() function -- all allocations are freed at once when clear() function is called, //! or when the pool is destroyed. //!

//! It is also possible to create a standalone memory_pool, and use it //! to allocate nodes, whose lifetime will not be tied to any document. //!

//! Pool maintains RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. //! Until static memory is exhausted, no dynamic memory allocations are done. //! When static memory is exhausted, pool allocates additional blocks of memory of size RAPIDXML_DYNAMIC_POOL_SIZE each, //! by using global new[] and delete[] operators. //! This behaviour can be changed by setting custom allocation routines. //! Use set_allocator() function to set them. //!

//! Allocations for nodes, attributes and strings are aligned at RAPIDXML_ALIGNMENT bytes. //! This value defaults to the size of pointer on target architecture. //!

//! To obtain absolutely top performance from the parser, //! it is important that all nodes are allocated from a single, contiguous block of memory. //! Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably. //! If required, you can tweak RAPIDXML_STATIC_POOL_SIZE, RAPIDXML_DYNAMIC_POOL_SIZE and RAPIDXML_ALIGNMENT //! to obtain best wasted memory to performance compromise. //! To do it, define their values before rapidxml.hpp file is included. //! \param Ch Character type of created nodes. template class memory_pool { public: //! \cond internal typedef void *(rapidxml_alloc_func)(std::size_t); // Type of user-defined function used to allocate memory typedef void (free_func)(void *); // Type of user-defined function used to free memory //! \endcond //! Constructs empty pool with default allocator functions. memory_pool() : m_rapidxml_alloc_func(0) , m_free_func(0) { init(); } //! Destroys pool and frees all the memory. //! This causes memory occupied by nodes allocated by the pool to be freed. //! Nodes allocated from the pool are no longer valid. ~memory_pool() { clear(); } //! Allocates a new node from the pool, and optionally assigns name and value to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param type Type of node to create. //! \param name Name to assign to the node, or 0 to assign no name. //! \param value Value to assign to the node, or 0 to assign no value. //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. //! \return Pointer to allocated node. This pointer will never be NULL. xml_node *allocate_node(node_type type, const Ch *name = 0, const Ch *value = 0, std::size_t name_size = 0, std::size_t value_size = 0) { void *memory = allocate_aligned(sizeof(xml_node)); xml_node *node = new(memory) xml_node(type); if (name) { if (name_size > 0) node->name(name, name_size); else node->name(name); } if (value) { if (value_size > 0) node->value(value, value_size); else node->value(value); } return node; } //! Allocates a new attribute from the pool, and optionally assigns name and value to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param name Name to assign to the attribute, or 0 to assign no name. //! \param value Value to assign to the attribute, or 0 to assign no value. //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. //! \return Pointer to allocated attribute. This pointer will never be NULL. xml_attribute *allocate_attribute(const Ch *name = 0, const Ch *value = 0, std::size_t name_size = 0, std::size_t value_size = 0) { void *memory = allocate_aligned(sizeof(xml_attribute)); xml_attribute *attribute = new(memory) xml_attribute; if (name) { if (name_size > 0) attribute->name(name, name_size); else attribute->name(name); } if (value) { if (value_size > 0) attribute->value(value, value_size); else attribute->value(value); } return attribute; } //! Allocates a char array of given size from the pool, and optionally copies a given string to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param source String to initialize the allocated memory with, or 0 to not initialize it. //! \param size Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated. //! \return Pointer to allocated char array. This pointer will never be NULL. Ch *allocate_string(const Ch *source = 0, std::size_t size = 0) { assert(source || size); // Either source or size (or both) must be specified if (size == 0) size = internal::measure(source) + 1; Ch *result = static_cast(allocate_aligned(size * sizeof(Ch))); if (source) for (std::size_t i = 0; i < size; ++i) result[i] = source[i]; return result; } //! Clones an xml_node and its hierarchy of child nodes and attributes. //! Nodes and attributes are allocated from this memory pool. //! Names and values are not cloned, they are shared between the clone and the source. //! Result node can be optionally specified as a second parameter, //! in which case its contents will be replaced with cloned source node. //! This is useful when you want to clone entire document. //! \param source Node to clone. //! \param result Node to put results in, or 0 to automatically allocate result node //! \return Pointer to cloned node. This pointer will never be NULL. xml_node *clone_node(const xml_node *source, xml_node *result = 0) { // Prepare result node if (result) { result->remove_all_attributes(); result->remove_all_nodes(); result->type(source->type()); } else result = allocate_node(source->type()); // Clone name and value result->name(source->name(), source->name_size()); result->value(source->value(), source->value_size()); // Clone child nodes and attributes for (xml_node *child = source->first_node(); child; child = child->next_sibling()) result->append_node(clone_node(child)); for (xml_attribute *attr = source->first_attribute(); attr; attr = attr->next_attribute()) result->append_attribute(allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size())); return result; } //! Clears the pool. //! This causes memory occupied by nodes allocated by the pool to be freed. //! Any nodes or strings allocated from the pool will no longer be valid. void clear() { while (m_begin != m_static_memory) { char *previous_begin = reinterpret_cast
(align(m_begin))->previous_begin; if (m_free_func) m_free_func(m_begin); else delete[] m_begin; m_begin = previous_begin; } init(); } //! Sets or resets the user-defined memory allocation functions for the pool. //! This can only be called when no memory is allocated from the pool yet, otherwise results are undefined. //! Allocation function must not return invalid pointer on failure. It should either throw, //! stop the program, or use longjmp() function to pass control to other place of program. //! If it returns invalid pointer, results are undefined. //!

//! User defined allocation functions must have the following forms: //!
//!
void *allocate(std::size_t size); //!
void free(void *pointer); //!

//! \param af Allocation function, or 0 to restore default function //! \param ff Free function, or 0 to restore default function void set_allocator(rapidxml_alloc_func *af, free_func *ff) { assert(m_begin == m_static_memory && m_ptr == align(m_begin)); // Verify that no memory is allocated yet m_rapidxml_alloc_func = af; m_free_func = ff; } private: struct header { char *previous_begin; }; void init() { m_begin = m_static_memory; m_ptr = align(m_begin); m_end = m_static_memory + sizeof(m_static_memory); } char *align(char *ptr) { std::size_t alignment = ((RAPIDXML_ALIGNMENT - (std::size_t(ptr) & (RAPIDXML_ALIGNMENT - 1))) & (RAPIDXML_ALIGNMENT - 1)); return ptr + alignment; } char *allocate_raw(std::size_t size) { // Allocate void *memory; if (m_rapidxml_alloc_func) // Allocate memory using either user-specified allocation function or global operator new[] { memory = m_rapidxml_alloc_func(size); assert(memory); // Allocator is not allowed to return 0, on failure it must either throw, stop the program or use longjmp } else { memory = new char[size]; #ifdef RAPIDXML_NO_EXCEPTIONS if (!memory) // If exceptions are disabled, verify memory allocation, because new will not be able to throw bad_alloc RAPIDXML_PARSE_ERROR("out of memory", 0); #endif } return static_cast(memory); } void *allocate_aligned(std::size_t size) { // Calculate aligned pointer char *result = align(m_ptr); // If not enough memory left in current pool, allocate a new pool if (result + size > m_end) { // Calculate required pool size (may be bigger than RAPIDXML_DYNAMIC_POOL_SIZE) std::size_t pool_size = RAPIDXML_DYNAMIC_POOL_SIZE; if (pool_size < size) pool_size = size; // Allocate std::size_t alloc_size = sizeof(header) + (2 * RAPIDXML_ALIGNMENT - 2) + pool_size; // 2 alignments required in worst case: one for header, one for actual allocation char *raw_memory = allocate_raw(alloc_size); // Setup new pool in allocated memory char *pool = align(raw_memory); header *new_header = reinterpret_cast
(pool); new_header->previous_begin = m_begin; m_begin = raw_memory; m_ptr = pool + sizeof(header); m_end = raw_memory + alloc_size; // Calculate aligned pointer again using new pool result = align(m_ptr); } // Update pool and return aligned pointer m_ptr = result + size; return result; } char *m_begin; // Start of raw memory making up current pool char *m_ptr; // First free byte in current pool char *m_end; // One past last available byte in current pool char m_static_memory[RAPIDXML_STATIC_POOL_SIZE]; // Static raw memory rapidxml_alloc_func *m_rapidxml_alloc_func; // Allocator function, or 0 if default is to be used free_func *m_free_func; // Free function, or 0 if default is to be used }; /////////////////////////////////////////////////////////////////////////// // XML base //! Base class for xml_node and xml_attribute implementing common functions: //! name(), name_size(), value(), value_size() and parent(). //! \param Ch Character type to use template class xml_base { public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction // Construct a base with empty name, value and parent xml_base() : m_name(0) , m_value(0) , m_parent(0) { } /////////////////////////////////////////////////////////////////////////// // Node data access //! Gets name of the node. //! Interpretation of name depends on type of node. //! Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. //!

//! Use name_size() function to determine length of the name. //! \return Name of node, or empty string if node has no name. Ch *name() const { return m_name ? m_name : nullstr(); } //! Gets size of node name, not including terminator character. //! This function works correctly irrespective of whether name is or is not zero terminated. //! \return Size of node name, in characters. std::size_t name_size() const { return m_name ? m_name_size : 0; } //! Gets value of node. //! Interpretation of value depends on type of node. //! Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. //!

//! Use value_size() function to determine length of the value. //! \return Value of node, or empty string if node has no value. Ch *value() const { return m_value ? m_value : nullstr(); } //! Gets size of node value, not including terminator character. //! This function works correctly irrespective of whether value is or is not zero terminated. //! \return Size of node value, in characters. std::size_t value_size() const { return m_value ? m_value_size : 0; } /////////////////////////////////////////////////////////////////////////// // Node modification //! Sets name of node to a non zero-terminated string. //! See \ref ownership_of_strings. //!

//! Note that node does not own its name or value, it only stores a pointer to it. //! It will not delete or otherwise free the pointer on destruction. //! It is reponsibility of the user to properly manage lifetime of the string. //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - //! on destruction of the document the string will be automatically freed. //!

//! Size of name must be specified separately, because name does not have to be zero terminated. //! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated). //! \param name Name of node to set. Does not have to be zero terminated. //! \param size Size of name, in characters. This does not include zero terminator, if one is present. void name(const Ch *name, std::size_t size) { m_name = const_cast(name); m_name_size = size; } //! Sets name of node to a zero-terminated string. //! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t). //! \param name Name of node to set. Must be zero terminated. void name(const Ch *name) { this->name(name, internal::measure(name)); } //! Sets value of node to a non zero-terminated string. //! See \ref ownership_of_strings. //!

//! Note that node does not own its name or value, it only stores a pointer to it. //! It will not delete or otherwise free the pointer on destruction. //! It is reponsibility of the user to properly manage lifetime of the string. //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - //! on destruction of the document the string will be automatically freed. //!

//! Size of value must be specified separately, because it does not have to be zero terminated. //! Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated). //!

//! If an element has a child node of type node_data, it will take precedence over element value when printing. //! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser. //! \param value value of node to set. Does not have to be zero terminated. //! \param size Size of value, in characters. This does not include zero terminator, if one is present. void value(const Ch *value, std::size_t size) { m_value = const_cast(value); m_value_size = size; } //! Sets value of node to a zero-terminated string. //! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t). //! \param value Vame of node to set. Must be zero terminated. void value(const Ch *value) { this->value(value, internal::measure(value)); } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets node parent. //! \return Pointer to parent node, or 0 if there is no parent. xml_node *parent() const { return m_parent; } protected: // Return empty string static Ch *nullstr() { static Ch zero = Ch('\0'); return &zero; } Ch *m_name; // Name of node, or 0 if no name Ch *m_value; // Value of node, or 0 if no value std::size_t m_name_size; // Length of node name, or undefined of no name std::size_t m_value_size; // Length of node value, or undefined if no value xml_node *m_parent; // Pointer to parent node, or 0 if none }; //! Class representing attribute node of XML document. //! Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base). //! Note that after parse, both name and value of attribute will point to interior of source text used for parsing. //! Thus, this text must persist in memory for the lifetime of attribute. //! \param Ch Character type to use. template class xml_attribute: public xml_base { friend class xml_node; public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction //! Constructs an empty attribute with the specified type. //! Consider using memory_pool of appropriate xml_document if allocating attributes manually. xml_attribute() { } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets document of which attribute is a child. //! \return Pointer to document that contains this attribute, or 0 if there is no parent document. xml_document *document() const { if (xml_node *node = this->parent()) { while (node->parent()) node = node->parent(); return node->type() == node_document ? static_cast *>(node) : 0; } else return 0; } //! Gets previous attribute, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return this->m_parent ? m_prev_attribute : 0; } //! Gets next attribute, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *next_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return this->m_parent ? m_next_attribute : 0; } private: xml_attribute *m_prev_attribute; // Pointer to previous sibling of attribute, or 0 if none; only valid if parent is non-zero xml_attribute *m_next_attribute; // Pointer to next sibling of attribute, or 0 if none; only valid if parent is non-zero }; /////////////////////////////////////////////////////////////////////////// // XML node //! Class representing a node of XML document. //! Each node may have associated name and value strings, which are available through name() and value() functions. //! Interpretation of name and value depends on type of the node. //! Type of node can be determined by using type() function. //!

//! Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. //! Thus, this text must persist in the memory for the lifetime of node. //! \param Ch Character type to use. template class xml_node: public xml_base { public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction //! Constructs an empty node with the specified type. //! Consider using memory_pool of appropriate document to allocate nodes manually. //! \param type Type of node to construct. xml_node(node_type type) : m_type(type) , m_first_node(0) , m_first_attribute(0) { } /////////////////////////////////////////////////////////////////////////// // Node data access //! Gets type of node. //! \return Type of node. node_type type() const { return m_type; } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets document of which node is a child. //! \return Pointer to document that contains this node, or 0 if there is no parent document. xml_document *document() const { xml_node *node = const_cast *>(this); while (node->parent()) node = node->parent(); return node->type() == node_document ? static_cast *>(node) : 0; } //! Gets first child node, optionally matching node name. //! \param name Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found child, or 0 if not found. xml_node *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *child = m_first_node; child; child = child->next_sibling()) if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) return child; return 0; } else return m_first_node; } //! Gets last child node, optionally matching node name. //! Behaviour is undefined if node has no children. //! Use first_node() to test if node has children. //! \param name Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found child, or 0 if not found. xml_node *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(m_first_node); // Cannot query for last child if node has no children if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *child = m_last_node; child; child = child->previous_sibling()) if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) return child; return 0; } else return m_last_node; } //! Gets previous sibling node, optionally matching node name. //! Behaviour is undefined if node has no parent. //! Use parent() to test if node has a parent. //! \param name Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found sibling, or 0 if not found. xml_node *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(this->m_parent); // Cannot query for siblings if node has no parent if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling) if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) return sibling; return 0; } else return m_prev_sibling; } //! Gets next sibling node, optionally matching node name. //! Behaviour is undefined if node has no parent. //! Use parent() to test if node has a parent. //! \param name Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found sibling, or 0 if not found. xml_node *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(this->m_parent); // Cannot query for siblings if node has no parent if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling) if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) return sibling; return 0; } else return m_next_sibling; } //! Gets first attribute of node, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return m_first_attribute; } //! Gets last attribute of node, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return m_first_attribute ? m_last_attribute : 0; } /////////////////////////////////////////////////////////////////////////// // Node modification //! Sets type of node. //! \param type Type of node to set. void type(node_type type) { m_type = type; } /////////////////////////////////////////////////////////////////////////// // Node manipulation //! Prepends a new child node. //! The prepended child becomes the first child, and all existing children are moved one position back. //! \param child Node to prepend. void prepend_node(xml_node *child) { assert(child && !child->parent() && child->type() != node_document); if (first_node()) { child->m_next_sibling = m_first_node; m_first_node->m_prev_sibling = child; } else { child->m_next_sibling = 0; m_last_node = child; } m_first_node = child; child->m_parent = this; child->m_prev_sibling = 0; } //! Appends a new child node. //! The appended child becomes the last child. //! \param child Node to append. void append_node(xml_node *child) { assert(child && !child->parent() && child->type() != node_document); if (first_node()) { child->m_prev_sibling = m_last_node; m_last_node->m_next_sibling = child; } else { child->m_prev_sibling = 0; m_first_node = child; } m_last_node = child; child->m_parent = this; child->m_next_sibling = 0; } //! Inserts a new child node at specified place inside the node. //! All children after and including the specified node are moved one position back. //! \param where Place where to insert the child, or 0 to insert at the back. //! \param child Node to insert. void insert_node(xml_node *where, xml_node *child) { assert(!where || where->parent() == this); assert(child && !child->parent() && child->type() != node_document); if (where == m_first_node) prepend_node(child); else if (where == 0) append_node(child); else { child->m_prev_sibling = where->m_prev_sibling; child->m_next_sibling = where; where->m_prev_sibling->m_next_sibling = child; where->m_prev_sibling = child; child->m_parent = this; } } //! Removes first child node. //! If node has no children, behaviour is undefined. //! Use first_node() to test if node has children. void remove_first_node() { assert(first_node()); xml_node *child = m_first_node; m_first_node = child->m_next_sibling; if (child->m_next_sibling) child->m_next_sibling->m_prev_sibling = 0; else m_last_node = 0; child->m_parent = 0; } //! Removes last child of the node. //! If node has no children, behaviour is undefined. //! Use first_node() to test if node has children. void remove_last_node() { assert(first_node()); xml_node *child = m_last_node; if (child->m_prev_sibling) { m_last_node = child->m_prev_sibling; child->m_prev_sibling->m_next_sibling = 0; } else m_first_node = 0; child->m_parent = 0; } //! Removes specified child from the node // \param where Pointer to child to be removed. void remove_node(xml_node *where) { assert(where && where->parent() == this); assert(first_node()); if (where == m_first_node) remove_first_node(); else if (where == m_last_node) remove_last_node(); else { where->m_prev_sibling->m_next_sibling = where->m_next_sibling; where->m_next_sibling->m_prev_sibling = where->m_prev_sibling; where->m_parent = 0; } } //! Removes all child nodes (but not attributes). void remove_all_nodes() { for (xml_node *node = first_node(); node; node = node->m_next_sibling) node->m_parent = 0; m_first_node = 0; } //! Prepends a new attribute to the node. //! \param attribute Attribute to prepend. void prepend_attribute(xml_attribute *attribute) { assert(attribute && !attribute->parent()); if (first_attribute()) { attribute->m_next_attribute = m_first_attribute; m_first_attribute->m_prev_attribute = attribute; } else { attribute->m_next_attribute = 0; m_last_attribute = attribute; } m_first_attribute = attribute; attribute->m_parent = this; attribute->m_prev_attribute = 0; } //! Appends a new attribute to the node. //! \param attribute Attribute to append. void append_attribute(xml_attribute *attribute) { assert(attribute && !attribute->parent()); if (first_attribute()) { attribute->m_prev_attribute = m_last_attribute; m_last_attribute->m_next_attribute = attribute; } else { attribute->m_prev_attribute = 0; m_first_attribute = attribute; } m_last_attribute = attribute; attribute->m_parent = this; attribute->m_next_attribute = 0; } //! Inserts a new attribute at specified place inside the node. //! All attributes after and including the specified attribute are moved one position back. //! \param where Place where to insert the attribute, or 0 to insert at the back. //! \param attribute Attribute to insert. void insert_attribute(xml_attribute *where, xml_attribute *attribute) { assert(!where || where->parent() == this); assert(attribute && !attribute->parent()); if (where == m_first_attribute) prepend_attribute(attribute); else if (where == 0) append_attribute(attribute); else { attribute->m_prev_attribute = where->m_prev_attribute; attribute->m_next_attribute = where; where->m_prev_attribute->m_next_attribute = attribute; where->m_prev_attribute = attribute; attribute->m_parent = this; } } //! Removes first attribute of the node. //! If node has no attributes, behaviour is undefined. //! Use first_attribute() to test if node has attributes. void remove_first_attribute() { assert(first_attribute()); xml_attribute *attribute = m_first_attribute; if (attribute->m_next_attribute) { attribute->m_next_attribute->m_prev_attribute = 0; } else m_last_attribute = 0; attribute->m_parent = 0; m_first_attribute = attribute->m_next_attribute; } //! Removes last attribute of the node. //! If node has no attributes, behaviour is undefined. //! Use first_attribute() to test if node has attributes. void remove_last_attribute() { assert(first_attribute()); xml_attribute *attribute = m_last_attribute; if (attribute->m_prev_attribute) { attribute->m_prev_attribute->m_next_attribute = 0; m_last_attribute = attribute->m_prev_attribute; } else m_first_attribute = 0; attribute->m_parent = 0; } //! Removes specified attribute from node. //! \param where Pointer to attribute to be removed. void remove_attribute(xml_attribute *where) { assert(first_attribute() && where->parent() == this); if (where == m_first_attribute) remove_first_attribute(); else if (where == m_last_attribute) remove_last_attribute(); else { where->m_prev_attribute->m_next_attribute = where->m_next_attribute; where->m_next_attribute->m_prev_attribute = where->m_prev_attribute; where->m_parent = 0; } } //! Removes all attributes of node. void remove_all_attributes() { for (xml_attribute *attribute = first_attribute(); attribute; attribute = attribute->m_next_attribute) attribute->m_parent = 0; m_first_attribute = 0; } private: /////////////////////////////////////////////////////////////////////////// // Restrictions // No copying xml_node(const xml_node &); void operator =(const xml_node &); /////////////////////////////////////////////////////////////////////////// // Data members // Note that some of the pointers below have UNDEFINED values if certain other pointers are 0. // This is required for maximum performance, as it allows the parser to omit initialization of // unneded/redundant values. // // The rules are as follows: // 1. first_node and first_attribute contain valid pointers, or 0 if node has no children/attributes respectively // 2. last_node and last_attribute are valid only if node has at least one child/attribute respectively, otherwise they contain garbage // 3. prev_sibling and next_sibling are valid only if node has a parent, otherwise they contain garbage node_type m_type; // Type of node; always valid xml_node *m_first_node; // Pointer to first child node, or 0 if none; always valid xml_node *m_last_node; // Pointer to last child node, or 0 if none; this value is only valid if m_first_node is non-zero xml_attribute *m_first_attribute; // Pointer to first attribute of node, or 0 if none; always valid xml_attribute *m_last_attribute; // Pointer to last attribute of node, or 0 if none; this value is only valid if m_first_attribute is non-zero xml_node *m_prev_sibling; // Pointer to previous sibling of node, or 0 if none; this value is only valid if m_parent is non-zero xml_node *m_next_sibling; // Pointer to next sibling of node, or 0 if none; this value is only valid if m_parent is non-zero }; /////////////////////////////////////////////////////////////////////////// // XML document //! This class represents root of the DOM hierarchy. //! It is also an xml_node and a memory_pool through public inheritance. //! Use parse() function to build a DOM tree from a zero-terminated XML text string. //! parse() function allocates memory for nodes and attributes by using functions of xml_document, //! which are inherited from memory_pool. //! To access root node of the document, use the document itself, as if it was an xml_node. //! \param Ch Character type to use. template class xml_document: public xml_node, public memory_pool { public: //! Constructs empty XML document xml_document() : xml_node(node_document) { } //! Parses zero-terminated XML string according to given flags. //! Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. //! The string must persist for the lifetime of the document. //! In case of error, rapidxml::parse_error exception will be thrown. //!

//! If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. //! Make sure that data is zero-terminated. //!

//! Document can be parsed into multiple times. //! Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool. //! \param text XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser. template void parse(Ch *text) { assert(text); // Remove current contents this->remove_all_nodes(); this->remove_all_attributes(); // Parse BOM, if any parse_bom(text); // Parse children while (1) { // Skip whitespace before node skip(text); if (*text == 0) break; // Parse and append new child if (*text == Ch('<')) { ++text; // Skip '<' if (xml_node *node = parse_node(text)) this->append_node(node); } else RAPIDXML_PARSE_ERROR("expected <", text); } } //! Clears the document by deleting all nodes and clearing the memory pool. //! All nodes owned by document pool are destroyed. void clear() { this->remove_all_nodes(); this->remove_all_attributes(); memory_pool::clear(); } private: /////////////////////////////////////////////////////////////////////// // Internal character utility functions // Detect whitespace character struct whitespace_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_whitespace[static_cast(ch)]; } }; // Detect node name character struct node_name_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_node_name[static_cast(ch)]; } }; // Detect attribute name character struct attribute_name_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_attribute_name[static_cast(ch)]; } }; // Detect text character (PCDATA) struct text_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text[static_cast(ch)]; } }; // Detect text character (PCDATA) that does not require processing struct text_pure_no_ws_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text_pure_no_ws[static_cast(ch)]; } }; // Detect text character (PCDATA) that does not require processing struct text_pure_with_ws_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text_pure_with_ws[static_cast(ch)]; } }; // Detect attribute value character template struct attribute_value_pred { static unsigned char test(Ch ch) { if (Quote == Ch('\'')) return internal::lookup_tables<0>::lookup_attribute_data_1[static_cast(ch)]; if (Quote == Ch('\"')) return internal::lookup_tables<0>::lookup_attribute_data_2[static_cast(ch)]; return 0; // Should never be executed, to avoid warnings on Comeau } }; // Detect attribute value character template struct attribute_value_pure_pred { static unsigned char test(Ch ch) { if (Quote == Ch('\'')) return internal::lookup_tables<0>::lookup_attribute_data_1_pure[static_cast(ch)]; if (Quote == Ch('\"')) return internal::lookup_tables<0>::lookup_attribute_data_2_pure[static_cast(ch)]; return 0; // Should never be executed, to avoid warnings on Comeau } }; // Insert coded character, using UTF8 or 8-bit ASCII template static void insert_coded_character(Ch *&text, unsigned long code) { if (Flags & parse_no_utf8) { // Insert 8-bit ASCII character // Todo: possibly verify that code is less than 256 and use replacement char otherwise? text[0] = static_cast(code); text += 1; } else { // Insert UTF8 sequence if (code < 0x80) // 1 byte sequence { text[0] = static_cast(code); text += 1; } else if (code < 0x800) // 2 byte sequence { text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xC0); text += 2; } else if (code < 0x10000) // 3 byte sequence { text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xE0); text += 3; } else if (code < 0x110000) // 4 byte sequence { text[3] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xF0); text += 4; } else // Invalid, only codes up to 0x10FFFF are allowed in Unicode { RAPIDXML_PARSE_ERROR("invalid numeric character entity", text); } } } // Skip characters until predicate evaluates to true template static void skip(Ch *&text) { Ch *tmp = text; while (StopPred::test(*tmp)) ++tmp; text = tmp; } // Skip characters until predicate evaluates to true while doing the following: // - replacing XML character entity references with proper characters (' & " < > &#...;) // - condensing whitespace sequences to single space character template static Ch *skip_and_expand_character_refs(Ch *&text) { // If entity translation, whitespace condense and whitespace trimming is disabled, use plain skip if (Flags & parse_no_entity_translation && !(Flags & parse_normalize_whitespace) && !(Flags & parse_trim_whitespace)) { skip(text); return text; } // Use simple skip until first modification is detected skip(text); // Use translation skip Ch *src = text; Ch *dest = src; while (StopPred::test(*src)) { // If entity translation is enabled if (!(Flags & parse_no_entity_translation)) { // Test if replacement is needed if (src[0] == Ch('&')) { switch (src[1]) { // & ' case Ch('a'): if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';')) { *dest = Ch('&'); ++dest; src += 5; continue; } if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';')) { *dest = Ch('\''); ++dest; src += 6; continue; } break; // " case Ch('q'): if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';')) { *dest = Ch('"'); ++dest; src += 6; continue; } break; // > case Ch('g'): if (src[2] == Ch('t') && src[3] == Ch(';')) { *dest = Ch('>'); ++dest; src += 4; continue; } break; // < case Ch('l'): if (src[2] == Ch('t') && src[3] == Ch(';')) { *dest = Ch('<'); ++dest; src += 4; continue; } break; // &#...; - assumes ASCII case Ch('#'): if (src[2] == Ch('x')) { unsigned long code = 0; src += 3; // Skip &#x while (1) { unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; if (digit == 0xFF) break; code = code * 16 + digit; ++src; } insert_coded_character(dest, code); // Put character in output } else { unsigned long code = 0; src += 2; // Skip &# while (1) { unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; if (digit == 0xFF) break; code = code * 10 + digit; ++src; } insert_coded_character(dest, code); // Put character in output } if (*src == Ch(';')) ++src; else RAPIDXML_PARSE_ERROR("expected ;", src); continue; // Something else default: // Ignore, just copy '&' verbatim break; } } } // If whitespace condensing is enabled if (Flags & parse_normalize_whitespace) { // Test if condensing is needed if (whitespace_pred::test(*src)) { *dest = Ch(' '); ++dest; // Put single space in dest ++src; // Skip first whitespace char // Skip remaining whitespace chars while (whitespace_pred::test(*src)) ++src; continue; } } // No replacement, only copy character *dest++ = *src++; } // Return new end text = src; return dest; } /////////////////////////////////////////////////////////////////////// // Internal parsing functions // Parse BOM, if any template void parse_bom(Ch *&text) { // UTF-8? if (static_cast(text[0]) == 0xEF && static_cast(text[1]) == 0xBB && static_cast(text[2]) == 0xBF) { text += 3; // Skup utf-8 bom } } // Parse XML declaration ( xml_node *parse_xml_declaration(Ch *&text) { // If parsing of declaration is disabled if (!(Flags & parse_declaration_node)) { // Skip until end of declaration while (text[0] != Ch('?') || text[1] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 2; // Skip '?>' return 0; } // Create declaration xml_node *declaration = this->allocate_node(node_declaration); // Skip whitespace before attributes or ?> skip(text); // Parse declaration attributes parse_node_attributes(text, declaration); // Skip ?> if (text[0] != Ch('?') || text[1] != Ch('>')) RAPIDXML_PARSE_ERROR("expected ?>", text); text += 2; return declaration; } // Parse XML comment (' return 0; // Do not produce comment node } // Remember value start Ch *value = text; // Skip until end of comment while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Create comment node xml_node *comment = this->allocate_node(node_comment); comment->value(value, text - value); // Place zero terminator after comment value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 3; // Skip '-->' return comment; } // Parse DOCTYPE template xml_node *parse_doctype(Ch *&text) { // Remember value start Ch *value = text; // Skip to > while (*text != Ch('>')) { // Determine character type switch (*text) { // If '[' encountered, scan for matching ending ']' using naive algorithm with depth // This works for all W3C test files except for 2 most wicked case Ch('['): { ++text; // Skip '[' int depth = 1; while (depth > 0) { switch (*text) { case Ch('['): ++depth; break; case Ch(']'): --depth; break; case 0: RAPIDXML_PARSE_ERROR("unexpected end of data", text); } ++text; } break; } // Error on end of text case Ch('\0'): RAPIDXML_PARSE_ERROR("unexpected end of data", text); // Other character, skip it default: ++text; } } // If DOCTYPE nodes enabled if (Flags & parse_doctype_node) { // Create a new doctype node xml_node *doctype = this->allocate_node(node_doctype); doctype->value(value, text - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 1; // skip '>' return doctype; } else { text += 1; // skip '>' return 0; } } // Parse PI template xml_node *parse_pi(Ch *&text) { // If creation of PI nodes is enabled if (Flags & parse_pi_nodes) { // Create pi node xml_node *pi = this->allocate_node(node_pi); // Extract PI target name Ch *name = text; skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected PI target", text); pi->name(name, text - name); // Skip whitespace between pi target and pi skip(text); // Remember start of pi Ch *value = text; // Skip to '?>' while (text[0] != Ch('?') || text[1] != Ch('>')) { if (*text == Ch('\0')) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Set pi value (verbatim, no entity expansion or whitespace normalization) pi->value(value, text - value); // Place zero terminator after name and value if (!(Flags & parse_no_string_terminators)) { pi->name()[pi->name_size()] = Ch('\0'); pi->value()[pi->value_size()] = Ch('\0'); } text += 2; // Skip '?>' return pi; } else { // Skip to '?>' while (text[0] != Ch('?') || text[1] != Ch('>')) { if (*text == Ch('\0')) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 2; // Skip '?>' return 0; } } // Parse and append data // Return character that ends data. // This is necessary because this character might have been overwritten by a terminating 0 template Ch parse_and_append_data(xml_node *node, Ch *&text, Ch *contents_start) { // Backup to contents start if whitespace trimming is disabled if (!(Flags & parse_trim_whitespace)) text = contents_start; // Skip until end of data Ch *value = text, *end; if (Flags & parse_normalize_whitespace) end = skip_and_expand_character_refs(text); else end = skip_and_expand_character_refs(text); // Trim trailing whitespace if flag is set; leading was already trimmed by whitespace skip after > if (Flags & parse_trim_whitespace) { if (Flags & parse_normalize_whitespace) { // Whitespace is already condensed to single space characters by skipping function, so just trim 1 char off the end if (*(end - 1) == Ch(' ')) --end; } else { // Backup until non-whitespace character is found while (whitespace_pred::test(*(end - 1))) --end; } } // If characters are still left between end and value (this test is only necessary if normalization is enabled) // Create new data node if (!(Flags & parse_no_data_nodes)) { xml_node *data = this->allocate_node(node_data); data->value(value, end - value); node->append_node(data); } // Add data to parent node if no data exists yet if (!(Flags & parse_no_element_values)) if (*node->value() == Ch('\0')) node->value(value, end - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) { Ch ch = *text; *end = Ch('\0'); return ch; // Return character that ends data; this is required because zero terminator overwritten it } // Return character that ends data return *text; } // Parse CDATA template xml_node *parse_cdata(Ch *&text) { // If CDATA is disabled if (Flags & parse_no_data_nodes) { // Skip until end of cdata while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 3; // Skip ]]> return 0; // Do not produce CDATA node } // Skip until end of cdata Ch *value = text; while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Create new cdata node xml_node *cdata = this->allocate_node(node_cdata); cdata->value(value, text - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 3; // Skip ]]> return cdata; } // Parse element node template xml_node *parse_element(Ch *&text) { // Create element node xml_node *element = this->allocate_node(node_element); // Extract element name Ch *name = text; skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected element name", text); element->name(name, text - name); // Skip whitespace between element name and attributes or > skip(text); // Parse attributes, if any parse_node_attributes(text, element); // Determine ending type if (*text == Ch('>')) { ++text; parse_node_contents(text, element); } else if (*text == Ch('/')) { ++text; if (*text != Ch('>')) RAPIDXML_PARSE_ERROR("expected >", text); ++text; } else RAPIDXML_PARSE_ERROR("expected >", text); // Place zero terminator after name if (!(Flags & parse_no_string_terminators)) element->name()[element->name_size()] = Ch('\0'); // Return parsed element return element; } // Determine node type, and parse it template xml_node *parse_node(Ch *&text) { // Parse proper node type switch (text[0]) { // <... default: // Parse and append element node return parse_element(text); // (text); } else { // Parse PI return parse_pi(text); } // (text); } break; // (text); } break; // (text); } } // switch // Attempt to skip other, unrecognized node types starting with ')) { if (*text == 0) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } ++text; // Skip '>' return 0; // No node recognized } } // Parse contents of the node - children, data etc. template void parse_node_contents(Ch *&text, xml_node *node) { // For all children and text while (1) { // Skip whitespace between > and node contents Ch *contents_start = text; // Store start of node contents before whitespace is skipped skip(text); Ch next_char = *text; // After data nodes, instead of continuing the loop, control jumps here. // This is because zero termination inside parse_and_append_data() function // would wreak havoc with the above code. // Also, skipping whitespace after data nodes is unnecessary. after_data_node: // Determine what comes next: node closing, child node, data node, or 0? switch (next_char) { // Node closing or child node case Ch('<'): if (text[1] == Ch('/')) { // Node closing text += 2; // Skip '(text); if (!internal::compare(node->name(), node->name_size(), closing_name, text - closing_name, true)) RAPIDXML_PARSE_ERROR("invalid closing tag name", text); } else { // No validation, just skip name skip(text); } // Skip remaining whitespace after node name skip(text); if (*text != Ch('>')) RAPIDXML_PARSE_ERROR("expected >", text); ++text; // Skip '>' return; // Node closed, finished parsing contents } else { // Child node ++text; // Skip '<' if (xml_node *child = parse_node(text)) node->append_node(child); } break; // End of data - error case Ch('\0'): RAPIDXML_PARSE_ERROR("unexpected end of data", text); // Data node default: next_char = parse_and_append_data(node, text, contents_start); goto after_data_node; // Bypass regular processing after data nodes } } } // Parse XML attributes of the node template void parse_node_attributes(Ch *&text, xml_node *node) { // For all attributes while (attribute_name_pred::test(*text)) { // Extract attribute name Ch *name = text; ++text; // Skip first character of attribute name skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected attribute name", name); // Create new attribute xml_attribute *attribute = this->allocate_attribute(); attribute->name(name, text - name); node->append_attribute(attribute); // Skip whitespace after attribute name skip(text); // Skip = if (*text != Ch('=')) RAPIDXML_PARSE_ERROR("expected =", text); ++text; // Add terminating zero after name if (!(Flags & parse_no_string_terminators)) attribute->name()[attribute->name_size()] = 0; // Skip whitespace after = skip(text); // Skip quote and remember if it was ' or " Ch quote = *text; if (quote != Ch('\'') && quote != Ch('"')) RAPIDXML_PARSE_ERROR("expected ' or \"", text); ++text; // Extract attribute value and expand char refs in it Ch *value = text, *end; const int AttFlags = Flags & ~parse_normalize_whitespace; // No whitespace normalization in attributes if (quote == Ch('\'')) end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text); else end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text); // Set attribute value attribute->value(value, end - value); // Make sure that end quote is present if (*text != quote) RAPIDXML_PARSE_ERROR("expected ' or \"", text); ++text; // Skip quote // Add terminating zero after value if (!(Flags & parse_no_string_terminators)) attribute->value()[attribute->value_size()] = 0; // Skip whitespace after attribute value skip(text); } } }; //! \cond internal namespace internal { // Whitespace (space \n \r \t) template const unsigned char lookup_tables::lookup_whitespace[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 5 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 7 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // F }; // Node name (anything but space \n \r \t / > ? \0) template const unsigned char lookup_tables::lookup_node_name[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) (anything but < \0) template const unsigned char lookup_tables::lookup_text[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) that does not require processing when ws normalization is disabled // (anything but < \0 &) template const unsigned char lookup_tables::lookup_text_pure_no_ws[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) that does not require processing when ws normalizationis is enabled // (anything but < \0 & space \n \r \t) template const unsigned char lookup_tables::lookup_text_pure_with_ws[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute name (anything but space \n \r \t / < > = ? ! \0) template const unsigned char lookup_tables::lookup_attribute_name[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with single quote (anything but ' \0) template const unsigned char lookup_tables::lookup_attribute_data_1[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with single quote that does not require processing (anything but ' \0 &) template const unsigned char lookup_tables::lookup_attribute_data_1_pure[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with double quote (anything but " \0) template const unsigned char lookup_tables::lookup_attribute_data_2[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with double quote that does not require processing (anything but " \0 &) template const unsigned char lookup_tables::lookup_attribute_data_2_pure[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Digits (dec and hex, 255 denotes end of numeric character reference) template const unsigned char lookup_tables::lookup_digits[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 1 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, // 3 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 4 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 5 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 6 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 7 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 8 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 9 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // A 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // B 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // C 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // D 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // E 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 // F }; // Upper case conversion template const unsigned char lookup_tables::lookup_upcase[256] = { // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A B C D E F 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // 0 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, // 1 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, // 2 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, // 3 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 4 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, // 5 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 6 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127, // 7 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 8 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 9 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // A 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // B 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // C 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // D 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // E 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // F }; } //! \endcond } // Undefine internal macros #undef RAPIDXML_PARSE_ERROR // On MSVC, restore warnings state #ifdef _MSC_VER #pragma warning(pop) #endif #endif ================================================ FILE: Libraries/Core/Android/Headers/rapidxml/rapidxml_iterators.hpp ================================================ #ifndef RAPIDXML_ITERATORS_HPP_INCLUDED #define RAPIDXML_ITERATORS_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_iterators.hpp This file contains rapidxml iterators #include "rapidxml.hpp" namespace rapidxml { //! Iterator of child nodes of xml_node template class node_iterator { public: typedef typename xml_node value_type; typedef typename xml_node &reference; typedef typename xml_node *pointer; typedef std::ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; node_iterator() : m_node(0) { } node_iterator(xml_node *node) : m_node(node->first_node()) { } reference operator *() const { assert(m_node); return *m_node; } pointer operator->() const { assert(m_node); return m_node; } node_iterator& operator++() { assert(m_node); m_node = m_node->next_sibling(); return *this; } node_iterator operator++(int) { node_iterator tmp = *this; ++this; return tmp; } node_iterator& operator--() { assert(m_node && m_node->previous_sibling()); m_node = m_node->previous_sibling(); return *this; } node_iterator operator--(int) { node_iterator tmp = *this; ++this; return tmp; } bool operator ==(const node_iterator &rhs) { return m_node == rhs.m_node; } bool operator !=(const node_iterator &rhs) { return m_node != rhs.m_node; } private: xml_node *m_node; }; //! Iterator of child attributes of xml_node template class attribute_iterator { public: typedef typename xml_attribute value_type; typedef typename xml_attribute &reference; typedef typename xml_attribute *pointer; typedef std::ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; attribute_iterator() : m_attribute(0) { } attribute_iterator(xml_node *node) : m_attribute(node->first_attribute()) { } reference operator *() const { assert(m_attribute); return *m_attribute; } pointer operator->() const { assert(m_attribute); return m_attribute; } attribute_iterator& operator++() { assert(m_attribute); m_attribute = m_attribute->next_attribute(); return *this; } attribute_iterator operator++(int) { attribute_iterator tmp = *this; ++this; return tmp; } attribute_iterator& operator--() { assert(m_attribute && m_attribute->previous_attribute()); m_attribute = m_attribute->previous_attribute(); return *this; } attribute_iterator operator--(int) { attribute_iterator tmp = *this; ++this; return tmp; } bool operator ==(const attribute_iterator &rhs) { return m_attribute == rhs.m_attribute; } bool operator !=(const attribute_iterator &rhs) { return m_attribute != rhs.m_attribute; } private: xml_attribute *m_attribute; }; } #endif ================================================ FILE: Libraries/Core/Android/Headers/rapidxml/rapidxml_print.hpp ================================================ #ifndef RAPIDXML_PRINT_HPP_INCLUDED #define RAPIDXML_PRINT_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_print.hpp This file contains rapidxml printer implementation #include "rapidxml.hpp" // Only include streams if not disabled #ifndef RAPIDXML_NO_STREAMS #include #include #endif namespace rapidxml { /////////////////////////////////////////////////////////////////////// // Printing flags const int print_no_indenting = 0x1; //!< Printer flag instructing the printer to suppress indenting of XML. See print() function. /////////////////////////////////////////////////////////////////////// // Internal //! \cond internal namespace internal { /////////////////////////////////////////////////////////////////////////// // Function declarations template inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out); template inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out); template inline OutIt fill_chars(OutIt out, int n, Ch ch); template inline bool find_char(const Ch *begin, const Ch *end); template inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_attributes(OutIt out, const xml_node *node, int flags); template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent); /////////////////////////////////////////////////////////////////////////// // Internal character operations // Copy characters from given range to given output iterator template inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out) { while (begin != end) *out++ = *begin++; return out; } // Copy characters from given range to given output iterator and expand // characters into references (< > ' " &) template inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out) { while (begin != end) { if (*begin == noexpand) { *out++ = *begin; // No expansion, copy character } else { switch (*begin) { case Ch('<'): *out++ = Ch('&'); *out++ = Ch('l'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('>'): *out++ = Ch('&'); *out++ = Ch('g'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('\''): *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('p'); *out++ = Ch('o'); *out++ = Ch('s'); *out++ = Ch(';'); break; case Ch('"'): *out++ = Ch('&'); *out++ = Ch('q'); *out++ = Ch('u'); *out++ = Ch('o'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('&'): *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('m'); *out++ = Ch('p'); *out++ = Ch(';'); break; default: *out++ = *begin; // No expansion, copy character } } ++begin; // Step to next character } return out; } // Fill given output iterator with repetitions of the same character template inline OutIt fill_chars(OutIt out, int n, Ch ch) { for (int i = 0; i < n; ++i) *out++ = ch; return out; } // Find character template inline bool find_char(const Ch *begin, const Ch *end) { while (begin != end) if (*begin++ == ch) return true; return false; } /////////////////////////////////////////////////////////////////////////// // Internal printing operations // Print node template inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) { // Print proper node type switch (node->type()) { // Document case node_document: out = print_children(out, node, flags, indent); break; // Element case node_element: out = print_element_node(out, node, flags, indent); break; // Data case node_data: out = print_data_node(out, node, flags, indent); break; // CDATA case node_cdata: out = print_cdata_node(out, node, flags, indent); break; // Declaration case node_declaration: out = print_declaration_node(out, node, flags, indent); break; // Comment case node_comment: out = print_comment_node(out, node, flags, indent); break; // Doctype case node_doctype: out = print_doctype_node(out, node, flags, indent); break; // Pi case node_pi: out = print_pi_node(out, node, flags, indent); break; // Unknown default: assert(0); break; } // If indenting not disabled, add line break after node if (!(flags & print_no_indenting)) *out = Ch('\n'), ++out; // Return modified iterator return out; } // Print children of the node template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent) { for (xml_node *child = node->first_node(); child; child = child->next_sibling()) out = print_node(out, child, flags, indent); return out; } // Print attributes of the node template inline OutIt print_attributes(OutIt out, const xml_node *node, int flags) { for (xml_attribute *attribute = node->first_attribute(); attribute; attribute = attribute->next_attribute()) { if (attribute->name() && attribute->value()) { // Print attribute name *out = Ch(' '), ++out; out = copy_chars(attribute->name(), attribute->name() + attribute->name_size(), out); *out = Ch('='), ++out; // Print attribute value using appropriate quote type if (find_char(attribute->value(), attribute->value() + attribute->value_size())) { *out = Ch('\''), ++out; out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('"'), out); *out = Ch('\''), ++out; } else { *out = Ch('"'), ++out; out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('\''), out); *out = Ch('"'), ++out; } } } return out; } // Print data node template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_data); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); return out; } // Print data node template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_cdata); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'); ++out; *out = Ch('!'); ++out; *out = Ch('['); ++out; *out = Ch('C'); ++out; *out = Ch('D'); ++out; *out = Ch('A'); ++out; *out = Ch('T'); ++out; *out = Ch('A'); ++out; *out = Ch('['); ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch(']'); ++out; *out = Ch(']'); ++out; *out = Ch('>'); ++out; return out; } // Print element node template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_element); // Print element name and attributes, if any if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); out = print_attributes(out, node, flags); // If node is childless if (node->value_size() == 0 && !node->first_node()) { // Print childless node tag ending *out = Ch('/'), ++out; *out = Ch('>'), ++out; } else { // Print normal node tag ending *out = Ch('>'), ++out; // Test if node contains a single data node only (and no other nodes) xml_node *child = node->first_node(); if (!child) { // If node has no children, only print its value without indenting out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); } else if (child->next_sibling() == 0 && child->type() == node_data) { // If node has a sole data child, only print its value without indenting out = copy_and_expand_chars(child->value(), child->value() + child->value_size(), Ch(0), out); } else { // Print all children with full indenting if (!(flags & print_no_indenting)) *out = Ch('\n'), ++out; out = print_children(out, node, flags, indent + 1); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); } // Print node end *out = Ch('<'), ++out; *out = Ch('/'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); *out = Ch('>'), ++out; } return out; } // Print declaration node template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent) { // Print declaration start if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('?'), ++out; *out = Ch('x'), ++out; *out = Ch('m'), ++out; *out = Ch('l'), ++out; // Print attributes out = print_attributes(out, node, flags); // Print declaration end *out = Ch('?'), ++out; *out = Ch('>'), ++out; return out; } // Print comment node template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_comment); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('!'), ++out; *out = Ch('-'), ++out; *out = Ch('-'), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('-'), ++out; *out = Ch('-'), ++out; *out = Ch('>'), ++out; return out; } // Print doctype node template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_doctype); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('!'), ++out; *out = Ch('D'), ++out; *out = Ch('O'), ++out; *out = Ch('C'), ++out; *out = Ch('T'), ++out; *out = Ch('Y'), ++out; *out = Ch('P'), ++out; *out = Ch('E'), ++out; *out = Ch(' '), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('>'), ++out; return out; } // Print pi node template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_pi); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('?'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); *out = Ch(' '), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('?'), ++out; *out = Ch('>'), ++out; return out; } } //! \endcond /////////////////////////////////////////////////////////////////////////// // Printing //! Prints XML to given output iterator. //! \param out Output iterator to print to. //! \param node Node to be printed. Pass xml_document to print entire document. //! \param flags Flags controlling how XML is printed. //! \return Output iterator pointing to position immediately after last character of printed text. template inline OutIt print(OutIt out, const xml_node &node, int flags = 0) { return internal::print_node(out, &node, flags, 0); } #ifndef RAPIDXML_NO_STREAMS //! Prints XML to given output stream. //! \param out Output stream to print to. //! \param node Node to be printed. Pass xml_document to print entire document. //! \param flags Flags controlling how XML is printed. //! \return Output stream. template inline std::basic_ostream &print(std::basic_ostream &out, const xml_node &node, int flags = 0) { print(std::ostream_iterator(out), node, flags); return out; } //! Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process. //! \param out Output stream to print to. //! \param node Node to be printed. //! \return Output stream. template inline std::basic_ostream &operator <<(std::basic_ostream &out, const xml_node &node) { return print(out, node); } #endif } #endif ================================================ FILE: Libraries/Core/Android/Headers/rapidxml/rapidxml_utils.hpp ================================================ #ifndef RAPIDXML_UTILS_HPP_INCLUDED #define RAPIDXML_UTILS_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_utils.hpp This file contains high-level rapidxml utilities that can be useful //! in certain simple scenarios. They should probably not be used if maximizing performance is the main objective. #include "rapidxml.hpp" #include #include #include #include namespace rapidxml { //! Represents data loaded from a file template class file { public: //! Loads file into the memory. Data will be automatically destroyed by the destructor. //! \param filename Filename to load. file(const char *filename) { using namespace std; // Open stream basic_ifstream stream(filename, ios::binary); if (!stream) throw runtime_error(string("cannot open file ") + filename); stream.unsetf(ios::skipws); // Determine stream size stream.seekg(0, ios::end); size_t size = stream.tellg(); stream.seekg(0); // Load data and add terminating 0 m_data.resize(size + 1); stream.read(&m_data.front(), static_cast(size)); m_data[size] = 0; } //! Loads file into the memory. Data will be automatically destroyed by the destructor //! \param stream Stream to load from file(std::basic_istream &stream) { using namespace std; // Load data and add terminating 0 stream.unsetf(ios::skipws); m_data.assign(istreambuf_iterator(stream), istreambuf_iterator()); if (stream.fail() || stream.bad()) throw runtime_error("error reading stream"); m_data.push_back(0); } //! Gets file data. //! \return Pointer to data of file. Ch *data() { return &m_data.front(); } //! Gets file data. //! \return Pointer to data of file. const Ch *data() const { return &m_data.front(); } //! Gets file data size. //! \return Size of file data, in characters. std::size_t size() const { return m_data.size(); } private: std::vector m_data; // File data }; //! Counts children of node. Time complexity is O(n). //! \return Number of children of node template inline std::size_t count_children(xml_node *node) { xml_node *child = node->first_node(); std::size_t count = 0; while (child) { ++count; child = child->next_sibling(); } return count; } //! Counts attributes of node. Time complexity is O(n). //! \return Number of attributes of node template inline std::size_t count_attributes(xml_node *node) { xml_attribute *attr = node->first_attribute(); std::size_t count = 0; while (attr) { ++count; attr = attr->next_attribute(); } return count; } } #endif ================================================ FILE: Libraries/Core/RPi/Headers/EGL/egl.h ================================================ /* -*- mode: c; tab-width: 8; -*- */ /* vi: set sw=4 ts=8: */ /* Reference version of egl.h for EGL 1.4. * $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $ */ /* ** Copyright (c) 2007-2009 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ #ifndef __egl_h_ #define __egl_h_ /* All platform-dependent types and macro boilerplate (such as EGLAPI * and EGLAPIENTRY) should go in eglplatform.h. */ #include "eglplatform.h" #ifdef __cplusplus extern "C" { #endif /* EGL Types */ /* EGLint is defined in eglplatform.h */ typedef unsigned int EGLBoolean; typedef unsigned int EGLenum; typedef void *EGLConfig; typedef void *EGLContext; typedef void *EGLDisplay; typedef void *EGLSurface; typedef void *EGLClientBuffer; /* EGL Versioning */ #define EGL_VERSION_1_0 1 #define EGL_VERSION_1_1 1 #define EGL_VERSION_1_2 1 #define EGL_VERSION_1_3 1 #define EGL_VERSION_1_4 1 /* EGL Enumerants. Bitmasks and other exceptional cases aside, most * enums are assigned unique values starting at 0x3000. */ /* EGL aliases */ #define EGL_FALSE ((EGLBoolean)0) #define EGL_TRUE ((EGLBoolean)1) /* Out-of-band handle values */ #define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0) #define EGL_NO_CONTEXT ((EGLContext)0) #define EGL_NO_DISPLAY ((EGLDisplay)0) #define EGL_NO_SURFACE ((EGLSurface)0) /* Out-of-band attribute value */ #define EGL_DONT_CARE ((EGLint)-1) /* Errors / GetError return values */ #define EGL_SUCCESS 0x3000 #define EGL_NOT_INITIALIZED 0x3001 #define EGL_BAD_ACCESS 0x3002 #define EGL_BAD_ALLOC 0x3003 #define EGL_BAD_ATTRIBUTE 0x3004 #define EGL_BAD_CONFIG 0x3005 #define EGL_BAD_CONTEXT 0x3006 #define EGL_BAD_CURRENT_SURFACE 0x3007 #define EGL_BAD_DISPLAY 0x3008 #define EGL_BAD_MATCH 0x3009 #define EGL_BAD_NATIVE_PIXMAP 0x300A #define EGL_BAD_NATIVE_WINDOW 0x300B #define EGL_BAD_PARAMETER 0x300C #define EGL_BAD_SURFACE 0x300D #define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */ /* Reserved 0x300F-0x301F for additional errors */ /* Config attributes */ #define EGL_BUFFER_SIZE 0x3020 #define EGL_ALPHA_SIZE 0x3021 #define EGL_BLUE_SIZE 0x3022 #define EGL_GREEN_SIZE 0x3023 #define EGL_RED_SIZE 0x3024 #define EGL_DEPTH_SIZE 0x3025 #define EGL_STENCIL_SIZE 0x3026 #define EGL_CONFIG_CAVEAT 0x3027 #define EGL_CONFIG_ID 0x3028 #define EGL_LEVEL 0x3029 #define EGL_MAX_PBUFFER_HEIGHT 0x302A #define EGL_MAX_PBUFFER_PIXELS 0x302B #define EGL_MAX_PBUFFER_WIDTH 0x302C #define EGL_NATIVE_RENDERABLE 0x302D #define EGL_NATIVE_VISUAL_ID 0x302E #define EGL_NATIVE_VISUAL_TYPE 0x302F #define EGL_SAMPLES 0x3031 #define EGL_SAMPLE_BUFFERS 0x3032 #define EGL_SURFACE_TYPE 0x3033 #define EGL_TRANSPARENT_TYPE 0x3034 #define EGL_TRANSPARENT_BLUE_VALUE 0x3035 #define EGL_TRANSPARENT_GREEN_VALUE 0x3036 #define EGL_TRANSPARENT_RED_VALUE 0x3037 #define EGL_NONE 0x3038 /* Attrib list terminator */ #define EGL_BIND_TO_TEXTURE_RGB 0x3039 #define EGL_BIND_TO_TEXTURE_RGBA 0x303A #define EGL_MIN_SWAP_INTERVAL 0x303B #define EGL_MAX_SWAP_INTERVAL 0x303C #define EGL_LUMINANCE_SIZE 0x303D #define EGL_ALPHA_MASK_SIZE 0x303E #define EGL_COLOR_BUFFER_TYPE 0x303F #define EGL_RENDERABLE_TYPE 0x3040 #define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */ #define EGL_CONFORMANT 0x3042 /* Reserved 0x3041-0x304F for additional config attributes */ /* Config attribute values */ #define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ #define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */ #define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ #define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */ #define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */ /* More config attribute values, for EGL_TEXTURE_FORMAT */ #define EGL_NO_TEXTURE 0x305C #define EGL_TEXTURE_RGB 0x305D #define EGL_TEXTURE_RGBA 0x305E #define EGL_TEXTURE_2D 0x305F /* Config attribute mask bits */ #define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */ #define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */ #define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */ #define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */ #define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */ #define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */ #define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */ #define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */ #define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */ #define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */ #define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */ /* QueryString targets */ #define EGL_VENDOR 0x3053 #define EGL_VERSION 0x3054 #define EGL_EXTENSIONS 0x3055 #define EGL_CLIENT_APIS 0x308D /* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */ #define EGL_HEIGHT 0x3056 #define EGL_WIDTH 0x3057 #define EGL_LARGEST_PBUFFER 0x3058 #define EGL_TEXTURE_FORMAT 0x3080 #define EGL_TEXTURE_TARGET 0x3081 #define EGL_MIPMAP_TEXTURE 0x3082 #define EGL_MIPMAP_LEVEL 0x3083 #define EGL_RENDER_BUFFER 0x3086 #define EGL_VG_COLORSPACE 0x3087 #define EGL_VG_ALPHA_FORMAT 0x3088 #define EGL_HORIZONTAL_RESOLUTION 0x3090 #define EGL_VERTICAL_RESOLUTION 0x3091 #define EGL_PIXEL_ASPECT_RATIO 0x3092 #define EGL_SWAP_BEHAVIOR 0x3093 #define EGL_MULTISAMPLE_RESOLVE 0x3099 /* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */ #define EGL_BACK_BUFFER 0x3084 #define EGL_SINGLE_BUFFER 0x3085 /* OpenVG color spaces */ #define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */ #define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */ /* OpenVG alpha formats */ #define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */ #define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */ /* Constant scale factor by which fractional display resolutions & * aspect ratio are scaled when queried as integer values. */ #define EGL_DISPLAY_SCALING 10000 /* Unknown display resolution/aspect ratio */ #define EGL_UNKNOWN ((EGLint)-1) /* Back buffer swap behaviors */ #define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */ #define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */ /* CreatePbufferFromClientBuffer buffer types */ #define EGL_OPENVG_IMAGE 0x3096 /* QueryContext targets */ #define EGL_CONTEXT_CLIENT_TYPE 0x3097 /* CreateContext attributes */ #define EGL_CONTEXT_CLIENT_VERSION 0x3098 /* Multisample resolution behaviors */ #define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */ #define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */ /* BindAPI/QueryAPI targets */ #define EGL_OPENGL_ES_API 0x30A0 #define EGL_OPENVG_API 0x30A1 #define EGL_OPENGL_API 0x30A2 /* GetCurrentSurface targets */ #define EGL_DRAW 0x3059 #define EGL_READ 0x305A /* WaitNative engines */ #define EGL_CORE_NATIVE_ENGINE 0x305B /* EGL 1.2 tokens renamed for consistency in EGL 1.3 */ #define EGL_COLORSPACE EGL_VG_COLORSPACE #define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT #define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB #define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR #define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE #define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE /* EGL extensions must request enum blocks from the Khronos * API Registrar, who maintains the enumerant registry. Submit * a bug in Khronos Bugzilla against task "Registry". */ /* EGL Functions */ EGLAPI EGLint EGLAPIENTRY eglGetError(void); EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id); EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor); EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy); EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name); EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface); EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api); EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void); EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void); EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void); EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer( EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx); EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void); EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw); EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void); EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void); EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine); EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface); EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target); /* This is a generic function pointer type, whose name indicates it must * be cast to the proper type *and calling convention* before use. */ typedef void (*__eglMustCastToProperFunctionPointerType)(void); /* Now, define eglGetProcAddress using the generic function ptr. type */ EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const char *procname); #ifdef __cplusplus } #endif #endif /* __egl_h_ */ ================================================ FILE: Libraries/Core/RPi/Headers/EGL/eglext.h ================================================ #ifndef __eglext_h_ #define __eglext_h_ #ifdef __cplusplus extern "C" { #endif /* ** Copyright (c) 2007-2009 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ #include "eglplatform.h" /* We want this */ #ifndef EGL_EGLEXT_PROTOTYPES #define EGL_EGLEXT_PROTOTYPES #endif /*************************************************************/ /* Header file version number */ /* Current version at http://www.khronos.org/registry/egl/ */ /* $Revision: 7244 $ on $Date: 2009-01-20 17:06:59 -0800 (Tue, 20 Jan 2009) $ */ #define EGL_EGLEXT_VERSION 3 #ifndef EGL_KHR_config_attribs #define EGL_KHR_config_attribs 1 #define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */ #define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */ #define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */ #endif #ifndef EGL_KHR_lock_surface #define EGL_KHR_lock_surface 1 #define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ #define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */ #define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */ #define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */ #define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */ #define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */ #define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */ #define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */ #define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */ #define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */ #define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */ #define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */ #define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */ #define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */ #define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */ #define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */ #define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */ #define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */ #define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */ #define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */ #define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */ #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface); #endif #ifndef EGL_KHR_image #define EGL_KHR_image 1 #define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */ typedef void *EGLImageKHR; #define EGL_NO_IMAGE_KHR ((EGLImageKHR)0) #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image); #endif #ifndef EGL_KHR_vg_parent_image #define EGL_KHR_vg_parent_image 1 #define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */ #endif #ifndef EGL_KHR_gl_texture_2D_image #define EGL_KHR_gl_texture_2D_image 1 #define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */ #define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */ #endif #ifndef EGL_KHR_gl_texture_cubemap_image #define EGL_KHR_gl_texture_cubemap_image 1 #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */ #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */ #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */ #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */ #define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */ #define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */ #endif #ifndef EGL_KHR_gl_texture_3D_image #define EGL_KHR_gl_texture_3D_image 0 #define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */ #define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */ #endif #ifndef EGL_KHR_gl_renderbuffer_image #define EGL_KHR_gl_renderbuffer_image 1 #define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */ #endif #ifndef EGL_KHR_image_base #define EGL_KHR_image_base 1 /* Most interfaces defined by EGL_KHR_image_pixmap above */ #define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */ #endif #ifndef EGL_KHR_image_pixmap #define EGL_KHR_image_pixmap 1 /* Interfaces defined by EGL_KHR_image above */ #endif #ifndef EGL_KHR_fence_sync #define EGL_KHR_fence_sync 1 #define GL_OES_EGL_sync 1 #endif #ifndef EGL_KHR_sync #define EGL_KHR_sync 1 #endif #if ((EGL_KHR_sync == 1) || (EGL_KHR_fence_sync == 1)) #define EGL_KHR_sync 1 /* EGL_KHR_fence_sync depends on this stuff */ /* * EGLSyncKHR is an opaque handle to an EGL sync object */ typedef void* EGLSyncKHR; /* * EGLTimeKHR is a 64-bit unsigned integer representing intervals * in nanoseconds. */ typedef khronos_utime_nanoseconds_t EGLTimeKHR; #define EGL_SYNC_FENCE_KHR 0x30F9 #define EGL_SYNC_REUSABLE_KHR 0x30FA #define EGL_SYNC_TYPE_KHR 0x30F7 #define EGL_SYNC_STATUS_KHR 0x30F1 #define EGL_SYNC_CONDITION_KHR 0x30F8 #define EGL_SIGNALED_KHR 0x30F2 #define EGL_UNSIGNALED_KHR 0x30F3 #define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0 #define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 #define EGL_TIMEOUT_EXPIRED_KHR 0x30F5 #define EGL_CONDITION_SATISFIED_KHR 0x30F6 #define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull #define EGL_NO_SYNC_KHR ((EGLSyncKHR)0) #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync); EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync); typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout); typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode); typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value); #endif #ifdef __cplusplus } #endif #include "eglext_brcm.h" #if defined(ANDROID) #include "eglext_android.h" #include "eglext_nvidia.h" #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/EGL/eglext_android.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(ANDROID) #ifndef EGLEXT_ANDROID_H #define EGLEXT_ANDROID_H #ifdef __cplusplus extern "C" { #endif #ifndef EGL_ANDROID_image_native_buffer #define EGL_ANDROID_image_native_buffer 1 #if defined(EGL_EGLEXT_ANDROID_STRUCT_HEADER) #include #else struct android_native_buffer_t; #endif #define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */ #endif /* Structure layout for android native buffers. * * Note: this will be harmonized with gralloc_brcm.h. */ typedef enum { EGL_BRCM_ANDROID_BUFFER_TYPE_GL_RESOURCE = 0, EGL_BRCM_ANDROID_BUFFER_TYPE_MM_RESOURCE, } EGL_BRCM_ANDROID_BUFFER_TYPE_T; /* By default Android always define this internally, also due to a missing ** proper pending #define in the Android frameworks/base/opengl/libs/egl/egl.cpp ** module we cannot actually disable EGL_ANDROID_swap_rectangle support via build ** configuration (ie setting 'TARGET_GLOBAL_CPPFLAGS += -DEGL_ANDROID_swap_rectangle=0' ** in our BoardConfig.mk) which would be the preferred mechanism, instead we therefore ** have to match Android behavior and define by default what is expected to be supported, ** as well as provide an implementation for it (which implementation may be empty as ** long as it satisfies Android expectations). */ #ifndef EGL_ANDROID_swap_rectangle #define EGL_ANDROID_swap_rectangle 1 #endif #if EGL_ANDROID_swap_rectangle #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglSetSwapRectangleANDROID (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETSWAPRECTANGLEANDROIDPROC) (EGLDisplay dpy, EGLSurface draw, EGLint left, EGLint top, EGLint width, EGLint height); #endif /* EGL_ANDROID_swap_rectangle */ #ifndef EGL_ANDROID_render_buffer #define EGL_ANDROID_render_buffer 1 #endif #if EGL_ANDROID_render_buffer #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLClientBuffer EGLAPIENTRY eglGetRenderBufferANDROID (EGLDisplay dpy, EGLSurface sur); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef EGLClientBuffer (EGLAPIENTRYP PFNEGLGETRENDERBUFFERANDROIDPROC) (EGLDisplay dpy, EGLSurface sur); #endif /* EGL_ANDROID_swap_rectangle */ #ifndef EGL_ANDROID_recordable #define EGL_ANDROID_recordable 1 #define EGL_RECORDABLE_ANDROID 0x3142 #endif #ifdef __cplusplus } #endif #endif /* EGLEXT_ANDROID_H */ #endif /* defined(ANDROID) */ ================================================ FILE: Libraries/Core/RPi/Headers/EGL/eglext_brcm.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef EGLEXT_BRCM_H #define EGLEXT_BRCM_H #ifdef __cplusplus extern "C" { #endif #define EGL_NATIVE_PIXMAP_CLIENT_SIDE_BRCM 0x99930B0 /* eglCreateImageKHR server-side target */ #define EGL_IMAGE_FROM_SURFACE_BRCM 0x99930B1 /* eglCreateImageKHR server-side target */ /* Multimedia target - created by gralloc */ #define EGL_IMAGE_BRCM_MULTIMEDIA 0x99930B2 #define EGL_IMAGE_BRCM_DUPLICATE 0x99930B3 /* a new EGL Image pointing at the same underlying object */ #define EGL_IMAGE_BRCM_RAW_PIXELS 0x99930B4 /* Raw YUV multimedia pixels */ /* Fastpath for creating greyscale textures from a single plane of a * MMAL opaque buffers. */ #define EGL_IMAGE_BRCM_MULTIMEDIA_Y 0x99930C0 #define EGL_IMAGE_BRCM_MULTIMEDIA_U 0x99930C1 #define EGL_IMAGE_BRCM_MULTIMEDIA_V 0x99930C2 /* EGL image buffer allocated in shared memory */ #define EGL_IMAGE_BRCM_VCSM 0x99930C3 struct egl_image_brcm_vcsm_info { unsigned width; unsigned height; unsigned int vcsm_handle; }; #ifndef EGL_BRCM_sane_choose_config #define EGL_BRCM_sane_choose_config 1 #endif #if EGL_BRCM_sane_choose_config #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglSaneChooseConfigBRCM(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSANECHOOSECONFIGBRCM)(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); #endif #ifndef EGL_BRCM_global_image #define EGL_BRCM_global_image 1 #endif #if EGL_BRCM_global_image #define EGL_PIXEL_FORMAT_ARGB_8888_PRE_BRCM 0 #define EGL_PIXEL_FORMAT_ARGB_8888_BRCM 1 #define EGL_PIXEL_FORMAT_XRGB_8888_BRCM 2 #define EGL_PIXEL_FORMAT_RGB_565_BRCM 3 #define EGL_PIXEL_FORMAT_A_8_BRCM 4 #define EGL_PIXEL_FORMAT_RENDER_GL_BRCM (1 << 3) #define EGL_PIXEL_FORMAT_RENDER_GLES_BRCM (1 << 4) #define EGL_PIXEL_FORMAT_RENDER_GLES2_BRCM (1 << 5) #define EGL_PIXEL_FORMAT_RENDER_VG_BRCM (1 << 6) #define EGL_PIXEL_FORMAT_RENDER_MASK_BRCM 0x78 #define EGL_PIXEL_FORMAT_VG_IMAGE_BRCM (1 << 7) #define EGL_PIXEL_FORMAT_GLES_TEXTURE_BRCM (1 << 8) #define EGL_PIXEL_FORMAT_GLES2_TEXTURE_BRCM (1 << 9) #define EGL_PIXEL_FORMAT_TEXTURE_MASK_BRCM 0x380 #define EGL_PIXEL_FORMAT_USAGE_MASK_BRCM 0x3f8 #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI void EGLAPIENTRY eglCreateGlobalImageBRCM(EGLint width, EGLint height, EGLint pixel_format, const void *data, EGLint data_stride, EGLint *id); EGLAPI void EGLAPIENTRY eglCreateCopyGlobalImageBRCM(const EGLint *src_id, EGLint *id); EGLAPI EGLBoolean EGLAPIENTRY eglDestroyGlobalImageBRCM(const EGLint *id); EGLAPI EGLBoolean EGLAPIENTRY eglQueryGlobalImageBRCM(const EGLint *id, EGLint *width_height_pixel_format); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef void (EGLAPIENTRYP PFNEGLCREATEGLOBALIMAGEBRCMPROC)(EGLint width, EGLint height, EGLint pixel_format, const void *data, EGLint data_stride, EGLint *id); typedef void (EGLAPIENTRYP PFNEGLCREATECOPYGLOBALIMAGEBRCMPROC)(const EGLint *src_id, EGLint *id); typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYGLOBALIMAGEBRCMPROC)(const EGLint *id); typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYGLOBALIMAGEBRCMPROC)(const EGLint *id, EGLint *width_height_pixel_format); #endif #ifndef EGL_BRCM_perf_monitor #define EGL_BRCM_perf_monitor 0 #endif #if EGL_BRCM_perf_monitor #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglInitPerfMonitorBRCM(EGLDisplay display); EGLAPI EGLBoolean EGLAPIENTRY eglTermPerfMonitorBRCM(EGLDisplay display); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef void (EGLAPIENTRYP PFNEGLINITPERFMONITORBRCMPROC)(EGLDisplay display); typedef void (EGLAPIENTRYP PFNEGLTERMPERFMONITORBRCMPROC)(EGLDisplay display); #endif #ifndef EGL_BRCM_driver_monitor #define EGL_BRCM_driver_monitor 1 #endif #if EGL_BRCM_driver_monitor #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLBoolean EGLAPIENTRY eglInitDriverMonitorBRCM(EGLDisplay display, EGLint hw_bank, EGLint l3c_bank); EGLAPI void EGLAPIENTRY eglGetDriverMonitorXMLBRCM(EGLDisplay display, EGLint bufSize, EGLint *length, char *xmlStats); EGLAPI EGLBoolean EGLAPIENTRY eglTermDriverMonitorBRCM(EGLDisplay display); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef void (EGLAPIENTRYP PFNEGLINITDRIVERMONITORBRCMPROC)(EGLDisplay display, EGLint hw_bank, EGLint l3c_bank); typedef void (EGLAPIENTRYP PFNEGLGETDRIVERMONITORXMLBRCMPROC)(EGLDisplay display, EGLint bufSize, EGLint *length, char *xmlStats); typedef void (EGLAPIENTRYP PFNEGLTERMDRIVERMONITORBRCMPROC)(EGLDisplay display); #endif #ifndef EGL_BRCM_perf_stats #define EGL_BRCM_perf_stats 0 #endif #if EGL_BRCM_perf_stats #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI void eglPerfStatsResetBRCM(void); EGLAPI void eglPerfStatsGetBRCM(char *buffer, EGLint buffer_len, EGLBoolean reset); #endif typedef void (EGLAPIENTRYP PFNEGLPERFSTATSRESETBRCM) (void); typedef void (EGLAPIENTRYP PFNEGLPERFSTATSGETBRCM) (char *buffer, EGLint buffer_len, EGLBoolean reset); #endif #ifndef EGL_proc_state_valid #define EGL_proc_state_valid 1 #endif #if EGL_proc_state_valid #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI void EGLAPIENTRY eglProcStateValid( EGLDisplay dpy, EGLBoolean *result ); #endif typedef void (EGLAPIENTRYP PFNEGLPROCSTATEVALID) ( EGLDisplay dpy, EGLBoolean *valid ); #endif #ifndef EGL_BRCM_flush #define EGL_BRCM_flush 1 #endif #if EGL_BRCM_flush #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI void EGLAPIENTRY eglFlushBRCM(void); #endif /* EGL_EGLEXT_PROTOTYPES */ typedef void (EGLAPIENTRYP PFNEGLFLUSHBRCMPROC)(void); #endif #ifndef EGL_BRCM_image_wrap #define EGL_BRCM_image_wrap 1 #define EGL_IMAGE_WRAP_BRCM 0x9993140 #endif #ifndef EGL_BRCM_image_wrap_bcg #define EGL_BRCM_image_wrap_bcg 0 #define EGL_IMAGE_WRAP_BRCM_BCG 0x9993141 #if EGL_BRCM_image_wrap_bcg typedef struct { BEGL_BufferFormat format; uint16_t width; uint16_t height; int32_t stride; /* in bytes */ void *storage; } EGL_IMAGE_WRAP_BRCM_BCG_IMAGE_T; #endif #endif #ifndef EGL_BRCM_mem_usage #define EGL_BRCM_mem_usage 0 #endif #if EGL_BRCM_mem_usage #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI void eglProcessMemUsageGetBRCM(uint32_t id_0, uint32_t id_1, char *buffer, uint32_t buffer_len); #endif typedef void (EGLAPIENTRYP PFNEGLPROCESSMEMUSAGEGETBRCM) (uint32_t id_0, uint32_t id_1, char *buffer, uint32_t buffer_len); #endif /* Only enable this #define if the application (or wrapper layer) is going to call eglDirectRenderingPointer when appropriate (i.e. the first time eglMakeCurrent is called, and then at eglSwapBuffers) Only used for testing purposes on 2763 */ //#define DIRECT_RENDERING #ifdef DIRECT_RENDERING EGLAPI EGLBoolean EGLAPIENTRY eglDirectRenderingPointer(EGLDisplay dpy, EGLSurface surf, void *image /* KHRN_IMAGE_WRAP_T */); #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/EGL/eglext_nvidia.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(ANDROID) #ifndef EGLEXT_NVIDIA_H #define EGLEXT_NVIDIA_H #ifdef __cplusplus extern "C" { #endif #ifndef EGL_NV_system_time #define EGL_NV_system_time 1 typedef khronos_int64_t EGLint64NV; typedef khronos_uint64_t EGLuint64NV; #ifdef EGL_EGLEXT_PROTOTYPES EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void); EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void); #endif typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC)(void); typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC)(void); #endif #ifdef __cplusplus } #endif #endif /* EGLEXT_NVIDIA_H */ #endif /* defined(ANDROID) */ ================================================ FILE: Libraries/Core/RPi/Headers/EGL/eglplatform.h ================================================ #ifndef __eglplatform_h_ #define __eglplatform_h_ /* ** Copyright (c) 2007-2009 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ /* Platform-specific types and definitions for egl.h * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ * * Adopters may modify khrplatform.h and this file to suit their platform. * You are encouraged to submit all modifications to the Khronos group so that * they can be included in future versions of this file. Please submit changes * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) * by filing a bug against product "EGL" component "Registry". */ #include "../KHR/khrplatform.h" #ifdef ABSTRACT_PLATFORM #include "begl_memplatform.h" #include "begl_hwplatform.h" #include "begl_dispplatform.h" #endif /* ABSTRACT_PLATFORM */ /* Macros used in EGL function prototype declarations. * * EGL functions should be prototyped as: * * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); * * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h */ #ifndef EGLAPI #define EGLAPI KHRONOS_APICALL #endif #ifndef EGLAPIENTRY #define EGLAPIENTRY KHRONOS_APIENTRY #endif #ifndef EGLAPIENTRYP #define EGLAPIENTRYP EGLAPIENTRY * #endif #ifndef EGLAPI #ifdef KHAPI #define EGLAPI KHAPI #else #define EGLAPI extern #endif #endif /* The types NativeDisplayType, NativeWindowType, and NativePixmapType * are aliases of window-system-dependent types, such as X Display * or * Windows Device Context. They must be defined in platform-specific * code below. The EGL-prefixed versions of Native*Type are the same * types, renamed in EGL 1.3 so all types in the API start with "EGL". * * Khronos STRONGLY RECOMMENDS that you use the default definitions * provided below, since these changes affect both binary and source * portability of applications using EGL running on different EGL * implementations. */ /* Unix (tentative) #include typedef Display *NativeDisplayType; - or maybe, if encoding "hostname:display.head" typedef const char *NativeWindowType; etc. */ #if (defined (__ANDROID__) || defined(ANDROID)) && defined(KHRN_BCG_ANDROID) struct android_native_window_t; struct egl_native_pixmap_t; typedef struct android_native_window_t* EGLNativeWindowType; typedef struct egl_native_pixmap_t* EGLNativePixmapType; typedef void *EGLNativeDisplayType; #else typedef void *EGLNativeDisplayType; typedef void *EGLNativePixmapType; typedef void *EGLNativeWindowType; #endif #ifndef EGL_SERVER_SMALLINT #include "interface/vmcs_host/vc_dispmanx.h" /* TODO: EGLNativeWindowType is really one of these but I'm leaving it * as void* for now, in case changing it would cause problems */ typedef struct { DISPMANX_ELEMENT_HANDLE_T element; int width; /* This is necessary because dispmanx elements are not queriable. */ int height; } EGL_DISPMANX_WINDOW_T; #elif defined (ABSTRACT_PLATFORM) #else /* window I of a horizontal strip of N WxH windows */ #define PACK_NATIVE_WINDOW(W, H, I, N) ((NativeWindowType)((W) | ((H) << 12) | ((I) << 24) | ((N) << 28))) #define UNPACK_NATIVE_WINDOW_W(WIN) ((unsigned int)(WIN) & 0xfff) #define UNPACK_NATIVE_WINDOW_H(WIN) (((unsigned int)(WIN) >> 12) & 0xfff) #define UNPACK_NATIVE_WINDOW_I(WIN) (((unsigned int)(WIN) >> 24) & 0xf) #define UNPACK_NATIVE_WINDOW_N(WIN) ((unsigned int)(WIN) >> 28) /* todo: can we change these to use PACK_NATIVE_WINDOW and get rid of platform_canonical_win from platform.h? */ #define NATIVE_WINDOW_800_480 ((NativeWindowType)0) #define NATIVE_WINDOW_640_480 ((NativeWindowType)1) #define NATIVE_WINDOW_320_240 ((NativeWindowType)2) #define NATIVE_WINDOW_240_320 ((NativeWindowType)3) #define NATIVE_WINDOW_64_64 ((NativeWindowType)4) #define NATIVE_WINDOW_400_480_A ((NativeWindowType)5) #define NATIVE_WINDOW_400_480_B ((NativeWindowType)6) #define NATIVE_WINDOW_512_512 ((NativeWindowType)7) #define NATIVE_WINDOW_360_640 ((NativeWindowType)8) #define NATIVE_WINDOW_640_360 ((NativeWindowType)9) #define NATIVE_WINDOW_1280_720 ((NativeWindowType)10) #define NATIVE_WINDOW_1920_1080 ((NativeWindowType)11) #define NATIVE_WINDOW_480_320 ((NativeWindowType)12) #define NATIVE_WINDOW_1680_1050 ((NativeWindowType)13) #endif /* EGL 1.2 types, renamed for consistency in EGL 1.3 */ typedef EGLNativeDisplayType NativeDisplayType; typedef EGLNativePixmapType NativePixmapType; typedef EGLNativeWindowType NativeWindowType; /* Define EGLint. This must be a signed integral type large enough to contain * all legal attribute names and values passed into and out of EGL, whether * their type is boolean, bitmask, enumerant (symbolic constant), integer, * handle, or other. While in general a 32-bit integer will suffice, if * handles are 64 bit types, then EGLint should be defined as a signed 64-bit * integer type. */ typedef khronos_int32_t EGLint; #ifdef ABSTRACT_PLATFORM #ifdef __cplusplus extern "C" { #endif /* The client application, or default platform library must register valid versions of each of these interfaces before any EGL or GL functions are invoked, using the following functions provided by the 3D driver. */ typedef struct { BEGL_MemoryInterface *memInterface; /* Memory interface which will called by the 3d driver */ BEGL_HWInterface *hwInterface; /* Hardware interface which will be called by the driver */ BEGL_DisplayInterface *displayInterface; /* Display interface which will be called by the driver */ BEGL_DisplayCallbacks displayCallbacks; /* Callback pointers set by BEGL_GetDefaultDriverInterfaces, for client to call into driver */ int hwInterfaceCloned; int memInterfaceCloned; void *memInterfaceFn; void *hwInterfaceFn; } BEGL_DriverInterfaces; /* Register application level overrides for any or all of the abstract API calls made by the 3D driver. */ EGLAPI void EGLAPIENTRY BEGL_RegisterDriverInterfaces(BEGL_DriverInterfaces *iface); /* Get a pointer to the registered driver interfaces, can be used to override partial defaults - see android platform layer(s) for example */ EGLAPI BEGL_DriverInterfaces * BEGL_GetDriverInterfaces(void); /* Initializes all interfaces in the structure to NULL, fills out Callbacks with appropriate function pointers */ EGLAPI void EGLAPIENTRY BEGL_GetDefaultDriverInterfaces(BEGL_DriverInterfaces *iface); #ifdef __cplusplus } #endif #endif /* ABSTRACT_PLATFORM */ #if 0 #include "interface/khronos/common/khrn_client_mangle.h" #endif #endif /* __eglplatform_h */ ================================================ FILE: Libraries/Core/RPi/Headers/GLES2/gl2.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __gl2_h_ #define __gl2_h_ /* $Revision: 10602 $ on $Date:: 2010-03-05 06:35:34 +0000 #$ */ #include "gl2platform.h" #ifdef __cplusplus extern "C" { #endif /* * This document is licensed under the SGI Free Software B License Version * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . */ /*------------------------------------------------------------------------- * Data type definitions *-----------------------------------------------------------------------*/ #ifndef __gl_h_ typedef void GLvoid; typedef char GLchar; typedef unsigned int GLenum; typedef unsigned char GLboolean; typedef unsigned int GLbitfield; typedef khronos_int8_t GLbyte; typedef short GLshort; typedef int GLint; typedef int GLsizei; typedef khronos_uint8_t GLubyte; typedef unsigned short GLushort; typedef unsigned int GLuint; typedef khronos_float_t GLfloat; typedef khronos_float_t GLclampf; typedef khronos_int32_t GLfixed; /* GL types for handling large vertex buffer objects */ typedef khronos_intptr_t GLintptr; typedef khronos_ssize_t GLsizeiptr; #endif /* OpenGL ES core versions */ #define GL_ES_VERSION_2_0 1 /* ClearBufferMask */ #define GL_DEPTH_BUFFER_BIT 0x00000100 #define GL_STENCIL_BUFFER_BIT 0x00000400 #define GL_COLOR_BUFFER_BIT 0x00004000 /* Boolean */ #define GL_FALSE (GLboolean)0 #define GL_TRUE (GLboolean)1 /* BeginMode */ #define GL_POINTS 0x0000 #define GL_LINES 0x0001 #define GL_LINE_LOOP 0x0002 #define GL_LINE_STRIP 0x0003 #define GL_TRIANGLES 0x0004 #define GL_TRIANGLE_STRIP 0x0005 #define GL_TRIANGLE_FAN 0x0006 /* AlphaFunction (not supported in ES20) */ /* GL_NEVER */ /* GL_LESS */ /* GL_EQUAL */ /* GL_LEQUAL */ /* GL_GREATER */ /* GL_NOTEQUAL */ /* GL_GEQUAL */ /* GL_ALWAYS */ /* BlendingFactorDest */ #define GL_ZERO 0 #define GL_ONE 1 #define GL_SRC_COLOR 0x0300 #define GL_ONE_MINUS_SRC_COLOR 0x0301 #define GL_SRC_ALPHA 0x0302 #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DST_ALPHA 0x0304 #define GL_ONE_MINUS_DST_ALPHA 0x0305 /* BlendingFactorSrc */ /* GL_ZERO */ /* GL_ONE */ #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 /* GL_SRC_ALPHA */ /* GL_ONE_MINUS_SRC_ALPHA */ /* GL_DST_ALPHA */ /* GL_ONE_MINUS_DST_ALPHA */ /* BlendEquationSeparate */ #define GL_FUNC_ADD 0x8006 #define GL_BLEND_EQUATION 0x8009 #define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */ #define GL_BLEND_EQUATION_ALPHA 0x883D /* BlendSubtract */ #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B /* Separate Blend Functions */ #define GL_BLEND_DST_RGB 0x80C8 #define GL_BLEND_SRC_RGB 0x80C9 #define GL_BLEND_DST_ALPHA 0x80CA #define GL_BLEND_SRC_ALPHA 0x80CB #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #define GL_CONSTANT_ALPHA 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 #define GL_BLEND_COLOR 0x8005 /* Buffer Objects */ #define GL_ARRAY_BUFFER 0x8892 #define GL_ELEMENT_ARRAY_BUFFER 0x8893 #define GL_ARRAY_BUFFER_BINDING 0x8894 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 #define GL_STREAM_DRAW 0x88E0 #define GL_STATIC_DRAW 0x88E4 #define GL_DYNAMIC_DRAW 0x88E8 #define GL_BUFFER_SIZE 0x8764 #define GL_BUFFER_USAGE 0x8765 #define GL_CURRENT_VERTEX_ATTRIB 0x8626 /* CullFaceMode */ #define GL_FRONT 0x0404 #define GL_BACK 0x0405 #define GL_FRONT_AND_BACK 0x0408 /* DepthFunction */ /* GL_NEVER */ /* GL_LESS */ /* GL_EQUAL */ /* GL_LEQUAL */ /* GL_GREATER */ /* GL_NOTEQUAL */ /* GL_GEQUAL */ /* GL_ALWAYS */ /* EnableCap */ #define GL_TEXTURE_2D 0x0DE1 #define GL_CULL_FACE 0x0B44 #define GL_BLEND 0x0BE2 #define GL_DITHER 0x0BD0 #define GL_STENCIL_TEST 0x0B90 #define GL_DEPTH_TEST 0x0B71 #define GL_SCISSOR_TEST 0x0C11 #define GL_POLYGON_OFFSET_FILL 0x8037 #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #define GL_SAMPLE_COVERAGE 0x80A0 /* ErrorCode */ #define GL_NO_ERROR 0 #define GL_INVALID_ENUM 0x0500 #define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 #define GL_OUT_OF_MEMORY 0x0505 /* FrontFaceDirection */ #define GL_CW 0x0900 #define GL_CCW 0x0901 /* GetPName */ #define GL_LINE_WIDTH 0x0B21 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E #define GL_CULL_FACE_MODE 0x0B45 #define GL_FRONT_FACE 0x0B46 #define GL_DEPTH_RANGE 0x0B70 #define GL_DEPTH_WRITEMASK 0x0B72 #define GL_DEPTH_CLEAR_VALUE 0x0B73 #define GL_DEPTH_FUNC 0x0B74 #define GL_STENCIL_CLEAR_VALUE 0x0B91 #define GL_STENCIL_FUNC 0x0B92 #define GL_STENCIL_FAIL 0x0B94 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 #define GL_STENCIL_REF 0x0B97 #define GL_STENCIL_VALUE_MASK 0x0B93 #define GL_STENCIL_WRITEMASK 0x0B98 #define GL_STENCIL_BACK_FUNC 0x8800 #define GL_STENCIL_BACK_FAIL 0x8801 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 #define GL_STENCIL_BACK_REF 0x8CA3 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 #define GL_VIEWPORT 0x0BA2 #define GL_SCISSOR_BOX 0x0C10 /* GL_SCISSOR_TEST */ #define GL_COLOR_CLEAR_VALUE 0x0C22 #define GL_COLOR_WRITEMASK 0x0C23 #define GL_UNPACK_ALIGNMENT 0x0CF5 #define GL_PACK_ALIGNMENT 0x0D05 #define GL_MAX_TEXTURE_SIZE 0x0D33 #define GL_MAX_VIEWPORT_DIMS 0x0D3A #define GL_SUBPIXEL_BITS 0x0D50 #define GL_RED_BITS 0x0D52 #define GL_GREEN_BITS 0x0D53 #define GL_BLUE_BITS 0x0D54 #define GL_ALPHA_BITS 0x0D55 #define GL_DEPTH_BITS 0x0D56 #define GL_STENCIL_BITS 0x0D57 #define GL_POLYGON_OFFSET_UNITS 0x2A00 /* GL_POLYGON_OFFSET_FILL */ #define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_TEXTURE_BINDING_2D 0x8069 #define GL_SAMPLE_BUFFERS 0x80A8 #define GL_SAMPLES 0x80A9 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA #define GL_SAMPLE_COVERAGE_INVERT 0x80AB /* GetTextureParameter */ /* GL_TEXTURE_MAG_FILTER */ /* GL_TEXTURE_MIN_FILTER */ /* GL_TEXTURE_WRAP_S */ /* GL_TEXTURE_WRAP_T */ #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 /* HintMode */ #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 /* HintTarget */ #define GL_GENERATE_MIPMAP_HINT 0x8192 /* DataType */ #define GL_BYTE 0x1400 #define GL_UNSIGNED_BYTE 0x1401 #define GL_SHORT 0x1402 #define GL_UNSIGNED_SHORT 0x1403 #define GL_INT 0x1404 #define GL_UNSIGNED_INT 0x1405 #define GL_FLOAT 0x1406 #define GL_FIXED 0x140C /* PixelFormat */ #define GL_DEPTH_COMPONENT 0x1902 #define GL_ALPHA 0x1906 #define GL_RGB 0x1907 #define GL_RGBA 0x1908 #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA 0x190A /* PixelType */ /* GL_UNSIGNED_BYTE */ #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 /* Shaders */ #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 #define GL_MAX_VERTEX_ATTRIBS 0x8869 #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB #define GL_MAX_VARYING_VECTORS 0x8DFC #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD #define GL_SHADER_TYPE 0x8B4F #define GL_DELETE_STATUS 0x8B80 #define GL_LINK_STATUS 0x8B82 #define GL_VALIDATE_STATUS 0x8B83 #define GL_ATTACHED_SHADERS 0x8B85 #define GL_ACTIVE_UNIFORMS 0x8B86 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 #define GL_ACTIVE_ATTRIBUTES 0x8B89 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A #define GL_SHADING_LANGUAGE_VERSION 0x8B8C #define GL_CURRENT_PROGRAM 0x8B8D /* StencilFunction */ #define GL_NEVER 0x0200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 #define GL_GREATER 0x0204 #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 /* StencilOp */ /* GL_ZERO */ #define GL_KEEP 0x1E00 #define GL_REPLACE 0x1E01 #define GL_INCR 0x1E02 #define GL_DECR 0x1E03 #define GL_INVERT 0x150A #define GL_INCR_WRAP 0x8507 #define GL_DECR_WRAP 0x8508 /* StringName */ #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 /* TextureMagFilter */ #define GL_NEAREST 0x2600 #define GL_LINEAR 0x2601 /* TextureMinFilter */ /* GL_NEAREST */ /* GL_LINEAR */ #define GL_NEAREST_MIPMAP_NEAREST 0x2700 #define GL_LINEAR_MIPMAP_NEAREST 0x2701 #define GL_NEAREST_MIPMAP_LINEAR 0x2702 #define GL_LINEAR_MIPMAP_LINEAR 0x2703 /* TextureParameterName */ #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MIN_FILTER 0x2801 #define GL_TEXTURE_WRAP_S 0x2802 #define GL_TEXTURE_WRAP_T 0x2803 /* TextureTarget */ /* GL_TEXTURE_2D */ #define GL_TEXTURE 0x1702 #define GL_TEXTURE_CUBE_MAP 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C /* TextureUnit */ #define GL_TEXTURE0 0x84C0 #define GL_TEXTURE1 0x84C1 #define GL_TEXTURE2 0x84C2 #define GL_TEXTURE3 0x84C3 #define GL_TEXTURE4 0x84C4 #define GL_TEXTURE5 0x84C5 #define GL_TEXTURE6 0x84C6 #define GL_TEXTURE7 0x84C7 #define GL_TEXTURE8 0x84C8 #define GL_TEXTURE9 0x84C9 #define GL_TEXTURE10 0x84CA #define GL_TEXTURE11 0x84CB #define GL_TEXTURE12 0x84CC #define GL_TEXTURE13 0x84CD #define GL_TEXTURE14 0x84CE #define GL_TEXTURE15 0x84CF #define GL_TEXTURE16 0x84D0 #define GL_TEXTURE17 0x84D1 #define GL_TEXTURE18 0x84D2 #define GL_TEXTURE19 0x84D3 #define GL_TEXTURE20 0x84D4 #define GL_TEXTURE21 0x84D5 #define GL_TEXTURE22 0x84D6 #define GL_TEXTURE23 0x84D7 #define GL_TEXTURE24 0x84D8 #define GL_TEXTURE25 0x84D9 #define GL_TEXTURE26 0x84DA #define GL_TEXTURE27 0x84DB #define GL_TEXTURE28 0x84DC #define GL_TEXTURE29 0x84DD #define GL_TEXTURE30 0x84DE #define GL_TEXTURE31 0x84DF #define GL_ACTIVE_TEXTURE 0x84E0 /* TextureWrapMode */ #define GL_REPEAT 0x2901 #define GL_CLAMP_TO_EDGE 0x812F #define GL_MIRRORED_REPEAT 0x8370 /* Uniform Types */ #define GL_FLOAT_VEC2 0x8B50 #define GL_FLOAT_VEC3 0x8B51 #define GL_FLOAT_VEC4 0x8B52 #define GL_INT_VEC2 0x8B53 #define GL_INT_VEC3 0x8B54 #define GL_INT_VEC4 0x8B55 #define GL_BOOL 0x8B56 #define GL_BOOL_VEC2 0x8B57 #define GL_BOOL_VEC3 0x8B58 #define GL_BOOL_VEC4 0x8B59 #define GL_FLOAT_MAT2 0x8B5A #define GL_FLOAT_MAT3 0x8B5B #define GL_FLOAT_MAT4 0x8B5C #define GL_SAMPLER_2D 0x8B5E #define GL_SAMPLER_CUBE 0x8B60 /* Vertex Arrays */ #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F /* Read Format */ #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B /* Shader Source */ #define GL_COMPILE_STATUS 0x8B81 #define GL_INFO_LOG_LENGTH 0x8B84 #define GL_SHADER_SOURCE_LENGTH 0x8B88 #define GL_SHADER_COMPILER 0x8DFA /* Shader Binary */ #define GL_SHADER_BINARY_FORMATS 0x8DF8 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 /* Shader Precision-Specified Types */ #define GL_LOW_FLOAT 0x8DF0 #define GL_MEDIUM_FLOAT 0x8DF1 #define GL_HIGH_FLOAT 0x8DF2 #define GL_LOW_INT 0x8DF3 #define GL_MEDIUM_INT 0x8DF4 #define GL_HIGH_INT 0x8DF5 /* Framebuffer Object. */ #define GL_FRAMEBUFFER 0x8D40 #define GL_RENDERBUFFER 0x8D41 #define GL_RGBA4 0x8056 #define GL_RGB5_A1 0x8057 #define GL_RGB565 0x8D62 #define GL_DEPTH_COMPONENT16 0x81A5 #define GL_STENCIL_INDEX 0x1901 #define GL_STENCIL_INDEX8 0x8D48 #define GL_RENDERBUFFER_WIDTH 0x8D42 #define GL_RENDERBUFFER_HEIGHT 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 #define GL_RENDERBUFFER_RED_SIZE 0x8D50 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 #define GL_COLOR_ATTACHMENT0 0x8CE0 #define GL_DEPTH_ATTACHMENT 0x8D00 #define GL_STENCIL_ATTACHMENT 0x8D20 #define GL_NONE 0 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9 #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD #define GL_FRAMEBUFFER_BINDING 0x8CA6 #define GL_RENDERBUFFER_BINDING 0x8CA7 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 /*------------------------------------------------------------------------- * GL core functions. *-----------------------------------------------------------------------*/ GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture); GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader); GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name); GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer); GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture); GL_APICALL void GL_APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); GL_APICALL void GL_APIENTRY glBlendEquation ( GLenum mode ); GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target); GL_APICALL void GL_APIENTRY glClear (GLbitfield mask); GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth); GL_APICALL void GL_APIENTRY glClearStencil (GLint s); GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader); GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data); GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data); GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL GLuint GL_APIENTRY glCreateProgram (void); GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type); GL_APICALL void GL_APIENTRY glCullFace (GLenum mode); GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint* buffers); GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers); GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program); GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers); GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader); GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures); GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func); GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag); GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar); GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader); GL_APICALL void GL_APIENTRY glDisable (GLenum cap); GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index); GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices); GL_APICALL void GL_APIENTRY glEnable (GLenum cap); GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index); GL_APICALL void GL_APIENTRY glFinish (void); GL_APICALL void GL_APIENTRY glFlush (void); GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode); GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers); GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target); GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers); GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers); GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures); GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name); GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name); GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean* params); GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint* params); GL_APICALL GLenum GL_APIENTRY glGetError (void); GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat* params); GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog); GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog); GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision); GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); GL_APICALL const GLubyte* GL_APIENTRY glGetString (GLenum name); GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat* params); GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat* params); GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint* params); GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name); GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params); GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint* params); GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer); GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode); GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer); GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap); GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer); GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program); GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer); GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader); GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture); GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width); GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program); GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param); GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units); GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void); GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length); GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length); GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask); GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels); GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat* params); GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params); GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels); GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x); GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat* v); GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x); GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v); GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y); GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat* v); GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y); GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v); GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z); GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat* v); GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z); GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v); GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat* v); GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w); GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v); GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); GL_APICALL void GL_APIENTRY glUseProgram (GLuint program); GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program); GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x); GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat* values); GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y); GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat* values); GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z); GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat* values); GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w); GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat* values); GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr); GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); #ifdef __cplusplus } #endif #endif /* __gl2_h_ */ ================================================ FILE: Libraries/Core/RPi/Headers/GLES2/gl2ext.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __gl2ext_h_ #define __gl2ext_h_ /* $Revision: 15049 $ on $Date:: 2011-07-07 01:28:16 +0100 #$ */ #ifdef __cplusplus extern "C" { #endif /* We want this */ #ifndef GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES #endif /* * This document is licensed under the SGI Free Software B License Version * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . */ #ifndef GL_APIENTRYP # define GL_APIENTRYP GL_APIENTRY* #endif /*------------------------------------------------------------------------* * OES extension tokens *------------------------------------------------------------------------*/ /* GL_OES_compressed_ETC1_RGB8_texture */ #ifndef GL_OES_compressed_ETC1_RGB8_texture #define GL_ETC1_RGB8_OES 0x8D64 #endif /* GL_OES_compressed_paletted_texture */ #ifndef GL_OES_compressed_paletted_texture #define GL_PALETTE4_RGB8_OES 0x8B90 #define GL_PALETTE4_RGBA8_OES 0x8B91 #define GL_PALETTE4_R5_G6_B5_OES 0x8B92 #define GL_PALETTE4_RGBA4_OES 0x8B93 #define GL_PALETTE4_RGB5_A1_OES 0x8B94 #define GL_PALETTE8_RGB8_OES 0x8B95 #define GL_PALETTE8_RGBA8_OES 0x8B96 #define GL_PALETTE8_R5_G6_B5_OES 0x8B97 #define GL_PALETTE8_RGBA4_OES 0x8B98 #define GL_PALETTE8_RGB5_A1_OES 0x8B99 #endif /* GL_OES_depth24 */ #ifndef GL_OES_depth24 #define GL_DEPTH_COMPONENT24_OES 0x81A6 #endif /* GL_OES_depth32 */ #ifndef GL_OES_depth32 #define GL_DEPTH_COMPONENT32_OES 0x81A7 #endif /* GL_OES_depth_texture */ /* No new tokens introduced by this extension. */ /* GL_OES_EGL_image */ #ifndef GL_OES_EGL_image typedef void* GLeglImageOES; #endif /* GL_OES_EGL_image_external */ #ifndef GL_OES_EGL_image_external /* GLeglImageOES defined in GL_OES_EGL_image already. */ #define GL_TEXTURE_EXTERNAL_OES 0x8D65 #define GL_SAMPLER_EXTERNAL_OES 0x8D66 #define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67 #define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68 #endif /* GL_OES_element_index_uint */ #ifndef GL_OES_element_index_uint #define GL_UNSIGNED_INT 0x1405 #endif /* GL_OES_get_program_binary */ #ifndef GL_OES_get_program_binary #define GL_PROGRAM_BINARY_LENGTH_OES 0x8741 #define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE #define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF #endif /* GL_OES_mapbuffer */ #ifndef GL_OES_mapbuffer #define GL_WRITE_ONLY_OES 0x88B9 #define GL_BUFFER_ACCESS_OES 0x88BB #define GL_BUFFER_MAPPED_OES 0x88BC #define GL_BUFFER_MAP_POINTER_OES 0x88BD #endif /* GL_OES_packed_depth_stencil */ #ifndef GL_OES_packed_depth_stencil #define GL_DEPTH_STENCIL_OES 0x84F9 #define GL_UNSIGNED_INT_24_8_OES 0x84FA #define GL_DEPTH24_STENCIL8_OES 0x88F0 #endif /* GL_OES_rgb8_rgba8 */ #ifndef GL_OES_rgb8_rgba8 #define GL_RGB8_OES 0x8051 #define GL_RGBA8_OES 0x8058 #endif /* GL_OES_standard_derivatives */ #ifndef GL_OES_standard_derivatives #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B #endif /* GL_OES_stencil1 */ #ifndef GL_OES_stencil1 #define GL_STENCIL_INDEX1_OES 0x8D46 #endif /* GL_OES_stencil4 */ #ifndef GL_OES_stencil4 #define GL_STENCIL_INDEX4_OES 0x8D47 #endif /* GL_OES_texture_3D */ #ifndef GL_OES_texture_3D #define GL_TEXTURE_WRAP_R_OES 0x8072 #define GL_TEXTURE_3D_OES 0x806F #define GL_TEXTURE_BINDING_3D_OES 0x806A #define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073 #define GL_SAMPLER_3D_OES 0x8B5F #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4 #endif /* GL_OES_texture_float */ /* No new tokens introduced by this extension. */ /* GL_OES_texture_float_linear */ /* No new tokens introduced by this extension. */ /* GL_OES_texture_half_float */ #ifndef GL_OES_texture_half_float #define GL_HALF_FLOAT_OES 0x8D61 #endif /* GL_OES_texture_half_float_linear */ /* No new tokens introduced by this extension. */ /* GL_OES_texture_npot */ /* No new tokens introduced by this extension. */ /* GL_OES_vertex_array_object */ #ifndef GL_OES_vertex_array_object #define GL_VERTEX_ARRAY_BINDING_OES 0x85B5 #endif /* GL_OES_vertex_half_float */ /* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */ /* GL_OES_vertex_type_10_10_10_2 */ #ifndef GL_OES_vertex_type_10_10_10_2 #define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6 #define GL_INT_10_10_10_2_OES 0x8DF7 #endif /*------------------------------------------------------------------------* * AMD extension tokens *------------------------------------------------------------------------*/ /* GL_AMD_compressed_3DC_texture */ #ifndef GL_AMD_compressed_3DC_texture #define GL_3DC_X_AMD 0x87F9 #define GL_3DC_XY_AMD 0x87FA #endif /* GL_AMD_compressed_ATC_texture */ #ifndef GL_AMD_compressed_ATC_texture #define GL_ATC_RGB_AMD 0x8C92 #define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93 #define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE #endif /* GL_AMD_performance_monitor */ #ifndef GL_AMD_performance_monitor #define GL_COUNTER_TYPE_AMD 0x8BC0 #define GL_COUNTER_RANGE_AMD 0x8BC1 #define GL_UNSIGNED_INT64_AMD 0x8BC2 #define GL_PERCENTAGE_AMD 0x8BC3 #define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 #define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 #define GL_PERFMON_RESULT_AMD 0x8BC6 #endif /* GL_AMD_program_binary_Z400 */ #ifndef GL_AMD_program_binary_Z400 #define GL_Z400_BINARY_AMD 0x8740 #endif /*------------------------------------------------------------------------* * ANGLE extension tokens *------------------------------------------------------------------------*/ /* GL_ANGLE_framebuffer_blit */ #ifndef GL_ANGLE_framebuffer_blit #define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 #define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 #define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 #define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA #endif /* GL_ANGLE_framebuffer_multisample */ #ifndef GL_ANGLE_framebuffer_multisample #define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 #define GL_MAX_SAMPLES_ANGLE 0x8D57 #endif /*------------------------------------------------------------------------* * APPLE extension tokens *------------------------------------------------------------------------*/ /* GL_APPLE_rgb_422 */ #ifndef GL_APPLE_rgb_422 #define GL_RGB_422_APPLE 0x8A1F #define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA #define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB #endif /* GL_APPLE_framebuffer_multisample */ #ifndef GL_APPLE_framebuffer_multisample #define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56 #define GL_MAX_SAMPLES_APPLE 0x8D57 #define GL_READ_FRAMEBUFFER_APPLE 0x8CA8 #define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9 #define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6 #define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA #endif /* GL_APPLE_texture_format_BGRA8888 */ #ifndef GL_APPLE_texture_format_BGRA8888 #define GL_BGRA_EXT 0x80E1 #endif /* GL_APPLE_texture_max_level */ #ifndef GL_APPLE_texture_max_level #define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D #endif /*------------------------------------------------------------------------* * ARM extension tokens *------------------------------------------------------------------------*/ /* GL_ARM_mali_shader_binary */ #ifndef GL_ARM_mali_shader_binary #define GL_MALI_SHADER_BINARY_ARM 0x8F60 #endif /* GL_ARM_rgba8 */ /* No new tokens introduced by this extension. */ /*------------------------------------------------------------------------* * EXT extension tokens *------------------------------------------------------------------------*/ /* GL_EXT_blend_minmax */ #ifndef GL_EXT_blend_minmax #define GL_MIN_EXT 0x8007 #define GL_MAX_EXT 0x8008 #endif /* GL_EXT_discard_framebuffer */ #ifndef GL_EXT_discard_framebuffer #define GL_COLOR_EXT 0x1800 #define GL_DEPTH_EXT 0x1801 #define GL_STENCIL_EXT 0x1802 #endif /* GL_EXT_multi_draw_arrays */ /* No new tokens introduced by this extension. */ /* GL_EXT_read_format_bgra */ #ifndef GL_EXT_read_format_bgra #define GL_BGRA_EXT 0x80E1 #define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365 #define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366 #endif /* GL_EXT_shader_texture_lod */ /* No new tokens introduced by this extension. */ /* GL_EXT_texture_filter_anisotropic */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #endif /* GL_EXT_texture_format_BGRA8888 */ #ifndef GL_EXT_texture_format_BGRA8888 #define GL_BGRA_EXT 0x80E1 #endif #ifndef GL_texture_format_RGBX8888_BRCM #define GL_RGBX_BRCM 0x80EE #endif /* GL_EXT_texture_type_2_10_10_10_REV */ #ifndef GL_EXT_texture_type_2_10_10_10_REV #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 #endif /* GL_EXT_texture_compression_dxt1 */ #ifndef GL_EXT_texture_compression_dxt1 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 #endif /* GL_EXT_unpack_subimage */ #ifndef GL_EXT_unpack_subimage #define GL_UNPACK_ROW_LENGTH 0x0CF2 #define GL_UNPACK_SKIP_ROWS 0x0CF3 #define GL_UNPACK_SKIP_PIXELS 0x0CF4 #endif /*------------------------------------------------------------------------* * DMP extension tokens *------------------------------------------------------------------------*/ /* GL_DMP_shader_binary */ #ifndef GL_DMP_shader_binary #define GL_SHADER_BINARY_DMP 0x9250 #endif /*------------------------------------------------------------------------* * IMG extension tokens *------------------------------------------------------------------------*/ /* GL_IMG_program_binary */ #ifndef GL_IMG_program_binary #define GL_SGX_PROGRAM_BINARY_IMG 0x9130 #endif /* GL_IMG_read_format */ #ifndef GL_IMG_read_format #define GL_BGRA_IMG 0x80E1 #define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365 #endif /* GL_IMG_shader_binary */ #ifndef GL_IMG_shader_binary #define GL_SGX_BINARY_IMG 0x8C0A #endif /* GL_IMG_texture_compression_pvrtc */ #ifndef GL_IMG_texture_compression_pvrtc #define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00 #define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01 #define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02 #define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03 #endif /* GL_IMG_multisampled_render_to_texture */ #ifndef GL_IMG_multisampled_render_to_texture #define GL_RENDERBUFFER_SAMPLES_IMG 0x9133 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134 #define GL_MAX_SAMPLES_IMG 0x9135 #define GL_TEXTURE_SAMPLES_IMG 0x9136 #endif /*------------------------------------------------------------------------* * NV extension tokens *------------------------------------------------------------------------*/ /* GL_NV_coverage_sample */ #ifndef GL_NV_coverage_sample #define GL_COVERAGE_COMPONENT_NV 0x8ED0 #define GL_COVERAGE_COMPONENT4_NV 0x8ED1 #define GL_COVERAGE_ATTACHMENT_NV 0x8ED2 #define GL_COVERAGE_BUFFERS_NV 0x8ED3 #define GL_COVERAGE_SAMPLES_NV 0x8ED4 #define GL_COVERAGE_ALL_FRAGMENTS_NV 0x8ED5 #define GL_COVERAGE_EDGE_FRAGMENTS_NV 0x8ED6 #define GL_COVERAGE_AUTOMATIC_NV 0x8ED7 #define GL_COVERAGE_BUFFER_BIT_NV 0x8000 #endif /* GL_NV_depth_nonlinear */ #ifndef GL_NV_depth_nonlinear #define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C #endif /* GL_NV_draw_buffers */ #ifndef GL_NV_draw_buffers #define GL_MAX_DRAW_BUFFERS_NV 0x8824 #define GL_DRAW_BUFFER0_NV 0x8825 #define GL_DRAW_BUFFER1_NV 0x8826 #define GL_DRAW_BUFFER2_NV 0x8827 #define GL_DRAW_BUFFER3_NV 0x8828 #define GL_DRAW_BUFFER4_NV 0x8829 #define GL_DRAW_BUFFER5_NV 0x882A #define GL_DRAW_BUFFER6_NV 0x882B #define GL_DRAW_BUFFER7_NV 0x882C #define GL_DRAW_BUFFER8_NV 0x882D #define GL_DRAW_BUFFER9_NV 0x882E #define GL_DRAW_BUFFER10_NV 0x882F #define GL_DRAW_BUFFER11_NV 0x8830 #define GL_DRAW_BUFFER12_NV 0x8831 #define GL_DRAW_BUFFER13_NV 0x8832 #define GL_DRAW_BUFFER14_NV 0x8833 #define GL_DRAW_BUFFER15_NV 0x8834 #define GL_COLOR_ATTACHMENT0_NV 0x8CE0 #define GL_COLOR_ATTACHMENT1_NV 0x8CE1 #define GL_COLOR_ATTACHMENT2_NV 0x8CE2 #define GL_COLOR_ATTACHMENT3_NV 0x8CE3 #define GL_COLOR_ATTACHMENT4_NV 0x8CE4 #define GL_COLOR_ATTACHMENT5_NV 0x8CE5 #define GL_COLOR_ATTACHMENT6_NV 0x8CE6 #define GL_COLOR_ATTACHMENT7_NV 0x8CE7 #define GL_COLOR_ATTACHMENT8_NV 0x8CE8 #define GL_COLOR_ATTACHMENT9_NV 0x8CE9 #define GL_COLOR_ATTACHMENT10_NV 0x8CEA #define GL_COLOR_ATTACHMENT11_NV 0x8CEB #define GL_COLOR_ATTACHMENT12_NV 0x8CEC #define GL_COLOR_ATTACHMENT13_NV 0x8CED #define GL_COLOR_ATTACHMENT14_NV 0x8CEE #define GL_COLOR_ATTACHMENT15_NV 0x8CEF #endif /* GL_NV_fbo_color_attachments */ #ifndef GL_NV_fbo_color_attachments #define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF /* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */ #endif /* GL_NV_fence */ #ifndef GL_NV_fence #define GL_ALL_COMPLETED_NV 0x84F2 #define GL_FENCE_STATUS_NV 0x84F3 #define GL_FENCE_CONDITION_NV 0x84F4 #endif /* GL_NV_read_buffer */ #ifndef GL_NV_read_buffer #define GL_READ_BUFFER_NV 0x0C02 #endif /* GL_NV_read_buffer_front */ /* No new tokens introduced by this extension. */ /* GL_NV_read_depth */ /* No new tokens introduced by this extension. */ /* GL_NV_read_depth_stencil */ /* No new tokens introduced by this extension. */ /* GL_NV_read_stencil */ /* No new tokens introduced by this extension. */ /* GL_NV_texture_compression_s3tc_update */ /* No new tokens introduced by this extension. */ /* GL_NV_texture_npot_2D_mipmap */ /* No new tokens introduced by this extension. */ /*------------------------------------------------------------------------* * QCOM extension tokens *------------------------------------------------------------------------*/ /* GL_QCOM_alpha_test */ #ifndef GL_QCOM_alpha_test #define GL_ALPHA_TEST_QCOM 0x0BC0 #define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1 #define GL_ALPHA_TEST_REF_QCOM 0x0BC2 #endif /* GL_QCOM_driver_control */ /* No new tokens introduced by this extension. */ /* GL_QCOM_extended_get */ #ifndef GL_QCOM_extended_get #define GL_TEXTURE_WIDTH_QCOM 0x8BD2 #define GL_TEXTURE_HEIGHT_QCOM 0x8BD3 #define GL_TEXTURE_DEPTH_QCOM 0x8BD4 #define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5 #define GL_TEXTURE_FORMAT_QCOM 0x8BD6 #define GL_TEXTURE_TYPE_QCOM 0x8BD7 #define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8 #define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9 #define GL_TEXTURE_TARGET_QCOM 0x8BDA #define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB #define GL_STATE_RESTORE 0x8BDC #endif /* GL_QCOM_extended_get2 */ /* No new tokens introduced by this extension. */ /* GL_QCOM_perfmon_global_mode */ #ifndef GL_QCOM_perfmon_global_mode #define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0 #endif /* GL_QCOM_writeonly_rendering */ #ifndef GL_QCOM_writeonly_rendering #define GL_WRITEONLY_RENDERING_QCOM 0x8823 #endif /* GL_QCOM_tiled_rendering */ #ifndef GL_QCOM_tiled_rendering #define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001 #define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002 #define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004 #define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008 #define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010 #define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020 #define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040 #define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080 #define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100 #define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200 #define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400 #define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800 #define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000 #define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000 #define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000 #define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000 #define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000 #define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000 #define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000 #define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000 #define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000 #define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000 #define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000 #define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000 #define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000 #define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000 #define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000 #define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000 #define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000 #define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000 #define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000 #define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 #endif /*------------------------------------------------------------------------* * VIV extension tokens *------------------------------------------------------------------------*/ /* GL_VIV_shader_binary */ #ifndef GL_VIV_shader_binary #define GL_SHADER_BINARY_VIV 0x8FC4 #endif /*------------------------------------------------------------------------* * BRCM extension tokens * TODO: these aren't official yet *------------------------------------------------------------------------*/ #ifndef GL_BRCM_side_by_side_stero_hint #define GL_SIDE_BY_SIDE_STEREO_HINT_BRCM 0x8193 /* GET AN OFFICIAL ENUM */ #endif /*------------------------------------------------------------------------* * End of extension tokens, start of corresponding extension functions *------------------------------------------------------------------------*/ /*------------------------------------------------------------------------* * OES extension functions *------------------------------------------------------------------------*/ /* GL_OES_compressed_ETC1_RGB8_texture */ #ifndef GL_OES_compressed_ETC1_RGB8_texture #define GL_OES_compressed_ETC1_RGB8_texture 1 #endif /* GL_OES_compressed_paletted_texture */ #ifndef GL_OES_compressed_paletted_texture #define GL_OES_compressed_paletted_texture 1 #endif /* GL_OES_depth24 */ #ifndef GL_OES_depth24 #define GL_OES_depth24 1 #endif /* GL_OES_depth32 */ #ifndef GL_OES_depth32 #define GL_OES_depth32 0 #endif /* GL_OES_depth_texture */ #ifndef GL_OES_depth_texture #define GL_OES_depth_texture 0 #endif /* GL_OES_EGL_image */ #ifndef GL_OES_EGL_image #define GL_OES_EGL_image 1 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image); GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image); #endif typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image); typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); #endif /* GL_OES_EGL_image_external */ #ifndef GL_OES_EGL_image_external #define GL_OES_EGL_image_external 1 /* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */ #endif /* GL_OES_element_index_uint */ #ifndef GL_OES_element_index_uint #define GL_OES_element_index_uint 0 #endif /* GL_OES_fbo_render_mipmap */ #ifndef GL_OES_fbo_render_mipmap #define GL_OES_fbo_render_mipmap 0 #endif /* GL_OES_fragment_precision_high */ #ifndef GL_OES_fragment_precision_high #define GL_OES_fragment_precision_high 0 #endif /* GL_OES_get_program_binary */ #ifndef GL_OES_get_program_binary #define GL_OES_get_program_binary 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); GL_APICALL void GL_APIENTRY glProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); #endif typedef void (GL_APIENTRYP PFNGLGETPROGRAMBINARYOESPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length); #endif /* GL_OES_mapbuffer */ #ifndef GL_OES_mapbuffer #define GL_OES_mapbuffer 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void* GL_APIENTRY glMapBufferOES (GLenum target, GLenum access); GL_APICALL GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target); GL_APICALL void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, GLvoid** params); #endif typedef void* (GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access); typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target); typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, GLvoid** params); #endif /* GL_OES_packed_depth_stencil */ #ifndef GL_OES_packed_depth_stencil #define GL_OES_packed_depth_stencil 0 #endif /* GL_OES_rgb8_rgba8 */ #ifndef GL_OES_rgb8_rgba8 #define GL_OES_rgb8_rgba8 0 #endif /* GL_OES_standard_derivatives */ #ifndef GL_OES_standard_derivatives #define GL_OES_standard_derivatives 0 #endif /* GL_OES_stencil1 */ #ifndef GL_OES_stencil1 #define GL_OES_stencil1 0 #endif /* GL_OES_stencil4 */ #ifndef GL_OES_stencil4 #define GL_OES_stencil4 0 #endif /* GL_OES_texture_3D */ #ifndef GL_OES_texture_3D #define GL_OES_texture_3D 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); GL_APICALL void GL_APIENTRY glTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); GL_APICALL void GL_APIENTRY glCopyTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); GL_APICALL void GL_APIENTRY glCompressedTexImage3DOES (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); GL_APICALL void GL_APIENTRY glCompressedTexSubImage3DOES (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); GL_APICALL void GL_APIENTRY glFramebufferTexture3DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); #endif typedef void (GL_APIENTRYP PFNGLTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels); typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels); typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DOESPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data); typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DOESPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data); typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); #endif /* GL_OES_texture_float */ #ifndef GL_OES_texture_float #define GL_OES_texture_float 0 #endif /* GL_OES_texture_float_linear */ #ifndef GL_OES_texture_float_linear #define GL_OES_texture_float_linear 0 #endif /* GL_OES_texture_half_float */ #ifndef GL_OES_texture_half_float #define GL_OES_texture_half_float 0 #endif /* GL_OES_texture_half_float_linear */ #ifndef GL_OES_texture_half_float_linear #define GL_OES_texture_half_float_linear 0 #endif /* GL_OES_texture_npot */ #ifndef GL_OES_texture_npot #define GL_OES_texture_npot 1 #endif /* GL_OES_vertex_array_object */ #ifndef GL_OES_vertex_array_object #define GL_OES_vertex_array_object 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBindVertexArrayOES (GLuint array); GL_APICALL void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays); GL_APICALL void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays); GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array); #endif typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array); typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays); typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays); typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array); #endif /* GL_OES_vertex_half_float */ #ifndef GL_OES_vertex_half_float #define GL_OES_vertex_half_float 1 #endif /* GL_OES_vertex_type_10_10_10_2 */ #ifndef GL_OES_vertex_type_10_10_10_2 #define GL_OES_vertex_type_10_10_10_2 0 #endif /*------------------------------------------------------------------------* * AMD extension functions *------------------------------------------------------------------------*/ /* GL_AMD_compressed_3DC_texture */ #ifndef GL_AMD_compressed_3DC_texture #define GL_AMD_compressed_3DC_texture 0 #endif /* GL_AMD_compressed_ATC_texture */ #ifndef GL_AMD_compressed_ATC_texture #define GL_AMD_compressed_ATC_texture 0 #endif /* AMD_performance_monitor */ #ifndef GL_AMD_performance_monitor #define GL_AMD_performance_monitor 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); GL_APICALL void GL_APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); GL_APICALL void GL_APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); GL_APICALL void GL_APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); GL_APICALL void GL_APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); GL_APICALL void GL_APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); GL_APICALL void GL_APIENTRY glBeginPerfMonitorAMD (GLuint monitor); GL_APICALL void GL_APIENTRY glEndPerfMonitorAMD (GLuint monitor); GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); #endif typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); typedef void (GL_APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (GL_APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); typedef void (GL_APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *countersList); typedef void (GL_APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); typedef void (GL_APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); #endif /* GL_AMD_program_binary_Z400 */ #ifndef GL_AMD_program_binary_Z400 #define GL_AMD_program_binary_Z400 0 #endif /*------------------------------------------------------------------------* * ANGLE extension functions *------------------------------------------------------------------------*/ /* GL_ANGLE_framebuffer_blit */ #ifndef GL_ANGLE_framebuffer_blit #define GL_ANGLE_framebuffer_blit 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #endif typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #endif /* GL_ANGLE_framebuffer_multisample */ #ifndef GL_ANGLE_framebuffer_multisample #define GL_ANGLE_framebuffer_multisample 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #endif typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #endif /*------------------------------------------------------------------------* * APPLE extension functions *------------------------------------------------------------------------*/ /* GL_APPLE_rgb_422 */ #ifndef GL_APPLE_rgb_422 #define GL_APPLE_rgb_422 0 #endif /* GL_APPLE_framebuffer_multisample */ #ifndef GL_APPLE_framebuffer_multisample #define GL_APPLE_framebuffer_multisample 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum, GLsizei, GLenum, GLsizei, GLsizei); GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void); #endif /* GL_APPLE_texture_format_BGRA8888 */ #ifndef GL_APPLE_texture_format_BGRA8888 #define GL_APPLE_texture_format_BGRA8888 0 #endif /* GL_APPLE_texture_max_level */ #ifndef GL_APPLE_texture_max_level #define GL_APPLE_texture_max_level 0 #endif /*------------------------------------------------------------------------* * ARM extension functions *------------------------------------------------------------------------*/ /* GL_ARM_mali_shader_binary */ #ifndef GL_ARM_mali_shader_binary #define GL_ARM_mali_shader_binary 0 #endif /* GL_ARM_rgba8 */ #ifndef GL_ARM_rgba8 #define GL_ARM_rgba8 0 #endif /*------------------------------------------------------------------------* * APPLE extension tokens *------------------------------------------------------------------------*/ /* GL_APPLE_rgb_422 */ #ifndef GL_APPLE_rgb_422 #define GL_APPLE_rgb_422 1 #define GL_RGB_422_APPLE 0x8A1F #define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA #define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB #endif /*------------------------------------------------------------------------* * EXT extension functions *------------------------------------------------------------------------*/ /* GL_EXT_blend_minmax */ #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 0 #endif /* GL_EXT_discard_framebuffer */ #ifndef GL_EXT_discard_framebuffer #define GL_EXT_discard_framebuffer 1 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments); #endif typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments); #endif /* GL_EXT_debug_marker */ #ifndef GL_EXT_debug_marker #define GL_EXT_debug_marker 1 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker); GL_APICALL void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker); GL_APICALL void GL_APIENTRY glPopGroupMarkerEXT (void); #endif typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker); typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker); typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void); #endif #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); GL_APICALL void GL_APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); #endif /* GL_GLEXT_PROTOTYPES */ typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); #endif /* GL_EXT_read_format_bgra */ #ifndef GL_EXT_read_format_bgra #define GL_EXT_read_format_bgra 0 #endif /* GL_EXT_shader_texture_lod */ #ifndef GL_EXT_shader_texture_lod #define GL_EXT_shader_texture_lod 0 #endif /* GL_EXT_texture_filter_anisotropic */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_EXT_texture_filter_anisotropic 0 #endif /* GL_EXT_texture_format_BGRA8888 */ #ifndef GL_EXT_texture_format_BGRA8888 #define GL_EXT_texture_format_BGRA8888 1 #endif #ifndef GL_texture_format_RGBX8888_BRCM #define GL_texture_format_RGBX8888_BRCM 1 #endif /* GL_EXT_texture_type_2_10_10_10_REV */ #ifndef GL_EXT_texture_type_2_10_10_10_REV #define GL_EXT_texture_type_2_10_10_10_REV 0 #endif /* GL_EXT_texture_compression_dxt1 */ #ifndef GL_EXT_texture_compression_dxt1 #define GL_EXT_texture_compression_dxt1 0 #endif /* GL_EXT_unpack_subimage */ #ifndef GL_EXT_unpack_subimage #define GL_EXT_unpack_subimage 0 #endif /*------------------------------------------------------------------------* * DMP extension functions *------------------------------------------------------------------------*/ /* GL_DMP_shader_binary */ #ifndef GL_DMP_shader_binary #define GL_DMP_shader_binary 0 #endif /*------------------------------------------------------------------------* * IMG extension functions *------------------------------------------------------------------------*/ /* GL_IMG_program_binary */ #ifndef GL_IMG_program_binary #define GL_IMG_program_binary 0 #endif /* GL_IMG_read_format */ #ifndef GL_IMG_read_format #define GL_IMG_read_format 0 #endif /* GL_IMG_shader_binary */ #ifndef GL_IMG_shader_binary #define GL_IMG_shader_binary 0 #endif /* GL_IMG_texture_compression_pvrtc */ #ifndef GL_IMG_texture_compression_pvrtc #define GL_IMG_texture_compression_pvrtc 0 #endif /* GL_IMG_multisampled_render_to_texture */ #ifndef GL_IMG_multisampled_render_to_texture #define GL_IMG_multisampled_render_to_texture 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei); GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); #endif typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples); #endif /*------------------------------------------------------------------------* * NV extension functions *------------------------------------------------------------------------*/ /* GL_NV_coverage_sample */ #ifndef GL_NV_coverage_sample #define GL_NV_coverage_sample 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask); GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation); #endif typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask); typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation); #endif /* GL_NV_depth_nonlinear */ #ifndef GL_NV_depth_nonlinear #define GL_NV_depth_nonlinear 0 #endif /* GL_NV_draw_buffers */ #ifndef GL_NV_draw_buffers #define GL_NV_draw_buffers 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs); #endif typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs); #endif /* GL_NV_fbo_color_attachments */ #ifndef GL_NV_fbo_color_attachments #define GL_NV_fbo_color_attachments 0 #endif /* GL_NV_fence */ #ifndef GL_NV_fence #define GL_NV_fence 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); GL_APICALL void GL_APIENTRY glGenFencesNV (GLsizei, GLuint *); GL_APICALL GLboolean GL_APIENTRY glIsFenceNV (GLuint); GL_APICALL GLboolean GL_APIENTRY glTestFenceNV (GLuint); GL_APICALL void GL_APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); GL_APICALL void GL_APIENTRY glFinishFenceNV (GLuint); GL_APICALL void GL_APIENTRY glSetFenceNV (GLuint, GLenum); #endif typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); #endif /* GL_NV_read_buffer */ #ifndef GL_NV_read_buffer #define GL_NV_read_buffer 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode); #endif typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode); #endif /* GL_NV_read_buffer_front */ #ifndef GL_NV_read_buffer_front #define GL_NV_read_buffer_front 0 #endif /* GL_NV_read_depth */ #ifndef GL_NV_read_depth #define GL_NV_read_depth 0 #endif /* GL_NV_read_depth_stencil */ #ifndef GL_NV_read_depth_stencil #define GL_NV_read_depth_stencil 0 #endif /* GL_NV_read_stencil */ #ifndef GL_NV_read_stencil #define GL_NV_read_stencil 0 #endif /* GL_NV_texture_compression_s3tc_update */ #ifndef GL_NV_texture_compression_s3tc_update #define GL_NV_texture_compression_s3tc_update 0 #endif /* GL_NV_texture_npot_2D_mipmap */ #ifndef GL_NV_texture_npot_2D_mipmap #define GL_NV_texture_npot_2D_mipmap 0 #endif /*------------------------------------------------------------------------* * QCOM extension functions *------------------------------------------------------------------------*/ /* GL_QCOM_alpha_test */ #ifndef GL_QCOM_alpha_test #define GL_QCOM_alpha_test 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref); #endif typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref); #endif /* GL_QCOM_driver_control */ #ifndef GL_QCOM_driver_control #define GL_QCOM_driver_control 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls); GL_APICALL void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); GL_APICALL void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl); GL_APICALL void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl); #endif typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls); typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString); typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl); #endif /* GL_QCOM_extended_get */ #ifndef GL_QCOM_extended_get #define GL_QCOM_extended_get 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures); GL_APICALL void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); GL_APICALL void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); GL_APICALL void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); GL_APICALL void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); GL_APICALL void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param); GL_APICALL void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); GL_APICALL void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, GLvoid **params); #endif typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures); typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers); typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers); typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers); typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params); typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param); typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLvoid *texels); typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, GLvoid **params); #endif /* GL_QCOM_extended_get2 */ #ifndef GL_QCOM_extended_get2 #define GL_QCOM_extended_get2 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders); GL_APICALL void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms); GL_APICALL GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program); GL_APICALL void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length); #endif typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders); typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms); typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program); typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length); #endif /* GL_QCOM_perfmon_global_mode */ #ifndef GL_QCOM_perfmon_global_mode #define GL_QCOM_perfmon_global_mode 0 #endif /* GL_QCOM_writeonly_rendering */ #ifndef GL_QCOM_writeonly_rendering #define GL_QCOM_writeonly_rendering 0 #endif /* GL_QCOM_tiled_rendering */ #ifndef GL_QCOM_tiled_rendering #define GL_QCOM_tiled_rendering 0 #ifdef GL_GLEXT_PROTOTYPES GL_APICALL void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); GL_APICALL void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask); #endif typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask); typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); #endif /*------------------------------------------------------------------------* * VIV extension tokens *------------------------------------------------------------------------*/ /* GL_VIV_shader_binary */ #ifndef GL_VIV_shader_binary #define GL_VIV_shader_binary 0 #endif /*------------------------------------------------------------------------* * BRCM extension functions * TODO: these aren't official yet *------------------------------------------------------------------------*/ #ifndef GL_BRCM_side_by_side_stero_hint #define GL_BRCM_side_by_side_stero_hint 1 #endif #ifdef __cplusplus } #endif #endif /* __gl2ext_h_ */ ================================================ FILE: Libraries/Core/RPi/Headers/GLES2/gl2platform.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __gl2platform_h_ #define __gl2platform_h_ /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ #ifdef __cplusplus extern "C" { #endif /* * This document is licensed under the SGI Free Software B License Version * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . */ /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h * * Adopters may modify khrplatform.h and this file to suit their platform. * You are encouraged to submit all modifications to the Khronos group so that * they can be included in future versions of this file. Please submit changes * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) * by filing a bug against product "OpenGL-ES" component "Registry". */ #include "../KHR/khrplatform.h" #ifndef GL_APICALL #define GL_APICALL KHRONOS_APICALL #endif #ifndef GL_APIENTRY #define GL_APIENTRY KHRONOS_APIENTRY #endif #ifdef __cplusplus } #endif #endif /* __gl2platform_h_ */ ================================================ FILE: Libraries/Core/RPi/Headers/IL/OMX_Audio.h ================================================ /* * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** @file OMX_Audio.h - OpenMax IL version 1.1.2 * The structures needed by Audio components to exchange * parameters and configuration data with the componenmilts. */ #ifndef OMX_Audio_h #define OMX_Audio_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_Core.h" /** @defgroup midi MIDI * @ingroup audio */ /** @defgroup effects Audio effects * @ingroup audio */ /** @defgroup audio OpenMAX IL Audio Domain * Structures for OpenMAX IL Audio domain * @{ */ /** Enumeration used to define the possible audio codings. * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must * be done in a vendor specific way. Since this is for an audio * processing element this enum is relevant. However, for another * type of component other enums would be in this area. */ typedef enum OMX_AUDIO_CODINGTYPE { OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */ OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */ OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */ OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */ OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */ OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */ OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/ OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */ OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */ OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */ OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */ OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */ OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */ OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */ OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */ OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */ OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */ OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */ OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */ OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */ OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */ OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */ OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */ OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */ OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */ OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */ OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */ OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */ OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ #define OMX_AUDIO_CodingFLAC_Supported 1 OMX_AUDIO_CodingFLAC, /**< Any variant of FLAC */ #define OMX_AUDIO_CodingDDP_Supported 1 OMX_AUDIO_CodingDDP, /**< Any variant of Dolby Digital Plus */ #define OMX_AUDIO_CodingDTS_Supported 1 OMX_AUDIO_CodingDTS, /**< Any variant of DTS */ #define OMX_AUDIO_CodingWMAPRO_Supported 1 OMX_AUDIO_CodingWMAPRO, /**< Any variant of WMA Professional */ #define OMX_AUDIO_CodingATRAC3_Supported 1 OMX_AUDIO_CodingATRAC3, /**< Sony ATRAC-3 variants */ #define OMX_AUDIO_CodingATRACX_Supported 1 OMX_AUDIO_CodingATRACX, /**< Sony ATRAC-X variants */ #define OMX_AUDIO_CodingATRACAAL_Supported 1 OMX_AUDIO_CodingATRACAAL, /**< Sony ATRAC advanced-lossless variants */ OMX_AUDIO_CodingMax = 0x7FFFFFFF } OMX_AUDIO_CODINGTYPE; /** The PortDefinition structure is used to define all of the parameters * necessary for the compliant component to setup an input or an output audio * path. If additional information is needed to define the parameters of the * port (such as frequency), additional structures must be sent such as the * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port. */ typedef struct OMX_AUDIO_PORTDEFINITIONTYPE { OMX_STRING cMIMEType; /**< MIME type of data for the port */ OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference for an output device, otherwise this field is 0 */ OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is supported by the OMX component */ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */ } OMX_AUDIO_PORTDEFINITIONTYPE; /** Port format parameter. This structure is used to enumerate * the various data input/output format supported by the port. */ typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Indicates which port to set */ OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */ } OMX_AUDIO_PARAM_PORTFORMATTYPE; /** PCM mode type */ typedef enum OMX_AUDIO_PCMMODETYPE { OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */ OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */ OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */ OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_PCMModeMax = 0x7FFFFFFF } OMX_AUDIO_PCMMODETYPE; typedef enum OMX_AUDIO_CHANNELTYPE { OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */ OMX_AUDIO_ChannelLF = 0x1, /**< Left front */ OMX_AUDIO_ChannelRF = 0x2, /**< Right front */ OMX_AUDIO_ChannelCF = 0x3, /**< Center front */ OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */ OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */ OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */ OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */ OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */ OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */ OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_ChannelMax = 0x7FFFFFFF } OMX_AUDIO_CHANNELTYPE; #define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */ #define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */ /** PCM format description */ typedef struct OMX_AUDIO_PARAM_PCMMODETYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */ OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */ OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */ OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for non-interleaved data (e.g. block data) */ OMX_U32 nBitPerSample; /**< Bit per sample */ OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */ OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */ } OMX_AUDIO_PARAM_PCMMODETYPE; /** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC. */ typedef enum OMX_AUDIO_CHANNELMODETYPE { OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those two channels changes accordingly to each channel information */ OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between 2 channels for higher compression gain */ OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half the bitrate of the overall bitrate */ OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */ OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF } OMX_AUDIO_CHANNELMODETYPE; typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE { OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */ OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */ OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */ OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF } OMX_AUDIO_MP3STREAMFORMATTYPE; /** MP3 params */ typedef struct OMX_AUDIO_PARAM_MP3TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should limit the audio signal. Use 0 to let encoder decide */ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */ } OMX_AUDIO_PARAM_MP3TYPE; typedef enum OMX_AUDIO_DDPBITSTREAMID { OMX_AUDIO_DDPBitStreamIdAC3 = 8, OMX_AUDIO_DDPBitStreamIdEAC3 = 16, OMX_AUDIO_DDPBitStreamIdKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_DDPBitStreamIdVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_DDPBitStreamIdMax = 0x7FFFFFFF } OMX_AUDIO_DDPBITSTREAMID; typedef enum OMX_AUDIO_DDPBITSTREAMMODE { OMX_AUDIO_DDPBitStreamModeCM = 0, /**< DDP any main audio service: complete main (CM) */ OMX_AUDIO_DDPBitStreamModeME, /**< DDP any main audio service: music and effects (ME) */ OMX_AUDIO_DDPBitStreamModeVI, /**< DDP any associated service: visually impaired (VI) */ OMX_AUDIO_DDPBitStreamModeHI, /**< DDP any associated service: hearing impaired (HI) */ OMX_AUDIO_DDPBitStreamModeD, /**< DDP any associated service: dialogue (D) */ OMX_AUDIO_DDPBitStreamModeC, /**< DDP any associated service: commentary (C) */ OMX_AUDIO_DDPBitStreamModeE, /**< DDP any associated service: emergency (E) */ OMX_AUDIO_DDPBitStreamModeVO, /**< DDP associated service: voice over (VO) */ OMX_AUDIO_DDPBitStreamModeK, /**< DDP main audio service: karaoke */ OMX_AUDIO_DDPBitStreamModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_DDPBitStreamModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_DDPBitStreamModeMax = 0x7FFFFFFF } OMX_AUDIO_DDPBITSTREAMMODE; typedef enum OMX_AUDIO_DDPDOLBYSURROUNDMODE { OMX_AUDIO_DDPDolbySurroundModeNotIndicated = 0, /**< Not indicated */ OMX_AUDIO_DDPDolbySurroundModeNotDolbySurround, /**< Not Dolby Surround */ OMX_AUDIO_DDPDolbySurroundModeDolbySurroundEncoded, /**< Dolby Surround encoded */ OMX_AUDIO_DDPDolbySurroundModeReserverd, /**< Reserved */ OMX_AUDIO_DDPDolbySurroundModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_DDPDolbySurroundModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_DDPDolbySurroundModeMax = 0x7FFFFFFF } OMX_AUDIO_DDPDOLBYSURROUNDMODE; /** DDP params */ typedef struct OMX_AUDIO_PARAM_DDPTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_AUDIO_DDPBITSTREAMID eBitStreamId; OMX_AUDIO_DDPBITSTREAMMODE eBitStreamMode; OMX_AUDIO_DDPDOLBYSURROUNDMODE eDolbySurroundMode; OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMapping[i] */ } OMX_AUDIO_PARAM_DDPTYPE; /** DTS params */ typedef struct OMX_AUDIO_PARAM_DTSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nDtsType; /** DTS type 1, 2, or 3. */ OMX_U32 nFormat; /** DTS stream is either big/little endian and 16/14 bit packing */ OMX_U32 nDtsFrameSizeBytes; /** DTS frame size in bytes */ OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMapping[i] */ } OMX_AUDIO_PARAM_DTSTYPE; typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE { OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */ OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */ OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */ OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */ OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */ OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */ OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */ OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF } OMX_AUDIO_AACSTREAMFORMATTYPE; /** AAC mode type. Note that the term profile is used with the MPEG-2 * standard and the term object type and profile is used with MPEG-4 */ typedef enum OMX_AUDIO_AACPROFILETYPE{ OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */ OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */ OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */ OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */ OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */ OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */ OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */ OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */ OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */ OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */ OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AACObjectMax = 0x7FFFFFFF } OMX_AUDIO_AACPROFILETYPE; /** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE). * Required for encoder configuration and optional as decoder info output. * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */ #define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */ #define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */ #define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */ #define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */ #define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */ #define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */ #define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/ /** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE). * Required for ER encoder configuration and optional as decoder info output */ #define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */ #define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */ #define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */ #define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */ #define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */ /** AAC params */ typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should limit the audio signal. Use 0 to let encoder decide */ OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec. Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD). Use 0 to let encoder decide */ OMX_U32 nAACtools; /**< AAC tool usage */ OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */ OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */ OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ } OMX_AUDIO_PARAM_AACPROFILETYPE; /** VORBIS params */ typedef struct OMX_AUDIO_PARAM_VORBISTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable rate or unknown bit rates. Encoding is set to the bitrate closest to specified value (in bps) */ OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */ OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should limit the audio signal. Use 0 to let encoder decide */ OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high). In the default mode of operation, the quality level is 3. Normal quality range is 0 - 10. */ OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the normal VBR encoding, but allows hard or soft bitrate constraints to be enforced by the encoder. This mode can be slower, and may also be lower quality. It is primarily useful for streaming. */ OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on non-stereo streams). Useful for lower-bitrate encoding. */ } OMX_AUDIO_PARAM_VORBISTYPE; /** WMA Version */ typedef enum OMX_AUDIO_WMAFORMATTYPE { OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */ OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */ OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */ OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */ OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF } OMX_AUDIO_WMAFORMATTYPE; /** WMA Profile */ typedef enum OMX_AUDIO_WMAPROFILETYPE { OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */ OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */ OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */ OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */ OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF } OMX_AUDIO_WMAPROFILETYPE; /** WMA params */ typedef struct OMX_AUDIO_PARAM_WMATYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U16 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */ OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */ OMX_U32 nSamplingRate; /**< Sampling rate of the source data */ OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */ OMX_U16 nEncodeOptions; /**< WMA Type-specific data */ OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */ } OMX_AUDIO_PARAM_WMATYPE; /** * RealAudio format */ typedef enum OMX_AUDIO_RAFORMATTYPE { OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */ OMX_AUDIO_RA8, /**< RealAudio 8 codec */ OMX_AUDIO_RA9, /**< RealAudio 9 codec */ OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */ OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */ OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */ OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */ OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */ OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_RAFormatMax = 0x7FFFFFFF } OMX_AUDIO_RAFORMATTYPE; /** RA (Real Audio) params */ typedef struct OMX_AUDIO_PARAM_RATYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */ OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */ OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */ OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */ OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */ OMX_U32 nNumRegions; /**< is the number of regions value */ OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */ } OMX_AUDIO_PARAM_RATYPE; /** SBC Allocation Method Type */ typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE { OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */ OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */ OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF } OMX_AUDIO_SBCALLOCMETHODTYPE; /** SBC params */ typedef struct OMX_AUDIO_PARAM_SBCTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nBlocks; /**< Number of blocks */ OMX_U32 nSubbands; /**< Number of subbands */ OMX_U32 nBitPool; /**< Bitpool value */ OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */ } OMX_AUDIO_PARAM_SBCTYPE; /** ADPCM stream format parameters */ typedef struct OMX_AUDIO_PARAM_ADPCMTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_U32 nBitsPerSample; /**< Number of bits in each sample */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ } OMX_AUDIO_PARAM_ADPCMTYPE; /** G723 rate */ typedef enum OMX_AUDIO_G723RATE { OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */ OMX_AUDIO_G723ModeLow, /**< 5300 bps */ OMX_AUDIO_G723ModeHigh, /**< 6300 bps */ OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_G723ModeMax = 0x7FFFFFFF } OMX_AUDIO_G723RATE; /** G723 - Sample rate must be 8 KHz */ typedef struct OMX_AUDIO_PARAM_G723TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ OMX_BOOL bPostFilter; /**< Enable Post Filter */ } OMX_AUDIO_PARAM_G723TYPE; /** ITU G726 (ADPCM) rate */ typedef enum OMX_AUDIO_G726MODE { OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */ OMX_AUDIO_G726Mode16, /**< 16 kbps */ OMX_AUDIO_G726Mode24, /**< 24 kbps */ OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */ OMX_AUDIO_G726Mode40, /**< 40 kbps */ OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_G726ModeMax = 0x7FFFFFFF } OMX_AUDIO_G726MODE; /** G.726 stream format parameters - must be at 8KHz */ typedef struct OMX_AUDIO_PARAM_G726TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_AUDIO_G726MODE eG726Mode; } OMX_AUDIO_PARAM_G726TYPE; /** G729 coder type */ typedef enum OMX_AUDIO_G729TYPE { OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */ OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */ OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */ OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */ OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_G729Max = 0x7FFFFFFF } OMX_AUDIO_G729TYPE; /** G729 stream format parameters - fixed 6KHz sample rate */ typedef struct OMX_AUDIO_PARAM_G729TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_AUDIO_G729TYPE eBitType; } OMX_AUDIO_PARAM_G729TYPE; /** AMR Frame format */ typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE { OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance (Standard) Format */ OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface Format 1 */ OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface Format 2*/ OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage Format */ OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time Transport Protocol Payload Format */ OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */ OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF } OMX_AUDIO_AMRFRAMEFORMATTYPE; /** AMR band mode */ typedef enum OMX_AUDIO_AMRBANDMODETYPE { OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */ OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */ OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */ OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */ OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */ OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */ OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */ OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */ OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */ OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */ OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */ OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */ OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */ OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */ OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */ OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */ OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */ OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */ OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF } OMX_AUDIO_AMRBANDMODETYPE; /** AMR Discontinuous Transmission mode */ typedef enum OMX_AUDIO_AMRDTXMODETYPE { OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */ OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using Voice Activity Detector 1 (VAD1) is enabled */ OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using Voice Activity Detector 2 (VAD2) is enabled */ OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between Off, VAD1 or VAD2 modes */ OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */ OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF } OMX_AUDIO_AMRDTXMODETYPE; /** AMR params */ typedef struct OMX_AUDIO_PARAM_AMRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate read only field */ OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */ OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */ OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */ } OMX_AUDIO_PARAM_AMRTYPE; /** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */ typedef struct OMX_AUDIO_PARAM_GSMFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_GSMFRTYPE; /** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */ typedef struct OMX_AUDIO_PARAM_GSMHRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_GSMHRTYPE; /** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */ typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_GSMEFRTYPE; /** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_TDMAFRTYPE; /** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_TDMAEFRTYPE; /** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_PDCFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_PDCFRTYPE; /** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_PDCEFRTYPE; /** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_PDCHRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_PDCHRTYPE; /** CDMA Rate types */ typedef enum OMX_AUDIO_CDMARATETYPE { OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */ OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */ OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */ OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */ OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/ OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */ OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_CDMARateMax = 0x7FFFFFFF } OMX_AUDIO_CDMARATETYPE; /** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_QCELP8TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ } OMX_AUDIO_PARAM_QCELP8TYPE; /** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_QCELP13TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ } OMX_AUDIO_PARAM_QCELP13TYPE; /** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_EVRCTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */ } OMX_AUDIO_PARAM_EVRCTYPE; /** SMV ( up to 8.55kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_SMVTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/ } OMX_AUDIO_PARAM_SMVTYPE; /** MIDI Format * @ingroup midi */ typedef enum OMX_AUDIO_MIDIFORMATTYPE { OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */ OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */ OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */ OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */ OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */ OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */ OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */ OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */ OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF } OMX_AUDIO_MIDIFORMATTYPE; /** MIDI params * @ingroup midi */ typedef struct OMX_AUDIO_PARAM_MIDITYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire MIDI file passed in, otherwise if 0x0, the MIDI data is merged and streamed (instead of passed as an entire MIDI file) */ OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic voices. A value of zero indicates that the default polyphony of the device is used */ OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound bank at initialization */ OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */ } OMX_AUDIO_PARAM_MIDITYPE; /** Type of the MIDI sound bank * @ingroup midi */ typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE { OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */ OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */ OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */ OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */ OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */ OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF } OMX_AUDIO_MIDISOUNDBANKTYPE; /** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank * @ingroup midi */ typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE { OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */ OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */ OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */ OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */ OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF } OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE; /** MIDI params to load/unload user soundbank * @ingroup midi */ typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nDLSIndex; /**< DLS file index to be loaded */ OMX_U32 nDLSSize; /**< Size in bytes */ OMX_PTR pDLSData; /**< Pointer to DLS file data */ OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */ OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */ } OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE; /** Structure for Live MIDI events and MIP messages. * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.) * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */ OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an array for the MIP message buffer, where the size is indicated by nMidiEventSize */ } OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE; /** MIDI sound bank/ program pair in a given channel * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */ OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */ OMX_U16 nIDSoundBank; /**< Sound bank ID */ OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks by index if multiple banks are present */ } OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE; /** MIDI control * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10 format based on JAVA MMAPI (JSR-135) requirement */ OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point number based on JSR-135 requirement */ OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10 fixed-point number based on JSR-135 requirement */ OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic voices. A value of zero indicates that the default polyphony of the device is used */ OMX_U32 nNumRepeat; /**< Number of times to repeat playback */ OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback will stop automatically. Set to zero if not used */ OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */ OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */ OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */ OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */ OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */ OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */ } OMX_AUDIO_CONFIG_MIDICONTROLTYPE; /** MIDI Playback States * @ingroup midi */ typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE { OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to other defined states */ OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open. The MIDI engine is currently processing MIDI events. */ OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being primed. The MIDI engine is currently processing MIDI events. */ OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but not playing. The MIDI engine is currently processing MIDI events. The transition to this state is only possible from the OMX_AUDIO_MIDIPlayBackStatePlaying state, when the 'playback head' reaches the end of media data or the playback stops due to stop time set.*/ OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently playing. The MIDI engine is currently processing MIDI events.*/ OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS resource constraints */ OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and SP-MIDI content constraints, there is no audible MIDI content during playback currently. The situation may change if resources are freed later.*/ OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF } OMX_AUDIO_MIDIPLAYBACKSTATETYPE; /** MIDI status * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field. NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_U32 nDuration; /**< The length of the currently open MIDI resource in milliseconds. NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_U32 nPosition; /**< Current Position of the MIDI resource being played in milliseconds */ OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently open MIDI resource. NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing MIDI resource. NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */ } OMX_AUDIO_CONFIG_MIDISTATUSTYPE; /** MIDI Meta Event structure one per Meta Event. * MIDI Meta Events are like audio metadata, except that they are interspersed * with the MIDI content throughout the file and are not localized in the header. * As such, it is necessary to retrieve information about these Meta Events from * the engine, as it encounters these Meta Events within the MIDI content. * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright, * author, default tempo, etc.) scattered throughout the file. * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{ OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nIndex; /**< Index of Meta Event */ OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ OMX_U32 nTrack; /**< track number for the meta event */ OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */ } OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE; /** MIDI Meta Event Data structure - one per Meta Event. * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{ OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nIndex; /**< Index of Meta Event */ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ OMX_U8 nData[1]; /**< array of one or more bytes of meta data as indicated by the nMetaEventSize field */ } OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE; /** Audio Volume adjustment for a port */ typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port index indicating which port to set. Select the input port to set just that port's volume. Select the output port to adjust the master volume. */ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or logarithmic scale (mB) */ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR Volume logarithmic setting for this port. The values for volume are in mB (millibels = 1/100 dB) relative to a gain of 1 (e.g. the output is the same as the input level). Values are in mB from nMax (maximum volume) to nMin mB (typically negative). Since the volume is "voltage" and not a "power", it takes a setting of -600 mB to decrease the volume by 1/2. If a component cannot accurately set the volume to the requested value, it must set the volume to the closest value BELOW the requested value. When getting the volume setting, the current actual volume must be returned. */ } OMX_AUDIO_CONFIG_VOLUMETYPE; /** Audio Volume adjustment for a channel */ typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port index indicating which port to set. Select the input port to set just that port's volume. Select the output port to adjust the master volume. */ OMX_U32 nChannel; /**< channel to select from 0 to N-1, using OMX_ALL to apply volume settings to all channels */ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or logarithmic scale (mB) */ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR Volume logarithmic setting for this port. The values for volume are in mB (millibels = 1/100 dB) relative to a gain of 1 (e.g. the output is the same as the input level). Values are in mB from nMax (maximum volume) to nMin mB (typically negative). Since the volume is "voltage" and not a "power", it takes a setting of -600 mB to decrease the volume by 1/2. If a component cannot accurately set the volume to the requested value, it must set the volume to the closest value BELOW the requested value. When getting the volume setting, the current actual volume must be returned. */ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, FALSE otherwise */ } OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE; /** Audio balance setting */ typedef struct OMX_AUDIO_CONFIG_BALANCETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port index indicating which port to set. Select the input port to set just that port's balance. Select the output port to adjust the master balance. */ OMX_S32 nBalance; /**< balance setting for this port (-100 to 100, where -100 indicates all left, and no right */ } OMX_AUDIO_CONFIG_BALANCETYPE; /** Audio Port mute */ typedef struct OMX_AUDIO_CONFIG_MUTETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port index indicating which port to set. Select the input port to set just that port's mute. Select the output port to adjust the master mute. */ OMX_BOOL bMute; /**< Mute setting for this port */ } OMX_AUDIO_CONFIG_MUTETYPE; /** Audio Channel mute */ typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannel; /**< channel to select from 0 to N-1, using OMX_ALL to apply mute settings to all channels */ OMX_BOOL bMute; /**< Mute setting for this channel */ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, FALSE otherwise */ } OMX_AUDIO_CONFIG_CHANNELMUTETYPE; /** Enable / Disable for loudness control, which boosts bass and to a * smaller extent high end frequencies to compensate for hearing * ability at the extreme ends of the audio spectrum */ typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bLoudness; /**< Enable/disable for loudness */ } OMX_AUDIO_CONFIG_LOUDNESSTYPE; /** Enable / Disable for bass, which controls low frequencies */ typedef struct OMX_AUDIO_CONFIG_BASSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for bass control */ OMX_S32 nBass; /**< bass setting for the port, as a continuous value from -100 to 100 (0 means no change in bass level)*/ } OMX_AUDIO_CONFIG_BASSTYPE; /** Enable / Disable for treble, which controls high frequencies tones */ typedef struct OMX_AUDIO_CONFIG_TREBLETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for treble control */ OMX_S32 nTreble; /**< treble setting for the port, as a continuous value from -100 to 100 (0 means no change in treble level) */ } OMX_AUDIO_CONFIG_TREBLETYPE; /** An equalizer is typically used for two reasons: to compensate for an * sub-optimal frequency response of a system to make it sound more natural * or to create intentionally some unnatural coloring to the sound to create * an effect. * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for equalizer */ OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is N-1, where N is the number of bands, lower limit is 0 */ OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a read only element and is used to determine the lower, center and upper frequency of this band. */ OMX_BS32 sBandLevel; /**< band level in millibels */ } OMX_AUDIO_CONFIG_EQUALIZERTYPE; /** Stereo widening mode type * @ingroup effects */ typedef enum OMX_AUDIO_STEREOWIDENINGTYPE { OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */ OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */ OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF } OMX_AUDIO_STEREOWIDENINGTYPE; /** Control for stereo widening, which is a special 2-channel * case of the audio virtualizer effect. For example, for 5.1-channel * output, it translates to virtual surround sound. * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */ OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */ OMX_U32 nStereoWidening; /**< stereo widening setting for the port, as a continuous value from 0 to 100 */ } OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE; /** The chorus effect (or ``choralizer'') is any signal processor which makes * one sound source (such as a voice) sound like many such sources singing * (or playing) in unison. Since performance in unison is never exact, chorus * effects simulate this by making independently modified copies of the input * signal. Modifications may include (1) delay, (2) frequency shift, and * (3) amplitude modulation. * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for chorus */ OMX_BU32 sDelay; /**< average delay in milliseconds */ OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */ OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of delay (i.e. 0 to 100) */ OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */ } OMX_AUDIO_CONFIG_CHORUSTYPE; /** Reverberation is part of the reflected sound that follows the early * reflections. In a typical room, this consists of a dense succession of * echoes whose energy decays exponentially. The reverberation effect structure * as defined here includes both (early) reflections as well as (late) reverberations. * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for reverberation control */ OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect (i.e. both early reflections and late reverberation) in millibels */ OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies relative to the intensity at low frequencies in millibels */ OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections (relative to room value), in millibels */ OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative to the direct path, in milliseconds */ OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation relative to room level, in millibels */ OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection to the beginning of the late reverberation section, in milliseconds */ OMX_BU32 sDecayTime; /**< Late reverberation decay time at low frequencies, in milliseconds */ OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative to low frequency decay time in percent */ OMX_U32 nDensity; /**< Modal density in the late reverberation decay, in percent (i.e. 0 - 100) */ OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay, in percent (i.e. 0 - 100) */ OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is the frequency used as the reference for all the high-frequency settings above */ } OMX_AUDIO_CONFIG_REVERBERATIONTYPE; /** Possible settings for the Echo Cancelation structure to use * @ingroup effects */ typedef enum OMX_AUDIO_ECHOCANTYPE { OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */ OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation - echo from plastics and face */ OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for Hands Free operation */ OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for Car Kit (longer echo) */ OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_EchoCanMax = 0x7FFFFFFF } OMX_AUDIO_ECHOCANTYPE; /** Enable / Disable for echo cancelation, which removes undesired echo's * from the audio * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */ } OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE; /** Enable / Disable for noise reduction, which undesired noise from * the audio * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */ } OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE; /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/IL/OMX_Broadcom.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // OpenMAX IL - Broadcom specific types #ifndef OMX_Broadcom_h #define OMX_Broadcom_h #include "OMX_Component.h" // for use in buffer headers - marks the contained data // as being a codec header #define OMX_BUFFERFLAG_TIME_UNKNOWN 0x00000100 //for use in buffer headers - marks the buffer as being the //snapshot preview image from a still capture. //Mainly to be used with the DisplayFunction callback from camera. #define OMX_BUFFERFLAG_CAPTURE_PREVIEW 0x00000200 /* Mark the end of a NAL unit produced by a video encoder. */ #define OMX_BUFFERFLAG_ENDOFNAL 0x00000400 /* Marks pBuffer in OMX_BUFFERHEADERTYPE as containing a fragment list instead of the actual buffer */ #define OMX_BUFFERFLAG_FRAGMENTLIST 0x00000800 /* Marks the start of a new sequence of data following any kind of seek operation. */ #define OMX_BUFFERFLAG_DISCONTINUITY 0x00001000 /** Codec side information Flag: * OMX_BUFFERFLAG_CODECSIDEINFO is an optional flag that is set by an * output port when all bytes in the buffer form part or all of a set of * codec specific side information. For example, distortion information * estimated by H.264 encoder can be sent using this flag to signal * the decoder quality */ #define OMX_BUFFERFLAG_CODECSIDEINFO 0x00002000 // for use in buffer headers - indicated the timestamp is a DTS rather than PTS #define OMX_BUFFERFLAG_TIME_IS_DTS 0x000004000 // for use in buffer headers - signals that a video picture is interlaced #define OMX_BUFFERFLAG_INTERLACED 0x000010000 // Signals that the top field of the current interlaced frame should be displayed first #define OMX_BUFFERFLAG_TOP_FIELD_FIRST 0x000020000 /** * Macros to convert to OMX_TICKS from a signed 64 bit value and * vice-versa. These macros don't actually do anything unless OMX_TICKS * is defined as a two-part structure (instead of a native signed 64-bit type). **/ #ifndef OMX_SKIP64BIT #define omx_ticks_from_s64(s) (s) #define omx_ticks_to_s64(t) (t) #else static inline OMX_TICKS omx_ticks_from_s64(signed long long s) { OMX_TICKS t; t.nLowPart = (OMX_U32)s; t.nHighPart = (OMX_U32)(s>>32); return t; } #define omx_ticks_to_s64(t) ((t).nLowPart | ((uint64_t)((t).nHighPart) << 32)) #endif /* OMX_SKIP64BIT */ /* Buffer fragment descriptor */ typedef struct OMX_BUFFERFRAGMENTTYPE { OMX_PTR pBuffer; /**< Pointer to actual block of memory that is acting as the fragment buffer */ OMX_U32 nLen; /**< number of bytes in the buffer */ } OMX_BUFFERFRAGMENTTYPE; /* OMX_IndexParamBrcmEnableIJGTableScaling: JPEG Quality Table Setting. */ typedef struct OMX_PARAM_IJGSCALINGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; } OMX_PARAM_IJGSCALINGTYPE; /* The boolean \code{bEnabled} value determines whether the component uses the standard IJG quality tables when encoding images. */ /* OMX_IndexConfigTimeInvalidStartTime: Invalid Start Times */ /* This allows clock clients to supply a start time notification to the clock whilst indicating that this time is invalid. */ /* OMX_IndexParamBrcmMaxFrameSkips: Frame timestamp jumps */ /* This number represents the number of times a jump in frame timestamps has been observed that is greater than expected. */ /* OMX_IndexConfigAsynchronousFailureURI: Asynchronous Failure Filename */ /* This allows the client to query for the filename that cause an asynchronous output error. */ /* OMX_IndexParamAsynchronousOutput: Asynchronous Output */ /* The allows the client to specify to a component that is writing files that this writing may happen asynchronously, including opening and closing of files. */ /* OMX_IndexConfigClockAdjustment: Clock Adjustment */ /* This allows the client to read from the clock the total time adjustment made to the clock whilst running by the reference clock. If the reference clock sends a time that causes the media time to jump this difference is added to the total, which can be reported via this index. When the stream restarts by setting the clock state to \code{OMX_TIME_ClockStateRunning} or \code{OMX_TIME_ClockStateWaitingForStartTime} this adjustment total is set to zero. */ /* OMX_IndexParamBrcmDataUnit: Data Unit */ /* The data unit is an indication to components connected to this component of the type of data delivery available. \code{OMX_DataUnitCodedPicture} indicates that we are able to give framing information, using the \code{OMX_BUFFERFLAG_ENDOFFRAME} flag to indicate that the data contained finishes a complete frame. \code{OMX_DataUnitArbitraryStreamSection} indicates that no end-of-frame markers will be present, and the decoder should perform the steps necessary to decode the stream. The other enum values are not used. */ /* OMX_IndexConfigPresentationOffset: Presentation Offset */ /* The value of \code{nTimestamp} is added to the offset requested for each new input frame. Takes effect for all new input frames, and has no effect on the offset used for currently-queued frames. A positive value will make the requested port earlier relative to other streams, a negative value will make the requested port later relative to other streams. */ /* OMX_IndexConfigSingleStep: Single Step */ /* When setting this config on a paused clock, where the \code{nU32} value is non-zero and \code{nPortIndex} is OMX_ALL, the media clock will advance through the next \code{nU32} next requested media times. A paused clock is in running state but has a time scale of 0. This will trigger the display of some video frames, so allowing single-stepping functionality. This config can be set multiple times, and will buffer up stepping requests until we have media requests to fulfil, or the clock is stopped or un-paused. This config can also be used on some video output ports and, if \code{nU32} is non-zero, requests that the output port forwards the next \code{nU32} frames appending an EOS marker on the last frame, and then ceases to forward data on this port. If \code{nU32} is zero, any previous request to forward a limited number of frames is cancelled and the default behaviour of this port will resume. */ /* OMX_IndexParamCameraCamplusId: Camera Subsystem Identification */ /* This parameter allows the configuration of the identifier to be used to initialise the Broadcom Camplus subsystem that sits beneath the camera component. If only one instance of the camera component is used, the default value can be used. If more than one instance is required, they must each have their own unique values for this parameter. It is also used to tie the component to the image pool created with \code{OMX_Set upCamPools}. */ /* OMX_IndexConfigAudioRenderingLatency: Audio Rendering Latency */ /* This config allows the client to query the current latency of audio rendering. The latency is returned as the number of samples that an audio rendering component has received but have not been played. */ /* OMX_IndexConfigBrcmPoolMemAllocSize: Pool memory usage values */ /* This config allows the client to query how much memory is being used by the component for any image pools. */ /* OMX_IndexConfigDisplayRegion: Display Region */ typedef enum OMX_DISPLAYTRANSFORMTYPE{ OMX_DISPLAY_ROT0 = 0, OMX_DISPLAY_MIRROR_ROT0 = 1, OMX_DISPLAY_MIRROR_ROT180 = 2, OMX_DISPLAY_ROT180 = 3, OMX_DISPLAY_MIRROR_ROT90 = 4, OMX_DISPLAY_ROT270 = 5, OMX_DISPLAY_ROT90 = 6, OMX_DISPLAY_MIRROR_ROT270 = 7, OMX_DISPLAY_DUMMY = 0x7FFFFFFF } OMX_DISPLAYTRANSFORMTYPE; typedef struct OMX_DISPLAYRECTTYPE { OMX_S16 x_offset; OMX_S16 y_offset; OMX_S16 width; OMX_S16 height; } OMX_DISPLAYRECTTYPE; typedef enum OMX_DISPLAYMODETYPE { OMX_DISPLAY_MODE_FILL = 0, OMX_DISPLAY_MODE_LETTERBOX = 1, // these allow a left eye source->dest to be specified and the right eye mapping will be inferred by symmetry OMX_DISPLAY_MODE_STEREO_LEFT_TO_LEFT = 2, OMX_DISPLAY_MODE_STEREO_TOP_TO_TOP = 3, OMX_DISPLAY_MODE_STEREO_LEFT_TO_TOP = 4, OMX_DISPLAY_MODE_STEREO_TOP_TO_LEFT = 5, OMX_DISPLAY_MODE_DUMMY = 0x7FFFFFFF } OMX_DISPLAYMODETYPE; typedef enum OMX_DISPLAYSETTYPE { OMX_DISPLAY_SET_NONE = 0, OMX_DISPLAY_SET_NUM = 1, OMX_DISPLAY_SET_FULLSCREEN = 2, OMX_DISPLAY_SET_TRANSFORM = 4, OMX_DISPLAY_SET_DEST_RECT = 8, OMX_DISPLAY_SET_SRC_RECT = 0x10, OMX_DISPLAY_SET_MODE = 0x20, OMX_DISPLAY_SET_PIXEL = 0x40, OMX_DISPLAY_SET_NOASPECT = 0x80, OMX_DISPLAY_SET_LAYER = 0x100, OMX_DISPLAY_SET_COPYPROTECT = 0x200, OMX_DISPLAY_SET_ALPHA = 0x400, OMX_DISPLAY_SET_DUMMY = 0x7FFFFFFF } OMX_DISPLAYSETTYPE; typedef struct OMX_CONFIG_DISPLAYREGIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_DISPLAYSETTYPE set; OMX_U32 num; OMX_BOOL fullscreen; OMX_DISPLAYTRANSFORMTYPE transform; OMX_DISPLAYRECTTYPE dest_rect; OMX_DISPLAYRECTTYPE src_rect; OMX_BOOL noaspect; OMX_DISPLAYMODETYPE mode; OMX_U32 pixel_x; OMX_U32 pixel_y; OMX_S32 layer; OMX_BOOL copyprotect_required; OMX_U32 alpha; OMX_U32 wfc_context_width; OMX_U32 wfc_context_height; } OMX_CONFIG_DISPLAYREGIONTYPE; /* This config sets the output display device, as well as the region used on the output display, any display transformation, and some flags to indicate how to scale the image. The structure uses a bitfield, \code{set}, to indicate which fields are set and should be used. All other fields will maintain their current value. \code{num} describes the display output device, with 0 typically being a directly connected LCD display. \code{fullscreen} indicates that we are using the full device screen area, rather than a window of the display. If fullscreen is false, then dest_rect is used to specify a region of the display to use. \code{transform} indicates any rotation or flipping used to map frames onto the natural display orientation. The \code{src_rect} indicates which area of the frame to display. If all values are zero, the whole frame will be used. The \code{noaspect} flag, if set, indicates that any display scaling should disregard the aspect ratio of the frame region being displayed. \code{mode} indicates how the image should be scaled to fit the display. \code{OMX_DISPLAY_MODE_FILL} indicates that the image should fill the screen by potentially cropping the frames. Setting \code{mode} to \code{OMX_DISPLAY_MODE_LETTERBOX} indicates that all the source region should be displayed and black bars added if necessary. The \code{pixel_x} and \code{pixel_y} values, if non-zero, are used to describe the size of a source pixel. If values are zero, then pixels default to being square. Set the \code{layer} that the image will appear on with the \code{layer} field. */ /* OMX_IndexParamSource: Source Image Configuration */ typedef enum OMX_SOURCETYPE { OMX_SOURCE_WHITE = 0, // all white images OMX_SOURCE_BLACK = 1, // all black images OMX_SOURCE_DIAGONAL = 2, // greyscale diagonal stripes OMX_SOURCE_NOISE = 3, // random pixel values OMX_SOURCE_RANDOM = 4, // a shaded random pattern of colours OMX_SOURCE_COLOUR = 5, // a solid colour determined by nParam OMX_SOURCE_BLOCKS = 6, // random coloured blocks of 16x16 size OMX_SOURCE_SWIRLY, // a swirly pattern used for encode testing OMX_SOURCE_DUMMY = 0x7FFFFFFF } OMX_SOURCETYPE; typedef struct OMX_PARAM_SOURCETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_SOURCETYPE eType; OMX_U32 nParam; OMX_U32 nFrameCount; OMX_U32 xFrameRate; } OMX_PARAM_SOURCETYPE; /* The source type determines the kind of image that is produced. Not all combinations of source type and image type are supported. The \code{OMX_SOURCE_SWIRLY} setting can only be used with YUV420 packed planar image formats. When producing RGB565 image format, the \code{OMX_SOURCE_DIAGONAL} and \code{OMX_SOURCE_RANDOM} modes are treated as \code{OMX_SOURCE_NOISE}. The \code{nParam} field is used to specify the colour for the source colour mode, and the offset of the diagonal pattern for diagonal mode. For the blocks mode, \code{nParam} is used as the seed for the random colour generator. The \code{nFrameCount} parameter determines how many frames to send. If it is zero, then frames are sent continuously. For any other value, it counts down until it has sent that many frames, and then stops, sending out an EOS. The \code{xFrameRate} setting is used to determine the timestamp for each frame produced, or can be set to zero if timestamps should all remain at zero. */ /* OMX_IndexParamSourceSeed: Source Random Seed */ typedef struct OMX_PARAM_SOURCESEEDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U16 nData[16]; } OMX_PARAM_SOURCESEEDTYPE; /* This structure sets the current state of the random number generator used for \code{OMX_SOURCE_RANDOM} source type, allowing repeatable random image creation. */ /* OMX_IndexParamResize: Resize Control */ typedef enum OMX_RESIZEMODETYPE { OMX_RESIZE_NONE, OMX_RESIZE_CROP, OMX_RESIZE_BOX, OMX_RESIZE_BYTES, OMX_RESIZE_DUMMY = 0x7FFFFFFF } OMX_RESIZEMODETYPE; typedef struct OMX_PARAM_RESIZETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_RESIZEMODETYPE eMode; OMX_U32 nMaxWidth; OMX_U32 nMaxHeight; OMX_U32 nMaxBytes; OMX_BOOL bPreserveAspectRatio; OMX_BOOL bAllowUpscaling; } OMX_PARAM_RESIZETYPE; /* The mode determines the kind of resize. \code{OMX_RESIZE_BOX} allow the \code{nMaxWidth} and \code{nMaxHeight} to set a bounding box into which the output must fit. \code{OMX_RESIZE_BYTES} allows \code{nMaxBytes} to set the maximum number of bytes into which the full output frame must fit. Two flags aid the setting of the output size. \code{bPreseveAspectRatio} sets whether the resize should preserve the aspect ratio of the incoming image. \code{bAllowUpscaling} sets whether the resize is allowed to increase the size of the output image compared to the size of the input image. */ typedef struct OMX_PARAM_TESTINTERFACETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bTest; OMX_BOOL bSetExtra; OMX_U32 nExtra; OMX_BOOL bSetError; OMX_BOOL stateError[2]; } OMX_PARAM_TESTINTERFACETYPE; /* OMX_IndexConfigVisualisation: Visualisation Mode */ typedef struct OMX_CONFIG_VISUALISATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U8 name[16]; OMX_U8 property[64]; } OMX_CONFIG_VISUALISATIONTYPE; /* \code{name} is a string of characters specifying the type of visualization. The component appends \code{"_vis.vll"} to the name provided, and attempts to load a visualisation library contained in this VLL. \code{property} contains configuration parameters and values, which is interpreted by the visualisation library. Typically all visualisations will accept a property string containing \code{'mode='}, where \code{} may be a random 32 bit integer in decimal format. If provided, this may select a random mode from that visualisation library. */ /* This parameter is used when creating proprietary communication with the display component, and provides the display function for passing images to be displayed, together with a function used to flush all pending image updates and release all images. */ /* OMX_IndexConfigBrcmAudioDestination: Audio Destination */ typedef struct OMX_CONFIG_BRCMAUDIODESTINATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 sName[16]; } OMX_CONFIG_BRCMAUDIODESTINATIONTYPE; /* This config sets the platform-specific audio destination or output device for audio sink components (e.g. audio_render). \code{sName} describes the audio destination, with \code{"local"} typically being directly connected to headphones. */ /* OMX_IndexConfigBrcmAudioSource: Audio Source */ typedef struct OMX_CONFIG_BRCMAUDIOSOURCETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 sName[16]; } OMX_CONFIG_BRCMAUDIOSOURCETYPE; /* This config sets the platform-specific audio source or input device for audio source components (e.g. audio_capture). \code{sName} describes the audio source, with \code{"local"} typically being directly connected to microphone. */ /* OMX_IndexConfigBrcmAudioDownmixCoefficients: Audio Downmix Coefficients */ typedef struct OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 coeff[16]; } OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS; /* This config sets the platform-specific audio downmixing coefficients for the audio mixer component. The coefficients are 16.16 fixed point. The even coefficients contribute to the left channel. The odd coefficients contribute to the right channel. L' = coeff[0] * sample[N] + coeff[2] * sample[N+1] + coeff[4] * sample[N+2] + coeff[6] * sample[N+3] + coeff[8] * sample[N+4] + coeff[10] * sample[N+5] + coeff[12] * sample[N+6] + coeff[14] * sample[N+7] R' = coeff[1] * sample[N] + coeff[3] * sample[N+1] + coeff[5] * sample[N+2] + coeff[7] * sample[N+3] + coeff[9] * sample[N+4] + coeff[11] * sample[N+5] + coeff[13] * sample[N+6] + coeff[15] * sample[N+7] \code{coeff} describes the downmixing coefficients */ /* OMX_IndexConfigBrcmAudioDownmixCoefficients8x8: Audio Downmix Coefficient matrix */ typedef struct OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS8x8 { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 coeff[64]; } OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS8x8; /* This config sets the platform-specific audio downmixing coefficients for the audio mixer component. The coefficients are 16.16 fixed point. The coefficients are a 8*8 mixing matrix from 8 input channels to 8 outputs channels \code{coeff} describes the downmixing coefficients */ /* OMX_IndexConfigBrcmAudioMaxSample: Maximum sample seen */ typedef struct OMX_CONFIG_BRCMAUDIOMAXSAMPLE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nMaxSample; OMX_TICKS nTimeStamp; } OMX_CONFIG_BRCMAUDIOMAXSAMPLE; /* This gets the largest sample produced (after downmixing with OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS8x8) since this config was last read. The nTimestamp is the earliest timestamp processed. This can be used for DRC schemes \code{coeff} maximum sample seen in current block */ /* OMX_IndexConfigPlayMode: Play Mode */ typedef enum OMX_PLAYMODETYPE { OMX_PLAYMODE_NORMAL, OMX_PLAYMODE_FF, OMX_PLAYMODE_REW, OMX_PLAYMODE_DUMMY = 0x7FFFFFFF } OMX_PLAYMODETYPE; typedef struct OMX_CONFIG_PLAYMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_PLAYMODETYPE eMode; } OMX_CONFIG_PLAYMODETYPE; /* The playmode affects which frames are extracted from the media file and passed on the output ports. \code{OMX_PLAYMODE_NORMAL} will extract all frames, \code{OMX_PLAYMODE_FF} extracts only IDR frames when video is present, or only occasional packets of audio if no video is present. \code{OMX_PLAYMODE_REW} is similar to \code{OMX_PLAYMODE_FF} but extracts packets in reverse time order. */ typedef enum OMX_DELIVERYFORMATTYPE { OMX_DELIVERYFORMAT_STREAM, // no framing information is known OMX_DELIVERYFORMAT_SINGLE_PACKET, // packetised, at most one frame per buffer OMX_DELIVERYFORMAT_DUMMY = 0x7FFFFFFF } OMX_DELIVERYFORMATTYPE; typedef struct OMX_PARAM_DELIVERYFORMATTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_DELIVERYFORMATTYPE eFormat; } OMX_PARAM_DELIVERYFORMATTYPE; /* OMX_IndexParamCodecConfig: Codec Configuration */ typedef struct OMX_PARAM_CODECCONFIGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 bCodecConfigIsComplete; OMX_U8 nData[1]; } OMX_PARAM_CODECCONFIGTYPE; /* This parameter contains opaque data in a format specified by Broadcom and allows out-of-band information such as cropping rectangles, aspect ratio information, codec-specific header bytes, and other essential information to be passed between connected components. \code{bCodecConfigIsCompete} specifies if the codec config is fully contained in here and there is no need to wait for OMX_BUFFERFLAG_CODECCONFIG buffers */ typedef struct OMX_PARAM_STILLSFUNCTIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bBuffer; OMX_PTR (*pOpenFunc)(void); OMX_PTR (*pCloseFunc)(void); OMX_PTR (*pReadFunc)(void); OMX_PTR (*pSeekFunc)(void); OMX_PTR (*pWriteFunc)(void); } OMX_PARAM_STILLSFUNCTIONTYPE; typedef void* OMX_BUFFERADDRESSHANDLETYPE; typedef struct OMX_PARAM_BUFFERADDRESSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nAllocLen; OMX_BUFFERADDRESSHANDLETYPE handle; } OMX_PARAM_BUFFERADDRESSTYPE; typedef struct OMX_PARAM_TUNNELSETUPTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_TUNNELSETUPTYPE sSetup; } OMX_PARAM_TUNNELSETUPTYPE; /* OMX_IndexParamBrcmPortEGL: Used for querying whether a port is an EGL port or not. */ typedef struct OMX_PARAM_BRCMPORTEGLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bPortIsEGL; } OMX_PARAM_BRCMPORTEGLTYPE; /* */ #define OMX_CONFIG_IMAGEFILTERPARAMS_MAXPARAMS 6 /* OMX_IndexConfigCommonImageFilterParameters: Parameterized Image Filter */ typedef struct OMX_CONFIG_IMAGEFILTERPARAMSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGEFILTERTYPE eImageFilter; OMX_U32 nNumParams; OMX_U32 nParams[OMX_CONFIG_IMAGEFILTERPARAMS_MAXPARAMS]; } OMX_CONFIG_IMAGEFILTERPARAMSTYPE; /* This structure contains optional parameters for some image filters. The following table lists all image filters that support parameters.
FilterParametersNotes
\code{OMX_ImageFilterSolarize} \code{[x0 y0 y1 y2]} Linear mapping of \code{[0,x0]} to \code{[0,y0>]} and \code{[x0,255]} to \code{[y1,y2]}. Default is \code{"128 128 128 0"}.
\code{OMX_ImageFilterSharpen} \code{[sz [str [th]]} \code{sz} size of filter, either 1 or 2. \code{str} strength of filter. \code{th} threshold of filter. Default is \code{"1 40 20"}.
\code{OMX_ImageFilterFilm} \code{[[str] [u v]]} \code{str} strength of effect. \code{u} sets u to constant value. \code{v} sets v to constant value. Default is \code{"24"}.
\code{OMX_ImageFilterBlur} \code{[sz]} \code{sz} size of filter, either 1 or 2. Default is \code{"2"}.
\code{OMX_ImageFilterSaturation} \code{[str]} \code{str} strength of effect, in 8.8 fixed point format. u/v value differences from 128 are multiplied by \code{str}. Default is \code{"272"}.
*/ /* OMX_IndexConfigTransitionControl: Transition Control */ typedef struct OMX_CONFIG_TRANSITIONCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nPosStart; OMX_U32 nPosEnd; OMX_S32 nPosIncrement; OMX_TICKS nFrameIncrement; OMX_BOOL bSwapInputs; OMX_U8 name[16]; OMX_U8 property[64]; } OMX_CONFIG_TRANSITIONCONTROLTYPE; /* This structure represents the internal configuration of the transition. Transitions are generated by a loadable plug-in described by the \code{name} field. The component appends \code{"_tran.vll"} to the name provided, and attempts to load a transition library contained in this VLL. The exact type of transition is configured in a plug-in-dependent manner with the \code{property} field. All plug-ins should accept a \code{property} field equal to \code{"flags="}, where \code{} can be a random 32 bit number. If \code{bSwapInputs} is false, then the start image is on port 210, the stop image on port 211. These are reversed if \code{bSwapInputs} is true. Transition frames are generated from the plug-in by referencing a frame position in [0,65536], where position 0 is the start image, position 65536 is the stop image. The first frame position generated is \code{nPosStart}. The last frame position generated is \code{nPosEnd}. Each frame will increment the position by \code{nPosIncrement}. The timestamp attached to each frame will increment by \code{nFrameIncrement}. */ /* This parameter is used to provide a callback function pointer for release events. It is used for internal clients on VideoCore. */ /* OMX_IndexConfigAudioMonoTrackControl: Dual Mono Control */ typedef enum OMX_AUDIOMONOTRACKOPERATIONSTYPE { OMX_AUDIOMONOTRACKOPERATIONS_NOP, OMX_AUDIOMONOTRACKOPERATIONS_L_TO_R, OMX_AUDIOMONOTRACKOPERATIONS_R_TO_L, OMX_AUDIOMONOTRACKOPERATIONS_DUMMY = 0x7FFFFFFF } OMX_AUDIOMONOTRACKOPERATIONSTYPE ; typedef struct OMX_CONFIG_AUDIOMONOTRACKCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_AUDIOMONOTRACKOPERATIONSTYPE eMode; } OMX_CONFIG_AUDIOMONOTRACKCONTROLTYPE; /* This config controls the options to support dual mono audio streams. The output can be unchanged, or the left channel copied over the right channel, or the right channel copied over the left channel. This config can be applied at any time with stereo 16-bit-per-sample data. Since audio output is typically buffered, any change will not be audible until that buffering has been played out. */ /* OMX_IndexParamCameraImagePool: Camera Image Pools */ typedef enum OMX_CAMERAIMAGEPOOLINPUTMODETYPE { OMX_CAMERAIMAGEPOOLINPUTMODE_ONEPOOL, /*All input images are allocated from one pool Works for simple stills capture use cases Can not be used with parallel stills capture and video encode, as the pool will be sized for capture or viewfinder, not both simultaneously. The pool wouldn't divide sensibly in this mode anyway. */ OMX_CAMERAIMAGEPOOLINPUTMODE_TWOPOOLS, /*All stills & video input images are allocated from two separate pools. This ensures that parallel capture can work, but would consume more memory if used on a simple stills capture use case. */ } OMX_CAMERAIMAGEPOOLINPUTMODETYPE; typedef struct OMX_PARAM_CAMERAIMAGEPOOLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nNumHiResVideoFrames; OMX_U32 nHiResVideoWidth; OMX_U32 nHiResVideoHeight; OMX_COLOR_FORMATTYPE eHiResVideoType; OMX_U32 nNumHiResStillsFrames; OMX_U32 nHiResStillsWidth; OMX_U32 nHiResStillsHeight; OMX_COLOR_FORMATTYPE eHiResStillsType; OMX_U32 nNumLoResFrames; OMX_U32 nLoResWidth; OMX_U32 nLoResHeight; OMX_COLOR_FORMATTYPE eLoResType; OMX_U32 nNumSnapshotFrames; OMX_COLOR_FORMATTYPE eSnapshotType; OMX_CAMERAIMAGEPOOLINPUTMODETYPE eInputPoolMode; OMX_U32 nNumInputVideoFrames; OMX_U32 nInputVideoWidth; OMX_U32 nInputVideoHeight; OMX_COLOR_FORMATTYPE eInputVideoType; OMX_U32 nNumInputStillsFrames; OMX_U32 nInputStillsWidth; OMX_U32 nInputStillsHeight; OMX_COLOR_FORMATTYPE eInputStillsType; } OMX_PARAM_CAMERAIMAGEPOOLTYPE; /* \sloppy This parameter specifies the size, type, and number, of images to allow in the images pools required by Camplus. Supported types are \code{OMX_COLOR_FormatYUV420PackedPlanar}, \code{OMX_COLOR_FormatYUV422PackedPlanar}, \code{OMX_COLOR_FormatRawBayer8bit}, \code{OMX_COLOR_FormatRawBayer10bit}, \code{OMX_COLOR_FormatRawBayer8bitcompressed}, and 0 (reserved for the Broadcom-specific format required by the video encoder). The input pool width, height, and type can be set as 0 to make the component query Camplus for the sensor mode that would correspond to the largest of the viewfinder port definition, the capture port definition, or the high resolution image pool. */ /* OMX_IndexParamImagePoolSize: Specifying Image Pool Properties */ typedef struct OMX_PARAM_IMAGEPOOLSIZETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 width; OMX_U32 height; OMX_U32 num_pages; } OMX_PARAM_IMAGEPOOLSIZETYPE; /* This parameter is used to control the size of pool that the component will allocate in the absence of setting an external pool. The default can be reset by setting this parameter with all three fields set to zero. */ /* OMX_IndexParamImagePoolExternal: Client Allocated Image Pools */ struct opaque_vc_pool_s; typedef struct opaque_vc_pool_s OMX_BRCM_POOL_T; typedef struct OMX_PARAM_IMAGEPOOLEXTERNALTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BRCM_POOL_T *image_pool; OMX_BRCM_POOL_T *image_pool2; OMX_BRCM_POOL_T *image_pool3; OMX_BRCM_POOL_T *image_pool4; OMX_BRCM_POOL_T *image_pool5; } OMX_PARAM_IMAGEPOOLEXTERNALTYPE; /* This config allows the client to pass in handles to pre-allocated image pools for use within the component. */ struct _IL_FIFO_T; typedef struct OMX_PARAM_RUTILFIFOINFOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; struct _IL_FIFO_T *pILFifo; } OMX_PARAM_RUTILFIFOINFOTYPE; /* OMX_IndexParamILFifoConfig: Allows configuration of the FIFO settings. */ typedef struct OMX_PARAM_ILFIFOCONFIG { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nDataSize; /**< The size of the FIFO's data area */ OMX_U32 nHeaderCount; /**< The number of headers allocated */ } OMX_PARAM_ILFIFOCONFIG; /** * Allows configuring the size of the ILFIFO used in a component. */ /* OMX_IndexConfigCameraSensorModes: Camera Sensor Mode */ typedef struct OMX_CONFIG_CAMERASENSORMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nModeIndex; OMX_U32 nNumModes; OMX_U32 nWidth; OMX_U32 nHeight; OMX_U32 nPaddingRight; OMX_U32 nPaddingDown; OMX_COLOR_FORMATTYPE eColorFormat; OMX_U32 nFrameRateMax; OMX_U32 nFrameRateMin; } OMX_CONFIG_CAMERASENSORMODETYPE; /* This parameter is used by clients to determine the sensor mode, and hence the memory usage, of the camera module. This is primarily used for determining the size of the input image pool. It can be used in two ways dependent on \code{nPortIndex}. If \code{nPortIndex} is \code{OMX_ALL}, it returns the sensor mode corresponding to \code{nModeIndex}, and the number of modes in \code{nNumModes}. If \code{nModeIndex} is greater than or equal to \code{nNumModes} only \code{nNumModes} is returned. If \code{nPortIndex} is equal to a camera video output port index, it returns the sensor mode that would be selected for the values currently in \code{OMX_IndexParamPortDefinition} for that port. The \code{nPaddingRight} and \code{nPaddingDown} values determine the extra padding the sensor adds to the image. These values must be added to \code{nWidth} and \code{nHeight} respectively if the client is specifying the input image pool size. */ typedef struct OMX_BRCMBUFFERSTATSTYPE { OMX_U32 nOrdinal; OMX_TICKS nTimeStamp; OMX_U32 nFilledLen; OMX_U32 nFlags; union { OMX_U32 nU32; struct { OMX_U32 nYpart; OMX_U32 nUVpart; } image; } crc; } OMX_BRCMBUFFERSTATSTYPE; /* Ports that gather statistics for debugging and diagnostics might also collect information about buffer header fields and data. Note that: The \code{nOrdinal} field increases monotonically whenever a new buffer is received or emitted and shall not be reset upon a port flush. The \code{nFilledLen} might indicate the size of a data area larger than the data area that actually contributed to the checksums (e.g. when image data is provided with cropping information). */ /* OMX_IndexConfigBrcmPortBufferStats: Query port buffer stats history */ typedef struct OMX_CONFIG_BRCMPORTBUFFERSTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nCount; OMX_BRCMBUFFERSTATSTYPE sData[1]; } OMX_CONFIG_BRCMPORTBUFFERSTATSTYPE; /* Ports that gather statistics for debugging and diagnostics might also collect information about buffer header fields and data. The \code{sStatsData} field is a variable length array and the number of items is denoted by \code{nStatsCount}. */ /* OMX_IndexConfigBrcmPortStats: Query port statistics */ typedef struct OMX_CONFIG_BRCMPORTSTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nImageCount; OMX_U32 nBufferCount; OMX_U32 nFrameCount; OMX_U32 nFrameSkips; OMX_U32 nDiscards; OMX_U32 nEOS; OMX_U32 nMaxFrameSize; OMX_TICKS nByteCount; OMX_TICKS nMaxTimeDelta; OMX_U32 nCorruptMBs; /**< Number of corrupt macroblocks in the stream */ } OMX_CONFIG_BRCMPORTSTATSTYPE; /* Some ports gather various statistics that can be used by clients for debugging purposes. This structure is the set of all statistics that are gathered. The \code{nFrameSkips} field indicates the number of frames that did not have an expected PTS value based on the port frame rate. The \code{nByteCount} field is a 64 bit value, that will either use a 64 bit type or two 32 bit types, similarly to \code{OMX_TICKS}. */ /* OMX_IndexConfigBrcmClockMissCount: Missed clock request accounting */ /* For each port on the clock component, requests for media times may be made. These are typically done one per video frame to allow for scheduling the display of that frame at the correct time. If a request is made after the time has occurred, then that frame will be displayed late, and the clock component keeps a per-port record of the number of times this occurs. This record can be read using this index. */ typedef struct OMX_CONFIG_BRCMCAMERASTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nOutFrameCount; OMX_U32 nDroppedFrameCount; } OMX_CONFIG_BRCMCAMERASTATSTYPE; // for backward compatibility typedef struct OMX_CONFIG_BRCMCAMERASTATSTYPE OMX_CONFIG_BRCMCAMERASTATS; #define OMX_BRCM_MAXIOPERFBANDS 10 typedef struct { OMX_U32 count[OMX_BRCM_MAXIOPERFBANDS]; OMX_U32 num[OMX_BRCM_MAXIOPERFBANDS]; } OMX_BRCM_PERFSTATS; /* OMX_IndexConfigBrcmIOPerfStats: Query I/O performance statistics */ typedef struct OMX_CONFIG_BRCMIOPERFSTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnabled; /**< Enable/disable I/O performance statistics */ OMX_BRCM_PERFSTATS write; /**< count:bytes num:microseconds */ OMX_BRCM_PERFSTATS flush; /**< count:frequency num:microseconds waiting to flush data */ OMX_BRCM_PERFSTATS wait; /**< count:frequency num:microseconds waiting in calling function */ } OMX_CONFIG_BRCMIOPERFSTATSTYPE; /* A sink component can gather various statistics about I/O (eg. file media) performance that can be used by clients for debugging purposes. The \code{bEnabled} field is used to turn the gathering of statistics on/off. */ typedef struct OMX_CONFIG_SHARPNESSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nSharpness; } OMX_CONFIG_SHARPNESSTYPE; /* OMX_IndexConfigCommonFlickerCancellation: Flicker cancellation */ typedef enum OMX_COMMONFLICKERCANCELTYPE { OMX_COMMONFLICKERCANCEL_OFF, OMX_COMMONFLICKERCANCEL_AUTO, OMX_COMMONFLICKERCANCEL_50, OMX_COMMONFLICKERCANCEL_60, OMX_COMMONFLICKERCANCEL_DUMMY = 0x7FFFFFFF } OMX_COMMONFLICKERCANCELTYPE; typedef struct OMX_CONFIG_FLICKERCANCELTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_COMMONFLICKERCANCELTYPE eFlickerCancel; } OMX_CONFIG_FLICKERCANCELTYPE; /* Query / set the flicker cancellation frequency. Values are defined for Off, 50Hz, 60Hz, or auto. The method for auto detecting the flicker frequency is not defined, and currently results in the feature being turned off. */ /* OMX_IndexConfigCommonRedEyeRemoval: Red eye removal/reduction */ typedef enum OMX_REDEYEREMOVALTYPE { OMX_RedEyeRemovalNone, /**< No red eye removal */ OMX_RedEyeRemovalOn, /**< Red eye removal on */ OMX_RedEyeRemovalAuto, /**< Red eye removal will be done automatically when detected */ OMX_RedEyeRemovalKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_RedEyeRemovalVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_RedEyeRemovalSimple, /**< Use simple red eye reduction mechanism if supported by algorithm */ OMX_RedEyeRemovalMax = 0x7FFFFFFF } OMX_REDEYEREMOVALTYPE; typedef struct OMX_CONFIG_REDEYEREMOVALTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_REDEYEREMOVALTYPE eMode; } OMX_CONFIG_REDEYEREMOVALTYPE; /* Configures the red eye reduction algorithm in the camera processing pipeline. The stage is only enabled if the flash mode is not FlashOff. The OMX_RedEyeRemovalSimple mode requests that the algorithm uses a reduced complexity algorithm to reduce the processing time. */ typedef enum OMX_FACEDETECTIONCONTROLTYPE { OMX_FaceDetectionControlNone, /**< Disables face detection */ OMX_FaceDetectionControlOn, /**< Enables face detection */ OMX_FaceDetectionControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_FaceDetectionControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_FaceDetectionControlMax = 0x7FFFFFFF } OMX_FACEDETECTIONCONTROLTYPE; typedef struct OMX_CONFIG_FACEDETECTIONCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_FACEDETECTIONCONTROLTYPE eMode; OMX_U32 nFrames; /**< number of frames to apply this setting for, 0 for unlimited */ OMX_U32 nMaxRegions; /**< maximum number of regions to detect, 0 for unlimited */ OMX_U32 nQuality; /**< hint for algorithmic complexity, range is 0-100. 0 for simplest algorithm, 100 for best quality */ } OMX_CONFIG_FACEDETECTIONCONTROLTYPE; typedef enum OMX_FACEREGIONFLAGSTYPE { OMX_FaceRegionFlagsNone = 0, OMX_FaceRegionFlagsBlink = 1, OMX_FaceRegionFlagsSmile = 2, OMX_FaceRegionFlagsKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_FaceRegionFlagsVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_FaceRegionFlagsMax = 0x7FFFFFFF } OMX_FACEREGIONFLAGSTYPE; typedef struct OMX_FACEREGIONTYPE { OMX_S16 nLeft; /**< X Coordinate of the top left corner of the rectangle */ OMX_S16 nTop; /**< Y Coordinate of the top left corner of the rectangle */ OMX_U16 nWidth; /**< Width of the rectangle */ OMX_U16 nHeight; /**< Height of the rectangle */ OMX_FACEREGIONFLAGSTYPE nFlags; /**< Flags for the region */ #ifndef OMX_SKIP64BIT OMX_U64 nFaceRecognitionId; /**< ID returned by face recognition for this face */ #else struct { OMX_U32 nLowPart; /**< low bits of the signed 64 bit value */ OMX_U32 nHighPart; /**< high bits of the signed 64 bit value */ } nFaceRecognitionId; #endif } OMX_FACEREGIONTYPE; typedef struct OMX_CONFIG_FACEDETECTIONREGIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< index of port with face detection enabled */ OMX_U32 nIndex; /**< first requested region number, allowing retrieval of many regions over several requests */ OMX_U32 nDetectedRegions; /**< total number of detected regions */ OMX_S32 nValidRegions; /**< number of valid regions in sRegion array When getting, the client sets this to the number of regions available. The component writes region data and updates this field with how many regions have been written to. */ OMX_U32 nImageWidth; /**< Width of the image, hence reference for the face coordinates */ OMX_U32 nImageHeight; /**< Height of the image, hence reference for the face coordinates */ OMX_FACEREGIONTYPE sRegion[1]; /**< variable length array of face regions */ } OMX_CONFIG_FACEDETECTIONREGIONTYPE; typedef enum OMX_INTERLACETYPE { OMX_InterlaceProgressive, /**< The data is not interlaced, it is progressive scan */ OMX_InterlaceFieldSingleUpperFirst, /**< The data is interlaced, fields sent separately in temporal order, with upper field first */ OMX_InterlaceFieldSingleLowerFirst, /**< The data is interlaced, fields sent separately in temporal order, with lower field first */ OMX_InterlaceFieldsInterleavedUpperFirst, /**< The data is interlaced, two fields sent together line interleaved, with the upper field temporally earlier */ OMX_InterlaceFieldsInterleavedLowerFirst, /**< The data is interlaced, two fields sent together line interleaved, with the lower field temporally earlier */ OMX_InterlaceMixed, /**< The stream may contain a mixture of progressive and interlaced frames */ OMX_InterlaceKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_InterlaceVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_InterlaceMax = 0x7FFFFFFF } OMX_INTERLACETYPE; typedef struct OMX_CONFIG_INTERLACETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< index of port emitting or accepting the content */ OMX_INTERLACETYPE eMode; /**< The interlace type of the content */ OMX_BOOL bRepeatFirstField; /**< Whether to repeat the first field */ } OMX_CONFIG_INTERLACETYPE; /* OMX_IndexParamIspTuner: Custom ISP tuner */ typedef struct OMX_PARAM_CAMERAISPTUNERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 tuner_name[64]; } OMX_PARAM_CAMERAISPTUNERTYPE; /* This parameter allows a custom ISP tuner to be loaded instead of the default one specified for the camera module. Setting an empty string uses the default value. */ /* OMX_IndexConfigCameraInputFrame: Pointer to the raw input image */ typedef struct OMX_CONFIG_IMAGEPTRTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_PTR pImage; } OMX_CONFIG_IMAGEPTRTYPE; /* This parameter parameter allows the return of a pointer to a VideoCore image resource. */ /* OMX_IndexConfigAFAssistLight: Autofocus assist light mode selection */ typedef enum OMX_AFASSISTTYPE { OMX_AFAssistAuto, OMX_AFAssistOn, OMX_AFAssistOff, OMX_AFAssistTorch, OMX_AFAssistKhronosExtensions = 0x6F000000, OMX_AFAssistVendorStartUnused = 0x7F000000, OMX_AFAssistMax = 0x7FFFFFFF } OMX_AFASSISTTYPE; typedef struct OMX_CONFIG_AFASSISTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_AFASSISTTYPE eMode; } OMX_CONFIG_AFASSISTTYPE; /* Set the mode to adopt for the autofocus assist light. \code{OMX_AFAssistTorch} will turn the AF assist light on permanently, allowing it to be used as a torch. */ /* OMX_IndexConfigInputCropPercentage: Specify input crop as a percentage */ typedef struct OMX_CONFIG_INPUTCROPTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 xLeft; /**< Fraction of the width for the top left corner of the rectangle */ OMX_U32 xTop; /**< Fraction of the height for the top left corner of the rectangle */ OMX_U32 xWidth; /**< Fraction of the image width desired */ OMX_U32 xHeight; /**< Fraction of the image height desired */ } OMX_CONFIG_INPUTCROPTYPE; /* This parameter allows the input cropping to be specified as a percentage of the current width/height. Required for the camera component where the output resolution varies dependent on the port. All percentage values are as 16p16 fixed point numbers (0x10000 = 100\%) */ /* OMX_IndexParamCodecRequirements: Advanced codec requirements */ typedef struct OMX_PARAM_CODECREQUIREMENTSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nCallbackID; OMX_BOOL bTryHWCodec; } OMX_PARAM_CODECREQUIREMENTSTYPE; /* This parameter allows internal users of RIL components controlling video codecs to request that the component loads the component and queries for requirements. The component will perform a callback with the given nCallbackID value passing a pointer to the requirements structure as the data field. */ /* OMX_IndexConfigBrcmEGLImageMemHandle: Mapping from an EGLImage to a VideoCore mem handle */ typedef struct OMX_CONFIG_BRCMEGLIMAGEMEMHANDLETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_PTR eglImage; OMX_PTR memHandle; } OMX_CONFIG_BRCMEGLIMAGEMEMHANDLETYPE; /* This config allows the EGL server to notify a RIL component that an EGLImage is available for rendering into and to provide a mapping from an EGLImage to a mem handle. */ /* OMX_IndexConfigPrivacyIndicator: Privacy indicator control */ typedef enum OMX_PRIVACYINDICATORTYPE { OMX_PrivacyIndicatorOff, OMX_PrivacyIndicatorOn, OMX_PrivacyIndicatorForceOn, OMX_PrivacyIndicatorKhronosExtensions = 0x6F000000, OMX_PrivacyIndicatorVendorStartUnused = 0x7F000000, OMX_PrivacyIndicatorMax = 0x7FFFFFFF } OMX_PRIVACYINDICATORTYPE; typedef struct OMX_CONFIG_PRIVACYINDICATORTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_PRIVACYINDICATORTYPE ePrivacyIndicatorMode; } OMX_CONFIG_PRIVACYINDICATORTYPE; /* This config allows control over the privacy indicator light. This light indicates when a capture is in progress. \code{OMX_PrivacyIndicatorOff} indicator is disabled. \code{OMX_PrivacyIndicatorOn} indicator will be turned on whenever an image is being captured as determined by the capturing bit. Minimum on duration of approx 200ms. \code{OMX_PrivacyIndicatorForceOn} results in turning the indicator on immediately, whether an image is being captured or not. The mode will automatically revert to \code{OMX_PrivacyIndicatorOff} once the indicator has been turned on, so \code{OMX_PrivacyIndicatorForceOn} must be requested at least every 200ms if the indicator is to remain on. */ /* OMX_IndexParamCameraFlashType: Select flash type */ typedef enum OMX_CAMERAFLASHTYPE { OMX_CameraFlashDefault, OMX_CameraFlashXenon, OMX_CameraFlashLED, OMX_CameraFlashNone, OMX_CameraFlashKhronosExtensions = 0x6F000000, OMX_CameraFlashVendorStartUnused = 0x7F000000, OMX_CameraFlashMax = 0x7FFFFFFF } OMX_CAMERAFLASHTYPE; typedef struct OMX_PARAM_CAMERAFLASHTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_CAMERAFLASHTYPE eFlashType; OMX_BOOL bRedEyeUsesTorchMode; } OMX_PARAM_CAMERAFLASHTYPE; /* This parameter allows the selection of xenon or LED flash devices to be used with the currently selected camera. If that device is not available, then the component will revert back to whatever flash device is available for that camera. \code{bRedEyeUsesTorchMode} allows the blinking for red eye reduction to be switched between using the indicator mode, and the torch mode for the flash driver. */ /* OMX_IndexConfigCameraFlashConfig: Flash cycle configuration */ typedef enum OMX_CAMERAFLASHCONFIGSYNCTYPE { OMX_CameraFlashConfigSyncFrontSlow, OMX_CameraFlashConfigSyncRearSlow, OMX_CameraFlashConfigSyncFrontFast, OMX_CameraFlashConfigSyncKhronosExtensions = 0x6F000000, OMX_CameraFlashConfigSyncVendorStartUnused = 0x7F000000, OMX_CameraFlashConfigSyncMax = 0x7FFFFFFF } OMX_CAMERAFLASHCONFIGSYNCTYPE; typedef struct OMX_CONFIG_CAMERAFLASHCONFIGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bUsePreFlash; OMX_BOOL bUseFocusDistanceInfo; OMX_CAMERAFLASHCONFIGSYNCTYPE eFlashSync; OMX_BOOL bIgnoreChargeState; } OMX_CONFIG_CAMERAFLASHCONFIGTYPE; /* This parameter allows the configuration of various parameters relating to the flash cycle. Some of the options are only applicable to xenon flash. \code{bUsePreFlash} uses a low intensity pre-flash to determine flash intensity. This setting is recommended for almost all flash situations. \code{bUseFocusDistanceInfo} uses the distance of the subject, as measured by the AF algorithm to set the intensity of the flash. \code{eFlashSync} configures which edge of the shutter is used to synchronise the flash, and the duration of the exposure. \code{eIgnoreChargeState} will make the flash fire, even if it is not fully charged. */ /* OMX_IndexConfigBrcmAudioTrackGaplessPlayback: Encoder/decoder delay and padding information for gapless playback. */ typedef struct OMX_CONFIG_BRCMAUDIOTRACKGAPLESSPLAYBACKTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nDelay; /**< number of samples delay added by the codec */ OMX_U32 nPadding; /**< number of silent samples added to the end */ } OMX_CONFIG_BRCMAUDIOTRACKGAPLESSPLAYBACKTYPE; /* This config allows communication between components to facilitate gapless playback. */ /* OMX_IndexConfigBrcmAudioTrackChangeControl: Configure gapless/crossfaded audio track change. */ typedef struct OMX_CONFIG_BRCMAUDIOTRACKCHANGECONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nSrcPortIndex; OMX_U32 nDstPortIndex; OMX_U32 nXFade; } OMX_CONFIG_BRCMAUDIOTRACKCHANGECONTROLTYPE; /* This config allows the client to specify the gapless or crossfade parameters to be used on a track change. If \code{nXFade} is 0, then a normal or gapless track change will result, otherwise a crossfade of \code{nXFade} ms is used. */ /* OMX_IndexParamBrcmPixelValueRange: Describing the pixel value range */ typedef enum OMX_BRCMPIXELVALUERANGETYPE { OMX_PixelValueRangeUnspecified = 0, OMX_PixelValueRangeITU_R_BT601, OMX_PixelValueRangeFull8Bit, OMX_PixelValueRangeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_PixelValueRangeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_PixelValueRangeMax = 0x7FFFFFFF } OMX_BRCMPIXELVALUERANGETYPE; typedef struct OMX_PARAM_BRCMPIXELVALUERANGETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BRCMPIXELVALUERANGETYPE ePixelValueRange; } OMX_PARAM_BRCMPIXELVALUERANGETYPE; /* This structure allows a description of the range that pixel values may have. This is typically useful since some standards use the full 8 bit range, whereas others introduce pedastals which reduce the range at the top and bottom end. */ /* OMX_IndexParamCameraDisableAlgorithm: Disabling camera processing stages. */ typedef enum OMX_CAMERADISABLEALGORITHMTYPE { OMX_CameraDisableAlgorithmFacetracking, OMX_CameraDisableAlgorithmRedEyeReduction, OMX_CameraDisableAlgorithmVideoStabilisation, OMX_CameraDisableAlgorithmWriteRaw, OMX_CameraDisableAlgorithmVideoDenoise, OMX_CameraDisableAlgorithmStillsDenoise, OMX_CameraDisableAlgorithmAntiShake, OMX_CameraDisableAlgorithmImageEffects, OMX_CameraDisableAlgorithmDarkSubtract, OMX_CameraDisableAlgorithmDynamicRangeExpansion, OMX_CameraDisableAlgorithmFaceRecognition, OMX_CameraDisableAlgorithmFaceBeautification, OMX_CameraDisableAlgorithmSceneDetection, OMX_CameraDisableAlgorithmHighDynamicRange, OMX_CameraDisableAlgorithmKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_CameraDisableAlgorithmVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_CameraDisableAlgorithmMax = 0x7FFFFFFF } OMX_CAMERADISABLEALGORITHMTYPE; typedef struct OMX_PARAM_CAMERADISABLEALGORITHMTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_CAMERADISABLEALGORITHMTYPE eAlgorithm; OMX_BOOL bDisabled; } OMX_PARAM_CAMERADISABLEALGORITHMTYPE; /* Allows plugin algorithms to be disabled to save memory within the camera component */ /* OMX_IndexConfigBrcmAudioEffectControl: Audio Effect Control */ typedef struct OMX_CONFIG_BRCMAUDIOEFFECTCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnable; OMX_U8 name[16]; OMX_U8 property[256]; } OMX_CONFIG_BRCMAUDIOEFFECTCONTROLTYPE; /* This structure represents the internal configuration of an audio effect. The audio effect is provided by a loadable plug-in described in the \code{name} field and is configured in a plug-in-dependent manner with the \code{property} field. The \code{bEnable} field is used to turn the effect on/off. */ /* OMX_IndexConfigBrcmMinimumProcessingLatency: Processing Latency Bound */ typedef struct OMX_CONFIG_BRCMMINIMUMPROCESSINGLATENCY { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_TICKS nOffset; } OMX_CONFIG_BRCMMINIMUMPROCESSINGLATENCY; /* Query/set the difference between the actual media time and when the component receives request fulfillments for media time requests. This can be used with e.g. splitter/mixer components to control when the component stops waiting for input or output packets from active streams and continues with processing (to maintain a constant processing rate). */ /** Enable or disable Supplemental Enhancment Information (SEI) messages to be inserted in * the H.264 bitstream. */ typedef struct OMX_PARAM_BRCMVIDEOAVCSEIENABLETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnable; } OMX_PARAM_BRCMVIDEOAVCSEIENABLETYPE; /* OMX_IndexParamBrcmAllowMemChange: Allowing changing memory allocation on state transition */ typedef struct OMX_PARAM_BRCMALLOWMEMCHANGETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnable; } OMX_PARAM_BRCMALLOWMEMCHANGETYPE; /* Let the component change the amount of memory it has allocated when going from LOADED to IDLE. By default this is enabled, but if it is disabled the component will fail to transition to IDLE if the component requires more memory than has already been allocated. This might occur if (for example) the component was configured, taken to IDLE, then taken back to LOADED, the profile increased and the component taken back to IDLE. */ typedef enum OMX_CONFIG_CAMERAUSECASE { OMX_CameraUseCaseAuto, OMX_CameraUseCaseVideo, OMX_CameraUseCaseStills, OMX_CameraUseCaseKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_CameraUseCaseVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_CameraUseCaseMax = 0x7FFFFFFF } OMX_CONFIG_CAMERAUSECASE; typedef struct OMX_CONFIG_CAMERAUSECASETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_CONFIG_CAMERAUSECASE eUseCase; } OMX_CONFIG_CAMERAUSECASETYPE; /* OMX_IndexParamBrcmDisableProprietaryTunnels: Disabling proprietary tunnelling */ typedef struct OMX_PARAM_BRCMDISABLEPROPRIETARYTUNNELSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bUseBuffers; } OMX_PARAM_BRCMDISABLEPROPRIETARYTUNNELSTYPE; /* Tell a source component to refuse to support proprietary tunnelling. Buffers will be used instead. */ // // Control for memory allocation and component-internal buffering // /* OMX_IndexParamBrcmRetainMemory: Controlling memory use on state transition */ typedef struct OMX_PARAM_BRCMRETAINMEMORYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnable; } OMX_PARAM_BRCMRETAINMEMORYTYPE; /* Ask a component to retain its memory when going from IDLE to LOADED, if possible. This has the benefit that you are then guaranteed that the transition to IDLE cannot fail due to lack of memory, but has the disadvantage that you cannot leave the component lying around in LOADED, unused, since it is using significant amounts of memory. */ /** Tell write media how large the output buffer should be. This is a hint, and * may be ignored. A good size is bandwidth*, which works out at * around 1Mbyte for up to 16Mbit/s. Sizes may (and probably will) be rounded down * to the nearest power of 2. */ typedef struct OMX_PARAM_BRCMOUTPUTBUFFERSIZETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nBufferSize; } OMX_PARAM_BRCMOUTPUTBUFFERSIZETYPE; /* OMX_IndexConfigCameraInfo: Camera device driver information */ #define OMX_CONFIG_CAMERAINFOTYPE_NAME_LEN 16 typedef struct OMX_CONFIG_LENSCALIBRATIONVALUETYPE { OMX_U16 nShutterDelayTime; OMX_U16 nNdTransparency; OMX_U16 nPwmPulseNearEnd; /**< Num pulses to move lens 1um at near end */ OMX_U16 nPwmPulseFarEnd; /**< Num pulses to move lens 1um at far end */ OMX_U16 nVoltagePIOutNearEnd[3]; OMX_U16 nVoltagePIOut10cm[3]; OMX_U16 nVoltagePIOutInfinity[3]; OMX_U16 nVoltagePIOutFarEnd[3]; OMX_U32 nAdcConversionNearEnd; OMX_U32 nAdcConversionFarEnd; } OMX_CONFIG_LENSCALIBRATIONVALUETYPE; /* Ask the camera component for the driver info on the current camera device */ #define OMX_CONFIG_CAMERAINFOTYPE_NAME_LEN 16 #define OMX_CONFIG_CAMERAINFOTYPE_SERIALNUM_LEN 20 #define OMX_CONFIG_CAMERAINFOTYPE_EPROMVER_LEN 8 typedef struct OMX_CONFIG_CAMERAINFOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 cameraname[OMX_CONFIG_CAMERAINFOTYPE_NAME_LEN]; OMX_U8 lensname[OMX_CONFIG_CAMERAINFOTYPE_NAME_LEN]; OMX_U16 nModelId; OMX_U8 nManufacturerId; OMX_U8 nRevNum; OMX_U8 sSerialNumber[OMX_CONFIG_CAMERAINFOTYPE_SERIALNUM_LEN]; OMX_U8 sEpromVersion[OMX_CONFIG_CAMERAINFOTYPE_EPROMVER_LEN]; OMX_CONFIG_LENSCALIBRATIONVALUETYPE sLensCalibration; OMX_U32 xFNumber; OMX_U32 xFocalLength; } OMX_CONFIG_CAMERAINFOTYPE; typedef enum OMX_CONFIG_CAMERAFEATURESSHUTTER { OMX_CameraFeaturesShutterUnknown, OMX_CameraFeaturesShutterNotPresent, OMX_CameraFeaturesShutterPresent, OMX_CameraFeaturesShutterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_CameraFeaturesShutterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_CameraFeaturesShutterMax = 0x7FFFFFFF } OMX_CONFIG_CAMERAFEATURESSHUTTER; typedef struct OMX_CONFIG_CAMERAFEATURESTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_CONFIG_CAMERAFEATURESSHUTTER eHasMechanicalShutter; OMX_BOOL bHasLens; } OMX_CONFIG_CAMERAFEATURESTYPE; //Should be added to the spec as part of IL416c /* OMX_IndexConfigRequestCallback: Enable config change notifications. */ typedef struct OMX_CONFIG_REQUESTCALLBACKTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_INDEXTYPE nIndex; OMX_BOOL bEnable; } OMX_CONFIG_REQUESTCALLBACKTYPE; /* This config implements IL416c to allow clients to request notification of when a config or parameter is changed. When the parameter specified in \code{nIndex} for port \code{nPortIndex} changes, an \code{OMX_EventParamOrConfigChanged} event is generated for the client. */ /* OMX_IndexConfigCommonFocusRegionXY: Define focus regions */ typedef enum OMX_FOCUSREGIONTYPE { OMX_FocusRegionNormal, OMX_FocusRegionFace, OMX_FocusRegionMax } OMX_FOCUSREGIONTYPE; typedef struct OMX_FOCUSREGIONXY { OMX_U32 xLeft; OMX_U32 xTop; OMX_U32 xWidth; OMX_U32 xHeight; OMX_U32 nWeight; OMX_U32 nMask; OMX_FOCUSREGIONTYPE eType; } OMX_FOCUSREGIONXY; typedef struct OMX_CONFIG_FOCUSREGIONXYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIndex; OMX_U32 nTotalRegions; OMX_S32 nValidRegions; OMX_BOOL bLockToFaces; OMX_U32 xFaceTolerance; OMX_FOCUSREGIONXY sRegion[1]; } OMX_CONFIG_FOCUSREGIONXYTYPE; /* Query / set the focus regions to use as a set of x/y/width/height boxes relative to the overall image. \code{nIndex} - first region number being set/read, allowing retrieval/setting of many regions over several requests. \code{nTotalRegions} - total number of regions currently defined. \code{nValidRegions} - number of valid regions in the \code{sRegion} array. When getting, the client sets this to the number of regions available. The component writes region data and updates this field with how many regions have been written to. When setting, this is the number of regions defined with this structure \code{bLockToFaces} - compare the region(s) given to the latest face tracking results. If a face is found within xFaceTolerance of the defined region, then amend the region to correspond to the face. \code{xFaceTolerance} - 0p16 value to define the max difference between the region centre and face tracking result centre to take the FT results \code{sRegions} - variable length array of focus regions. */ typedef struct OMX_CONFIG_U8TYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U8 nU8; /**< U8 value */ } OMX_PARAM_U8TYPE; typedef struct OMX_CONFIG_CAMERASETTINGSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nExposure; OMX_U32 nAnalogGain; OMX_U32 nDigitalGain; OMX_U32 nLux; OMX_U32 nRedGain; OMX_U32 nBlueGain; OMX_U32 nFocusPosition; } OMX_CONFIG_CAMERASETTINGSTYPE; /* OMX_IndexConfigDrawBoxLineParams: Face box style parameters. */ typedef struct OMX_YUVCOLOUR { OMX_U8 nY; OMX_U8 nU; OMX_U8 nV; } OMX_YUVCOLOUR; typedef struct OMX_CONFIG_DRAWBOXLINEPARAMS { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port to which this config applies */ OMX_U32 xCornerSize; /**< Size of the corners as a fraction of the complete side */ OMX_U32 nPrimaryFaceLineWidth; /**< Width of the box line for the primary face in pixels */ OMX_U32 nOtherFaceLineWidth; /**< Width of the box line for other faces in pixels */ OMX_U32 nFocusRegionLineWidth; /**< Width of the box line for focus regions in pixels */ OMX_YUVCOLOUR sPrimaryFaceColour; /**< YUV colour for the primary face */ OMX_YUVCOLOUR sPrimaryFaceSmileColour; /**< YUV colour for the primary face if smiling */ OMX_YUVCOLOUR sPrimaryFaceBlinkColour; /**< YUV colour for the primary face if blinking */ OMX_YUVCOLOUR sOtherFaceColour; /**< YUV colour for the all other faces */ OMX_YUVCOLOUR sOtherFaceSmileColour; /**< YUV colour for the all other faces if smiling */ OMX_YUVCOLOUR sOtherFaceBlinkColour; /**< YUV colour for the all other faces if blinking */ OMX_BOOL bShowFocusRegionsWhenIdle; /**< Are focus regions displayed when just in viewfinder/AF idle */ OMX_YUVCOLOUR sFocusRegionColour; /**< YUV colour for focus regions */ OMX_BOOL bShowAfState; /**< Change to the colours specified below if AF cycle has run */ OMX_BOOL bShowOnlyPrimaryAfState; /**< Only show the primary face when displaying the AF status */ OMX_BOOL bCombineNonFaceRegions; /**< Combine all regions not defined as faces into one single box covering them all */ OMX_YUVCOLOUR sAfLockPrimaryFaceColour; /**< YUV colour for the primary face */ OMX_YUVCOLOUR sAfLockOtherFaceColour; /**< YUV colour for the all other faces */ OMX_YUVCOLOUR sAfLockFocusRegionColour; /**< YUV colour for focus regions */ OMX_YUVCOLOUR sAfFailPrimaryFaceColour; /**< YUV colour for the primary face */ OMX_YUVCOLOUR sAfFailOtherFaceColour; /**< YUV colour for the all other faces */ OMX_YUVCOLOUR sAfFailFocusRegionColour; /**< YUV colour for focus regions */ } OMX_CONFIG_DRAWBOXLINEPARAMS; /* Query / set the parameters for the box to be drawn around faces/focus regions. */ #define OMX_PARAM_CAMERARMITYPE_RMINAME_LEN 16 //OMX_IndexParamCameraRmiControl typedef struct OMX_PARAM_CAMERARMITYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnabled; OMX_U8 sRmiName[OMX_PARAM_CAMERARMITYPE_RMINAME_LEN]; OMX_U32 nInputBufferHeight; OMX_U32 nRmiBufferSize; OMX_BRCM_POOL_T *pImagePool; } OMX_PARAM_CAMERARMITYPE; /* OMX_IndexConfigBrcmSyncOutput: Forcing a write sync */ typedef struct OMX_CONFIG_BRCMSYNCOUTPUTTYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ } OMX_CONFIG_BRCMSYNCOUTPUTTYPE; /* Setting this config forces a sync of data to the filesystem. */ /* OMX_IndexConfigDrmView: View information for DRM rental files */ typedef struct OMX_CONFIG_DRMVIEWTYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nCurrentView; /**< Current view count */ OMX_U32 nMaxView; /**< Max. no. of view allowed */ } OMX_CONFIG_DRMVIEWTYPE; /* This structure contains information about the number of available views in the selected DRM rental file, which typically have a given maximum view count. It allows the user to explicitly agree to playing the file, which will increment the number of current views the file has had. */ typedef struct OMX_PARAM_BRCMU64TYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nLowPart; /**< low bits of the unsigned 64 bit value */ OMX_U32 nHighPart; /**< high bits of the unsigned 64 bit value */ } OMX_PARAM_BRCMU64TYPE; /* OMX_IndexParamBrcmDisableEXIF: Disable generation of EXIF data */ /* This parameter is used by clients to control the generation of exif data in JPEG images. */ /* OMX_IndexParamBrcmThumbnail: Control generation of thumbnail */ typedef struct OMX_PARAM_BRCMTHUMBNAILTYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_BOOL bEnable; /**< Enable generation of thumbnails during still capture */ OMX_BOOL bUsePreview; /**< Use the preview image (as is) as thumbnail */ OMX_U32 nWidth; /**< Desired width of the thumbnail */ OMX_U32 nHeight; /**< Desired height of the thumbnail */ } OMX_PARAM_BRCMTHUMBNAILTYPE; /* This parameter is used by clients to control how thumbnails are generated when creating still images. Thumbnail generation will be turned on or off depending on the \code{bEnable} field. The \code{bUsePreview} field will let the component know whether it should use the low resolution preview image (if the component has one available) as is for the thumbnail. When this is set to true, it should make the generation of thumbnails faster (if a preview image is available) and should use less memory as well. The \code{nWidth} and \code{nHeight} fields allow the client to specify the dimensions of the thumbnail. If both \code{nWidth} and \code{nHeight} are 0, we will calculate a sensible size for the thumbnail. */ typedef struct OMX_PARAM_BRCMASPECTRATIOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nWidth; OMX_U32 nHeight; } OMX_PARAM_BRCMASPECTRATIOTYPE; /* OMX_IndexParamBrcmVideoDecodeErrorConcealment: Control error concealment for video decode */ typedef struct OMX_PARAM_BRCMVIDEODECODEERRORCONCEALMENTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bStartWithValidFrame; /**< Decoder will only start emitting frames from a non-corrupted frame */ } OMX_PARAM_BRCMVIDEODECODEERRORCONCEALMENTTYPE; /* This parameter is used by clients to control the type of error concealment that will be done by the video decoder. */ #define OMX_CONFIG_FLASHINFOTYPE_NAME_LEN 16 typedef struct OMX_CONFIG_FLASHINFOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 sFlashName[OMX_CONFIG_FLASHINFOTYPE_NAME_LEN]; OMX_CAMERAFLASHTYPE eFlashType; OMX_U8 nDeviceId; OMX_U8 nDeviceVersion; } OMX_CONFIG_FLASHINFOTYPE; /* OMX_IndexParamBrcmInterpolateMissingTimestamps: Configure component to interpolate missing timestamps */ /* Configures a component so that it tries to timestamp all the buffers it outputs. If the timestamp information is missing from the original buffer, the component will try its best to interpolate a value for the missing timestamp. */ /* OMX_IndexParamBrcmSetCodecPerformanceMonitoring: Configure component to output performance statistics */ /* Configures a codec component so that it outputs performance statistics to the given DECODE_PROGRESS_REPORT_T structure (passed as a pointer). This structure can then be read by the client to find out where the codec is at in its processing. */ /* OMX_IndexConfigDynamicRangeExpansion: Configure image dynamic range expansion processing */ typedef enum OMX_DYNAMICRANGEEXPANSIONMODETYPE { OMX_DynRangeExpOff, OMX_DynRangeExpLow, OMX_DynRangeExpMedium, OMX_DynRangeExpHigh, OMX_DynRangeExpKhronosExtensions = 0x6F000000, OMX_DynRangeExpVendorStartUnused = 0x7F000000, OMX_DynRangeExpMax = 0x7FFFFFFF } OMX_DYNAMICRANGEEXPANSIONMODETYPE; typedef struct OMX_CONFIG_DYNAMICRANGEEXPANSIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_DYNAMICRANGEEXPANSIONMODETYPE eMode; } OMX_CONFIG_DYNAMICRANGEEXPANSIONTYPE; /* Configures the intensity of an image dynamic range expansion processing stage */ /* OMX_IndexParamBrcmTransposeBufferCount: Configure the number of pre-allocated transpose buffers */ /* This config allows the client to explicitly set the number of destination buffers pre-allocated for ports that support 90/270 degree rotation (e.g. in video_render). The buffers will be pre-allocated during a state transition from LOADED to IDLE (the transition will fail if there is not enough memory available for the buffers). . */ /* OMX_IndexParamBrcmThreadAffinity: Control the CPU affinity of component thread(s) */ typedef enum OMX_BRCMTHREADAFFINITYTYPE { OMX_BrcmThreadAffinityCPU0, OMX_BrcmThreadAffinityCPU1, OMX_BrcmThreadAffinityMax = 0x7FFFFFFF } OMX_BRCMTHREADAFFINITYTYPE; typedef struct OMX_PARAM_BRCMTHREADAFFINITYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BRCMTHREADAFFINITYTYPE eAffinity; /**< Thread CPU affinity */ } OMX_PARAM_BRCMTHREADAFFINITYTYPE; /* This parameter is used by clients to hint the CPU that a component thread should run on. */ /* OMX_IndexConfigCommonSceneDetected: Reports the scene type detected by a scene detection algorithm. */ typedef enum OMX_SCENEDETECTTYPE { OMX_SceneDetectUnknown, OMX_SceneDetectLandscape, OMX_SceneDetectPortrait, OMX_SceneDetectMacro, OMX_SceneDetectNight, OMX_SceneDetectPortraitNight, OMX_SceneDetectBacklit, OMX_SceneDetectPortraitBacklit, OMX_SceneDetectSunset, OMX_SceneDetectBeach, OMX_SceneDetectSnow, OMX_SceneDetectFireworks, OMX_SceneDetectMax = 0x7FFFFFFF } OMX_SCENEDETECTTYPE; /* OMX_IndexConfigCommonSceneDetected: Reports the scene type detected by a scene detection algorithm. */ typedef struct OMX_CONFIG_SCENEDETECTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_SCENEDETECTTYPE eScene; /**< Scene type detected */ } OMX_CONFIG_SCENEDETECTTYPE; /* This config is used to report to clients the scene type that has been detected. */ /* OMX_IndexParamNalStreamFormat: Control the NAL unit packaging. This is a Khronos extension. */ typedef enum OMX_INDEXEXTTYPE { /* Video parameters and configurations */ OMX_IndexExtVideoStartUnused = OMX_IndexKhronosExtensions + 0x00600000, OMX_IndexParamNalStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */ OMX_IndexParamNalStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */ OMX_IndexParamNalStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */ OMX_IndexExtMax = 0x7FFFFFFF } OMX_INDEXEXTTYPE; /* OMX_IndexParamNalStreamFormat: Control the NAL unit packaging. This is a Khronos extension. */ typedef enum OMX_NALUFORMATSTYPE { OMX_NaluFormatStartCodes = 1, OMX_NaluFormatOneNaluPerBuffer = 2, OMX_NaluFormatOneByteInterleaveLength = 4, OMX_NaluFormatTwoByteInterleaveLength = 8, OMX_NaluFormatFourByteInterleaveLength = 16, OMX_NaluFormatCodingMax = 0x7FFFFFFF } OMX_NALUFORMATSTYPE; /* OMX_IndexParamNalStreamFormat: Control the NAL unit packaging. This is a Khronos extension. */ typedef struct OMX_NALSTREAMFORMATTYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_NALUFORMATSTYPE eNaluFormat; } OMX_NALSTREAMFORMATTYPE; /* This parameter is used to control the NAL unit packaging of an H264 video port. */ /* OMX_IndexParamVideoMvc: MVC codec parameters */ typedef struct OMX_VIDEO_PARAM_AVCTYPE OMX_VIDEO_PARAM_MVCTYPE; /* This parameter is currently identical to the AVC parameter type. */ /* OMX_IndexConfigBrcmDrawStaticBox: Define static box to be drawn */ typedef enum OMX_STATICBOXTYPE { OMX_StaticBoxNormal, OMX_StaticBoxPrimaryFaceAfIdle, OMX_StaticBoxNonPrimaryFaceAfIdle, OMX_StaticBoxFocusRegionAfIdle, OMX_StaticBoxPrimaryFaceAfSuccess, OMX_StaticBoxNonPrimaryFaceAfSuccess, OMX_StaticBoxFocusRegionAfSuccess, OMX_StaticBoxPrimaryFaceAfFail, OMX_StaticBoxNonPrimaryFaceAfFail, OMX_StaticBoxFocusRegionAfFail, OMX_StaticBoxMax } OMX_STATICBOXTYPE; typedef struct OMX_STATICBOX { OMX_U32 xLeft; OMX_U32 xTop; OMX_U32 xWidth; OMX_U32 xHeight; OMX_STATICBOXTYPE eType; } OMX_STATICBOX; typedef struct OMX_CONFIG_STATICBOXTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIndex; OMX_U32 nTotalBoxes; OMX_S32 nValidBoxes; OMX_BOOL bDrawOtherBoxes; OMX_STATICBOX sBoxes[1]; } OMX_CONFIG_STATICBOXTYPE; /* Query / set the parameters for a box to always be drawn on viewfinder images The x/y/width/height values for the boxes are relative to the overall image. \code{nIndex} - first box number being set/read, allowing retrieval/setting of many boxes over several requests. \code{nValidBoxes} - total number of boxes currently defined. \code{nValidBoxes} - number of valid boxes in the \code{sBoxes} array. When getting, the client sets this to the number of boxes available. The component writes box data and updates this field with how many boxes have been written to. When setting, this is the number of boxes defined with this structure \code{sBoxes} - variable length array of static boxes. */ /* OMX_IndexConfigPortCapturing: Per-port capturing state */ typedef struct OMX_CONFIG_PORTBOOLEANTYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; } OMX_CONFIG_PORTBOOLEANTYPE; /* This is proposed in IL533f for controlling which ports of a multi-port camera component are capturing frames. */ /* OMX_IndexConfigCaptureMode: Capturing mode type */ typedef enum OMX_CAMERACAPTUREMODETYPE { OMX_CameraCaptureModeWaitForCaptureEnd, OMX_CameraCaptureModeWaitForCaptureEndAndUsePreviousInputImage, OMX_CameraCaptureModeResumeViewfinderImmediately, OMX_CameraCaptureModeMax, } OMX_CAMERACAPTUREMODETYPE; typedef struct OMX_PARAM_CAMERACAPTUREMODETYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_CAMERACAPTUREMODETYPE eMode; } OMX_PARAM_CAMERACAPTUREMODETYPE; /* This controls the mode of operation for still image capture in the camera component. */ /* OMX_IndexParamBrcmDrmEncryption: Set DRM encryption scheme */ typedef enum OMX_BRCMDRMENCRYPTIONTYPE { OMX_DrmEncryptionNone = 0, OMX_DrmEncryptionHdcp2, OMX_DrmEncryptionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_DrmEncryptionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_DrmEncryptionRangeMax = 0x7FFFFFFF } OMX_BRCMDRMENCRYPTIONTYPE; typedef struct OMX_PARAM_BRCMDRMENCRYPTIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BRCMDRMENCRYPTIONTYPE eEncryption; OMX_U32 nConfigDataLen; OMX_U8 configData[1]; } OMX_PARAM_BRCMDRMENCRYPTIONTYPE; /* Query/set the DRM encryption scheme used by a port writing out data. */ /* OMX_IndexConfigBufferStall: Advertise buffer stall state */ typedef struct OMX_CONFIG_BUFFERSTALLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bStalled; /**< Whether we are stalled */ OMX_U32 nDelay; /**< Delay in real time (us) from last buffer to current time */ } OMX_CONFIG_BUFFERSTALLTYPE; /* Query/set the buffer stall threashold. When set the \code{nDelay} parameter specifies a time to class whether buffer output is stalled. When get, the \code{nDelay} parameter indicates the current buffer delay, and the {bStalled} parameter indicates whether this time is over a previously set threashold. When \code{OMX_IndexConfigRequestCallback} is used with this index, a notification is given when \code{bStalled} changes. */ /* OMX_IndexConfigLatencyTarget: Maintain target latency by adjusting clock speed */ typedef struct OMX_CONFIG_LATENCYTARGETTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; /**< whether this mode is enabled */ OMX_U32 nFilter; /**< number of latency samples to filter on, good value: 1 */ OMX_U32 nTarget; /**< target latency, us */ OMX_U32 nShift; /**< shift for storing latency values, good value: 7 */ OMX_S32 nSpeedFactor; /**< multiplier for speed changes, in 24.8 format, good value: 256-512 */ OMX_S32 nInterFactor; /**< divider for comparing latency versus gradiant, good value: 300 */ OMX_S32 nAdjCap; /**< limit for speed change before nSpeedFactor is applied, good value: 100 */ } OMX_CONFIG_LATENCYTARGETTYPE; /* Query/set parameters used when adjusting clock speed to match the measured latency to a specified value. */ /* OMX_IndexConfigBrcmUseProprietaryCallback: Force use of proprietary callback */ typedef struct OMX_CONFIG_BRCMUSEPROPRIETARYCALLBACKTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnable; } OMX_CONFIG_BRCMUSEPROPRIETARYCALLBACKTYPE; /* Disable/enable the use of proprietary callbacks rather than OpenMAX IL buffer handling. */ /* OMX_IndexParamCommonUseStcTimestamps: Select timestamp mode */ typedef enum OMX_TIMESTAMPMODETYPE { OMX_TimestampModeZero = 0, /**< Use a timestamp of 0 */ OMX_TimestampModeRawStc, /**< Use the raw STC as the timestamp */ OMX_TimestampModeResetStc, /**< Store the STC when video capture port goes active, and subtract that from STC for the timestamp */ OMX_TimestampModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_TimestampModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_TimestampModeMax = 0x7FFFFFFF } OMX_TIMESTAMPMODETYPE; typedef struct OMX_PARAM_TIMESTAMPMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_TIMESTAMPMODETYPE eTimestampMode; } OMX_PARAM_TIMESTAMPMODETYPE; /* Specifies what to use as timestamps in the absence of a clock component. */ /* EGL image buffer for passing to video port. * Used when port color format is OMX_COLOR_FormatBRCMEGL. */ typedef struct OMX_BRCMVEGLIMAGETYPE { /* Passed between ARM + VC; use fixed width types. */ OMX_U32 nWidth; OMX_U32 nHeight; OMX_U32 nStride; OMX_U32 nUmemHandle; OMX_U32 nUmemOffset; OMX_U32 nFlipped; /* Non-zero -> vertically flipped image */ } OMX_BRCMVEGLIMAGETYPE; /* Provides field of view */ typedef struct OMX_CONFIG_BRCMFOVTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 xFieldOfViewHorizontal; /**< Horizontal field of view in degrees. 16p16 value */ OMX_U32 xFieldOfViewVertical; /**< Vertical field of view in degrees. 16p16 value */ } OMX_CONFIG_BRCMFOVTYPE; /* OMX_IndexConfigBrcmDecoderPassThrough: Enabling Audio Passthrough */ /* This allows an audio decoder to disable decoding the stream and pass through correctly framed data to enable playback of compressed audio to supported output devices. */ /* OMX_IndexConfigBrcmClockReferenceSource: Select Clock Reference Source */ /* This control allows communicating directly to an audio renderer component whether it should act as a clock reference source or act as a slave. */ /* OMX_IndexConfigEncLevelExtension: AVC Override encode capabilities */ typedef struct OMX_VIDEO_CONFIG_LEVEL_EXTEND { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nCustomMaxMBPS; /**< Specifies maximum macro-blocks per second */ OMX_U32 nCustomMaxFS; /**< Specifies maximum frame size (macro-blocks per frame) */ OMX_U32 nCustomMaxBRandCPB; /**< Specifies maximum bitrate in units of 1000 bits/s and Codec Picture Buffer (CPB derived from bitrate) */ } OMX_VIDEO_CONFIG_LEVEL_EXTEND; /* This allows finer control of the H264 encode internal parameters. */ /* OMX_IndexParamBrcmEEDEEnable: Enable/Disable end to end distortion estimator */ typedef struct OMX_VIDEO_EEDE_ENABLE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 enable; } OMX_VIDEO_EEDE_ENABLE; /* This enables or disables the use of end to end distortion estimation. */ /* OMX_IndexParamBrcmEEDELossRate: Loss rate configuration for end to end distortion */ typedef struct OMX_VIDEO_EEDE_LOSSRATE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 loss_rate; /**< loss rate, 5 means 5% */ } OMX_VIDEO_EEDE_LOSSRATE; /* Set the packet loss rate used by the end to end distortion estimator. */ /* OMX_IndexParamColorSpace: Colour space information */ typedef enum OMX_COLORSPACETYPE { OMX_COLORSPACE_UNKNOWN, OMX_COLORSPACE_JPEG_JFIF, OMX_COLORSPACE_ITU_R_BT601, OMX_COLORSPACE_ITU_R_BT709, OMX_COLORSPACE_FCC, OMX_COLORSPACE_SMPTE240M, OMX_COLORSPACE_BT470_2_M, OMX_COLORSPACE_BT470_2_BG, OMX_COLORSPACE_JFIF_Y16_255, OMX_COLORSPACE_MAX = 0x7FFFFFFF } OMX_COLORSPACETYPE; typedef struct OMX_PARAM_COLORSPACETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_COLORSPACETYPE eColorSpace; } OMX_PARAM_COLORSPACETYPE; /* Sets the colourspace with which pixel buffers should be generated / interpreted. */ typedef enum OMX_CAPTURESTATETYPE { OMX_NotCapturing, OMX_CaptureStarted, OMX_CaptureComplete, OMX_CaptureMax = 0x7FFFFFFF } OMX_CAPTURESTATETYPE; typedef struct OMX_PARAM_CAPTURESTATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_CAPTURESTATETYPE eCaptureState; } OMX_PARAM_CAPTURESTATETYPE; /* Provides information on the colour space that's in use during image/video processing. */ /* OMX_IndexConfigMinimiseFragmentation: Minimising Fragmentation */ /* This control can be supported to enable the client to request that the component works to minimise fragmentation of output buffers. */ /* OMX_IndexConfigBrcmBufferFlagFilter: Filter buffers based on flags */ /* This control can be set to request that buffers are conditionally forwarded on output ports based on matching flags set on that buffer. */ /* OMX_IndexParamPortMaxFrameSize: Specifying maximum frame size */ /* This control can be used to control the maximum frame size allowed on an output port. */ /* OMX_IndexConfigBrcmCameraRnDPreprocess: Enable use of development ISP software stage */ /* This control can be used to enable a developmental software stage to be inserted into the preprocessor stage of the ISP. */ /* OMX_IndexConfigBrcmCameraRnDPostprocess: Enable use of development ISP software stage */ /* This control can be used to enable a developmental software stage to be inserted into the postprocessor stage of the ISP. */ /* OMX_IndexParamDisableVllPool: Controlling use of memory for loadable modules */ /* This control can be used to control whether loadable modules used a dedicated memory pool or use heap allocated memory. */ /* OMX_IndexParamBrcmVideoPrecodeForQP: Pre-code 1st frame for QP.*/ /* This control selects a pre-encode of the first frame to set up a better initial QP value. */ /* OMX_IndexParamBrcmVideoTimestampFifo: Video timestamp FIFO mode. */ /* When enabled, the timestamp fifo mode will change the way incoming timestamps are associated with output images so the incoming timestamps get used without re-ordering on output images. */ /* OMX_IndexParamCameraCustomSensorConfig: Custom camera sensor configuration. */ /* This parameter is passed down to the camera sensor driver to be interpreted as a request for a different configuration to normal. How the configuration varies is sensor specific. */ /* OMX_IndexParamCameraDeviceNumber: Camera device selection .*/ /* Controls which camera driver, or camera peripheral, to use. */ /* OMX_IndexParamBrcmMaxNumCallbacks: Codec callback limit. */ /* The codec can queue up a significant number of frames internally if the sink is not consuming the output fast enough. This control limits the number of frames that can be queued up. */ typedef struct OMX_PARAM_BRCMCONFIGFILETYPE { OMX_U32 nSize; /**< size of the structure in bytes, including actual URI name */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 fileSize; /**< Size of complete file data */ } OMX_PARAM_BRCMCONFIGFILETYPE; typedef struct OMX_PARAM_BRCMCONFIGFILECHUNKTYPE { OMX_U32 nSize; /**< size of the structure in bytes, including actual chunk data */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 size; /**< Number of bytes being transferred in this chunk */ OMX_U32 offset; /**< Offset of this chunk in the file */ OMX_U8 data[1]; /**< Chunk data */ } OMX_PARAM_BRCMCONFIGFILECHUNKTYPE; typedef struct OMX_PARAM_BRCMFRAMERATERANGETYPE { OMX_U32 nSize; /**< size of the structure in bytes, including actual chunk data */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; OMX_U32 xFramerateLow; /**< Low end of framerate range. Q16 format */ OMX_U32 xFramerateHigh; /**< High end of framerate range. Q16 format */ } OMX_PARAM_BRCMFRAMERATERANGETYPE; typedef struct OMX_PARAM_S32TYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_S32 nS32; /**< S32 value */ } OMX_PARAM_S32TYPE; typedef struct OMX_PARAM_BRCMVIDEODRMPROTECTBUFFERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 size_wanted; /**< Input. Zero size means internal video decoder buffer, mem_handle and phys_addr not returned in this case */ OMX_U32 protect; /**< Input. 1 = protect, 0 = unprotect */ OMX_U32 mem_handle; /**< Output. Handle for protected buffer */ OMX_PTR phys_addr; /**< Output. Physical memory address of protected buffer */ } OMX_PARAM_BRCMVIDEODRMPROTECTBUFFERTYPE; typedef struct OMX_CONFIG_ZEROSHUTTERLAGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 bZeroShutterMode; /**< Select ZSL mode from the camera. */ OMX_U32 bConcurrentCapture; /**< Perform concurrent captures for full ZSL. */ } OMX_CONFIG_ZEROSHUTTERLAGTYPE; /* OMX_IndexParamBrcmVideoDecodeConfigVD3: VDec3 configuration. */ typedef struct OMX_PARAM_BRCMVIDEODECODECONFIGVD3TYPE { OMX_U32 nSize; /**< size of the structure in bytes, including configuration data */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U8 config[1]; /**< Configuration data (a VD3_CONFIGURE_T) */ } OMX_PARAM_BRCMVIDEODECODECONFIGVD3TYPE; /* Codec specific configuration block to set up internal state in a non-standard manner. */ typedef struct OMX_CONFIG_CUSTOMAWBGAINSTYPE { OMX_U32 nSize; /**< size of the structure in bytes, including configuration data */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 xGainR; /**< Red gain - 16p16 */ OMX_U32 xGainB; /**< Blue gain - 16p16 */ } OMX_CONFIG_CUSTOMAWBGAINSTYPE; /* OMX_IndexConfigBrcmRenderStats: Render port statistics */ typedef struct OMX_CONFIG_BRCMRENDERSTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL nValid; OMX_U32 nMatch; OMX_U32 nPeriod; OMX_U32 nPhase; OMX_U32 nPixelClockNominal; OMX_U32 nPixelClock; OMX_U32 nHvsStatus; OMX_U32 dummy0[2]; } OMX_CONFIG_BRCMRENDERSTATSTYPE; /* This provides statistics from the renderer to allow more accurate synchronisation between the scheduler and display VSYNC. */ #define OMX_BRCM_MAXANNOTATETEXTLEN 256 typedef struct OMX_CONFIG_BRCMANNOTATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnable; OMX_BOOL bShowShutter; OMX_BOOL bShowAnalogGain; OMX_BOOL bShowLens; OMX_BOOL bShowCaf; OMX_BOOL bShowMotion; OMX_BOOL bShowFrameNum; OMX_BOOL bEnableBackground; OMX_BOOL bCustomBackgroundColour; OMX_U8 nBackgroundY; OMX_U8 nBackgroundU; OMX_U8 nBackgroundV; OMX_U8 dummy1; OMX_BOOL bCustomTextColour; OMX_U8 nTextY; OMX_U8 nTextU; OMX_U8 nTextV; OMX_U8 nTextSize; /**< Text size: 6-150 pixels */ OMX_U8 sText[OMX_BRCM_MAXANNOTATETEXTLEN]; } OMX_CONFIG_BRCMANNOTATETYPE; /* OMX_IndexParamBrcmStereoscopicMode: Stereoscopic camera support */ typedef enum OMX_BRCMSTEREOSCOPICMODETYPE { OMX_STEREOSCOPIC_NONE = 0, OMX_STEREOSCOPIC_SIDEBYSIDE = 1, OMX_STEREOSCOPIC_TOPBOTTOM = 2, OMX_STEREOSCOPIC_MAX = 0x7FFFFFFF, } OMX_BRCMSTEREOSCOPICMODETYPE; typedef struct OMX_CONFIG_BRCMSTEREOSCOPICMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BRCMSTEREOSCOPICMODETYPE eMode; /**< Packing mode */ OMX_BOOL bDecimate; /**< Half/half mode (pixel aspect ratio = 1:2 or 2:1 if set. 1:1 if not set) */ OMX_BOOL bSwapEyes; /**< False = left eye first. True = right eye first. */ } OMX_CONFIG_BRCMSTEREOSCOPICMODETYPE; /* This control sets up how stereoscopic images should be generated. */ /* OMX_IndexParamCameraInterface: Camera interface type. */ typedef enum OMX_CAMERAINTERFACETYPE { OMX_CAMERAINTERFACE_CSI = 0, OMX_CAMERAINTERFACE_CCP2 = 1, OMX_CAMERAINTERFACE_CPI = 2, OMX_CAMERAINTERFACE_MAX = 0x7FFFFFFF, } OMX_CAMERAINTERFACETYPE; typedef struct OMX_PARAM_CAMERAINTERFACETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_CAMERAINTERFACETYPE eMode; /**< Interface mode */ } OMX_PARAM_CAMERAINTERFACETYPE; /* This configures the physical camera interface type. */ typedef enum OMX_CAMERACLOCKINGMODETYPE { OMX_CAMERACLOCKINGMODE_STROBE = 0, OMX_CAMERACLOCKINGMODE_CLOCK = 1, OMX_CAMERACLOCKINGMODE_MAX = 0x7FFFFFFF, } OMX_CAMERACLOCKINGMODETYPE; typedef struct OMX_PARAM_CAMERACLOCKINGMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_CAMERACLOCKINGMODETYPE eMode; /**< Clocking mode */ } OMX_PARAM_CAMERACLOCKINGMODETYPE; /* OMX_IndexParamCameraRxConfig: Camera receiver configuration */ typedef enum OMX_CAMERARXDECODETYPE { OMX_CAMERARXDECODE_NONE = 0, OMX_CAMERARXDECODE_DPCM8TO10 = 1, OMX_CAMERARXDECODE_DPCM7TO10 = 2, OMX_CAMERARXDECODE_DPCM6TO10 = 3, OMX_CAMERARXDECODE_DPCM8TO12 = 4, OMX_CAMERARXDECODE_DPCM7TO12 = 5, OMX_CAMERARXDECODE_DPCM6TO12 = 6, OMX_CAMERARXDECODE_DPCM10TO14 = 7, OMX_CAMERARXDECODE_DPCM8TO14 = 8, OMX_CAMERARXDECODE_DPCM12TO16 = 9, OMX_CAMERARXDECODE_DPCM10TO16 = 10, OMX_CAMERARXDECODE_DPCM8TO16 = 11, OMX_CAMERARXDECODE_MAX = 0x7FFFFFFF } OMX_CAMERARXDECODETYPE; typedef enum OMX_CAMERARXENCODETYPE { OMX_CAMERARXENCODE_NONE = 0, OMX_CAMERARXENCODE_DPCM10TO8 = 1, OMX_CAMERARXENCODE_DPCM12TO8 = 2, OMX_CAMERARXENCODE_DPCM14TO8 = 3, OMX_CAMERARXENCODE_MAX = 0x7FFFFFFF } OMX_CAMERARXENCODETYPE; typedef enum OMX_CAMERARXUNPACKTYPE { OMX_CAMERARXUNPACK_NONE = 0, OMX_CAMERARXUNPACK_6 = 1, OMX_CAMERARXUNPACK_7 = 2, OMX_CAMERARXUNPACK_8 = 3, OMX_CAMERARXUNPACK_10 = 4, OMX_CAMERARXUNPACK_12 = 5, OMX_CAMERARXUNPACK_14 = 6, OMX_CAMERARXUNPACK_16 = 7, OMX_CAMERARXUNPACK_MAX = 0x7FFFFFFF } OMX_CAMERARXUNPACKYPE; typedef enum OMX_CAMERARXPACKTYPE { OMX_CAMERARXPACK_NONE = 0, OMX_CAMERARXPACK_8 = 1, OMX_CAMERARXPACK_10 = 2, OMX_CAMERARXPACK_12 = 3, OMX_CAMERARXPACK_14 = 4, OMX_CAMERARXPACK_16 = 5, OMX_CAMERARXPACK_RAW10 = 6, OMX_CAMERARXPACK_RAW12 = 7, OMX_CAMERARXPACK_MAX = 0x7FFFFFFF } OMX_CAMERARXPACKTYPE; typedef struct OMX_PARAM_CAMERARXCONFIG_TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_CAMERARXDECODETYPE eDecode; OMX_CAMERARXENCODETYPE eEncode; OMX_CAMERARXUNPACKYPE eUnpack; OMX_CAMERARXPACKTYPE ePack; OMX_U32 nDataLanes; OMX_U32 nEncodeBlockLength; OMX_U32 nEmbeddedDataLines; OMX_U32 nImageId; } OMX_PARAM_CAMERARXCONFIG_TYPE; /* Configures the setup and processing options of the camera receiver peripheral. */ typedef struct OMX_PARAM_CAMERARXTIMING_TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nTiming1; OMX_U32 nTiming2; OMX_U32 nTiming3; OMX_U32 nTiming4; OMX_U32 nTiming5; OMX_U32 nTerm1; OMX_U32 nTerm2; OMX_U32 nCpiTiming1; OMX_U32 nCpiTiming2; } OMX_PARAM_CAMERARXTIMING_TYPE; /* OMX_IndexParamBrcmBayerOrder: Bayer order */ typedef enum OMX_BAYERORDERTYPE { OMX_BayerOrderRGGB = 0, OMX_BayerOrderGBRG = 1, OMX_BayerOrderBGGR = 2, OMX_BayerOrderGRBG = 3, OMX_BayerOrderMax = 0x7FFFFFFF } OMX_BAYERORDERTYPE; typedef struct OMX_PARAM_BAYERORDERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BAYERORDERTYPE eBayerOrder; } OMX_PARAM_BAYERORDERTYPE; /* The IL standard does not support a way to specify the Bayer order of Bayer images. This control adds that missing functionality. */ /* OMX_IndexConfigBrcmPowerMonitor: Deprecated.*/ /* Deprecated. Do not use. */ /* OMX_IndexParamBrcmZeroCopy: Deprecated */ /* Deprecated. Do not use. */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/IL/OMX_Component.h ================================================ /* * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** OMX_Component.h - OpenMax IL version 1.1.2 * The OMX_Component header file contains the definitions used to define * the public interface of a component. This header file is intended to * be used by both the application and the component. */ #ifndef OMX_Component_h #define OMX_Component_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_Audio.h" #include "OMX_Video.h" #include "OMX_Image.h" #include "OMX_Other.h" /** @ingroup comp */ typedef enum OMX_PORTDOMAINTYPE { OMX_PortDomainAudio, OMX_PortDomainVideo, OMX_PortDomainImage, OMX_PortDomainOther, OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_PortDomainMax = 0x7ffffff } OMX_PORTDOMAINTYPE; /** @ingroup comp */ typedef struct OMX_PARAM_PORTDEFINITIONTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port number the structure applies to */ OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */ OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */ OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */ OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */ OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by OMX_CommandPortEnable/OMX_CommandPortDisable. When disabled a port is unpopulated. A disabled port is not populated with buffers on a transition to IDLE. */ OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by nBufferCountActual. A disabled port is always unpopulated. An enabled port is populated on a transition to OMX_StateIdle and unpopulated on a transition to loaded. */ OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */ union { OMX_AUDIO_PORTDEFINITIONTYPE audio; OMX_VIDEO_PORTDEFINITIONTYPE video; OMX_IMAGE_PORTDEFINITIONTYPE image; OMX_OTHER_PORTDEFINITIONTYPE other; } format; OMX_BOOL bBuffersContiguous; OMX_U32 nBufferAlignment; } OMX_PARAM_PORTDEFINITIONTYPE; /** @ingroup comp */ typedef struct OMX_PARAM_U32TYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nU32; /**< U32 value */ } OMX_PARAM_U32TYPE; /** @ingroup rpm */ typedef enum OMX_SUSPENSIONPOLICYTYPE { OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */ OMX_SuspensionEnabled, /**< Suspension allowed */ OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_SuspensionPolicyMax = 0x7fffffff } OMX_SUSPENSIONPOLICYTYPE; /** @ingroup rpm */ typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_SUSPENSIONPOLICYTYPE ePolicy; } OMX_PARAM_SUSPENSIONPOLICYTYPE; /** @ingroup rpm */ typedef enum OMX_SUSPENSIONTYPE { OMX_NotSuspended, /**< component is not suspended */ OMX_Suspended, /**< component is suspended */ OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_SuspendMax = 0x7FFFFFFF } OMX_SUSPENSIONTYPE; /** @ingroup rpm */ typedef struct OMX_PARAM_SUSPENSIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_SUSPENSIONTYPE eType; } OMX_PARAM_SUSPENSIONTYPE ; typedef struct OMX_CONFIG_BOOLEANTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnabled; } OMX_CONFIG_BOOLEANTYPE; /* Parameter specifying the content uri to use. */ /** @ingroup cp */ typedef struct OMX_PARAM_CONTENTURITYPE { OMX_U32 nSize; /**< size of the structure in bytes, including actual URI name */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U8 contentURI[1]; /**< The URI name */ } OMX_PARAM_CONTENTURITYPE; /* Parameter specifying the pipe to use. */ /** @ingroup cp */ typedef struct OMX_PARAM_CONTENTPIPETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_HANDLETYPE hPipe; /**< The pipe handle*/ } OMX_PARAM_CONTENTPIPETYPE; /** @ingroup rpm */ typedef struct OMX_RESOURCECONCEALMENTTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment methods (like degrading algorithm quality to lower resource consumption or functional bypass) on a component as a resolution to resource conflicts. */ } OMX_RESOURCECONCEALMENTTYPE; /** @ingroup metadata */ typedef enum OMX_METADATACHARSETTYPE { OMX_MetadataCharsetUnknown = 0, OMX_MetadataCharsetASCII, OMX_MetadataCharsetBinary, OMX_MetadataCharsetCodePage1252, OMX_MetadataCharsetUTF8, OMX_MetadataCharsetJavaConformantUTF8, OMX_MetadataCharsetUTF7, OMX_MetadataCharsetImapUTF7, OMX_MetadataCharsetUTF16LE, OMX_MetadataCharsetUTF16BE, OMX_MetadataCharsetGB12345, OMX_MetadataCharsetHZGB2312, OMX_MetadataCharsetGB2312, OMX_MetadataCharsetGB18030, OMX_MetadataCharsetGBK, OMX_MetadataCharsetBig5, OMX_MetadataCharsetISO88591, OMX_MetadataCharsetISO88592, OMX_MetadataCharsetISO88593, OMX_MetadataCharsetISO88594, OMX_MetadataCharsetISO88595, OMX_MetadataCharsetISO88596, OMX_MetadataCharsetISO88597, OMX_MetadataCharsetISO88598, OMX_MetadataCharsetISO88599, OMX_MetadataCharsetISO885910, OMX_MetadataCharsetISO885913, OMX_MetadataCharsetISO885914, OMX_MetadataCharsetISO885915, OMX_MetadataCharsetShiftJIS, OMX_MetadataCharsetISO2022JP, OMX_MetadataCharsetISO2022JP1, OMX_MetadataCharsetISOEUCJP, OMX_MetadataCharsetSMS7Bit, OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MetadataCharsetTypeMax= 0x7FFFFFFF } OMX_METADATACHARSETTYPE; /** @ingroup metadata */ typedef enum OMX_METADATASCOPETYPE { OMX_MetadataScopeAllLevels, OMX_MetadataScopeTopLevel, OMX_MetadataScopePortLevel, OMX_MetadataScopeNodeLevel, OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MetadataScopeTypeMax = 0x7fffffff } OMX_METADATASCOPETYPE; /** @ingroup metadata */ typedef enum OMX_METADATASEARCHMODETYPE { OMX_MetadataSearchValueSizeByIndex, OMX_MetadataSearchItemByIndex, OMX_MetadataSearchNextItemByKey, OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MetadataSearchTypeMax = 0x7fffffff } OMX_METADATASEARCHMODETYPE; /** @ingroup metadata */ typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_METADATASCOPETYPE eScopeMode; OMX_U32 nScopeSpecifier; OMX_U32 nMetadataItemCount; } OMX_CONFIG_METADATAITEMCOUNTTYPE; /** @ingroup metadata */ typedef struct OMX_CONFIG_METADATAITEMTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_METADATASCOPETYPE eScopeMode; OMX_U32 nScopeSpecifier; OMX_U32 nMetadataItemIndex; OMX_METADATASEARCHMODETYPE eSearchMode; OMX_METADATACHARSETTYPE eKeyCharset; OMX_U8 nKeySizeUsed; OMX_U8 nKey[128]; OMX_METADATACHARSETTYPE eValueCharset; OMX_STRING sLanguageCountry; OMX_U32 nValueMaxSize; OMX_U32 nValueSizeUsed; OMX_U8 nValue[1]; } OMX_CONFIG_METADATAITEMTYPE; /* @ingroup metadata */ typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bAllKeys; OMX_U32 nParentNodeID; OMX_U32 nNumNodes; } OMX_CONFIG_CONTAINERNODECOUNTTYPE; /** @ingroup metadata */ typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bAllKeys; OMX_U32 nParentNodeID; OMX_U32 nNodeIndex; OMX_U32 nNodeID; OMX_STRING cNodeName; OMX_BOOL bIsLeafType; } OMX_CONFIG_CONTAINERNODEIDTYPE; /** @ingroup metadata */ typedef struct OMX_PARAM_METADATAFILTERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and * the three key fields below are ignored */ OMX_METADATACHARSETTYPE eKeyCharset; OMX_U32 nKeySizeUsed; OMX_U8 nKey [128]; OMX_U32 nLanguageCountrySizeUsed; OMX_U8 nLanguageCountry[128]; OMX_BOOL bEnabled; /* if true then key is part of filter (e.g. * retained for query later). If false then * key is not part of filter */ } OMX_PARAM_METADATAFILTERTYPE; /** The OMX_HANDLETYPE structure defines the component handle. The component * handle is used to access all of the component's public methods and also * contains pointers to the component's private data area. The component * handle is initialized by the OMX core (with help from the component) * during the process of loading the component. After the component is * successfully loaded, the application can safely access any of the * component's public functions (although some may return an error because * the state is inappropriate for the access). * * @ingroup comp */ typedef struct OMX_COMPONENTTYPE { /** The size of this structure, in bytes. It is the responsibility of the allocator of this structure to fill in this value. Since this structure is allocated by the GetHandle function, this function will fill in this value. */ OMX_U32 nSize; /** nVersion is the version of the OMX specification that the structure is built against. It is the responsibility of the creator of this structure to initialize this value and every user of this structure should verify that it knows how to use the exact version of this structure found herein. */ OMX_VERSIONTYPE nVersion; /** pComponentPrivate is a pointer to the component private data area. This member is allocated and initialized by the component when the component is first loaded. The application should not access this data area. */ OMX_PTR pComponentPrivate; /** pApplicationPrivate is a pointer that is a parameter to the OMX_GetHandle method, and contains an application private value provided by the IL client. This application private data is returned to the IL Client by OMX in all callbacks */ OMX_PTR pApplicationPrivate; /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL specification for details on the GetComponentVersion method. */ OMX_ERRORTYPE (*GetComponentVersion)( OMX_IN OMX_HANDLETYPE hComponent, OMX_OUT OMX_STRING pComponentName, OMX_OUT OMX_VERSIONTYPE* pComponentVersion, OMX_OUT OMX_VERSIONTYPE* pSpecVersion, OMX_OUT OMX_UUIDTYPE* pComponentUUID); /** refer to OMX_SendCommand in OMX_core.h or the OMX IL specification for details on the SendCommand method. */ OMX_ERRORTYPE (*SendCommand)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_COMMANDTYPE Cmd, OMX_IN OMX_U32 nParam1, OMX_IN OMX_PTR pCmdData); /** refer to OMX_GetParameter in OMX_core.h or the OMX IL specification for details on the GetParameter method. */ OMX_ERRORTYPE (*GetParameter)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pComponentParameterStructure); /** refer to OMX_SetParameter in OMX_core.h or the OMX IL specification for details on the SetParameter method. */ OMX_ERRORTYPE (*SetParameter)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_IN OMX_PTR pComponentParameterStructure); /** refer to OMX_GetConfig in OMX_core.h or the OMX IL specification for details on the GetConfig method. */ OMX_ERRORTYPE (*GetConfig)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_INOUT OMX_PTR pComponentConfigStructure); /** refer to OMX_SetConfig in OMX_core.h or the OMX IL specification for details on the SetConfig method. */ OMX_ERRORTYPE (*SetConfig)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_IN OMX_PTR pComponentConfigStructure); /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL specification for details on the GetExtensionIndex method. */ OMX_ERRORTYPE (*GetExtensionIndex)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE* pIndexType); /** refer to OMX_GetState in OMX_core.h or the OMX IL specification for details on the GetState method. */ OMX_ERRORTYPE (*GetState)( OMX_IN OMX_HANDLETYPE hComponent, OMX_OUT OMX_STATETYPE* pState); /** The ComponentTunnelRequest method will interact with another OMX component to determine if tunneling is possible and to setup the tunneling. The return codes for this method can be used to determine if tunneling is not possible, or if tunneling is not supported. Base profile components (i.e. non-interop) do not support this method and should return OMX_ErrorNotImplemented The interop profile component MUST support tunneling to another interop profile component with a compatible port parameters. A component may also support proprietary communication. If proprietary communication is supported the negotiation of proprietary communication is done outside of OMX in a vendor specific way. It is only required that the proper result be returned and the details of how the setup is done is left to the component implementation. When this method is invoked when nPort in an output port, the component will: 1. Populate the pTunnelSetup structure with the output port's requirements and constraints for the tunnel. When this method is invoked when nPort in an input port, the component will: 1. Query the necessary parameters from the output port to determine if the ports are compatible for tunneling 2. If the ports are compatible, the component should store the tunnel step provided by the output port 3. Determine which port (either input or output) is the buffer supplier, and call OMX_SetParameter on the output port to indicate this selection. The component will return from this call within 5 msec. @param [in] hComp Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle method. @param [in] nPort nPort is used to select the port on the component to be used for tunneling. @param [in] hTunneledComp Handle of the component to tunnel with. This is the component handle returned by the call to the OMX_GetHandle method. When this parameter is 0x0 the component should setup the port for communication with the application / IL Client. @param [in] nPortOutput nPortOutput is used indicate the port the component should tunnel with. @param [in] pTunnelSetup Pointer to the tunnel setup structure. When nPort is an output port the component should populate the fields of this structure. When When nPort is an input port the component should review the setup provided by the component with the output port. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup tun */ OMX_ERRORTYPE (*ComponentTunnelRequest)( OMX_IN OMX_HANDLETYPE hComp, OMX_IN OMX_U32 nPort, OMX_IN OMX_HANDLETYPE hTunneledComp, OMX_IN OMX_U32 nTunneledPort, OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup); /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL specification for details on the UseBuffer method. @ingroup buf */ OMX_ERRORTYPE (*UseBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes, OMX_IN OMX_U8* pBuffer); /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL specification for details on the AllocateBuffer method. @ingroup buf */ OMX_ERRORTYPE (*AllocateBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes); /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL specification for details on the FreeBuffer method. @ingroup buf */ OMX_ERRORTYPE (*FreeBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL specification for details on the EmptyThisBuffer method. @ingroup buf */ OMX_ERRORTYPE (*EmptyThisBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL specification for details on the FillThisBuffer method. @ingroup buf */ OMX_ERRORTYPE (*FillThisBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); /** The SetCallbacks method is used by the core to specify the callback structure from the application to the component. This is a blocking call. The component will return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the GetHandle function. @param [in] pCallbacks pointer to an OMX_CALLBACKTYPE structure used to provide the callback information to the component @param [in] pAppData pointer to an application defined value. It is anticipated that the application will pass a pointer to a data structure or a "this pointer" in this area to allow the callback (in the application) to determine the context of the call @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. */ OMX_ERRORTYPE (*SetCallbacks)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_CALLBACKTYPE* pCallbacks, OMX_IN OMX_PTR pAppData); /** ComponentDeInit method is used to deinitialize the component providing a means to free any resources allocated at component initialization. NOTE: After this call the component handle is not valid for further use. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the GetHandle function. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. */ OMX_ERRORTYPE (*ComponentDeInit)( OMX_IN OMX_HANDLETYPE hComponent); /** @ingroup buf */ OMX_ERRORTYPE (*UseEGLImage)( OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN void* eglImage); OMX_ERRORTYPE (*ComponentRoleEnum)( OMX_IN OMX_HANDLETYPE hComponent, OMX_OUT OMX_U8 *cRole, OMX_IN OMX_U32 nIndex); } OMX_COMPONENTTYPE; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/IL/OMX_Core.h ================================================ /* * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** OMX_Core.h - OpenMax IL version 1.1.2 * The OMX_Core header file contains the definitions used by both the * application and the component to access common items. */ #ifndef OMX_Core_h #define OMX_Core_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if !defined(OMX_SKIP64BIT) && !defined(_VIDEOCORE) /* The Videocore compiler doesn't enforce 64 bit alignment on 64 bit variables, * which is almost equivalent to OMX_SKIP64BIT. * Annoyingly struct OMX_BUFFERHEADERTYPE doesn't do the sensible thing * and add padding fields or similar to make it the same for all compilers, * so all clients need to define this. * Warn if this isn't set, as the GPU will not interpret your buffers correctly, * or vice versa. */ #warning OMX_SKIP64BIT is not defined - this will be incompatible with the VC GPU code. #endif /* Each OMX header shall include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_Index.h" /** The OMX_COMMANDTYPE enumeration is used to specify the action in the * OMX_SendCommand macro. * @ingroup core */ typedef enum OMX_COMMANDTYPE { OMX_CommandStateSet, /**< Change the component state */ OMX_CommandFlush, /**< Flush the data queue(s) of a component */ OMX_CommandPortDisable, /**< Disable a port on a component. */ OMX_CommandPortEnable, /**< Enable a port on a component. */ OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */ OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_CommandMax = 0X7FFFFFFF } OMX_COMMANDTYPE; /** The OMX_STATETYPE enumeration is used to indicate or change the component * state. This enumeration reflects the current state of the component when * used with the OMX_GetState macro or becomes the parameter in a state change * command when used with the OMX_SendCommand macro. * * The component will be in the Loaded state after the component is initially * loaded into memory. In the Loaded state, the component is not allowed to * allocate or hold resources other than to build it's internal parameter * and configuration tables. The application will send one or more * SetParameters/GetParameters and SetConfig/GetConfig commands to the * component and the component will record each of these parameter and * configuration changes for use later. When the application sends the * Idle command, the component will acquire the resources needed for the * specified configuration and will transition to the idle state if the * allocation is successful. If the component cannot successfully * transition to the idle state for any reason, the state of the component * shall be fully rolled back to the Loaded state (e.g. all allocated * resources shall be released). When the component receives the command * to go to the Executing state, it shall begin processing buffers by * sending all input buffers it holds to the application. While * the component is in the Idle state, the application may also send the * Pause command. If the component receives the pause command while in the * Idle state, the component shall send all input buffers it holds to the * application, but shall not begin processing buffers. This will allow the * application to prefill buffers. * * @ingroup comp */ typedef enum OMX_STATETYPE { OMX_StateInvalid, /**< component has detected that it's internal data structures are corrupted to the point that it cannot determine it's state properly */ OMX_StateLoaded, /**< component has been loaded but has not completed initialization. The OMX_SetParameter macro and the OMX_GetParameter macro are the only valid macros allowed to be sent to the component in this state. */ OMX_StateIdle, /**< component initialization has been completed successfully and the component is ready to to start. */ OMX_StateExecuting, /**< component has accepted the start command and is processing data (if data is available) */ OMX_StatePause, /**< component has received pause command */ OMX_StateWaitForResources, /**< component is waiting for resources, either after preemption or before it gets the resources requested. See specification for complete details. */ OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_StateMax = 0X7FFFFFFF } OMX_STATETYPE; /** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These * errors should cover most of the common failure cases. However, * vendors are free to add additional error messages of their own as * long as they follow these rules: * 1. Vendor error messages shall be in the range of 0x90000000 to * 0x9000FFFF. * 2. Vendor error messages shall be defined in a header file provided * with the component. No error messages are allowed that are * not defined. */ typedef enum OMX_ERRORTYPE { OMX_ErrorNone = 0, /** There were insufficient resources to perform the requested operation */ OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000, /** There was an error, but the cause of the error could not be determined */ OMX_ErrorUndefined = (OMX_S32) 0x80001001, /** The component name string was not valid */ OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002, /** No component with the specified name string was found */ OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003, /** The component specified did not have a "OMX_ComponentInit" or "OMX_ComponentDeInit entry point */ OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004, /** One or more parameters were not valid */ OMX_ErrorBadParameter = (OMX_S32) 0x80001005, /** The requested function is not implemented */ OMX_ErrorNotImplemented = (OMX_S32) 0x80001006, /** The buffer was emptied before the next buffer was ready */ OMX_ErrorUnderflow = (OMX_S32) 0x80001007, /** The buffer was not available when it was needed */ OMX_ErrorOverflow = (OMX_S32) 0x80001008, /** The hardware failed to respond as expected */ OMX_ErrorHardware = (OMX_S32) 0x80001009, /** The component is in the state OMX_StateInvalid */ OMX_ErrorInvalidState = (OMX_S32) 0x8000100A, /** Stream is found to be corrupt */ OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B, /** Ports being connected are not compatible */ OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C, /** Resources allocated to an idle component have been lost resulting in the component returning to the loaded state */ OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D, /** No more indicies can be enumerated */ OMX_ErrorNoMore = (OMX_S32) 0x8000100E, /** The component detected a version mismatch */ OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F, /** The component is not ready to return data at this time */ OMX_ErrorNotReady = (OMX_S32) 0x80001010, /** There was a timeout that occurred */ OMX_ErrorTimeout = (OMX_S32) 0x80001011, /** This error occurs when trying to transition into the state you are already in */ OMX_ErrorSameState = (OMX_S32) 0x80001012, /** Resources allocated to an executing or paused component have been preempted, causing the component to return to the idle state */ OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013, /** A non-supplier port sends this error to the IL client (via the EventHandler callback) during the allocation of buffers (on a transition from the LOADED to the IDLE state or on a port restart) when it deems that it has waited an unusually long time for the supplier to send it an allocated buffer via a UseBuffer call. */ OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014, /** A non-supplier port sends this error to the IL client (via the EventHandler callback) during the deallocation of buffers (on a transition from the IDLE to LOADED state or on a port stop) when it deems that it has waited an unusually long time for the supplier to request the deallocation of a buffer header via a FreeBuffer call. */ OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015, /** A supplier port sends this error to the IL client (via the EventHandler callback) during the stopping of a port (either on a transition from the IDLE to LOADED state or a port stop) when it deems that it has waited an unusually long time for the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */ OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016, /** Attempting a state transtion that is not allowed */ OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017, /* Attempting a command that is not allowed during the present state. */ OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018, /** The values encapsulated in the parameter or config structure are not supported. */ OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019, /** The parameter or config indicated by the given index is not supported. */ OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A, /** The port index supplied is incorrect. */ OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B, /** The port has lost one or more of its buffers and it thus unpopulated. */ OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C, /** Component suspended due to temporary loss of resources */ OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D, /** Component suspended due to an inability to acquire dynamic resources */ OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E, /** When the macroblock error reporting is enabled the component returns new error for every frame that has errors */ OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F, /** A component reports this error when it cannot parse or determine the format of an input stream. */ OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020, /** The content open operation failed. */ OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021, /** The content creation operation failed. */ OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022, /** Separate table information is being used */ OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023, /** Tunneling is unsupported by the component*/ OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024, OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */ /** Disk Full error */ OMX_ErrorDiskFull = (OMX_S32) 0x90000001, /** Max file size is reached */ OMX_ErrorMaxFileSize = (OMX_S32) 0x90000002, /** Unauthorised to play a DRM protected file */ OMX_ErrorDrmUnauthorised = (OMX_S32) 0x90000003, /** The DRM protected file has expired */ OMX_ErrorDrmExpired = (OMX_S32) 0x90000004, /** Some other DRM library error */ OMX_ErrorDrmGeneral = (OMX_S32) 0x90000005, OMX_ErrorMax = 0x7FFFFFFF } OMX_ERRORTYPE; /** @ingroup core */ typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent); /** @ingroup core */ typedef struct OMX_COMPONENTREGISTERTYPE { const char * pName; /* Component name, 128 byte limit (including '\0') applies */ OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */ } OMX_COMPONENTREGISTERTYPE; /** @ingroup core */ extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[]; /** @ingroup rpm */ typedef struct OMX_PRIORITYMGMTTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nGroupPriority; /**< Priority of the component group */ OMX_U32 nGroupID; /**< ID of the component group */ } OMX_PRIORITYMGMTTYPE; /* Component name and Role names are limited to 128 characters including the terminating '\0'. */ #define OMX_MAX_STRINGNAME_SIZE 128 /** @ingroup comp */ typedef struct OMX_PARAM_COMPONENTROLETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */ } OMX_PARAM_COMPONENTROLETYPE; /** End of Stream Buffer Flag: * * A component sets EOS when it has no more data to emit on a particular * output port. Thus an output port shall set EOS on the last buffer it * emits. A component's determination of when an output port should * cease sending data is implemenation specific. * @ingroup buf */ #define OMX_BUFFERFLAG_EOS 0x00000001 /** Start Time Buffer Flag: * * The source of a stream (e.g. a demux component) sets the STARTTIME * flag on the buffer that contains the starting timestamp for the * stream. The starting timestamp corresponds to the first data that * should be displayed at startup or after a seek. * The first timestamp of the stream is not necessarily the start time. * For instance, in the case of a seek to a particular video frame, * the target frame may be an interframe. Thus the first buffer of * the stream will be the intra-frame preceding the target frame and * the starttime will occur with the target frame (with any other * required frames required to reconstruct the target intervening). * * The STARTTIME flag is directly associated with the buffer's * timestamp ' thus its association to buffer data and its * propagation is identical to the timestamp's. * * When a Sync Component client receives a buffer with the * STARTTIME flag it shall perform a SetConfig on its sync port * using OMX_ConfigTimeClientStartTime and passing the buffer's * timestamp. * * @ingroup buf */ #define OMX_BUFFERFLAG_STARTTIME 0x00000002 /** Decode Only Buffer Flag: * * The source of a stream (e.g. a demux component) sets the DECODEONLY * flag on any buffer that should shall be decoded but should not be * displayed. This flag is used, for instance, when a source seeks to * a target interframe that requires the decode of frames preceding the * target to facilitate the target's reconstruction. In this case the * source would emit the frames preceding the target downstream * but mark them as decode only. * * The DECODEONLY is associated with buffer data and propagated in a * manner identical to the buffer timestamp. * * A component that renders data should ignore all buffers with * the DECODEONLY flag set. * * @ingroup buf */ #define OMX_BUFFERFLAG_DECODEONLY 0x00000004 /* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt * @ingroup buf */ #define OMX_BUFFERFLAG_DATACORRUPT 0x00000008 /* End of Frame: The buffer contains exactly one end of frame and no data * occurs after the end of frame. This flag is an optional hint. The absence * of this flag does not imply the absence of an end of frame within the buffer. * @ingroup buf */ #define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010 /* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame ' * a frame that has no dependency on any other frame information * @ingroup buf */ #define OMX_BUFFERFLAG_SYNCFRAME 0x00000020 /* Extra data present flag: there is extra data appended to the data stream * residing in the buffer * @ingroup buf */ #define OMX_BUFFERFLAG_EXTRADATA 0x00000040 /** Codec Config Buffer Flag: * OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an * output port when all bytes in the buffer form part or all of a set of * codec specific configuration data. Examples include SPS/PPS nal units * for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for * OMX_AUDIO_CodingAAC. Any component that for a given stream sets * OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes * with frame data in the same buffer, and shall send all buffers * containing codec configuration bytes before any buffers containing * frame data that those configurations bytes describe. * If the stream format for a particular codec has a frame specific * header at the start of each frame, for example OMX_AUDIO_CodingMP3 or * OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as * normal without setting OMX_BUFFERFLAG_CODECCONFIG. * @ingroup buf */ #define OMX_BUFFERFLAG_CODECCONFIG 0x00000080 /** @ingroup buf */ typedef struct OMX_BUFFERHEADERTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U8* pBuffer; /**< Pointer to actual block of memory that is acting as the buffer */ OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */ OMX_U32 nFilledLen; /**< number of bytes currently in the buffer */ OMX_U32 nOffset; /**< start offset of valid data in bytes from the start of the buffer */ OMX_PTR pAppPrivate; /**< pointer to any data the application wants to associate with this buffer */ OMX_PTR pPlatformPrivate; /**< pointer to any data the platform wants to associate with this buffer */ OMX_PTR pInputPortPrivate; /**< pointer to any data the input port wants to associate with this buffer */ OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port wants to associate with this buffer */ OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a mark event upon processing this buffer. */ OMX_PTR pMarkData; /**< Application specific data associated with the mark sent on a mark event to disambiguate this mark from others. */ OMX_U32 nTickCount; /**< Optional entry that the component and application can update with a tick count when they access the component. This value should be in microseconds. Since this is a value relative to an arbitrary starting point, this value cannot be used to determine absolute time. This is an optional entry and not all components will update it.*/ OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample starting at the first logical sample boundary in the buffer. Timestamps of successive samples within the buffer may be inferred by adding the duration of the of the preceding buffer to the timestamp of the preceding buffer.*/ OMX_U32 nFlags; /**< buffer specific flags */ OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using this buffer */ OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using this buffer */ } OMX_BUFFERHEADERTYPE; /** The OMX_EXTRADATATYPE enumeration is used to define the * possible extra data payload types. * NB: this enum is binary backwards compatible with the previous * OMX_EXTRADATA_QUANT define. This should be replaced with * OMX_ExtraDataQuantization. */ typedef enum OMX_EXTRADATATYPE { OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */ OMX_ExtraDataQuantization, /**< The data payload contains quantization data */ OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_ExtraDataSequenceGap, /**< Indicates a gap in sequence numbers, data is uint32_t saying how many frames were lost */ OMX_ExtraDataDecodeOnlyUntil, /**< Indicates a timestamp until which all data should be decoded only, and the first packets after should generate a client start time flag. data is int32_t of seek time in milliseconds */ OMX_ExtraDataMax = 0x7FFFFFFF } OMX_EXTRADATATYPE; typedef struct OMX_OTHER_EXTRADATATYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_EXTRADATATYPE eType; /* Extra Data type */ OMX_U32 nDataSize; /* Size of the supporting data to follow */ OMX_U8 data[1]; /* Supporting data hint */ } OMX_OTHER_EXTRADATATYPE; /** @ingroup comp */ typedef struct OMX_PORT_PARAM_TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPorts; /**< The number of ports for this component */ OMX_U32 nStartPortNumber; /** first port number for this type of port */ } OMX_PORT_PARAM_TYPE; /** @ingroup comp */ typedef enum OMX_EVENTTYPE { OMX_EventCmdComplete, /**< component has sucessfully completed a command */ OMX_EventError, /**< component has detected an error condition */ OMX_EventMark, /**< component has detected a buffer mark */ OMX_EventPortSettingsChanged, /**< component is reported a port settings change */ OMX_EventBufferFlag, /**< component has detected an EOS */ OMX_EventResourcesAcquired, /**< component has been granted resources and is automatically starting the state change from OMX_StateWaitForResources to OMX_StateIdle. */ OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */ OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */ OMX_EventPortFormatDetected, /**< Component has detected a supported format. */ OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_EventParamOrConfigChanged, /* Should be added to the main spec as part of IL416c */ OMX_EventMax = 0x7FFFFFFF } OMX_EVENTTYPE; typedef struct OMX_CALLBACKTYPE { /** The EventHandler method is used to notify the application when an event of interest occurs. Events are defined in the OMX_EVENTTYPE enumeration. Please see that enumeration for details of what will be returned for each type of event. Callbacks should not return an error to the component, so if an error occurs, the application shall handle it internally. This is a blocking call. The application should return from this call within 5 msec to avoid blocking the component for an excessively long period of time. @param hComponent handle of the component to access. This is the component handle returned by the call to the GetHandle function. @param pAppData pointer to an application defined value that was provided in the pAppData parameter to the OMX_GetHandle method for the component. This application defined value is provided so that the application can have a component specific context when receiving the callback. @param eEvent Event that the component wants to notify the application about. @param nData1 nData will be the OMX_ERRORTYPE for an error event and will be an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event. @param nData2 nData2 will hold further information related to the event. Can be OMX_STATETYPE for a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event. Default value is 0 if not used. ) @param pEventData Pointer to additional event-specific data (see spec for meaning). */ OMX_ERRORTYPE (*EventHandler)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_EVENTTYPE eEvent, OMX_IN OMX_U32 nData1, OMX_IN OMX_U32 nData2, OMX_IN OMX_PTR pEventData); /** The EmptyBufferDone method is used to return emptied buffers from an input port back to the application for reuse. This is a blocking call so the application should not attempt to refill the buffers during this call, but should queue them and refill them in another thread. There is no error return, so the application shall handle any errors generated internally. The application should return from this call within 5 msec. @param hComponent handle of the component to access. This is the component handle returned by the call to the GetHandle function. @param pAppData pointer to an application defined value that was provided in the pAppData parameter to the OMX_GetHandle method for the component. This application defined value is provided so that the application can have a component specific context when receiving the callback. @param pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer indicating the buffer that was emptied. @ingroup buf */ OMX_ERRORTYPE (*EmptyBufferDone)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); /** The FillBufferDone method is used to return filled buffers from an output port back to the application for emptying and then reuse. This is a blocking call so the application should not attempt to empty the buffers during this call, but should queue the buffers and empty them in another thread. There is no error return, so the application shall handle any errors generated internally. The application shall also update the buffer header to indicate the number of bytes placed into the buffer. The application should return from this call within 5 msec. @param hComponent handle of the component to access. This is the component handle returned by the call to the GetHandle function. @param pAppData pointer to an application defined value that was provided in the pAppData parameter to the OMX_GetHandle method for the component. This application defined value is provided so that the application can have a component specific context when receiving the callback. @param pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer indicating the buffer that was filled. @ingroup buf */ OMX_ERRORTYPE (*FillBufferDone)( OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); } OMX_CALLBACKTYPE; /** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier preference when tunneling between two ports. @ingroup tun buf */ typedef enum OMX_BUFFERSUPPLIERTYPE { OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified, or don't care */ OMX_BufferSupplyInput, /**< input port supplies the buffers */ OMX_BufferSupplyOutput, /**< output port supplies the buffers */ OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_BufferSupplyMax = 0x7FFFFFFF } OMX_BUFFERSUPPLIERTYPE; /** buffer supplier parameter * @ingroup tun */ typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */ } OMX_PARAM_BUFFERSUPPLIERTYPE; /**< indicates that buffers received by an input port of a tunnel may not modify the data in the buffers @ingroup tun */ #define OMX_PORTTUNNELFLAG_READONLY 0x00000001 /** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output port to an input port as part the two ComponentTunnelRequest calls resulting from a OMX_SetupTunnel call from the IL Client. @ingroup tun */ typedef struct OMX_TUNNELSETUPTYPE { OMX_U32 nTunnelFlags; /**< bit flags for tunneling */ OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */ } OMX_TUNNELSETUPTYPE; /* OMX Component headers is included to enable the core to use macros for functions into the component for OMX release 1.0. Developers should not access any structures or data from within the component header directly */ /* TO BE REMOVED - #include */ /** GetComponentVersion will return information about the component. This is a blocking call. This macro will go directly from the application to the component (via a core macro). The component will return from this call within 5 msec. @param [in] hComponent handle of component to execute the command @param [out] pComponentName pointer to an empty string of length 128 bytes. The component will write its name into this string. The name will be terminated by a single zero byte. The name of a component will be 127 bytes or less to leave room for the trailing zero byte. An example of a valid component name is "OMX.ABC.ChannelMixer\0". @param [out] pComponentVersion pointer to an OMX Version structure that the component will fill in. The component will fill in a value that indicates the component version. NOTE: the component version is NOT the same as the OMX Specification version (found in all structures). The component version is defined by the vendor of the component and its value is entirely up to the component vendor. @param [out] pSpecVersion pointer to an OMX Version structure that the component will fill in. The SpecVersion is the version of the specification that the component was built against. Please note that this value may or may not match the structure's version. For example, if the component was built against the 2.0 specification, but the application (which creates the structure is built against the 1.0 specification the versions would be different. @param [out] pComponentUUID pointer to the UUID of the component which will be filled in by the component. The UUID is a unique identifier that is set at RUN time for the component and is unique to each instantion of the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetComponentVersion( \ hComponent, \ pComponentName, \ pComponentVersion, \ pSpecVersion, \ pComponentUUID) \ ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \ hComponent, \ pComponentName, \ pComponentVersion, \ pSpecVersion, \ pComponentUUID) /* Macro End */ /** Send a command to the component. This call is a non-blocking call. The component should check the parameters and then queue the command to the component thread to be executed. The component thread shall send the EventHandler() callback at the conclusion of the command. This macro will go directly from the application to the component (via a core macro). The component will return from this call within 5 msec. When the command is "OMX_CommandStateSet" the component will queue a state transition to the new state idenfied in nParam. When the command is "OMX_CommandFlush", to flush a port's buffer queues, the command will force the component to return all buffers NOT CURRENTLY BEING PROCESSED to the application, in the order in which the buffers were received. When the command is "OMX_CommandPortDisable" or "OMX_CommandPortEnable", the component's port (given by the value of nParam) will be stopped or restarted. When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the pCmdData will point to a OMX_MARKTYPE structure containing the component handle of the component to examine the buffer chain for the mark. nParam1 contains the index of the port on which the buffer mark is applied. Specification text for more details. @param [in] hComponent handle of component to execute the command @param [in] Cmd Command for the component to execute @param [in] nParam Parameter for the command to be executed. When Cmd has the value OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has the value OMX_CommandFlush, value of nParam indicates which port(s) to flush. -1 is used to flush all ports a single port index will only flush that port. When Cmd has the value "OMX_CommandPortDisable" or "OMX_CommandPortEnable", the component's port is given by the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer" the components pot is given by the value of nParam. @param [in] pCmdData Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value "OMX_CommandMarkBuffer". @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_SendCommand( \ hComponent, \ Cmd, \ nParam, \ pCmdData) \ ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \ hComponent, \ Cmd, \ nParam, \ pCmdData) /* Macro End */ /** The OMX_GetParameter macro will get one of the current parameter settings from the component. This macro cannot only be invoked when the component is in the OMX_StateInvalid state. The nParamIndex parameter is used to indicate which structure is being requested from the component. The application shall allocate the correct structure and shall fill in the structure size and version information before invoking this macro. When the parameter applies to a port, the caller shall fill in the appropriate nPortIndex value indicating the port on which the parameter applies. If the component has not had any settings changed, then the component should return a set of valid DEFAULT parameters for the component. This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nParamIndex Index of the structure to be filled. This value is from the OMX_INDEXTYPE enumeration. @param [in,out] pComponentParameterStructure Pointer to application allocated structure to be filled by the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetParameter( \ hComponent, \ nParamIndex, \ pComponentParameterStructure) \ ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \ hComponent, \ nParamIndex, \ pComponentParameterStructure) /* Macro End */ /** The OMX_SetParameter macro will send an initialization parameter structure to a component. Each structure shall be sent one at a time, in a separate invocation of the macro. This macro can only be invoked when the component is in the OMX_StateLoaded state, or the port is disabled (when the parameter applies to a port). The nParamIndex parameter is used to indicate which structure is being passed to the component. The application shall allocate the correct structure and shall fill in the structure size and version information (as well as the actual data) before invoking this macro. The application is free to dispose of this structure after the call as the component is required to copy any data it shall retain. This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nIndex Index of the structure to be sent. This value is from the OMX_INDEXTYPE enumeration. @param [in] pComponentParameterStructure pointer to application allocated structure to be used for initialization by the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_SetParameter( \ hComponent, \ nParamIndex, \ pComponentParameterStructure) \ ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \ hComponent, \ nParamIndex, \ pComponentParameterStructure) /* Macro End */ /** The OMX_GetConfig macro will get one of the configuration structures from a component. This macro can be invoked anytime after the component has been loaded. The nParamIndex call parameter is used to indicate which structure is being requested from the component. The application shall allocate the correct structure and shall fill in the structure size and version information before invoking this macro. If the component has not had this configuration parameter sent before, then the component should return a set of valid DEFAULT values for the component. This is a blocking call. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nIndex Index of the structure to be filled. This value is from the OMX_INDEXTYPE enumeration. @param [in,out] pComponentConfigStructure pointer to application allocated structure to be filled by the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetConfig( \ hComponent, \ nConfigIndex, \ pComponentConfigStructure) \ ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \ hComponent, \ nConfigIndex, \ pComponentConfigStructure) /* Macro End */ /** The OMX_SetConfig macro will send one of the configuration structures to a component. Each structure shall be sent one at a time, each in a separate invocation of the macro. This macro can be invoked anytime after the component has been loaded. The application shall allocate the correct structure and shall fill in the structure size and version information (as well as the actual data) before invoking this macro. The application is free to dispose of this structure after the call as the component is required to copy any data it shall retain. This is a blocking call. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nConfigIndex Index of the structure to be sent. This value is from the OMX_INDEXTYPE enumeration above. @param [in] pComponentConfigStructure pointer to application allocated structure to be used for initialization by the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_SetConfig( \ hComponent, \ nConfigIndex, \ pComponentConfigStructure) \ ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \ hComponent, \ nConfigIndex, \ pComponentConfigStructure) /* Macro End */ /** The OMX_GetExtensionIndex macro will invoke a component to translate a vendor specific configuration or parameter string into an OMX structure index. There is no requirement for the vendor to support this command for the indexes already found in the OMX_INDEXTYPE enumeration (this is done to save space in small components). The component shall support all vendor supplied extension indexes not found in the master OMX_INDEXTYPE enumeration. This is a blocking call. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the GetHandle function. @param [in] cParameterName OMX_STRING that shall be less than 128 characters long including the trailing null byte. This is the string that will get translated by the component into a configuration index. @param [out] pIndexType a pointer to a OMX_INDEXTYPE to receive the index value. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetExtensionIndex( \ hComponent, \ cParameterName, \ pIndexType) \ ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \ hComponent, \ cParameterName, \ pIndexType) /* Macro End */ /** The OMX_GetState macro will invoke the component to get the current state of the component and place the state value into the location pointed to by pState. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [out] pState pointer to the location to receive the state. The value returned is one of the OMX_STATETYPE members @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetState( \ hComponent, \ pState) \ ((OMX_COMPONENTTYPE*)hComponent)->GetState( \ hComponent, \ pState) /* Macro End */ /** The OMX_UseBuffer macro will request that the component use a buffer (and allocate its own buffer header) already allocated by another component, or by the IL Client. This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [out] ppBuffer pointer to an OMX_BUFFERHEADERTYPE structure used to receive the pointer to the buffer header @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_UseBuffer( \ hComponent, \ ppBufferHdr, \ nPortIndex, \ pAppPrivate, \ nSizeBytes, \ pBuffer) \ ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \ hComponent, \ ppBufferHdr, \ nPortIndex, \ pAppPrivate, \ nSizeBytes, \ pBuffer) /** The OMX_AllocateBuffer macro will request that the component allocate a new buffer and buffer header. The component will allocate the buffer and the buffer header and return a pointer to the buffer header. This is a blocking call. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [out] ppBuffer pointer to an OMX_BUFFERHEADERTYPE structure used to receive the pointer to the buffer header @param [in] nPortIndex nPortIndex is used to select the port on the component the buffer will be used with. The port can be found by using the nPortIndex value as an index into the Port Definition array of the component. @param [in] pAppPrivate pAppPrivate is used to initialize the pAppPrivate member of the buffer header structure. @param [in] nSizeBytes size of the buffer to allocate. Used when bAllocateNew is true. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_AllocateBuffer( \ hComponent, \ ppBuffer, \ nPortIndex, \ pAppPrivate, \ nSizeBytes) \ ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \ hComponent, \ ppBuffer, \ nPortIndex, \ pAppPrivate, \ nSizeBytes) /* Macro End */ /** The OMX_FreeBuffer macro will release a buffer header from the component which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If the component allocated the buffer (see the OMX_UseBuffer macro) then the component shall free the buffer and buffer header. This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nPortIndex nPortIndex is used to select the port on the component the buffer will be used with. @param [in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_FreeBuffer( \ hComponent, \ nPortIndex, \ pBuffer) \ ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \ hComponent, \ nPortIndex, \ pBuffer) /* Macro End */ /** The OMX_EmptyThisBuffer macro will send a buffer full of data to an input port of a component. The buffer will be emptied by the component and returned to the application via the EmptyBufferDone call back. This is a non-blocking call in that the component will record the buffer and return immediately and then empty the buffer, later, at the proper time. As expected, this macro may be invoked only while the component is in the OMX_StateExecuting. If nPortIndex does not specify an input port, the component shall return an error. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_EmptyThisBuffer( \ hComponent, \ pBuffer) \ ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \ hComponent, \ pBuffer) /* Macro End */ /** The OMX_FillThisBuffer macro will send an empty buffer to an output port of a component. The buffer will be filled by the component and returned to the application via the FillBufferDone call back. This is a non-blocking call in that the component will record the buffer and return immediately and then fill the buffer, later, at the proper time. As expected, this macro may be invoked only while the component is in the OMX_ExecutingState. If nPortIndex does not specify an output port, the component shall return an error. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_FillThisBuffer( \ hComponent, \ pBuffer) \ ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \ hComponent, \ pBuffer) /* Macro End */ /** The OMX_UseEGLImage macro will request that the component use a EGLImage provided by EGL (and allocate its own buffer header) This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [out] ppBuffer pointer to an OMX_BUFFERHEADERTYPE structure used to receive the pointer to the buffer header. Note that the memory location used for this buffer is NOT visible to the IL Client. @param [in] nPortIndex nPortIndex is used to select the port on the component the buffer will be used with. The port can be found by using the nPortIndex value as an index into the Port Definition array of the component. @param [in] pAppPrivate pAppPrivate is used to initialize the pAppPrivate member of the buffer header structure. @param [in] eglImage eglImage contains the handle of the EGLImage to use as a buffer on the specified port. The component is expected to validate properties of the EGLImage against the configuration of the port to ensure the component can use the EGLImage as a buffer. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_UseEGLImage( \ hComponent, \ ppBufferHdr, \ nPortIndex, \ pAppPrivate, \ eglImage) \ ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \ hComponent, \ ppBufferHdr, \ nPortIndex, \ pAppPrivate, \ eglImage) /** The OMX_Init method is used to initialize the OMX core. It shall be the first call made into OMX and it should only be executed one time without an interviening OMX_Deinit call. The core should return from this call within 20 msec. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void); /** The OMX_Deinit method is used to deinitialize the OMX core. It shall be the last call made into OMX. In the event that the core determines that thare are components loaded when this call is made, the core may return with an error rather than try to unload the components. The core should return from this call within 20 msec. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void); /** The OMX_ComponentNameEnum method will enumerate through all the names of recognised valid components in the system. This function is provided as a means to detect all the components in the system run-time. There is no strict ordering to the enumeration order of component names, although each name will only be enumerated once. If the OMX core supports run-time installation of new components, it is only requried to detect newly installed components when the first call to enumerate component names is made (i.e. when nIndex is 0x0). The core should return from this call in 20 msec. @param [out] cComponentName pointer to a null terminated string with the component name. The names of the components are strings less than 127 bytes in length plus the trailing null for a maximum size of 128 bytes. An example of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are assigned by the vendor, but shall start with "OMX." and then have the Vendor designation next. @param [in] nNameLength number of characters in the cComponentName string. With all component name strings restricted to less than 128 characters (including the trailing null) it is recomended that the caller provide a input string for the cComponentName of 128 characters. @param [in] nIndex number containing the enumeration index for the component. Multiple calls to OMX_ComponentNameEnum with increasing values of nIndex will enumerate through the component names in the system until OMX_ErrorNoMore is returned. The value of nIndex is 0 to (N-1), where N is the number of valid installed components in the system. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. When the value of nIndex exceeds the number of components in the system minus 1, OMX_ErrorNoMore will be returned. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum( OMX_OUT OMX_STRING cComponentName, OMX_IN OMX_U32 nNameLength, OMX_IN OMX_U32 nIndex); /** The OMX_GetHandle method will locate the component specified by the component name given, load that component into memory and then invoke the component's methods to create an instance of the component. The core should return from this call within 20 msec. @param [out] pHandle pointer to an OMX_HANDLETYPE pointer to be filled in by this method. @param [in] cComponentName pointer to a null terminated string with the component name. The names of the components are strings less than 127 bytes in length plus the trailing null for a maximum size of 128 bytes. An example of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are assigned by the vendor, but shall start with "OMX." and then have the Vendor designation next. @param [in] pAppData pointer to an application defined value that will be returned during callbacks so that the application can identify the source of the callback. @param [in] pCallBacks pointer to a OMX_CALLBACKTYPE structure that will be passed to the component to initialize it with. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle( OMX_OUT OMX_HANDLETYPE* pHandle, OMX_IN OMX_STRING cComponentName, OMX_IN OMX_PTR pAppData, OMX_IN OMX_CALLBACKTYPE* pCallBacks); /** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle method. If the component reference count goes to zero, the component will be unloaded from memory. The core should return from this call within 20 msec when the component is in the OMX_StateLoaded state. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the GetHandle function. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle( OMX_IN OMX_HANDLETYPE hComponent); /** The OMX_SetupTunnel method will handle the necessary calls to the components to setup the specified tunnel the two components. NOTE: This is an actual method (not a #define macro). This method will make calls into the component ComponentTunnelRequest method to do the actual tunnel connection. The ComponentTunnelRequest method on both components will be called. This method shall not be called unless the component is in the OMX_StateLoaded state except when the ports used for the tunnel are disabled. In this case, the component may be in the OMX_StateExecuting, OMX_StatePause, or OMX_StateIdle states. The core should return from this call within 20 msec. @param [in] hOutput Handle of the component to be accessed. Also this is the handle of the component whose port, specified in the nPortOutput parameter will be used the source for the tunnel. This is the component handle returned by the call to the OMX_GetHandle function. There is a requirement that hOutput be the source for the data when tunelling (i.e. nPortOutput is an output port). If 0x0, the component specified in hInput will have it's port specified in nPortInput setup for communication with the application / IL client. @param [in] nPortOutput nPortOutput is used to select the source port on component to be used in the tunnel. @param [in] hInput This is the component to setup the tunnel with. This is the handle of the component whose port, specified in the nPortInput parameter will be used the destination for the tunnel. This is the component handle returned by the call to the OMX_GetHandle function. There is a requirement that hInput be the destination for the data when tunelling (i.e. nPortInut is an input port). If 0x0, the component specified in hOutput will have it's port specified in nPortPOutput setup for communication with the application / IL client. @param [in] nPortInput nPortInput is used to select the destination port on component to be used in the tunnel. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. When OMX_ErrorNotImplemented is returned, one or both components is a non-interop component and does not support tunneling. On failure, the ports of both components are setup for communication with the application / IL Client. @ingroup core tun */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel( OMX_IN OMX_HANDLETYPE hOutput, OMX_IN OMX_U32 nPortOutput, OMX_IN OMX_HANDLETYPE hInput, OMX_IN OMX_U32 nPortInput); /** @ingroup cp */ OMX_API OMX_ERRORTYPE OMX_GetContentPipe( OMX_OUT OMX_HANDLETYPE *hPipe, OMX_IN OMX_STRING szURI); /** The OMX_GetComponentsOfRole method will return the number of components that support the given role and (if the compNames field is non-NULL) the names of those components. The call will fail if an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the client should: * first call this function with the compNames field NULL to determine the number of component names * second call this function with the compNames field pointing to an array of names allocated according to the number returned by the first call. The core should return from this call within 5 msec. @param [in] role This is generic standard component name consisting only of component class name and the type within that class (e.g. 'audio_decoder.aac'). @param [inout] pNumComps This is used both as input and output. If compNames is NULL, the input is ignored and the output specifies how many components support the given role. If compNames is not NULL, on input it bounds the size of the input structure and on output, it specifies the number of components string names listed within the compNames parameter. @param [inout] compNames If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts a list of the names of all physical components that implement the specified standard component name. Each name is NULL terminated. numComps indicates the number of names. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( OMX_IN OMX_STRING role, OMX_INOUT OMX_U32 *pNumComps, OMX_INOUT OMX_U8 **compNames); /** The OMX_GetRolesOfComponent method will return the number of roles supported by the given component and (if the roles field is non-NULL) the names of those roles. The call will fail if an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the client should: * first call this function with the roles field NULL to determine the number of role names * second call this function with the roles field pointing to an array of names allocated according to the number returned by the first call. The core should return from this call within 5 msec. @param [in] compName This is the name of the component being queried about. @param [inout] pNumRoles This is used both as input and output. If roles is NULL, the input is ignored and the output specifies how many roles the component supports. If compNames is not NULL, on input it bounds the size of the input structure and on output, it specifies the number of roles string names listed within the roles parameter. @param [out] roles If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts a list of the names of all standard components roles implemented on the specified component name. numComps indicates the number of names. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent ( OMX_IN OMX_STRING compName, OMX_INOUT OMX_U32 *pNumRoles, OMX_OUT OMX_U8 **roles); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/IL/OMX_ILCS.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // OpenMAX IL - ILCS specific types #ifndef OMX_ILCS_h #define OMX_ILCS_h typedef struct OMX_PARAM_PORTSUMMARYTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nNumPorts; /**< Total number of ports */ OMX_U32 reqSet; /**< Which set of ports is details below, portIndex[0] is port reqSet*32 */ OMX_U32 portDir; /**< Bitfield, 1 if output port, 0 if input port, max 256 ports */ OMX_U32 portIndex[32]; /**< Port Indexes */ } OMX_PARAM_PORTSUMMARYTYPE; typedef struct OMX_PARAM_MARKCOMPARISONTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_PTR mark; /**< Pointer to be used for mark comparisons */ } OMX_PARAM_MARKCOMPARISONTYPE; typedef struct OMX_PARAM_BRCMRECURSIONUNSAFETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_S32 (*pRecursionUnsafe)(OMX_PTR param); OMX_PTR param; } OMX_PARAM_BRCMRECURSIONUNSAFETYPE; typedef struct OMX_PARAM_TUNNELSTATUSTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port being queried */ OMX_U32 nIndex; /**< Query the nIndex'th port and fill in nPortIndex */ OMX_BOOL bUseIndex; /**< If OMX_TRUE read nIndex, otherwise read nPortIndex */ OMX_PTR hTunneledComponent; /**< Component currently tunnelling with */ OMX_U32 nTunneledPort; /**< Port on tunnelled component */ } OMX_PARAM_TUNNELSTATUSTYPE; #endif ================================================ FILE: Libraries/Core/RPi/Headers/IL/OMX_IVCommon.h ================================================ /** * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** * @file OMX_IVCommon.h - OpenMax IL version 1.1.2 * The structures needed by Video and Image components to exchange * parameters and configuration data with the components. */ #ifndef OMX_IVCommon_h #define OMX_IVCommon_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Each OMX header must include all required header files to allow the header * to compile without errors. The includes below are required for this header * file to compile successfully */ #include "OMX_Core.h" /** @defgroup iv OpenMAX IL Imaging and Video Domain * Common structures for OpenMAX IL Imaging and Video domains * @{ */ /** * Enumeration defining possible uncompressed image/video formats. * * ENUMS: * Unused : Placeholder value when format is N/A * Monochrome : black and white * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0 * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0 * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0 * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0 * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0 * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0 * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0 * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0 * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0 * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0 * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0 * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0 * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0 * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0 * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0 * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally * YUV411PackedPlanar : packed per payload in planar slices * YUV420Planar : Three arrays Y,U,V. * YUV420PackedPlanar : packed per payload in planar slices * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V * YUV422Planar : Three arrays Y,U,V. * YUV422PackedPlanar : packed per payload in planar slices * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr) * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb) * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY) * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY) * YUV444Interleaved : Each pixel contains equal parts YUV * RawBayer8bit : SMIA camera output format * RawBayer10bit : SMIA camera output format * RawBayer8bitcompressed : SMIA camera output format Vendor extensions * 32bitABGR888 : Alpha 31:24, Blue 23:16, Green 15:8, Red 7:0 */ typedef enum OMX_COLOR_FORMATTYPE { OMX_COLOR_FormatUnused, OMX_COLOR_FormatMonochrome, OMX_COLOR_Format8bitRGB332, OMX_COLOR_Format12bitRGB444, OMX_COLOR_Format16bitARGB4444, OMX_COLOR_Format16bitARGB1555, OMX_COLOR_Format16bitRGB565, OMX_COLOR_Format16bitBGR565, OMX_COLOR_Format18bitRGB666, OMX_COLOR_Format18bitARGB1665, OMX_COLOR_Format19bitARGB1666, OMX_COLOR_Format24bitRGB888, OMX_COLOR_Format24bitBGR888, OMX_COLOR_Format24bitARGB1887, OMX_COLOR_Format25bitARGB1888, OMX_COLOR_Format32bitBGRA8888, OMX_COLOR_Format32bitARGB8888, OMX_COLOR_FormatYUV411Planar, OMX_COLOR_FormatYUV411PackedPlanar, OMX_COLOR_FormatYUV420Planar, OMX_COLOR_FormatYUV420PackedPlanar, OMX_COLOR_FormatYUV420SemiPlanar, OMX_COLOR_FormatYUV422Planar, OMX_COLOR_FormatYUV422PackedPlanar, OMX_COLOR_FormatYUV422SemiPlanar, OMX_COLOR_FormatYCbYCr, OMX_COLOR_FormatYCrYCb, OMX_COLOR_FormatCbYCrY, OMX_COLOR_FormatCrYCbY, OMX_COLOR_FormatYUV444Interleaved, OMX_COLOR_FormatRawBayer8bit, OMX_COLOR_FormatRawBayer10bit, OMX_COLOR_FormatRawBayer8bitcompressed, OMX_COLOR_FormatL2, OMX_COLOR_FormatL4, OMX_COLOR_FormatL8, OMX_COLOR_FormatL16, OMX_COLOR_FormatL24, OMX_COLOR_FormatL32, OMX_COLOR_FormatYUV420PackedSemiPlanar, OMX_COLOR_FormatYUV422PackedSemiPlanar, OMX_COLOR_Format18BitBGR666, OMX_COLOR_Format24BitARGB6666, OMX_COLOR_Format24BitABGR6666, OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_COLOR_Format32bitABGR8888, OMX_COLOR_Format8bitPalette, OMX_COLOR_FormatYUVUV128, OMX_COLOR_FormatRawBayer12bit, OMX_COLOR_FormatBRCMEGL, OMX_COLOR_FormatBRCMOpaque, OMX_COLOR_FormatYVU420PackedPlanar, OMX_COLOR_FormatYVU420PackedSemiPlanar, OMX_COLOR_FormatRawBayer16bit, OMX_COLOR_FormatMax = 0x7FFFFFFF } OMX_COLOR_FORMATTYPE; /** * Defines the matrix for conversion from RGB to YUV or vice versa. * iColorMatrix should be initialized with the fixed point values * used in converting between formats. */ typedef struct OMX_CONFIG_COLORCONVERSIONTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */ OMX_U32 nPortIndex; /**< Port that this struct applies to */ OMX_S32 xColorMatrix[3][3]; /**< Stored in signed Q16 format */ OMX_S32 xColorOffset[4]; /**< Stored in signed Q16 format */ }OMX_CONFIG_COLORCONVERSIONTYPE; /** * Structure defining percent to scale each frame dimension. For example: * To make the width 50% larger, use fWidth = 1.5 and to make the width * 1/2 the original size, use fWidth = 0.5 */ typedef struct OMX_CONFIG_SCALEFACTORTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */ OMX_U32 nPortIndex; /**< Port that this struct applies to */ OMX_S32 xWidth; /**< Fixed point value stored as Q16 */ OMX_S32 xHeight; /**< Fixed point value stored as Q16 */ }OMX_CONFIG_SCALEFACTORTYPE; /** * Enumeration of possible image filter types */ typedef enum OMX_IMAGEFILTERTYPE { OMX_ImageFilterNone, OMX_ImageFilterNoise, OMX_ImageFilterEmboss, OMX_ImageFilterNegative, OMX_ImageFilterSketch, OMX_ImageFilterOilPaint, OMX_ImageFilterHatch, OMX_ImageFilterGpen, OMX_ImageFilterAntialias, OMX_ImageFilterDeRing, OMX_ImageFilterSolarize, OMX_ImageFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ImageFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ /* Broadcom specific image filters */ OMX_ImageFilterWatercolor, OMX_ImageFilterPastel, OMX_ImageFilterSharpen, OMX_ImageFilterFilm, OMX_ImageFilterBlur, OMX_ImageFilterSaturation, OMX_ImageFilterDeInterlaceLineDouble, OMX_ImageFilterDeInterlaceAdvanced, OMX_ImageFilterColourSwap, OMX_ImageFilterWashedOut, OMX_ImageFilterColourPoint, OMX_ImageFilterPosterise, OMX_ImageFilterColourBalance, OMX_ImageFilterCartoon, OMX_ImageFilterAnaglyph, OMX_ImageFilterDeInterlaceFast, OMX_ImageFilterMax = 0x7FFFFFFF } OMX_IMAGEFILTERTYPE; typedef enum OMX_IMAGEFILTERANAGLYPHTYPE { OMX_ImageFilterAnaglyphNone, OMX_ImageFilterAnaglyphSBStoRedCyan, OMX_ImageFilterAnaglyphSBStoCyanRed, OMX_ImageFilterAnaglyphSBStoGreenMagenta, OMX_ImageFilterAnaglyphSBStoMagentaGreen, OMX_ImageFilterAnaglyphTABtoRedCyan, OMX_ImageFilterAnaglyphTABtoCyanRed, OMX_ImageFilterAnaglyphTABtoGreenMagenta, OMX_ImageFilterAnaglyphTABtoMagentaGreen, } OMX_IMAGEFILTERANAGLYPHTYPE; /** * Image filter configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eImageFilter : Image filter type enumeration */ typedef struct OMX_CONFIG_IMAGEFILTERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGEFILTERTYPE eImageFilter; } OMX_CONFIG_IMAGEFILTERTYPE; /** * Customized U and V for color enhancement * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bColorEnhancement : Enable/disable color enhancement * nCustomizedU : Practical values: 16-240, range: 0-255, value set for * U component * nCustomizedV : Practical values: 16-240, range: 0-255, value set for * V component */ typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bColorEnhancement; OMX_U8 nCustomizedU; OMX_U8 nCustomizedV; } OMX_CONFIG_COLORENHANCEMENTTYPE; /** * Define color key and color key mask * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nARGBColor : 32bit Alpha, Red, Green, Blue Color * nARGBMask : 32bit Mask for Alpha, Red, Green, Blue channels */ typedef struct OMX_CONFIG_COLORKEYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nARGBColor; OMX_U32 nARGBMask; } OMX_CONFIG_COLORKEYTYPE; /** * List of color blend types for pre/post processing * * ENUMS: * None : No color blending present * AlphaConstant : Function is (alpha_constant * src) + * (1 - alpha_constant) * dst) * AlphaPerPixel : Function is (alpha * src) + (1 - alpha) * dst) * Alternate : Function is alternating pixels from src and dst * And : Function is (src & dst) * Or : Function is (src | dst) * Invert : Function is ~src */ typedef enum OMX_COLORBLENDTYPE { OMX_ColorBlendNone, OMX_ColorBlendAlphaConstant, OMX_ColorBlendAlphaPerPixel, OMX_ColorBlendAlternate, OMX_ColorBlendAnd, OMX_ColorBlendOr, OMX_ColorBlendInvert, OMX_ColorBlendKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ColorBlendVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_ColorBlendMax = 0x7FFFFFFF } OMX_COLORBLENDTYPE; /** * Color blend configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nRGBAlphaConstant : Constant global alpha values when global alpha is used * eColorBlend : Color blend type enumeration */ typedef struct OMX_CONFIG_COLORBLENDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nRGBAlphaConstant; OMX_COLORBLENDTYPE eColorBlend; } OMX_CONFIG_COLORBLENDTYPE; /** * Hold frame dimension * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nWidth : Frame width in pixels * nHeight : Frame height in pixels */ typedef struct OMX_FRAMESIZETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nWidth; OMX_U32 nHeight; } OMX_FRAMESIZETYPE; /** * Rotation configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nRotation : +/- integer rotation value */ typedef struct OMX_CONFIG_ROTATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nRotation; } OMX_CONFIG_ROTATIONTYPE; /** * Possible mirroring directions for pre/post processing * * ENUMS: * None : No mirroring * Vertical : Vertical mirroring, flip on X axis * Horizontal : Horizontal mirroring, flip on Y axis * Both : Both vertical and horizontal mirroring */ typedef enum OMX_MIRRORTYPE { OMX_MirrorNone = 0, OMX_MirrorVertical, OMX_MirrorHorizontal, OMX_MirrorBoth, OMX_MirrorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MirrorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MirrorMax = 0x7FFFFFFF } OMX_MIRRORTYPE; /** * Mirroring configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eMirror : Mirror type enumeration */ typedef struct OMX_CONFIG_MIRRORTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_MIRRORTYPE eMirror; } OMX_CONFIG_MIRRORTYPE; /** * Position information only * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nX : X coordinate for the point * nY : Y coordinate for the point */ typedef struct OMX_CONFIG_POINTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nX; OMX_S32 nY; } OMX_CONFIG_POINTTYPE; /** * Frame size plus position * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nLeft : X Coordinate of the top left corner of the rectangle * nTop : Y Coordinate of the top left corner of the rectangle * nWidth : Width of the rectangle * nHeight : Height of the rectangle */ typedef struct OMX_CONFIG_RECTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nLeft; OMX_S32 nTop; OMX_U32 nWidth; OMX_U32 nHeight; } OMX_CONFIG_RECTTYPE; /** * Deblocking state; it is required to be set up before starting the codec * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bDeblocking : Enable/disable deblocking mode */ typedef struct OMX_PARAM_DEBLOCKINGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bDeblocking; } OMX_PARAM_DEBLOCKINGTYPE; /** * Stabilization state * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bStab : Enable/disable frame stabilization state */ typedef struct OMX_CONFIG_FRAMESTABTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bStab; } OMX_CONFIG_FRAMESTABTYPE; /** * White Balance control type * * STRUCT MEMBERS: * SunLight : Referenced in JSR-234 * Flash : Optimal for device's integrated flash */ typedef enum OMX_WHITEBALCONTROLTYPE { OMX_WhiteBalControlOff = 0, OMX_WhiteBalControlAuto, OMX_WhiteBalControlSunLight, OMX_WhiteBalControlCloudy, OMX_WhiteBalControlShade, OMX_WhiteBalControlTungsten, OMX_WhiteBalControlFluorescent, OMX_WhiteBalControlIncandescent, OMX_WhiteBalControlFlash, OMX_WhiteBalControlHorizon, OMX_WhiteBalControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_WhiteBalControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_WhiteBalControlMax = 0x7FFFFFFF } OMX_WHITEBALCONTROLTYPE; /** * White Balance control configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eWhiteBalControl : White balance enumeration */ typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_WHITEBALCONTROLTYPE eWhiteBalControl; } OMX_CONFIG_WHITEBALCONTROLTYPE; /** * Exposure control type */ typedef enum OMX_EXPOSURECONTROLTYPE { OMX_ExposureControlOff = 0, OMX_ExposureControlAuto, OMX_ExposureControlNight, OMX_ExposureControlBackLight, OMX_ExposureControlSpotLight, OMX_ExposureControlSports, OMX_ExposureControlSnow, OMX_ExposureControlBeach, OMX_ExposureControlLargeAperture, OMX_ExposureControlSmallAperture, OMX_ExposureControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ExposureControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_ExposureControlVeryLong, OMX_ExposureControlFixedFps, OMX_ExposureControlNightWithPreview, OMX_ExposureControlAntishake, OMX_ExposureControlFireworks, OMX_ExposureControlMax = 0x7FFFFFFF } OMX_EXPOSURECONTROLTYPE; /** * White Balance control configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eExposureControl : Exposure control enumeration */ typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_EXPOSURECONTROLTYPE eExposureControl; } OMX_CONFIG_EXPOSURECONTROLTYPE; /** * Defines sensor supported mode. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nFrameRate : Single shot mode is indicated by a 0 * bOneShot : Enable for single shot, disable for streaming * sFrameSize : Framesize */ typedef struct OMX_PARAM_SENSORMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nFrameRate; OMX_BOOL bOneShot; OMX_FRAMESIZETYPE sFrameSize; } OMX_PARAM_SENSORMODETYPE; /** * Defines contrast level * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nContrast : Values allowed for contrast -100 to 100, zero means no change */ typedef struct OMX_CONFIG_CONTRASTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nContrast; } OMX_CONFIG_CONTRASTTYPE; /** * Defines brightness level * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nBrightness : 0-100% */ typedef struct OMX_CONFIG_BRIGHTNESSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nBrightness; } OMX_CONFIG_BRIGHTNESSTYPE; /** * Defines backlight level configuration for a video sink, e.g. LCD panel * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nBacklight : Values allowed for backlight 0-100% * nTimeout : Number of milliseconds before backlight automatically turns * off. A value of 0x0 disables backight timeout */ typedef struct OMX_CONFIG_BACKLIGHTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nBacklight; OMX_U32 nTimeout; } OMX_CONFIG_BACKLIGHTTYPE; /** * Defines setting for Gamma * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nGamma : Values allowed for gamma -100 to 100, zero means no change */ typedef struct OMX_CONFIG_GAMMATYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nGamma; } OMX_CONFIG_GAMMATYPE; /** * Define for setting saturation * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nSaturation : Values allowed for saturation -100 to 100, zero means * no change */ typedef struct OMX_CONFIG_SATURATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nSaturation; } OMX_CONFIG_SATURATIONTYPE; /** * Define for setting Lightness * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nLightness : Values allowed for lightness -100 to 100, zero means no * change */ typedef struct OMX_CONFIG_LIGHTNESSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nLightness; } OMX_CONFIG_LIGHTNESSTYPE; /** * Plane blend configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Index of input port associated with the plane. * nDepth : Depth of the plane in relation to the screen. Higher * numbered depths are "behind" lower number depths. * This number defaults to the Port Index number. * nAlpha : Transparency blending component for the entire plane. * See blending modes for more detail. */ typedef struct OMX_CONFIG_PLANEBLENDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nDepth; OMX_U32 nAlpha; } OMX_CONFIG_PLANEBLENDTYPE; /** * Define interlace type * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bEnable : Enable control variable for this functionality * (see below) * nInterleavePortIndex : Index of input or output port associated with * the interleaved plane. * pPlanarPortIndexes[4] : Index of input or output planar ports. */ typedef struct OMX_PARAM_INTERLEAVETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnable; OMX_U32 nInterleavePortIndex; } OMX_PARAM_INTERLEAVETYPE; /** * Defines the picture effect used for an input picture */ typedef enum OMX_TRANSITIONEFFECTTYPE { OMX_EffectNone, OMX_EffectFadeFromBlack, OMX_EffectFadeToBlack, OMX_EffectUnspecifiedThroughConstantColor, OMX_EffectDissolve, OMX_EffectWipe, OMX_EffectUnspecifiedMixOfTwoScenes, OMX_EffectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_EffectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_EffectReverseUnspecifiedMixOfTwoScenes, #ifndef __VIDEOCORE4__ OMX_EffectDiagonalWipe, OMX_EffectDiagonalWipeRotate, OMX_EffectEllipticalWipe, OMX_EffectEllipticalWipeRotate, OMX_EffectInverseEllipticalWipe, OMX_EffectInverseEllipticalWipeRotate, OMX_EffectGlassWipe, OMX_EffectGlassWipeRotate, OMX_EffectWavyWipe, OMX_EffectWavyWipeRotate, OMX_EffectMunchingSquares, OMX_EffectStripeWipe, OMX_EffectStripeWipeRotate, OMX_EffectRotozoomUnmatched, OMX_EffectRotozoomMatched, OMX_EffectRotozoomGentle, #endif OMX_EffectMunchRandom, OMX_EffectMunchVRandom, OMX_EffectMunchHRandom, OMX_EffectMunchWipe, OMX_EffectMunchMunch, OMX_EffectMunchStripe, OMX_EffectFadeRandom, OMX_EffectFadeVRandom, OMX_EffectFadeHRandom, OMX_EffectFadeWipe, OMX_EffectFadeMunch, OMX_EffectFadeStripe, OMX_EffectColourBlockRandom, OMX_EffectColourBlockVRandom, OMX_EffectColourBlockHRandom, OMX_EffectColourBlockWipe, OMX_EffectColourBlockMunch, OMX_EffectColourBlockStripe, OMX_EffectColourBlock2Random, OMX_EffectColourBlock2VRandom, OMX_EffectColourBlock2HRandom, OMX_EffectColourBlock2Wipe, OMX_EffectColourBlock2Munch, OMX_EffectColourBlock2Stripe, OMX_EffectShadeRandom, OMX_EffectShadeVRandom, OMX_EffectShadeHRandom, OMX_EffectShadeWipe, OMX_EffectShadeMunch, OMX_EffectShadeStripe, OMX_EffectBitmaskRandom, OMX_EffectBitmaskVRandom, OMX_EffectBitmaskHRandom, OMX_EffectBitmaskWipe, OMX_EffectBitmaskMunch, OMX_EffectBitmaskStripe, OMX_EffectBitmask2Random, OMX_EffectBitmask2VRandom, OMX_EffectBitmask2HRandom, OMX_EffectBitmask2Wipe, OMX_EffectBitmask2Munch, OMX_EffectBitmask2Stripe, OMX_EffectBitmask2ColourRandom, OMX_EffectBitmask2ColourVRandom, OMX_EffectBitmask2ColourHRandom, OMX_EffectBitmask2ColourWipe, OMX_EffectBitmask2ColourMunch, OMX_EffectBitmask2ColourStripe, OMX_EffectPushRight, OMX_EffectPushLeft, OMX_EffectPushDown, OMX_EffectPushUp, OMX_EffectCoverRight, OMX_EffectCoverLeft, OMX_EffectCoverDown, OMX_EffectCoverUp, OMX_EffectRevealRight, OMX_EffectRevealLeft, OMX_EffectRevealDown, OMX_EffectRevealUp, OMX_EffectWipeRight, OMX_EffectWipeLeft, OMX_EffectWipeDown, OMX_EffectWipeUp, OMX_EffectSpeckle, OMX_EffectCircle, OMX_EffectSpiral, OMX_EffectDiamond, OMX_EffectVert, OMX_EffectPlus, OMX_EffectClock, OMX_EffectPlasma, OMX_EffectDisplace, OMX_EffectGenie, OMX_EffectSide, OMX_EffectMaze, OMX_EffectRipple, OMX_EffectStar, OMX_EffectAlpha, OMX_EffectIntense, OMX_EffectIntenseU, OMX_EffectIntenseV, OMX_EffectInverseIntense, OMX_EffectInverseIntenseU, OMX_EffectInverseIntenseV, OMX_EffectPageTurn, OMX_EffectFlipPlaneDown, OMX_EffectFlipPlaneDownMid, OMX_EffectFlipPlaneDownHigh, OMX_EffectFlipPlaneLeft, OMX_EffectFlipPlaneLeftMid, OMX_EffectFlipPlaneLeftHigh, OMX_EffectFlipCubeDown, OMX_EffectFlipCubeDownMid, OMX_EffectFlipCubeDownHigh, OMX_EffectFlipCubeLeft, OMX_EffectFlipCubeLeftMid, OMX_EffectFlipCubeLeftHigh, OMX_EffectMax = 0x7FFFFFFF } OMX_TRANSITIONEFFECTTYPE; /** * Structure used to configure current transition effect * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eEffect : Effect to enable */ typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_TRANSITIONEFFECTTYPE eEffect; } OMX_CONFIG_TRANSITIONEFFECTTYPE; /** * Defines possible data unit types for encoded video data. The data unit * types are used both for encoded video input for playback as well as * encoded video output from recording. */ typedef enum OMX_DATAUNITTYPE { OMX_DataUnitCodedPicture, OMX_DataUnitVideoSegment, OMX_DataUnitSeveralSegments, OMX_DataUnitArbitraryStreamSection, OMX_DataUnitKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_DataUnitVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_DataUnitMax = 0x7FFFFFFF } OMX_DATAUNITTYPE; /** * Defines possible encapsulation types for coded video data unit. The * encapsulation information is used both for encoded video input for * playback as well as encoded video output from recording. */ typedef enum OMX_DATAUNITENCAPSULATIONTYPE { OMX_DataEncapsulationElementaryStream, OMX_DataEncapsulationGenericPayload, OMX_DataEncapsulationRtpPayload, OMX_DataEncapsulationKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_DataEncapsulationVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_DataEncapsulationMax = 0x7FFFFFFF } OMX_DATAUNITENCAPSULATIONTYPE; /** * Structure used to configure the type of being decoded/encoded */ typedef struct OMX_PARAM_DATAUNITTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_DATAUNITTYPE eUnitType; OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType; } OMX_PARAM_DATAUNITTYPE; /** * Defines dither types */ typedef enum OMX_DITHERTYPE { OMX_DitherNone, OMX_DitherOrdered, OMX_DitherErrorDiffusion, OMX_DitherOther, OMX_DitherKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_DitherVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_DitherMax = 0x7FFFFFFF } OMX_DITHERTYPE; /** * Structure used to configure current type of dithering */ typedef struct OMX_CONFIG_DITHERTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_DITHERTYPE eDither; /**< Type of dithering to use */ } OMX_CONFIG_DITHERTYPE; typedef struct OMX_CONFIG_CAPTUREMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_BOOL bContinuous; /**< If true then ignore frame rate and emit capture * data as fast as possible (otherwise obey port's frame rate). */ OMX_BOOL bFrameLimited; /**< If true then terminate capture after the port emits the * specified number of frames (otherwise the port does not * terminate the capture until instructed to do so by the client). * Even if set, the client may manually terminate the capture prior * to reaching the limit. */ OMX_U32 nFrameLimit; /**< Limit on number of frames emitted during a capture (only * valid if bFrameLimited is set). */ } OMX_CONFIG_CAPTUREMODETYPE; typedef enum OMX_METERINGTYPE { OMX_MeteringModeAverage, /**< Center-weighted average metering. */ OMX_MeteringModeSpot, /**< Spot (partial) metering. */ OMX_MeteringModeMatrix, /**< Matrix or evaluative metering. */ OMX_MeteringKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MeteringVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MeteringModeBacklit, OMX_EVModeMax = 0x7fffffff } OMX_METERINGTYPE; typedef struct OMX_CONFIG_EXPOSUREVALUETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_METERINGTYPE eMetering; OMX_S32 xEVCompensation; /**< Fixed point value stored as Q16 */ OMX_U32 nApertureFNumber; /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */ OMX_BOOL bAutoAperture; /**< Whether aperture number is defined automatically */ OMX_U32 nShutterSpeedMsec; /**< Shutterspeed in milliseconds */ OMX_BOOL bAutoShutterSpeed; /**< Whether shutter speed is defined automatically */ OMX_U32 nSensitivity; /**< e.g. nSensitivity = 100 implies "ISO 100" */ OMX_BOOL bAutoSensitivity; /**< Whether sensitivity is defined automatically */ } OMX_CONFIG_EXPOSUREVALUETYPE; /** * Focus region configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bCenter : Use center region as focus region of interest * bLeft : Use left region as focus region of interest * bRight : Use right region as focus region of interest * bTop : Use top region as focus region of interest * bBottom : Use bottom region as focus region of interest * bTopLeft : Use top left region as focus region of interest * bTopRight : Use top right region as focus region of interest * bBottomLeft : Use bottom left region as focus region of interest * bBottomRight : Use bottom right region as focus region of interest */ typedef struct OMX_CONFIG_FOCUSREGIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bCenter; OMX_BOOL bLeft; OMX_BOOL bRight; OMX_BOOL bTop; OMX_BOOL bBottom; OMX_BOOL bTopLeft; OMX_BOOL bTopRight; OMX_BOOL bBottomLeft; OMX_BOOL bBottomRight; } OMX_CONFIG_FOCUSREGIONTYPE; /** * Focus Status type */ typedef enum OMX_FOCUSSTATUSTYPE { OMX_FocusStatusOff = 0, OMX_FocusStatusRequest, OMX_FocusStatusReached, OMX_FocusStatusUnableToReach, OMX_FocusStatusLost, OMX_FocusStatusKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_FocusStatusVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_FocusStatusCafWatching, OMX_FocusStatusCafSceneChanged, OMX_FocusStatusMax = 0x7FFFFFFF } OMX_FOCUSSTATUSTYPE; /** * Focus status configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFocusStatus : Specifies the focus status * bCenterStatus : Use center region as focus region of interest * bLeftStatus : Use left region as focus region of interest * bRightStatus : Use right region as focus region of interest * bTopStatus : Use top region as focus region of interest * bBottomStatus : Use bottom region as focus region of interest * bTopLeftStatus : Use top left region as focus region of interest * bTopRightStatus : Use top right region as focus region of interest * bBottomLeftStatus : Use bottom left region as focus region of interest * bBottomRightStatus : Use bottom right region as focus region of interest */ typedef struct OMX_PARAM_FOCUSSTATUSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_FOCUSSTATUSTYPE eFocusStatus; OMX_BOOL bCenterStatus; OMX_BOOL bLeftStatus; OMX_BOOL bRightStatus; OMX_BOOL bTopStatus; OMX_BOOL bBottomStatus; OMX_BOOL bTopLeftStatus; OMX_BOOL bTopRightStatus; OMX_BOOL bBottomLeftStatus; OMX_BOOL bBottomRightStatus; } OMX_PARAM_FOCUSSTATUSTYPE; /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/IL/OMX_Image.h ================================================ /** * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * @file OMX_Image.h - OpenMax IL version 1.1.2 * The structures needed by Image components to exchange parameters and * configuration data with the components. */ #ifndef OMX_Image_h #define OMX_Image_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_IVCommon.h" /** @defgroup imaging OpenMAX IL Imaging Domain * @ingroup iv * Structures for OpenMAX IL Imaging domain * @{ */ /** * Enumeration used to define the possible image compression coding. */ typedef enum OMX_IMAGE_CODINGTYPE { OMX_IMAGE_CodingUnused, /**< Value when format is N/A */ OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */ OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */ OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */ OMX_IMAGE_CodingEXIF, /**< EXIF image format */ OMX_IMAGE_CodingTIFF, /**< TIFF image format */ OMX_IMAGE_CodingGIF, /**< Graphics image format */ OMX_IMAGE_CodingPNG, /**< PNG image format */ OMX_IMAGE_CodingLZW, /**< LZW image format */ OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */ OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_CodingTGA, OMX_IMAGE_CodingPPM, OMX_IMAGE_CodingMax = 0x7FFFFFFF } OMX_IMAGE_CODINGTYPE; /** * Data structure used to define an image path. The number of image paths * for input and output will vary by type of the image component. * * Input (aka Source) : Zero Inputs, one Output, * Splitter : One Input, 2 or more Outputs, * Processing Element : One Input, one output, * Mixer : 2 or more inputs, one output, * Output (aka Sink) : One Input, zero outputs. * * The PortDefinition structure is used to define all of the parameters * necessary for the compliant component to setup an input or an output * image path. If additional vendor specific data is required, it should * be transmitted to the component using the CustomCommand function. * Compliant components will prepopulate this structure with optimal * values during the OMX_GetParameter() command. * * STRUCT MEMBERS: * cMIMEType : MIME type of data for the port * pNativeRender : Platform specific reference for a display if a * sync, otherwise this field is 0 * nFrameWidth : Width of frame to be used on port if * uncompressed format is used. Use 0 for * unknown, don't care or variable * nFrameHeight : Height of frame to be used on port if * uncompressed format is used. Use 0 for * unknown, don't care or variable * nStride : Number of bytes per span of an image (i.e. * indicates the number of bytes to get from * span N to span N+1, where negative stride * indicates the image is bottom up * nSliceHeight : Height used when encoding in slices * bFlagErrorConcealment : Turns on error concealment if it is supported by * the OMX component * eCompressionFormat : Compression format used in this instance of * the component. When OMX_IMAGE_CodingUnused is * specified, eColorFormat is valid * eColorFormat : Decompressed format used by this component * pNativeWindow : Platform specific reference for a window object if a * display sink , otherwise this field is 0x0. */ typedef struct OMX_IMAGE_PORTDEFINITIONTYPE { OMX_STRING cMIMEType; OMX_NATIVE_DEVICETYPE pNativeRender; OMX_U32 nFrameWidth; OMX_U32 nFrameHeight; OMX_S32 nStride; OMX_U32 nSliceHeight; OMX_BOOL bFlagErrorConcealment; OMX_IMAGE_CODINGTYPE eCompressionFormat; OMX_COLOR_FORMATTYPE eColorFormat; OMX_NATIVE_WINDOWTYPE pNativeWindow; } OMX_IMAGE_PORTDEFINITIONTYPE; /** * Port format parameter. This structure is used to enumerate the various * data input/output format supported by the port. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Indicates which port to set * nIndex : Indicates the enumeration index for the format from * 0x0 to N-1 * eCompressionFormat : Compression format used in this instance of the * component. When OMX_IMAGE_CodingUnused is specified, * eColorFormat is valid * eColorFormat : Decompressed format used by this component */ typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIndex; OMX_IMAGE_CODINGTYPE eCompressionFormat; OMX_COLOR_FORMATTYPE eColorFormat; } OMX_IMAGE_PARAM_PORTFORMATTYPE; /** * Flash control type * * ENUMS * Torch : Flash forced constantly on */ typedef enum OMX_IMAGE_FLASHCONTROLTYPE { OMX_IMAGE_FlashControlOn = 0, OMX_IMAGE_FlashControlOff, OMX_IMAGE_FlashControlAuto, OMX_IMAGE_FlashControlRedEyeReduction, OMX_IMAGE_FlashControlFillin, OMX_IMAGE_FlashControlTorch, OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_FlashControlMax = 0x7FFFFFFF } OMX_IMAGE_FLASHCONTROLTYPE; /** * Flash control configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFlashControl : Flash control type */ typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGE_FLASHCONTROLTYPE eFlashControl; } OMX_IMAGE_PARAM_FLASHCONTROLTYPE; /** * Focus control type */ typedef enum OMX_IMAGE_FOCUSCONTROLTYPE { OMX_IMAGE_FocusControlOn = 0, OMX_IMAGE_FocusControlOff, OMX_IMAGE_FocusControlAuto, OMX_IMAGE_FocusControlAutoLock, OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_FocusControlHyperfocal, /* Focus at the hyperfocal point of the lens. */ OMX_IMAGE_FocusControlAutoMacro, /* CF over a macro range (eg 0-50cm) */ OMX_IMAGE_FocusControlAutoInfinity, /* CF over distant range (eg 50cm to infinity) */ OMX_IMAGE_FocusControlAutoLockMacro, /* AF over a macro range (eg 0-50cm) */ OMX_IMAGE_FocusControlAutoLockInfinity, /* AF over distant range (eg 50cm to infinity) */ OMX_IMAGE_FocusControlNearFixed, /* Focus at a fixed near focus point - (50cm-1m) */ OMX_IMAGE_FocusControlAutoNear, /* CF over a near range (eg 0-200cm) */ OMX_IMAGE_FocusControlAutoLockNear, /* AF over a near range (eg 0-200cm) */ OMX_IMAGE_FocusControlInfinityFixed, /* Focus at infinity */ OMX_IMAGE_FocusControlMacroFixed, /* Focus at a macro distance */ OMX_IMAGE_FocusControlAutoFast, /* CF over a full range with fast response */ OMX_IMAGE_FocusControlAutoMacroFast, /* CF over a macro range (eg 0-50cm) with fast response */ OMX_IMAGE_FocusControlAutoNearFast, /* CF over a near range (eg 0-200cm) */ OMX_IMAGE_FocusControlAutoInfinityFast, /* CF over distant range (eg 50cm to infinity) with fast response */ OMX_IMAGE_FocusControlCurrentFixed, /* Stop the lens at the current position */ OMX_IMAGE_FocusControlMax = 0x7FFFFFFF } OMX_IMAGE_FOCUSCONTROLTYPE; /** * Focus control configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFocusControl : Focus control * nFocusSteps : Focus can take on values from 0 mm to infinity. * Interest is only in number of steps over this range. * nFocusStepIndex : Current focus step index */ typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl; OMX_U32 nFocusSteps; OMX_U32 nFocusStepIndex; } OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE; /** * Q Factor for JPEG compression, which controls the tradeoff between image * quality and size. Q Factor provides a more simple means of controlling * JPEG compression quality, without directly programming Quantization * tables for chroma and luma * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1 * produces the smallest, worst quality images, and a factor * of 100 produces the largest, best quality images. A * typical default is 75 for small good quality images */ typedef struct OMX_IMAGE_PARAM_QFACTORTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nQFactor; } OMX_IMAGE_PARAM_QFACTORTYPE; /** * Quantization table type */ typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE { OMX_IMAGE_QuantizationTableLuma = 0, OMX_IMAGE_QuantizationTableChroma, OMX_IMAGE_QuantizationTableChromaCb, OMX_IMAGE_QuantizationTableChromaCr, OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF } OMX_IMAGE_QUANTIZATIONTABLETYPE; /** * JPEG quantization tables are used to determine DCT compression for * YUV data, as an alternative to specifying Q factor, providing exact * control of compression * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eQuantizationTable : Quantization table type * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored * in increasing columns then by rows of data (i.e. * row 1, ... row 8). Quantization values are in * the range 0-255 and stored in linear order * (i.e. the component will zig-zag the * quantization table data if required internally) */ typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable; OMX_U8 nQuantizationMatrix[64]; } OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE; /** * Huffman table type, the same Huffman table is applied for chroma and * luma component */ typedef enum OMX_IMAGE_HUFFMANTABLETYPE { OMX_IMAGE_HuffmanTableAC = 0, OMX_IMAGE_HuffmanTableDC, OMX_IMAGE_HuffmanTableACLuma, OMX_IMAGE_HuffmanTableACChroma, OMX_IMAGE_HuffmanTableDCLuma, OMX_IMAGE_HuffmanTableDCChroma, OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF } OMX_IMAGE_HUFFMANTABLETYPE; /** * JPEG Huffman table * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eHuffmanTable : Huffman table type * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each * possible length * nHuffmanTable[256] : 0-255, the size used for AC and DC * HuffmanTable are 16 and 162 */ typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable; OMX_U8 nNumberOfHuffmanCodeOfLength[16]; OMX_U8 nHuffmanTable[256]; }OMX_IMAGE_PARAM_HUFFMANTTABLETYPE; /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/IL/OMX_Index.h ================================================ /* * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** @file OMX_Index.h - OpenMax IL version 1.1.2 * The OMX_Index header file contains the definitions for both applications * and components . */ #ifndef OMX_Index_h #define OMX_Index_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_Types.h" /** The OMX_INDEXTYPE enumeration is used to select a structure when either * getting or setting parameters and/or configuration data. Each entry in * this enumeration maps to an OMX specified structure. When the * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods * are used, the second parameter will always be an entry from this enumeration * and the third entry will be the structure shown in the comments for the entry. * For example, if the application is initializing a cropping function, the * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter * and would send a pointer to an initialized OMX_RECTTYPE structure as the * third parameter. * * The enumeration entries named with the OMX_Config prefix are sent using * the OMX_SetConfig command and the enumeration entries named with the * OMX_PARAM_ prefix are sent using the OMX_SetParameter command. */ typedef enum OMX_INDEXTYPE { OMX_IndexComponentStartUnused = 0x01000000, OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */ OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */ OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */ OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */ OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */ OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */ OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */ OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */ OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */ OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */ OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */ OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */ OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */ OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */ OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */ OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */ OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */ OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */ OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */ OMX_IndexPortStartUnused = 0x02000000, OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */ OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */ OMX_IndexReservedStartUnused = 0x03000000, /* Audio parameters and configurations */ OMX_IndexAudioStartUnused = 0x04000000, OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */ OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */ OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */ OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */ OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */ OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */ OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */ OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */ OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */ OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */ OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */ OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */ OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */ OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */ OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */ OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */ OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */ OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */ OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */ OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */ OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */ OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */ OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */ OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */ OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */ OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */ OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */ OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */ OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */ OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */ OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */ OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */ OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */ OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */ OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */ OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */ OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */ OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */ OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */ OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */ OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */ OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */ OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */ OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */ OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */ OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */ OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */ /* Image specific parameters and configurations */ OMX_IndexImageStartUnused = 0x05000000, OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */ OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */ OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */ OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */ OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */ OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ /* Video specific parameters and configurations */ OMX_IndexVideoStartUnused = 0x06000000, OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */ OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */ OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */ OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */ OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */ OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */ OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */ OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */ OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */ OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */ OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */ OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */ OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */ OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */ OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */ OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */ OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */ OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */ OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */ OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */ OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */ OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */ /* Image & Video common Configurations */ OMX_IndexCommonStartUnused = 0x07000000, OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */ OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */ OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */ OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */ OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */ OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */ OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */ OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */ OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */ OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */ OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */ OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */ OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/ OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */ OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */ OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */ OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */ OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */ OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */ OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */ OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */ OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */ OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */ OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */ OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */ OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */ OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */ OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */ OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */ OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */ /* Reserved Configuration range */ OMX_IndexOtherStartUnused = 0x08000000, OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */ OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */ OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */ /* Reserved Time range */ OMX_IndexTimeStartUnused = 0x09000000, OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */ OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */ OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */ OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */ OMX_IndexConfigTimeClientStartTime, /** #define STDINT_H_AVAILABLE #endif /** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */ typedef unsigned char OMX_U8; /** OMX_S8 is an 8 bit signed quantity that is byte aligned */ typedef signed char OMX_S8; /** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */ typedef unsigned short OMX_U16; /** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */ typedef signed short OMX_S16; /** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */ #ifdef STDINT_H_AVAILABLE typedef uint32_t OMX_U32; #else typedef unsigned long OMX_U32; #endif /** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */ #ifdef STDINT_H_AVAILABLE typedef int32_t OMX_S32; #else typedef signed long OMX_S32; #endif /* Users with compilers that cannot accept the "long long" designation should define the OMX_SKIP64BIT macro. It should be noted that this may cause some components to fail to compile if the component was written to require 64 bit integral types. However, these components would NOT compile anyway since the compiler does not support the way the component was written. */ #ifndef OMX_SKIP64BIT #ifdef __SYMBIAN32__ /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ typedef unsigned long long OMX_U64; /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ typedef signed long long OMX_S64; #elif defined(WIN32) /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ typedef unsigned __int64 OMX_U64; /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ typedef signed __int64 OMX_S64; #else /* WIN32 */ /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ typedef unsigned long long OMX_U64; /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ typedef signed long long OMX_S64; #endif /* WIN32 */ #endif /** The OMX_BOOL type is intended to be used to represent a true or a false value when passing parameters to and from the OMX core and components. The OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary. */ typedef enum OMX_BOOL { OMX_FALSE = 0, OMX_TRUE = !OMX_FALSE, OMX_BOOL_MAX = 0x7FFFFFFF } OMX_BOOL; /** The OMX_PTR type is intended to be used to pass pointers between the OMX applications and the OMX Core and components. This is a 32 bit pointer and is aligned on a 32 bit boundary. */ typedef void* OMX_PTR; /** The OMX_STRING type is intended to be used to pass "C" type strings between the application and the core and component. The OMX_STRING type is a 32 bit pointer to a zero terminated string. The pointer is word aligned and the string is byte aligned. */ typedef char* OMX_STRING; /** The OMX_BYTE type is intended to be used to pass arrays of bytes such as buffers between the application and the component and core. The OMX_BYTE type is a 32 bit pointer to a zero terminated string. The pointer is word aligned and the string is byte aligned. */ typedef unsigned char* OMX_BYTE; /** OMX_UUIDTYPE is a very long unique identifier to uniquely identify at runtime. This identifier should be generated by a component in a way that guarantees that every instance of the identifier running on the system is unique. */ typedef unsigned char OMX_UUIDTYPE[128]; /** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or an output port. This enumeration is common across all component types. */ typedef enum OMX_DIRTYPE { OMX_DirInput, /**< Port is an input port */ OMX_DirOutput, /**< Port is an output port */ OMX_DirMax = 0x7FFFFFFF } OMX_DIRTYPE; /** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering for numerical data (i.e. big endian, or little endian). */ typedef enum OMX_ENDIANTYPE { OMX_EndianBig, /**< big endian */ OMX_EndianLittle, /**< little endian */ OMX_EndianMax = 0x7FFFFFFF } OMX_ENDIANTYPE; /** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data is signed or unsigned */ typedef enum OMX_NUMERICALDATATYPE { OMX_NumericalDataSigned, /**< signed data */ OMX_NumericalDataUnsigned, /**< unsigned data */ OMX_NumercialDataMax = 0x7FFFFFFF } OMX_NUMERICALDATATYPE; /** Unsigned bounded value type */ typedef struct OMX_BU32 { OMX_U32 nValue; /**< actual value */ OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ } OMX_BU32; /** Signed bounded value type */ typedef struct OMX_BS32 { OMX_S32 nValue; /**< actual value */ OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ } OMX_BS32; /** Structure representing some time or duration in microseconds. This structure * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate * negative deltas and preroll scenarios. The quantity is represented in microseconds * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g. * individual audio samples delivered at 192 kHz). The quantity is 64 bit to * accommodate a large dynamic range (signed 32 bit values would allow only for plus * or minus 35 minutes). * * Implementations with limited precision may convert the signed 64 bit value to * a signed 32 bit value internally but risk loss of precision. */ #ifndef OMX_SKIP64BIT typedef OMX_S64 OMX_TICKS; #else typedef struct OMX_TICKS { OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */ OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */ } OMX_TICKS; #endif #define OMX_TICKS_PER_SECOND 1000000 /** Define the public interface for the OMX Handle. The core will not use this value internally, but the application should only use this value. */ typedef void* OMX_HANDLETYPE; typedef struct OMX_MARKTYPE { OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a mark event upon processing the mark. */ OMX_PTR pMarkData; /**< Application specific data associated with the mark sent on a mark event to disambiguate this mark from others. */ } OMX_MARKTYPE; /** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the * platform & operating specific object used to reference the display * or can be used by a audio port for native audio rendering */ typedef void* OMX_NATIVE_DEVICETYPE; /** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the * platform & operating specific object used to reference the window */ typedef void* OMX_NATIVE_WINDOWTYPE; /** Define the OMX IL version that corresponds to this set of header files. * We also define a combined version that can be used to write or compare * values of the 32bit nVersion field, assuming a little endian architecture */ #define OMX_VERSION_MAJOR 1 #define OMX_VERSION_MINOR 1 #define OMX_VERSION_REVISION 2 #define OMX_VERSION_STEP 0 #define OMX_VERSION ((OMX_VERSION_STEP<<24) | (OMX_VERSION_REVISION<<16) | (OMX_VERSION_MINOR<<8) | OMX_VERSION_MAJOR) /** The OMX_VERSIONTYPE union is used to specify the version for a structure or component. For a component, the version is entirely specified by the component vendor. Components doing the same function from different vendors may or may not have the same version. For structures, the version shall be set by the entity that allocates the structure. For structures specified in the OMX 1.1 specification, the value of the version shall be set to 1.1.0.0 in all cases. Access to the OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or by accessing one of the structure elements to, for example, check only the Major revision. */ typedef union OMX_VERSIONTYPE { struct { OMX_U8 nVersionMajor; /**< Major version accessor element */ OMX_U8 nVersionMinor; /**< Minor version accessor element */ OMX_U8 nRevision; /**< Revision version accessor element */ OMX_U8 nStep; /**< Step version accessor element */ } s; OMX_U32 nVersion; /**< 32 bit value to make accessing the version easily done in a single word size copy/compare operation */ } OMX_VERSIONTYPE; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/IL/OMX_Video.h ================================================ /** * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** * @file OMX_Video.h - OpenMax IL version 1.1.2 * The structures is needed by Video components to exchange parameters * and configuration data with OMX components. */ #ifndef OMX_Video_h #define OMX_Video_h /** @defgroup video OpenMAX IL Video Domain * @ingroup iv * Structures for OpenMAX IL Video domain * @{ */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_IVCommon.h" /** * Enumeration used to define the possible video compression codings. * NOTE: This essentially refers to file extensions. If the coding is * being used to specify the ENCODE type, then additional work * must be done to configure the exact flavor of the compression * to be used. For decode cases where the user application can * not differentiate between MPEG-4 and H.264 bit streams, it is * up to the codec to handle this. */ typedef enum OMX_VIDEO_CODINGTYPE { OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */ OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */ OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */ OMX_VIDEO_CodingH263, /**< H.263 */ OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */ OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */ OMX_VIDEO_CodingRV, /**< all versions of Real Video */ OMX_VIDEO_CodingAVC, /**< H.264/AVC */ OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */ OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ #define OMX_AUDIO_CodingVP6_Supported 1 OMX_VIDEO_CodingVP6, /**< On2 VP6 */ #define OMX_AUDIO_CodingVP7_Supported 1 OMX_VIDEO_CodingVP7, /**< On2 VP7 */ #define OMX_AUDIO_CodingVP8_Supported 1 OMX_VIDEO_CodingVP8, /**< On2 VP8 */ #define OMX_AUDIO_CodingYUV_Supported 1 OMX_VIDEO_CodingYUV, /* raw YUV video */ #define OMX_AUDIO_CodingSorenson_Supported 1 OMX_VIDEO_CodingSorenson, /**< Sorenson */ #define OMX_AUDIO_CodingTheora_Supported 1 OMX_VIDEO_CodingTheora, /**< Theora */ #define OMX_AUDIO_CodingMVC_Supported 1 OMX_VIDEO_CodingMVC, /**< H.264/MVC */ OMX_VIDEO_CodingMax = 0x7FFFFFFF } OMX_VIDEO_CODINGTYPE; /** * Data structure used to define a video path. The number of Video paths for * input and output will vary by type of the Video component. * * Input (aka Source) : zero Inputs, one Output, * Splitter : one Input, 2 or more Outputs, * Processing Element : one Input, one output, * Mixer : 2 or more inputs, one output, * Output (aka Sink) : one Input, zero outputs. * * The PortDefinition structure is used to define all of the parameters * necessary for the compliant component to setup an input or an output video * path. If additional vendor specific data is required, it should be * transmitted to the component using the CustomCommand function. Compliant * components will prepopulate this structure with optimal values during the * GetDefaultInitParams command. * * STRUCT MEMBERS: * cMIMEType : MIME type of data for the port * pNativeRender : Platform specific reference for a display if a * sync, otherwise this field is 0 * nFrameWidth : Width of frame to be used on channel if * uncompressed format is used. Use 0 for unknown, * don't care or variable * nFrameHeight : Height of frame to be used on channel if * uncompressed format is used. Use 0 for unknown, * don't care or variable * nStride : Number of bytes per span of an image * (i.e. indicates the number of bytes to get * from span N to span N+1, where negative stride * indicates the image is bottom up * nSliceHeight : Height used when encoding in slices * nBitrate : Bit rate of frame to be used on channel if * compressed format is used. Use 0 for unknown, * don't care or variable * xFramerate : Frame rate to be used on channel if uncompressed * format is used. Use 0 for unknown, don't care or * variable. Units are Q16 frames per second. * bFlagErrorConcealment : Turns on error concealment if it is supported by * the OMX component * eCompressionFormat : Compression format used in this instance of the * component. When OMX_VIDEO_CodingUnused is * specified, eColorFormat is used * eColorFormat : Decompressed format used by this component * pNativeWindow : Platform specific reference for a window object if a * display sink , otherwise this field is 0x0. */ typedef struct OMX_VIDEO_PORTDEFINITIONTYPE { OMX_STRING cMIMEType; OMX_NATIVE_DEVICETYPE pNativeRender; OMX_U32 nFrameWidth; OMX_U32 nFrameHeight; OMX_S32 nStride; OMX_U32 nSliceHeight; OMX_U32 nBitrate; OMX_U32 xFramerate; OMX_BOOL bFlagErrorConcealment; OMX_VIDEO_CODINGTYPE eCompressionFormat; OMX_COLOR_FORMATTYPE eColorFormat; OMX_NATIVE_WINDOWTYPE pNativeWindow; } OMX_VIDEO_PORTDEFINITIONTYPE; /** * Port format parameter. This structure is used to enumerate the various * data input/output format supported by the port. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Indicates which port to set * nIndex : Indicates the enumeration index for the format from * 0x0 to N-1 * eCompressionFormat : Compression format used in this instance of the * component. When OMX_VIDEO_CodingUnused is specified, * eColorFormat is used * eColorFormat : Decompressed format used by this component * xFrameRate : Indicates the video frame rate in Q16 format */ typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIndex; OMX_VIDEO_CODINGTYPE eCompressionFormat; OMX_COLOR_FORMATTYPE eColorFormat; OMX_U32 xFramerate; } OMX_VIDEO_PARAM_PORTFORMATTYPE; /** * This is a structure for configuring video compression quantization * parameter values. Codecs may support different QP values for different * frame types. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version info * nPortIndex : Port that this structure applies to * nQpI : QP value to use for index frames * nQpP : QP value to use for P frames * nQpB : QP values to use for bidirectional frames */ typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nQpI; OMX_U32 nQpP; OMX_U32 nQpB; } OMX_VIDEO_PARAM_QUANTIZATIONTYPE; /** * Structure for configuration of video fast update parameters. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version info * nPortIndex : Port that this structure applies to * bEnableVFU : Enable/Disable video fast update * nFirstGOB : Specifies the number of the first macroblock row * nFirstMB : specifies the first MB relative to the specified first GOB * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB * and nFirstMB */ typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnableVFU; OMX_U32 nFirstGOB; OMX_U32 nFirstMB; OMX_U32 nNumMBs; } OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE; /** * Enumeration of possible bitrate control types */ typedef enum OMX_VIDEO_CONTROLRATETYPE { OMX_Video_ControlRateDisable, OMX_Video_ControlRateVariable, OMX_Video_ControlRateConstant, OMX_Video_ControlRateVariableSkipFrames, OMX_Video_ControlRateConstantSkipFrames, OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_Video_ControlRateMax = 0x7FFFFFFF } OMX_VIDEO_CONTROLRATETYPE; /** * Structure for configuring bitrate mode of a codec. * * STRUCT MEMBERS: * nSize : Size of the struct in bytes * nVersion : OMX spec version info * nPortIndex : Port that this struct applies to * eControlRate : Control rate type enum * nTargetBitrate : Target bitrate to encode with */ typedef struct OMX_VIDEO_PARAM_BITRATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_CONTROLRATETYPE eControlRate; OMX_U32 nTargetBitrate; } OMX_VIDEO_PARAM_BITRATETYPE; /** * Enumeration of possible motion vector (MV) types */ typedef enum OMX_VIDEO_MOTIONVECTORTYPE { OMX_Video_MotionVectorPixel, OMX_Video_MotionVectorHalfPel, OMX_Video_MotionVectorQuarterPel, OMX_Video_MotionVectorEighthPel, OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_Video_MotionVectorMax = 0x7FFFFFFF } OMX_VIDEO_MOTIONVECTORTYPE; /** * Structure for configuring the number of motion vectors used as well * as their accuracy. * * STRUCT MEMBERS: * nSize : Size of the struct in bytes * nVersion : OMX spec version info * nPortIndex : port that this structure applies to * eAccuracy : Enumerated MV accuracy * bUnrestrictedMVs : Allow unrestricted MVs * bFourMV : Allow use of 4 MVs * sXSearchRange : Search range in horizontal direction for MVs * sYSearchRange : Search range in vertical direction for MVs */ typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_MOTIONVECTORTYPE eAccuracy; OMX_BOOL bUnrestrictedMVs; OMX_BOOL bFourMV; OMX_S32 sXSearchRange; OMX_S32 sYSearchRange; } OMX_VIDEO_PARAM_MOTIONVECTORTYPE; /** * Enumeration of possible methods to use for Intra Refresh */ typedef enum OMX_VIDEO_INTRAREFRESHTYPE { OMX_VIDEO_IntraRefreshCyclic, /**< Cyclic intra refresh, bit 0 is set*/ OMX_VIDEO_IntraRefreshAdaptive, /**< Adaptive intra refresh, bit 1 is set*/ OMX_VIDEO_IntraRefreshBoth, /**< Cyclic + Adaptive intra refresh (no mrows since bit 2 is off)*/ OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_IntraRefreshCyclicMrows, /**< Cyclic intra refresh, multiple rows at a time bits 0 and 2 are set*/ OMX_VIDEO_IntraRefreshPseudoRand, /**< Pseudo random intra refresh, uses bit 3*/ OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF } OMX_VIDEO_INTRAREFRESHTYPE; /** * Structure for configuring intra refresh mode * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eRefreshMode : Cyclic, Adaptive, or Both * nAirMBs : Number of intra macroblocks to refresh in a frame when * AIR is enabled * nAirRef : Number of times a motion marked macroblock has to be * intra coded * nCirMBs : Number of consecutive macroblocks to be coded as "intra" * when CIR is enabled */ typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode; OMX_U32 nAirMBs; OMX_U32 nAirRef; OMX_U32 nCirMBs; OMX_U32 nPirMBs; } OMX_VIDEO_PARAM_INTRAREFRESHTYPE; /** * Structure for enabling various error correction methods for video * compression. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bEnableHEC : Enable/disable header extension codes (HEC) * bEnableResync : Enable/disable resynchronization markers * nResynchMarkerSpacing : Resynch markers interval (in bits) to be * applied in the stream * bEnableDataPartitioning : Enable/disable data partitioning * bEnableRVLC : Enable/disable reversible variable length * coding */ typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnableHEC; OMX_BOOL bEnableResync; OMX_U32 nResynchMarkerSpacing; OMX_BOOL bEnableDataPartitioning; OMX_BOOL bEnableRVLC; } OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE; /** * Configuration of variable block-size motion compensation (VBSMC) * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * b16x16 : Enable inter block search 16x16 * b16x8 : Enable inter block search 16x8 * b8x16 : Enable inter block search 8x16 * b8x8 : Enable inter block search 8x8 * b8x4 : Enable inter block search 8x4 * b4x8 : Enable inter block search 4x8 * b4x4 : Enable inter block search 4x4 */ typedef struct OMX_VIDEO_PARAM_VBSMCTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL b16x16; OMX_BOOL b16x8; OMX_BOOL b8x16; OMX_BOOL b8x8; OMX_BOOL b8x4; OMX_BOOL b4x8; OMX_BOOL b4x4; } OMX_VIDEO_PARAM_VBSMCTYPE; /** * H.263 profile types, each profile indicates support for various * performance bounds and different annexes. * * ENUMS: * Baseline : Baseline Profile: H.263 (V1), no optional modes * H320 Coding : H.320 Coding Efficiency Backward Compatibility * Profile: H.263+ (V2), includes annexes I, J, L.4 * and T * BackwardCompatible : Backward Compatibility Profile: H.263 (V1), * includes annex F * ISWV2 : Interactive Streaming Wireless Profile: H.263+ * (V2), includes annexes I, J, K and T * ISWV3 : Interactive Streaming Wireless Profile: H.263++ * (V3), includes profile 3 and annexes V and W.6.3.8 * HighCompression : Conversational High Compression Profile: H.263++ * (V3), includes profiles 1 & 2 and annexes D and U * Internet : Conversational Internet Profile: H.263++ (V3), * includes profile 5 and annex K * Interlace : Conversational Interlace Profile: H.263++ (V3), * includes profile 5 and annex W.6.3.11 * HighLatency : High Latency Profile: H.263++ (V3), includes * profile 6 and annexes O.1 and P.5 */ typedef enum OMX_VIDEO_H263PROFILETYPE { OMX_VIDEO_H263ProfileBaseline = 0x01, OMX_VIDEO_H263ProfileH320Coding = 0x02, OMX_VIDEO_H263ProfileBackwardCompatible = 0x04, OMX_VIDEO_H263ProfileISWV2 = 0x08, OMX_VIDEO_H263ProfileISWV3 = 0x10, OMX_VIDEO_H263ProfileHighCompression = 0x20, OMX_VIDEO_H263ProfileInternet = 0x40, OMX_VIDEO_H263ProfileInterlace = 0x80, OMX_VIDEO_H263ProfileHighLatency = 0x100, OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF } OMX_VIDEO_H263PROFILETYPE; /** * H.263 level types, each level indicates support for various frame sizes, * bit rates, decoder frame rates. */ typedef enum OMX_VIDEO_H263LEVELTYPE { OMX_VIDEO_H263Level10 = 0x01, OMX_VIDEO_H263Level20 = 0x02, OMX_VIDEO_H263Level30 = 0x04, OMX_VIDEO_H263Level40 = 0x08, OMX_VIDEO_H263Level45 = 0x10, OMX_VIDEO_H263Level50 = 0x20, OMX_VIDEO_H263Level60 = 0x40, OMX_VIDEO_H263Level70 = 0x80, OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_H263LevelMax = 0x7FFFFFFF } OMX_VIDEO_H263LEVELTYPE; /** * Specifies the picture type. These values should be OR'd to signal all * pictures types which are allowed. * * ENUMS: * Generic Picture Types: I, P and B * H.263 Specific Picture Types: SI and SP * H.264 Specific Picture Types: EI and EP * MPEG-4 Specific Picture Types: S */ typedef enum OMX_VIDEO_PICTURETYPE { OMX_VIDEO_PictureTypeI = 0x01, OMX_VIDEO_PictureTypeP = 0x02, OMX_VIDEO_PictureTypeB = 0x04, OMX_VIDEO_PictureTypeSI = 0x08, OMX_VIDEO_PictureTypeSP = 0x10, OMX_VIDEO_PictureTypeEI = 0x11, OMX_VIDEO_PictureTypeEP = 0x12, OMX_VIDEO_PictureTypeS = 0x14, OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF } OMX_VIDEO_PICTURETYPE; /** * H.263 Params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nPFrames : Number of P frames between each I frame * nBFrames : Number of B frames between each I frame * eProfile : H.263 profile(s) to use * eLevel : H.263 level(s) to use * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE * (specified in the 1998 version of H.263) to * indicate custom picture sizes or clock * frequencies * nAllowedPictureTypes : Specifies the picture types allowed in the * bitstream * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is * not constrained. It is recommended to change * the value of the RTYPE bit for each reference * picture in error-free communication * nPictureHeaderRepetition : Specifies the frequency of picture header * repetition * nGOBHeaderInterval : Specifies the interval of non-empty GOB * headers in units of GOBs */ typedef struct OMX_VIDEO_PARAM_H263TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nPFrames; OMX_U32 nBFrames; OMX_VIDEO_H263PROFILETYPE eProfile; OMX_VIDEO_H263LEVELTYPE eLevel; OMX_BOOL bPLUSPTYPEAllowed; OMX_U32 nAllowedPictureTypes; OMX_BOOL bForceRoundingTypeToZero; OMX_U32 nPictureHeaderRepetition; OMX_U32 nGOBHeaderInterval; } OMX_VIDEO_PARAM_H263TYPE; /** * MPEG-2 profile types, each profile indicates support for various * performance bounds and different annexes. */ typedef enum OMX_VIDEO_MPEG2PROFILETYPE { OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */ OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */ OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */ OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */ OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */ OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */ OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF } OMX_VIDEO_MPEG2PROFILETYPE; /** * MPEG-2 level types, each level indicates support for various frame * sizes, bit rates, decoder frame rates. No need */ typedef enum OMX_VIDEO_MPEG2LEVELTYPE { OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */ OMX_VIDEO_MPEG2LevelML, /**< Main Level */ OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */ OMX_VIDEO_MPEG2LevelHL, /**< High Level */ OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF } OMX_VIDEO_MPEG2LEVELTYPE; /** * MPEG-2 params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nPFrames : Number of P frames between each I frame * nBFrames : Number of B frames between each I frame * eProfile : MPEG-2 profile(s) to use * eLevel : MPEG-2 levels(s) to use */ typedef struct OMX_VIDEO_PARAM_MPEG2TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nPFrames; OMX_U32 nBFrames; OMX_VIDEO_MPEG2PROFILETYPE eProfile; OMX_VIDEO_MPEG2LEVELTYPE eLevel; } OMX_VIDEO_PARAM_MPEG2TYPE; /** * MPEG-4 profile types, each profile indicates support for various * performance bounds and different annexes. * * ENUMS: * - Simple Profile, Levels 1-3 * - Simple Scalable Profile, Levels 1-2 * - Core Profile, Levels 1-2 * - Main Profile, Levels 2-4 * - N-bit Profile, Level 2 * - Scalable Texture Profile, Level 1 * - Simple Face Animation Profile, Levels 1-2 * - Simple Face and Body Animation (FBA) Profile, Levels 1-2 * - Basic Animated Texture Profile, Levels 1-2 * - Hybrid Profile, Levels 1-2 * - Advanced Real Time Simple Profiles, Levels 1-4 * - Core Scalable Profile, Levels 1-3 * - Advanced Coding Efficiency Profile, Levels 1-4 * - Advanced Core Profile, Levels 1-2 * - Advanced Scalable Texture, Levels 2-3 */ typedef enum OMX_VIDEO_MPEG4PROFILETYPE { OMX_VIDEO_MPEG4ProfileSimple = 0x01, OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02, OMX_VIDEO_MPEG4ProfileCore = 0x04, OMX_VIDEO_MPEG4ProfileMain = 0x08, OMX_VIDEO_MPEG4ProfileNbit = 0x10, OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20, OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40, OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80, OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100, OMX_VIDEO_MPEG4ProfileHybrid = 0x200, OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400, OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800, OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000, OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000, OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000, OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000, OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF } OMX_VIDEO_MPEG4PROFILETYPE; /** * MPEG-4 level types, each level indicates support for various frame * sizes, bit rates, decoder frame rates. No need */ typedef enum OMX_VIDEO_MPEG4LEVELTYPE { OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */ OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */ OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */ OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */ OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */ OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */ OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */ OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */ OMX_VIDEO_MPEG4Level6 = 0x100, /**< Level 5 */ OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF } OMX_VIDEO_MPEG4LEVELTYPE; /** * MPEG-4 configuration. This structure handles configuration options * which are specific to MPEG4 algorithms * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+ * Annex K). Put zero if not used * bSVH : Enable Short Video Header mode * bGov : Flag to enable GOV * nPFrames : Number of P frames between each I frame (also called * GOV period) * nBFrames : Number of B frames between each I frame * nIDCVLCThreshold : Value of intra DC VLC threshold * bACPred : Flag to use ac prediction * nMaxPacketSize : Maximum size of packet in bytes. * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4. * Interpreted as described in MPEG4 standard. * eProfile : MPEG-4 profile(s) to use. * eLevel : MPEG-4 level(s) to use. * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream * nHeaderExtension : Specifies the number of consecutive video packet * headers within a VOP * bReversibleVLC : Specifies whether reversible variable length coding * is in use */ typedef struct OMX_VIDEO_PARAM_MPEG4TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nSliceHeaderSpacing; OMX_BOOL bSVH; OMX_BOOL bGov; OMX_U32 nPFrames; OMX_U32 nBFrames; OMX_U32 nIDCVLCThreshold; OMX_BOOL bACPred; OMX_U32 nMaxPacketSize; OMX_U32 nTimeIncRes; OMX_VIDEO_MPEG4PROFILETYPE eProfile; OMX_VIDEO_MPEG4LEVELTYPE eLevel; OMX_U32 nAllowedPictureTypes; OMX_U32 nHeaderExtension; OMX_BOOL bReversibleVLC; } OMX_VIDEO_PARAM_MPEG4TYPE; /** * WMV Versions */ typedef enum OMX_VIDEO_WMVFORMATTYPE { OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */ OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */ OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */ OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */ OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF } OMX_VIDEO_WMVFORMATTYPE; /** * WMV Params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFormat : Version of WMV stream / data */ typedef struct OMX_VIDEO_PARAM_WMVTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_WMVFORMATTYPE eFormat; } OMX_VIDEO_PARAM_WMVTYPE; /** * Real Video Version */ typedef enum OMX_VIDEO_RVFORMATTYPE { OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */ OMX_VIDEO_RVFormat8, /**< Real Video format 8 */ OMX_VIDEO_RVFormat9, /**< Real Video format 9 */ OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */ OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_RVFormatMax = 0x7FFFFFFF } OMX_VIDEO_RVFORMATTYPE; /** * Real Video Params * * STUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFormat : Version of RV stream / data * nBitsPerPixel : Bits per pixel coded in the frame * nPaddedWidth : Padded width in pixel of a video frame * nPaddedHeight : Padded Height in pixels of a video frame * nFrameRate : Rate of video in frames per second * nBitstreamFlags : Flags which internal information about the bitstream * nBitstreamVersion : Bitstream version * nMaxEncodeFrameSize: Max encoded frame size * bEnablePostFilter : Turn on/off post filter * bEnableTemporalInterpolation : Turn on/off temporal interpolation * bEnableLatencyMode : When enabled, the decoder does not display a decoded * frame until it has detected that no enhancement layer * frames or dependent B frames will be coming. This * detection usually occurs when a subsequent non-B * frame is encountered */ typedef struct OMX_VIDEO_PARAM_RVTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_RVFORMATTYPE eFormat; OMX_U16 nBitsPerPixel; OMX_U16 nPaddedWidth; OMX_U16 nPaddedHeight; OMX_U32 nFrameRate; OMX_U32 nBitstreamFlags; OMX_U32 nBitstreamVersion; OMX_U32 nMaxEncodeFrameSize; OMX_BOOL bEnablePostFilter; OMX_BOOL bEnableTemporalInterpolation; OMX_BOOL bEnableLatencyMode; } OMX_VIDEO_PARAM_RVTYPE; /** * AVC profile types, each profile indicates support for various * performance bounds and different annexes. */ typedef enum OMX_VIDEO_AVCPROFILETYPE { OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */ OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */ OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */ OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */ OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */ OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */ OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */ OMX_VIDEO_AVCProfileConstrainedBaseline = 0x80, /**< Constrained Baseline Profile */ OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF } OMX_VIDEO_AVCPROFILETYPE; /** * AVC level types, each level indicates support for various frame sizes, * bit rates, decoder frame rates. No need */ typedef enum OMX_VIDEO_AVCLEVELTYPE { OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */ OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */ OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */ OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */ OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */ OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */ OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */ OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */ OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */ OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */ OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */ OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */ OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */ OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */ OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */ OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */ OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF } OMX_VIDEO_AVCLEVELTYPE; /** * AVC loop filter modes * * OMX_VIDEO_AVCLoopFilterEnable : Enable * OMX_VIDEO_AVCLoopFilterDisable : Disable * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries */ typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE { OMX_VIDEO_AVCLoopFilterEnable = 0, OMX_VIDEO_AVCLoopFilterDisable, OMX_VIDEO_AVCLoopFilterDisableSliceBoundary, OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF } OMX_VIDEO_AVCLOOPFILTERTYPE; /** * AVC params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nSliceHeaderSpacing : Number of macroblocks between slice header, put * zero if not used * nPFrames : Number of P frames between each I frame * nBFrames : Number of B frames between each I frame * bUseHadamard : Enable/disable Hadamard transform * nRefFrames : Max number of reference frames to use for inter * motion search (1-16) * nRefIdxTrailing : Pic param set ref frame index (index into ref * frame buffer of trailing frames list), B frame * support * nRefIdxForward : Pic param set ref frame index (index into ref * frame buffer of forward frames list), B frame * support * bEnableUEP : Enable/disable unequal error protection. This * is only valid of data partitioning is enabled. * bEnableFMO : Enable/disable flexible macroblock ordering * bEnableASO : Enable/disable arbitrary slice ordering * bEnableRS : Enable/disable sending of redundant slices * eProfile : AVC profile(s) to use * eLevel : AVC level(s) to use * nAllowedPictureTypes : Specifies the picture types allowed in the * bitstream * bFrameMBsOnly : specifies that every coded picture of the * coded video sequence is a coded frame * containing only frame macroblocks * bMBAFF : Enable/disable switching between frame and * field macroblocks within a picture * bEntropyCodingCABAC : Entropy decoding method to be applied for the * syntax elements for which two descriptors appear * in the syntax tables * bWeightedPPrediction : Enable/disable weighted prediction shall not * be applied to P and SP slices * nWeightedBipredicitonMode : Default weighted prediction is applied to B * slices * bconstIpred : Enable/disable intra prediction * bDirect8x8Inference : Specifies the method used in the derivation * process for luma motion vectors for B_Skip, * B_Direct_16x16 and B_Direct_8x8 as specified * in subclause 8.4.1.2 of the AVC spec * bDirectSpatialTemporal : Flag indicating spatial or temporal direct * mode used in B slice coding (related to * bDirect8x8Inference) . Spatial direct mode is * more common and should be the default. * nCabacInitIdx : Index used to init CABAC contexts * eLoopFilterMode : Enable/disable loop filter */ typedef struct OMX_VIDEO_PARAM_AVCTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nSliceHeaderSpacing; OMX_U32 nPFrames; OMX_U32 nBFrames; OMX_BOOL bUseHadamard; OMX_U32 nRefFrames; OMX_U32 nRefIdx10ActiveMinus1; OMX_U32 nRefIdx11ActiveMinus1; OMX_BOOL bEnableUEP; OMX_BOOL bEnableFMO; OMX_BOOL bEnableASO; OMX_BOOL bEnableRS; OMX_VIDEO_AVCPROFILETYPE eProfile; OMX_VIDEO_AVCLEVELTYPE eLevel; OMX_U32 nAllowedPictureTypes; OMX_BOOL bFrameMBsOnly; OMX_BOOL bMBAFF; OMX_BOOL bEntropyCodingCABAC; OMX_BOOL bWeightedPPrediction; OMX_U32 nWeightedBipredicitonMode; OMX_BOOL bconstIpred ; OMX_BOOL bDirect8x8Inference; OMX_BOOL bDirectSpatialTemporal; OMX_U32 nCabacInitIdc; OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode; } OMX_VIDEO_PARAM_AVCTYPE; typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE, or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE, or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ OMX_U32 nProfileIndex; /**< Used to query for individual profile support information, This parameter is valid only for OMX_IndexParamVideoProfileLevelQuerySupported index, For all other indices this parameter is to be ignored. */ } OMX_VIDEO_PARAM_PROFILELEVELTYPE; /** * Structure for dynamically configuring bitrate mode of a codec. * * STRUCT MEMBERS: * nSize : Size of the struct in bytes * nVersion : OMX spec version info * nPortIndex : Port that this struct applies to * nEncodeBitrate : Target average bitrate to be generated in bps */ typedef struct OMX_VIDEO_CONFIG_BITRATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nEncodeBitrate; } OMX_VIDEO_CONFIG_BITRATETYPE; /** * Defines Encoder Frame Rate setting * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * xEncodeFramerate : Encoding framerate represented in Q16 format */ typedef struct OMX_CONFIG_FRAMERATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 xEncodeFramerate; /* Q16 format */ } OMX_CONFIG_FRAMERATETYPE; typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL IntraRefreshVOP; } OMX_CONFIG_INTRAREFRESHVOPTYPE; typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */ OMX_U8 ErrMap[1]; /* Error map hint */ } OMX_CONFIG_MACROBLOCKERRORMAPTYPE; typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; } OMX_CONFIG_MBERRORREPORTINGTYPE; typedef struct OMX_PARAM_MACROBLOCKSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nMacroblocks; } OMX_PARAM_MACROBLOCKSTYPE; /** * AVC Slice Mode modes * * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame */ typedef enum OMX_VIDEO_AVCSLICEMODETYPE { OMX_VIDEO_SLICEMODE_AVCDefault = 0, OMX_VIDEO_SLICEMODE_AVCMBSlice, OMX_VIDEO_SLICEMODE_AVCByteSlice, OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF } OMX_VIDEO_AVCSLICEMODETYPE; /** * AVC FMO Slice Mode Params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nNumSliceGroups : Specifies the number of slice groups * nSliceGroupMapType : Specifies the type of slice groups * eSliceMode : Specifies the type of slice */ typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U8 nNumSliceGroups; OMX_U8 nSliceGroupMapType; OMX_VIDEO_AVCSLICEMODETYPE eSliceMode; } OMX_VIDEO_PARAM_AVCSLICEFMO; /** * AVC IDR Period Configs * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nIDRPeriod : Specifies periodicity of IDR frames * nPFrames : Specifies internal of coding Intra frames */ typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIDRPeriod; OMX_U32 nPFrames; } OMX_VIDEO_CONFIG_AVCINTRAPERIOD; /** * AVC NAL Size Configs * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nNaluBytes : Specifies the NAL unit size */ typedef struct OMX_VIDEO_CONFIG_NALSIZE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nNaluBytes; } OMX_VIDEO_CONFIG_NALSIZE; /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/KHR/khrplatform.h ================================================ #ifndef __khrplatform_h_ #define __khrplatform_h_ /* ** Copyright (c) 2008-2009 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ /* Khronos platform-specific types and definitions. * * $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $ * * Adopters may modify this file to suit their platform. Adopters are * encouraged to submit platform specific modifications to the Khronos * group so that they can be included in future versions of this file. * Please submit changes by sending them to the public Khronos Bugzilla * (http://khronos.org/bugzilla) by filing a bug against product * "Khronos (general)" component "Registry". * * A predefined template which fills in some of the bug fields can be * reached using http://tinyurl.com/khrplatform-h-bugreport, but you * must create a Bugzilla login first. * * * See the Implementer's Guidelines for information about where this file * should be located on your system and for more details of its use: * http://www.khronos.org/registry/implementers_guide.pdf * * This file should be included as * #include * by Khronos client API header files that use its types and defines. * * The types in khrplatform.h should only be used to define API-specific types. * * Types defined in khrplatform.h: * khronos_int8_t signed 8 bit * khronos_uint8_t unsigned 8 bit * khronos_int16_t signed 16 bit * khronos_uint16_t unsigned 16 bit * khronos_int32_t signed 32 bit * khronos_uint32_t unsigned 32 bit * khronos_int64_t signed 64 bit * khronos_uint64_t unsigned 64 bit * khronos_intptr_t signed same number of bits as a pointer * khronos_uintptr_t unsigned same number of bits as a pointer * khronos_ssize_t signed size * khronos_usize_t unsigned size * khronos_float_t signed 32 bit floating point * khronos_time_ns_t unsigned 64 bit time in nanoseconds * khronos_utime_nanoseconds_t unsigned time interval or absolute time in * nanoseconds * khronos_stime_nanoseconds_t signed time interval in nanoseconds * khronos_boolean_enum_t enumerated boolean type. This should * only be used as a base type when a client API's boolean type is * an enum. Client APIs which use an integer or other type for * booleans cannot use this as the base type for their boolean. * * Tokens defined in khrplatform.h: * * KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values. * * KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0. * KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0. * * Calling convention macros defined in this file: * KHRONOS_APICALL * KHRONOS_APIENTRY * KHRONOS_APIATTRIBUTES * * These may be used in function prototypes as: * * KHRONOS_APICALL void KHRONOS_APIENTRY funcname( * int arg1, * int arg2) KHRONOS_APIATTRIBUTES; */ /*------------------------------------------------------------------------- * Definition of KHRONOS_APICALL *------------------------------------------------------------------------- * This precedes the return type of the function in the function prototype. */ #if defined(_WIN32) && !defined(__SCITECH_SNAP__) # define KHRONOS_APICALL __declspec(dllimport) #elif defined (__SYMBIAN32__) # define KHRONOS_APICALL IMPORT_C #else # define KHRONOS_APICALL #endif /*------------------------------------------------------------------------- * Definition of KHRONOS_APIENTRY *------------------------------------------------------------------------- * This follows the return type of the function and precedes the function * name in the function prototype. */ #if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__) /* Win32 but not WinCE */ # define KHRONOS_APIENTRY __stdcall #else # define KHRONOS_APIENTRY #endif /*------------------------------------------------------------------------- * Definition of KHRONOS_APIATTRIBUTES *------------------------------------------------------------------------- * This follows the closing parenthesis of the function prototype arguments. */ #if defined (__ARMCC_2__) #define KHRONOS_APIATTRIBUTES __softfp #else #define KHRONOS_APIATTRIBUTES #endif /*------------------------------------------------------------------------- * basic type definitions *-----------------------------------------------------------------------*/ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__) /* * Using */ #include typedef int32_t khronos_int32_t; typedef uint32_t khronos_uint32_t; typedef int64_t khronos_int64_t; typedef uint64_t khronos_uint64_t; #define KHRONOS_SUPPORT_INT64 1 #define KHRONOS_SUPPORT_FLOAT 1 #elif defined(__VMS ) || defined(__sgi) /* * Using */ #include typedef int32_t khronos_int32_t; typedef uint32_t khronos_uint32_t; typedef int64_t khronos_int64_t; typedef uint64_t khronos_uint64_t; #define KHRONOS_SUPPORT_INT64 1 #define KHRONOS_SUPPORT_FLOAT 1 #elif defined(_WIN32) && !defined(__SCITECH_SNAP__) /* * Win32 */ typedef __int32 khronos_int32_t; typedef unsigned __int32 khronos_uint32_t; typedef __int64 khronos_int64_t; typedef unsigned __int64 khronos_uint64_t; #define KHRONOS_SUPPORT_INT64 1 #define KHRONOS_SUPPORT_FLOAT 1 #elif defined(__sun__) || defined(__digital__) /* * Sun or Digital */ typedef int khronos_int32_t; typedef unsigned int khronos_uint32_t; #if defined(__arch64__) || defined(_LP64) typedef long int khronos_int64_t; typedef unsigned long int khronos_uint64_t; #else typedef long long int khronos_int64_t; typedef unsigned long long int khronos_uint64_t; #endif /* __arch64__ */ #define KHRONOS_SUPPORT_INT64 1 #define KHRONOS_SUPPORT_FLOAT 1 #elif defined(_VIDEOCORE) /* * VideoCore with Metaware compiler */ #include typedef int32_t khronos_int32_t; typedef uint32_t khronos_uint32_t; typedef int64_t khronos_int64_t; typedef uint64_t khronos_uint64_t; #define KHRONOS_SUPPORT_INT64 1 #define KHRONOS_SUPPORT_FLOAT 1 #elif 0 /* * Hypothetical platform with no float or int64 support */ typedef int khronos_int32_t; typedef unsigned int khronos_uint32_t; #define KHRONOS_SUPPORT_INT64 0 #define KHRONOS_SUPPORT_FLOAT 0 #else /* * Generic fallback */ #include typedef int32_t khronos_int32_t; typedef uint32_t khronos_uint32_t; typedef int64_t khronos_int64_t; typedef uint64_t khronos_uint64_t; #define KHRONOS_SUPPORT_INT64 1 #define KHRONOS_SUPPORT_FLOAT 1 #endif /* * Types that are (so far) the same on all platforms */ typedef signed char khronos_int8_t; typedef unsigned char khronos_uint8_t; typedef signed short int khronos_int16_t; typedef unsigned short int khronos_uint16_t; /* * Types that differ between LLP64 and LP64 architectures - in LLP64, * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears * to be the only LLP64 architecture in current use. */ #ifdef _WIN64 typedef signed long long int khronos_intptr_t; typedef unsigned long long int khronos_uintptr_t; typedef signed long long int khronos_ssize_t; typedef unsigned long long int khronos_usize_t; #else typedef signed long int khronos_intptr_t; typedef unsigned long int khronos_uintptr_t; typedef signed long int khronos_ssize_t; typedef unsigned long int khronos_usize_t; #endif #if KHRONOS_SUPPORT_FLOAT /* * Float type */ typedef float khronos_float_t; #endif #if KHRONOS_SUPPORT_INT64 /* Time types * * These types can be used to represent a time interval in nanoseconds or * an absolute Unadjusted System Time. Unadjusted System Time is the number * of nanoseconds since some arbitrary system event (e.g. since the last * time the system booted). The Unadjusted System Time is an unsigned * 64 bit value that wraps back to 0 every 584 years. Time intervals * may be either signed or unsigned. */ typedef khronos_uint64_t khronos_utime_nanoseconds_t; typedef khronos_int64_t khronos_stime_nanoseconds_t; #endif /* * Dummy value used to pad enum types to 32 bits. */ #ifndef KHRONOS_MAX_ENUM #define KHRONOS_MAX_ENUM 0x7FFFFFFF #endif /* * Enumerated boolean type * * Values other than zero should be considered to be true. Therefore * comparisons should not be made against KHRONOS_TRUE. */ typedef enum { KHRONOS_FALSE = 0, KHRONOS_TRUE = 1, KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM } khronos_boolean_enum_t; #endif /* __khrplatform_h_ */ ================================================ FILE: Libraries/Core/RPi/Headers/SHA1/HMAC_SHA1.h ================================================ /* 100% free public domain implementation of the HMAC-SHA1 algorithm by Chien-Chung, Chung (Jim Chung) */ #ifndef __HMAC_SHA1_H__ #define __HMAC_SHA1_H__ #include "SHA1.h" typedef unsigned char BYTE ; class CHMAC_SHA1 : public CSHA1 { private: BYTE m_ipad[64]; BYTE m_opad[64]; char * szReport ; char * SHA1_Key ; char * AppendBuf1 ; char * AppendBuf2 ; public: enum { SHA1_DIGEST_LENGTH = 20, SHA1_BLOCK_SIZE = 64, HMAC_BUF_LEN = 4096 } ; CHMAC_SHA1() :szReport(new char[HMAC_BUF_LEN]), AppendBuf1(new char[HMAC_BUF_LEN]), AppendBuf2(new char[HMAC_BUF_LEN]), SHA1_Key(new char[HMAC_BUF_LEN]) {} ~CHMAC_SHA1() { delete[] szReport ; delete[] AppendBuf1 ; delete[] AppendBuf2 ; delete[] SHA1_Key ; } void HMAC_SHA1(BYTE *text, int text_len, BYTE *key, int key_len, BYTE *digest); }; #endif /* __HMAC_SHA1_H__ */ ================================================ FILE: Libraries/Core/RPi/Headers/SHA1/SHA1.h ================================================ /* 100% free public domain implementation of the SHA-1 algorithm by Dominik Reichl Web: http://www.dominik-reichl.de/ Version 2.1 - 2012-06-19 - Deconstructor (resetting internal variables) is now only implemented if SHA1_WIPE_VARIABLES is defined (which is the default). - Renamed inclusion guard to contain a GUID. - Demo application is now using C++/STL objects and functions. - Unicode build of the demo application now outputs the hashes of both the ANSI and Unicode representations of strings. - Various other demo application improvements. Version 2.0 - 2012-06-14 - Added 'limits.h' include. - Renamed inclusion guard and macros for compliancy (names beginning with an underscore are reserved). Version 1.9 - 2011-11-10 - Added Unicode test vectors. - Improved support for hashing files using the HashFile method that are larger than 4 GB. - Improved file hashing performance (by using a larger buffer). - Disabled unnecessary compiler warnings. - Internal variables are now private. Version 1.8 - 2009-03-16 - Converted project files to Visual Studio 2008 format. - Added Unicode support for HashFile utility method. - Added support for hashing files using the HashFile method that are larger than 2 GB. - HashFile now returns an error code instead of copying an error message into the output buffer. - GetHash now returns an error code and validates the input parameter. - Added ReportHashStl STL utility method. - Added REPORT_HEX_SHORT reporting mode. - Improved Linux compatibility of test program. Version 1.7 - 2006-12-21 - Fixed buffer underrun warning that appeared when compiling with Borland C Builder (thanks to Rex Bloom and Tim Gallagher for the patch). - Breaking change: ReportHash writes the final hash to the start of the buffer, i.e. it's not appending it to the string anymore. - Made some function parameters const. - Added Visual Studio 2005 project files to demo project. Version 1.6 - 2005-02-07 (thanks to Howard Kapustein for patches) - You can set the endianness in your files, no need to modify the header file of the CSHA1 class anymore. - Aligned data support. - Made support/compilation of the utility functions (ReportHash and HashFile) optional (useful when bytes count, for example in embedded environments). Version 1.5 - 2005-01-01 - 64-bit compiler compatibility added. - Made variable wiping optional (define SHA1_WIPE_VARIABLES). - Removed unnecessary variable initializations. - ROL32 improvement for the Microsoft compiler (using _rotl). Version 1.4 - 2004-07-22 - CSHA1 now compiles fine with GCC 3.3 under Mac OS X (thanks to Larry Hastings). Version 1.3 - 2003-08-17 - Fixed a small memory bug and made a buffer array a class member to ensure correct working when using multiple CSHA1 class instances at one time. Version 1.2 - 2002-11-16 - Borlands C++ compiler seems to have problems with string addition using sprintf. Fixed the bug which caused the digest report function not to work properly. CSHA1 is now Borland compatible. Version 1.1 - 2002-10-11 - Removed two unnecessary header file includes and changed BOOL to bool. Fixed some minor bugs in the web page contents. Version 1.0 - 2002-06-20 - First official release. ================ Test Vectors ================ SHA1("abc" in ANSI) = A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D SHA1("abc" in Unicode LE) = 9F04F41A 84851416 2050E3D6 8C1A7ABB 441DC2B5 SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" in ANSI) = 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" in Unicode LE) = 51D7D876 9AC72C40 9C5B0E3F 69C60ADC 9A039014 SHA1(A million repetitions of "a" in ANSI) = 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F SHA1(A million repetitions of "a" in Unicode LE) = C4609560 A108A0C6 26AA7F2B 38A65566 739353C5 */ #ifndef SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 #define SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 #if !defined(SHA1_UTILITY_FUNCTIONS) && !defined(SHA1_NO_UTILITY_FUNCTIONS) #define SHA1_UTILITY_FUNCTIONS #endif #if !defined(SHA1_STL_FUNCTIONS) && !defined(SHA1_NO_STL_FUNCTIONS) #define SHA1_STL_FUNCTIONS #if !defined(SHA1_UTILITY_FUNCTIONS) #error STL functions require SHA1_UTILITY_FUNCTIONS. #endif #endif #include #include #ifdef SHA1_UTILITY_FUNCTIONS #include #include #endif #ifdef SHA1_STL_FUNCTIONS #include #endif #ifdef _MSC_VER #include #endif // You can define the endian mode in your files without modifying the SHA-1 // source files. Just #define SHA1_LITTLE_ENDIAN or #define SHA1_BIG_ENDIAN // in your files, before including the SHA1.h header file. If you don't // define anything, the class defaults to little endian. #if !defined(SHA1_LITTLE_ENDIAN) && !defined(SHA1_BIG_ENDIAN) #define SHA1_LITTLE_ENDIAN #endif // If you want variable wiping, #define SHA1_WIPE_VARIABLES, if not, // #define SHA1_NO_WIPE_VARIABLES. If you don't define anything, it // defaults to wiping. #if !defined(SHA1_WIPE_VARIABLES) && !defined(SHA1_NO_WIPE_VARIABLES) #define SHA1_WIPE_VARIABLES #endif #if defined(SHA1_HAS_TCHAR) #include #else #ifdef _MSC_VER #include #else #ifndef TCHAR #define TCHAR char #endif #ifndef _T #define _T(__x) (__x) #define _tmain main #define _tprintf printf #define _getts gets #define _tcslen strlen #define _tfopen fopen #define _tcscpy strcpy #define _tcscat strcat #define _sntprintf snprintf #endif #endif #endif /////////////////////////////////////////////////////////////////////////// // Define variable types #ifndef UINT_8 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_8 unsigned __int8 #else // !_MSC_VER #define UINT_8 unsigned char #endif // _MSC_VER #endif #ifndef UINT_32 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_32 unsigned __int32 #else // !_MSC_VER #if (ULONG_MAX == 0xFFFFFFFFUL) #define UINT_32 unsigned long #else #define UINT_32 unsigned int #endif #endif // _MSC_VER #endif // UINT_32 #ifndef INT_64 #ifdef _MSC_VER // Compiling with Microsoft compiler #define INT_64 __int64 #else // !_MSC_VER #define INT_64 long long #endif // _MSC_VER #endif // INT_64 #ifndef UINT_64 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_64 unsigned __int64 #else // !_MSC_VER #define UINT_64 unsigned long long #endif // _MSC_VER #endif // UINT_64 /////////////////////////////////////////////////////////////////////////// // Declare SHA-1 workspace typedef union { UINT_8 c[64]; UINT_32 l[16]; } SHA1_WORKSPACE_BLOCK; class CSHA1 { public: #ifdef SHA1_UTILITY_FUNCTIONS // Different formats for ReportHash(Stl) enum REPORT_TYPE { REPORT_HEX = 0, REPORT_DIGIT = 1, REPORT_HEX_SHORT = 2 }; #endif // Constructor and destructor CSHA1(); #ifdef SHA1_WIPE_VARIABLES ~CSHA1(); #endif void Reset(); // Hash in binary data and strings void Update(const UINT_8* pbData, UINT_32 uLen); #ifdef SHA1_UTILITY_FUNCTIONS // Hash in file contents bool HashFile(const TCHAR* tszFileName); #endif // Finalize hash; call it before using ReportHash(Stl) void Final(); #ifdef SHA1_UTILITY_FUNCTIONS bool ReportHash(TCHAR* tszReport, REPORT_TYPE rtReportType = REPORT_HEX) const; #endif #ifdef SHA1_STL_FUNCTIONS bool ReportHashStl(std::basic_string& strOut, REPORT_TYPE rtReportType = REPORT_HEX) const; #endif // Get the raw message digest (20 bytes) bool GetHash(UINT_8* pbDest20) const; private: // Private SHA-1 transformation void Transform(UINT_32* pState, const UINT_8* pBuffer); // Member variables UINT_32 m_state[5]; UINT_32 m_count[2]; UINT_32 m_reserved0[1]; // Memory alignment padding UINT_8 m_buffer[64]; UINT_8 m_digest[20]; UINT_32 m_reserved1[3]; // Memory alignment padding UINT_8 m_workspace[64]; SHA1_WORKSPACE_BLOCK* m_block; // SHA1 pointer to the byte array above }; #endif // SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 ================================================ FILE: Libraries/Core/RPi/Headers/SHA256/sha256.h ================================================ // ////////////////////////////////////////////////////////// // sha256.h // Copyright (c) 2014,2015 Stephan Brumme. All rights reserved. // see http://create.stephan-brumme.com/disclaimer.html // #pragma once //#include "hash.h" #include // define fixed size integer types #ifdef _MSC_VER // Windows typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; #else // GCC #include #endif /// compute SHA256 hash /** Usage: SHA256 sha256; std::string myHash = sha256("Hello World"); // std::string std::string myHash2 = sha256("How are you", 11); // arbitrary data, 11 bytes // or in a streaming fashion: SHA256 sha256; while (more data available) sha256.add(pointer to fresh data, number of new bytes); std::string myHash3 = sha256.getHash(); */ class SHA256 //: public Hash { public: /// split into 64 byte blocks (=> 512 bits), hash is 32 bytes long enum { BlockSize = 512 / 8, HashBytes = 32 }; /// same as reset() SHA256(); /// compute SHA256 of a memory block std::string operator()(const void* data, size_t numBytes); /// compute SHA256 of a string, excluding final zero std::string operator()(const std::string& text); /// add arbitrary number of bytes void add(const void* data, size_t numBytes); /// return latest hash as 64 hex characters std::string getHash(); /// return latest hash as bytes void getHash(unsigned char buffer[HashBytes]); /// restart void reset(); private: /// process 64 bytes void processBlock(const void* data); /// process everything left in the internal buffer void processBuffer(); /// size of processed data in bytes uint64_t m_numBytes; /// valid bytes in m_buffer size_t m_bufferSize; /// bytes not processed yet uint8_t m_buffer[BlockSize]; enum { HashValues = HashBytes / 4 }; /// hash, stored as integers uint32_t m_hash[HashValues]; }; ================================================ FILE: Libraries/Core/RPi/Headers/X11/DECkeysym.h ================================================ /*********************************************************** Copyright 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1988 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* * DEC private keysyms * (29th bit set) */ /* two-key compose sequence initiators, chosen to map to Latin1 characters */ #define DXK_ring_accent 0x1000FEB0 #define DXK_circumflex_accent 0x1000FE5E #define DXK_cedilla_accent 0x1000FE2C #define DXK_acute_accent 0x1000FE27 #define DXK_grave_accent 0x1000FE60 #define DXK_tilde 0x1000FE7E #define DXK_diaeresis 0x1000FE22 /* special keysym for LK2** "Remove" key on editing keypad */ #define DXK_Remove 0x1000FF00 /* Remove */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/HPkeysym.h ================================================ /* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Hewlett Packard or Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material. */ #ifndef _HPKEYSYM_H #define _HPKEYSYM_H #define hpXK_ClearLine 0x1000FF6F #define hpXK_InsertLine 0x1000FF70 #define hpXK_DeleteLine 0x1000FF71 #define hpXK_InsertChar 0x1000FF72 #define hpXK_DeleteChar 0x1000FF73 #define hpXK_BackTab 0x1000FF74 #define hpXK_KP_BackTab 0x1000FF75 #define hpXK_Modelock1 0x1000FF48 #define hpXK_Modelock2 0x1000FF49 #define hpXK_Reset 0x1000FF6C #define hpXK_System 0x1000FF6D #define hpXK_User 0x1000FF6E #define hpXK_mute_acute 0x100000A8 #define hpXK_mute_grave 0x100000A9 #define hpXK_mute_asciicircum 0x100000AA #define hpXK_mute_diaeresis 0x100000AB #define hpXK_mute_asciitilde 0x100000AC #define hpXK_lira 0x100000AF #define hpXK_guilder 0x100000BE #define hpXK_Ydiaeresis 0x100000EE #define hpXK_IO 0x100000EE #define hpXK_longminus 0x100000F6 #define hpXK_block 0x100000FC #ifndef _OSF_Keysyms #define _OSF_Keysyms #define osfXK_Copy 0x1004FF02 #define osfXK_Cut 0x1004FF03 #define osfXK_Paste 0x1004FF04 #define osfXK_BackTab 0x1004FF07 #define osfXK_BackSpace 0x1004FF08 #define osfXK_Clear 0x1004FF0B #define osfXK_Escape 0x1004FF1B #define osfXK_AddMode 0x1004FF31 #define osfXK_PrimaryPaste 0x1004FF32 #define osfXK_QuickPaste 0x1004FF33 #define osfXK_PageLeft 0x1004FF40 #define osfXK_PageUp 0x1004FF41 #define osfXK_PageDown 0x1004FF42 #define osfXK_PageRight 0x1004FF43 #define osfXK_Activate 0x1004FF44 #define osfXK_MenuBar 0x1004FF45 #define osfXK_Left 0x1004FF51 #define osfXK_Up 0x1004FF52 #define osfXK_Right 0x1004FF53 #define osfXK_Down 0x1004FF54 #define osfXK_EndLine 0x1004FF57 #define osfXK_BeginLine 0x1004FF58 #define osfXK_EndData 0x1004FF59 #define osfXK_BeginData 0x1004FF5A #define osfXK_PrevMenu 0x1004FF5B #define osfXK_NextMenu 0x1004FF5C #define osfXK_PrevField 0x1004FF5D #define osfXK_NextField 0x1004FF5E #define osfXK_Select 0x1004FF60 #define osfXK_Insert 0x1004FF63 #define osfXK_Undo 0x1004FF65 #define osfXK_Menu 0x1004FF67 #define osfXK_Cancel 0x1004FF69 #define osfXK_Help 0x1004FF6A #define osfXK_SelectAll 0x1004FF71 #define osfXK_DeselectAll 0x1004FF72 #define osfXK_Reselect 0x1004FF73 #define osfXK_Extend 0x1004FF74 #define osfXK_Restore 0x1004FF78 #define osfXK_Delete 0x1004FFFF #endif /* _OSF_Keysyms */ /************************************************************** * The use of the following macros is deprecated. * They are listed below only for backwards compatibility. */ #define XK_Reset 0x1000FF6C #define XK_System 0x1000FF6D #define XK_User 0x1000FF6E #define XK_ClearLine 0x1000FF6F #define XK_InsertLine 0x1000FF70 #define XK_DeleteLine 0x1000FF71 #define XK_InsertChar 0x1000FF72 #define XK_DeleteChar 0x1000FF73 #define XK_BackTab 0x1000FF74 #define XK_KP_BackTab 0x1000FF75 #define XK_Ext16bit_L 0x1000FF76 #define XK_Ext16bit_R 0x1000FF77 #define XK_mute_acute 0x100000a8 #define XK_mute_grave 0x100000a9 #define XK_mute_asciicircum 0x100000aa #define XK_mute_diaeresis 0x100000ab #define XK_mute_asciitilde 0x100000ac #define XK_lira 0x100000af #define XK_guilder 0x100000be #ifndef XK_Ydiaeresis #define XK_Ydiaeresis 0x100000ee #endif #define XK_IO 0x100000ee #define XK_longminus 0x100000f6 #define XK_block 0x100000fc #endif /* _HPKEYSYM_H */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/ImUtil.h ================================================ #ifndef _X11_IMUTIL_H_ #define _X11_IMUTIL_H_ extern int _XGetScanlinePad( Display *dpy, int depth); extern int _XGetBitsPerPixel( Display *dpy, int depth); extern int _XSetImage( XImage *srcimg, register XImage *dstimg, register int x, register int y); extern int _XReverse_Bytes( register unsigned char *bpt, register int nb); extern void _XInitImageFuncPtrs( register XImage *image); #endif /* _X11_IMUTIL_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Sunkeysym.h ================================================ /* * Copyright (c) 1991, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /************************************************************ Copyright 1991, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. ***********************************************************/ /* * Floating Accent */ #define SunXK_FA_Grave 0x1005FF00 #define SunXK_FA_Circum 0x1005FF01 #define SunXK_FA_Tilde 0x1005FF02 #define SunXK_FA_Acute 0x1005FF03 #define SunXK_FA_Diaeresis 0x1005FF04 #define SunXK_FA_Cedilla 0x1005FF05 /* * Miscellaneous Functions */ #define SunXK_F36 0x1005FF10 /* Labeled F11 */ #define SunXK_F37 0x1005FF11 /* Labeled F12 */ #define SunXK_Sys_Req 0x1005FF60 #define SunXK_Print_Screen 0x0000FF61 /* Same as XK_Print */ /* * International & Multi-Key Character Composition */ #define SunXK_Compose 0x0000FF20 /* Same as XK_Multi_key */ #define SunXK_AltGraph 0x0000FF7E /* Same as XK_Mode_switch */ /* * Cursor Control */ #define SunXK_PageUp 0x0000FF55 /* Same as XK_Prior */ #define SunXK_PageDown 0x0000FF56 /* Same as XK_Next */ /* * Open Look Functions */ #define SunXK_Undo 0x0000FF65 /* Same as XK_Undo */ #define SunXK_Again 0x0000FF66 /* Same as XK_Redo */ #define SunXK_Find 0x0000FF68 /* Same as XK_Find */ #define SunXK_Stop 0x0000FF69 /* Same as XK_Cancel */ #define SunXK_Props 0x1005FF70 #define SunXK_Front 0x1005FF71 #define SunXK_Copy 0x1005FF72 #define SunXK_Open 0x1005FF73 #define SunXK_Paste 0x1005FF74 #define SunXK_Cut 0x1005FF75 #define SunXK_PowerSwitch 0x1005FF76 #define SunXK_AudioLowerVolume 0x1005FF77 #define SunXK_AudioMute 0x1005FF78 #define SunXK_AudioRaiseVolume 0x1005FF79 #define SunXK_VideoDegauss 0x1005FF7A #define SunXK_VideoLowerBrightness 0x1005FF7B #define SunXK_VideoRaiseBrightness 0x1005FF7C #define SunXK_PowerSwitchShift 0x1005FF7D ================================================ FILE: Libraries/Core/RPi/Headers/X11/X.h ================================================ /* Definitions for the X window system likely to be used by applications */ #ifndef X_H #define X_H /*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #define X_PROTOCOL 11 /* current protocol version */ #define X_PROTOCOL_REVISION 0 /* current minor version */ /* Resources */ /* * _XSERVER64 must ONLY be defined when compiling X server sources on * systems where unsigned long is not 32 bits, must NOT be used in * client or library code. */ #ifndef _XSERVER64 # ifndef _XTYPEDEF_XID # define _XTYPEDEF_XID typedef unsigned long XID; # endif # ifndef _XTYPEDEF_MASK # define _XTYPEDEF_MASK typedef unsigned long Mask; # endif # ifndef _XTYPEDEF_ATOM # define _XTYPEDEF_ATOM typedef unsigned long Atom; /* Also in Xdefs.h */ # endif typedef unsigned long VisualID; typedef unsigned long Time; #else # include # ifndef _XTYPEDEF_XID # define _XTYPEDEF_XID typedef CARD32 XID; # endif # ifndef _XTYPEDEF_MASK # define _XTYPEDEF_MASK typedef CARD32 Mask; # endif # ifndef _XTYPEDEF_ATOM # define _XTYPEDEF_ATOM typedef CARD32 Atom; # endif typedef CARD32 VisualID; typedef CARD32 Time; #endif typedef XID Window; typedef XID Drawable; #ifndef _XTYPEDEF_FONT # define _XTYPEDEF_FONT typedef XID Font; #endif typedef XID Pixmap; typedef XID Cursor; typedef XID Colormap; typedef XID GContext; typedef XID KeySym; typedef unsigned char KeyCode; /***************************************************************** * RESERVED RESOURCE AND CONSTANT DEFINITIONS *****************************************************************/ #ifndef None #define None 0L /* universal null resource or null atom */ #endif #define ParentRelative 1L /* background pixmap in CreateWindow and ChangeWindowAttributes */ #define CopyFromParent 0L /* border pixmap in CreateWindow and ChangeWindowAttributes special VisualID and special window class passed to CreateWindow */ #define PointerWindow 0L /* destination window in SendEvent */ #define InputFocus 1L /* destination window in SendEvent */ #define PointerRoot 1L /* focus window in SetInputFocus */ #define AnyPropertyType 0L /* special Atom, passed to GetProperty */ #define AnyKey 0L /* special Key Code, passed to GrabKey */ #define AnyButton 0L /* special Button Code, passed to GrabButton */ #define AllTemporary 0L /* special Resource ID passed to KillClient */ #define CurrentTime 0L /* special Time */ #define NoSymbol 0L /* special KeySym */ /***************************************************************** * EVENT DEFINITIONS *****************************************************************/ /* Input Event Masks. Used as event-mask window attribute and as arguments to Grab requests. Not to be confused with event names. */ #define NoEventMask 0L #define KeyPressMask (1L<<0) #define KeyReleaseMask (1L<<1) #define ButtonPressMask (1L<<2) #define ButtonReleaseMask (1L<<3) #define EnterWindowMask (1L<<4) #define LeaveWindowMask (1L<<5) #define PointerMotionMask (1L<<6) #define PointerMotionHintMask (1L<<7) #define Button1MotionMask (1L<<8) #define Button2MotionMask (1L<<9) #define Button3MotionMask (1L<<10) #define Button4MotionMask (1L<<11) #define Button5MotionMask (1L<<12) #define ButtonMotionMask (1L<<13) #define KeymapStateMask (1L<<14) #define ExposureMask (1L<<15) #define VisibilityChangeMask (1L<<16) #define StructureNotifyMask (1L<<17) #define ResizeRedirectMask (1L<<18) #define SubstructureNotifyMask (1L<<19) #define SubstructureRedirectMask (1L<<20) #define FocusChangeMask (1L<<21) #define PropertyChangeMask (1L<<22) #define ColormapChangeMask (1L<<23) #define OwnerGrabButtonMask (1L<<24) /* Event names. Used in "type" field in XEvent structures. Not to be confused with event masks above. They start from 2 because 0 and 1 are reserved in the protocol for errors and replies. */ #define KeyPress 2 #define KeyRelease 3 #define ButtonPress 4 #define ButtonRelease 5 #define MotionNotify 6 #define EnterNotify 7 #define LeaveNotify 8 #define FocusIn 9 #define FocusOut 10 #define KeymapNotify 11 #define Expose 12 #define GraphicsExpose 13 #define NoExpose 14 #define VisibilityNotify 15 #define CreateNotify 16 #define DestroyNotify 17 #define UnmapNotify 18 #define MapNotify 19 #define MapRequest 20 #define ReparentNotify 21 #define ConfigureNotify 22 #define ConfigureRequest 23 #define GravityNotify 24 #define ResizeRequest 25 #define CirculateNotify 26 #define CirculateRequest 27 #define PropertyNotify 28 #define SelectionClear 29 #define SelectionRequest 30 #define SelectionNotify 31 #define ColormapNotify 32 #define ClientMessage 33 #define MappingNotify 34 #define GenericEvent 35 #define LASTEvent 36 /* must be bigger than any event # */ /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, state in various key-, mouse-, and button-related events. */ #define ShiftMask (1<<0) #define LockMask (1<<1) #define ControlMask (1<<2) #define Mod1Mask (1<<3) #define Mod2Mask (1<<4) #define Mod3Mask (1<<5) #define Mod4Mask (1<<6) #define Mod5Mask (1<<7) /* modifier names. Used to build a SetModifierMapping request or to read a GetModifierMapping request. These correspond to the masks defined above. */ #define ShiftMapIndex 0 #define LockMapIndex 1 #define ControlMapIndex 2 #define Mod1MapIndex 3 #define Mod2MapIndex 4 #define Mod3MapIndex 5 #define Mod4MapIndex 6 #define Mod5MapIndex 7 /* button masks. Used in same manner as Key masks above. Not to be confused with button names below. */ #define Button1Mask (1<<8) #define Button2Mask (1<<9) #define Button3Mask (1<<10) #define Button4Mask (1<<11) #define Button5Mask (1<<12) #define AnyModifier (1<<15) /* used in GrabButton, GrabKey */ /* button names. Used as arguments to GrabButton and as detail in ButtonPress and ButtonRelease events. Not to be confused with button masks above. Note that 0 is already defined above as "AnyButton". */ #define Button1 1 #define Button2 2 #define Button3 3 #define Button4 4 #define Button5 5 /* Notify modes */ #define NotifyNormal 0 #define NotifyGrab 1 #define NotifyUngrab 2 #define NotifyWhileGrabbed 3 #define NotifyHint 1 /* for MotionNotify events */ /* Notify detail */ #define NotifyAncestor 0 #define NotifyVirtual 1 #define NotifyInferior 2 #define NotifyNonlinear 3 #define NotifyNonlinearVirtual 4 #define NotifyPointer 5 #define NotifyPointerRoot 6 #define NotifyDetailNone 7 /* Visibility notify */ #define VisibilityUnobscured 0 #define VisibilityPartiallyObscured 1 #define VisibilityFullyObscured 2 /* Circulation request */ #define PlaceOnTop 0 #define PlaceOnBottom 1 /* protocol families */ #define FamilyInternet 0 /* IPv4 */ #define FamilyDECnet 1 #define FamilyChaos 2 #define FamilyInternet6 6 /* IPv6 */ /* authentication families not tied to a specific protocol */ #define FamilyServerInterpreted 5 /* Property notification */ #define PropertyNewValue 0 #define PropertyDelete 1 /* Color Map notification */ #define ColormapUninstalled 0 #define ColormapInstalled 1 /* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */ #define GrabModeSync 0 #define GrabModeAsync 1 /* GrabPointer, GrabKeyboard reply status */ #define GrabSuccess 0 #define AlreadyGrabbed 1 #define GrabInvalidTime 2 #define GrabNotViewable 3 #define GrabFrozen 4 /* AllowEvents modes */ #define AsyncPointer 0 #define SyncPointer 1 #define ReplayPointer 2 #define AsyncKeyboard 3 #define SyncKeyboard 4 #define ReplayKeyboard 5 #define AsyncBoth 6 #define SyncBoth 7 /* Used in SetInputFocus, GetInputFocus */ #define RevertToNone (int)None #define RevertToPointerRoot (int)PointerRoot #define RevertToParent 2 /***************************************************************** * ERROR CODES *****************************************************************/ #define Success 0 /* everything's okay */ #define BadRequest 1 /* bad request code */ #define BadValue 2 /* int parameter out of range */ #define BadWindow 3 /* parameter not a Window */ #define BadPixmap 4 /* parameter not a Pixmap */ #define BadAtom 5 /* parameter not an Atom */ #define BadCursor 6 /* parameter not a Cursor */ #define BadFont 7 /* parameter not a Font */ #define BadMatch 8 /* parameter mismatch */ #define BadDrawable 9 /* parameter not a Pixmap or Window */ #define BadAccess 10 /* depending on context: - key/button already grabbed - attempt to free an illegal cmap entry - attempt to store into a read-only color map entry. - attempt to modify the access control list from other than the local host. */ #define BadAlloc 11 /* insufficient resources */ #define BadColor 12 /* no such colormap */ #define BadGC 13 /* parameter not a GC */ #define BadIDChoice 14 /* choice not in range or already used */ #define BadName 15 /* font or color name doesn't exist */ #define BadLength 16 /* Request length incorrect */ #define BadImplementation 17 /* server is defective */ #define FirstExtensionError 128 #define LastExtensionError 255 /***************************************************************** * WINDOW DEFINITIONS *****************************************************************/ /* Window classes used by CreateWindow */ /* Note that CopyFromParent is already defined as 0 above */ #define InputOutput 1 #define InputOnly 2 /* Window attributes for CreateWindow and ChangeWindowAttributes */ #define CWBackPixmap (1L<<0) #define CWBackPixel (1L<<1) #define CWBorderPixmap (1L<<2) #define CWBorderPixel (1L<<3) #define CWBitGravity (1L<<4) #define CWWinGravity (1L<<5) #define CWBackingStore (1L<<6) #define CWBackingPlanes (1L<<7) #define CWBackingPixel (1L<<8) #define CWOverrideRedirect (1L<<9) #define CWSaveUnder (1L<<10) #define CWEventMask (1L<<11) #define CWDontPropagate (1L<<12) #define CWColormap (1L<<13) #define CWCursor (1L<<14) /* ConfigureWindow structure */ #define CWX (1<<0) #define CWY (1<<1) #define CWWidth (1<<2) #define CWHeight (1<<3) #define CWBorderWidth (1<<4) #define CWSibling (1<<5) #define CWStackMode (1<<6) /* Bit Gravity */ #define ForgetGravity 0 #define NorthWestGravity 1 #define NorthGravity 2 #define NorthEastGravity 3 #define WestGravity 4 #define CenterGravity 5 #define EastGravity 6 #define SouthWestGravity 7 #define SouthGravity 8 #define SouthEastGravity 9 #define StaticGravity 10 /* Window gravity + bit gravity above */ #define UnmapGravity 0 /* Used in CreateWindow for backing-store hint */ #define NotUseful 0 #define WhenMapped 1 #define Always 2 /* Used in GetWindowAttributes reply */ #define IsUnmapped 0 #define IsUnviewable 1 #define IsViewable 2 /* Used in ChangeSaveSet */ #define SetModeInsert 0 #define SetModeDelete 1 /* Used in ChangeCloseDownMode */ #define DestroyAll 0 #define RetainPermanent 1 #define RetainTemporary 2 /* Window stacking method (in configureWindow) */ #define Above 0 #define Below 1 #define TopIf 2 #define BottomIf 3 #define Opposite 4 /* Circulation direction */ #define RaiseLowest 0 #define LowerHighest 1 /* Property modes */ #define PropModeReplace 0 #define PropModePrepend 1 #define PropModeAppend 2 /***************************************************************** * GRAPHICS DEFINITIONS *****************************************************************/ /* graphics functions, as in GC.alu */ #define GXclear 0x0 /* 0 */ #define GXand 0x1 /* src AND dst */ #define GXandReverse 0x2 /* src AND NOT dst */ #define GXcopy 0x3 /* src */ #define GXandInverted 0x4 /* NOT src AND dst */ #define GXnoop 0x5 /* dst */ #define GXxor 0x6 /* src XOR dst */ #define GXor 0x7 /* src OR dst */ #define GXnor 0x8 /* NOT src AND NOT dst */ #define GXequiv 0x9 /* NOT src XOR dst */ #define GXinvert 0xa /* NOT dst */ #define GXorReverse 0xb /* src OR NOT dst */ #define GXcopyInverted 0xc /* NOT src */ #define GXorInverted 0xd /* NOT src OR dst */ #define GXnand 0xe /* NOT src OR NOT dst */ #define GXset 0xf /* 1 */ /* LineStyle */ #define LineSolid 0 #define LineOnOffDash 1 #define LineDoubleDash 2 /* capStyle */ #define CapNotLast 0 #define CapButt 1 #define CapRound 2 #define CapProjecting 3 /* joinStyle */ #define JoinMiter 0 #define JoinRound 1 #define JoinBevel 2 /* fillStyle */ #define FillSolid 0 #define FillTiled 1 #define FillStippled 2 #define FillOpaqueStippled 3 /* fillRule */ #define EvenOddRule 0 #define WindingRule 1 /* subwindow mode */ #define ClipByChildren 0 #define IncludeInferiors 1 /* SetClipRectangles ordering */ #define Unsorted 0 #define YSorted 1 #define YXSorted 2 #define YXBanded 3 /* CoordinateMode for drawing routines */ #define CoordModeOrigin 0 /* relative to the origin */ #define CoordModePrevious 1 /* relative to previous point */ /* Polygon shapes */ #define Complex 0 /* paths may intersect */ #define Nonconvex 1 /* no paths intersect, but not convex */ #define Convex 2 /* wholly convex */ /* Arc modes for PolyFillArc */ #define ArcChord 0 /* join endpoints of arc */ #define ArcPieSlice 1 /* join endpoints to center of arc */ /* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into GC.stateChanges */ #define GCFunction (1L<<0) #define GCPlaneMask (1L<<1) #define GCForeground (1L<<2) #define GCBackground (1L<<3) #define GCLineWidth (1L<<4) #define GCLineStyle (1L<<5) #define GCCapStyle (1L<<6) #define GCJoinStyle (1L<<7) #define GCFillStyle (1L<<8) #define GCFillRule (1L<<9) #define GCTile (1L<<10) #define GCStipple (1L<<11) #define GCTileStipXOrigin (1L<<12) #define GCTileStipYOrigin (1L<<13) #define GCFont (1L<<14) #define GCSubwindowMode (1L<<15) #define GCGraphicsExposures (1L<<16) #define GCClipXOrigin (1L<<17) #define GCClipYOrigin (1L<<18) #define GCClipMask (1L<<19) #define GCDashOffset (1L<<20) #define GCDashList (1L<<21) #define GCArcMode (1L<<22) #define GCLastBit 22 /***************************************************************** * FONTS *****************************************************************/ /* used in QueryFont -- draw direction */ #define FontLeftToRight 0 #define FontRightToLeft 1 #define FontChange 255 /***************************************************************** * IMAGING *****************************************************************/ /* ImageFormat -- PutImage, GetImage */ #define XYBitmap 0 /* depth 1, XYFormat */ #define XYPixmap 1 /* depth == drawable depth */ #define ZPixmap 2 /* depth == drawable depth */ /***************************************************************** * COLOR MAP STUFF *****************************************************************/ /* For CreateColormap */ #define AllocNone 0 /* create map with no entries */ #define AllocAll 1 /* allocate entire map writeable */ /* Flags used in StoreNamedColor, StoreColors */ #define DoRed (1<<0) #define DoGreen (1<<1) #define DoBlue (1<<2) /***************************************************************** * CURSOR STUFF *****************************************************************/ /* QueryBestSize Class */ #define CursorShape 0 /* largest size that can be displayed */ #define TileShape 1 /* size tiled fastest */ #define StippleShape 2 /* size stippled fastest */ /***************************************************************** * KEYBOARD/POINTER STUFF *****************************************************************/ #define AutoRepeatModeOff 0 #define AutoRepeatModeOn 1 #define AutoRepeatModeDefault 2 #define LedModeOff 0 #define LedModeOn 1 /* masks for ChangeKeyboardControl */ #define KBKeyClickPercent (1L<<0) #define KBBellPercent (1L<<1) #define KBBellPitch (1L<<2) #define KBBellDuration (1L<<3) #define KBLed (1L<<4) #define KBLedMode (1L<<5) #define KBKey (1L<<6) #define KBAutoRepeatMode (1L<<7) #define MappingSuccess 0 #define MappingBusy 1 #define MappingFailed 2 #define MappingModifier 0 #define MappingKeyboard 1 #define MappingPointer 2 /***************************************************************** * SCREEN SAVER STUFF *****************************************************************/ #define DontPreferBlanking 0 #define PreferBlanking 1 #define DefaultBlanking 2 #define DisableScreenSaver 0 #define DisableScreenInterval 0 #define DontAllowExposures 0 #define AllowExposures 1 #define DefaultExposures 2 /* for ForceScreenSaver */ #define ScreenSaverReset 0 #define ScreenSaverActive 1 /***************************************************************** * HOSTS AND CONNECTIONS *****************************************************************/ /* for ChangeHosts */ #define HostInsert 0 #define HostDelete 1 /* for ChangeAccessControl */ #define EnableAccess 1 #define DisableAccess 0 /* Display classes used in opening the connection * Note that the statically allocated ones are even numbered and the * dynamically changeable ones are odd numbered */ #define StaticGray 0 #define GrayScale 1 #define StaticColor 2 #define PseudoColor 3 #define TrueColor 4 #define DirectColor 5 /* Byte order used in imageByteOrder and bitmapBitOrder */ #define LSBFirst 0 #define MSBFirst 1 #endif /* X_H */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/XF86keysym.h ================================================ /* * XFree86 vendor specific keysyms. * * The XFree86 keysym range is 0x10080001 - 0x1008FFFF. * * X.Org will not be adding to the XF86 set of keysyms, though they have * been adopted and are considered a "standard" part of X keysym definitions. * XFree86 never properly commented these keysyms, so we have done our * best to explain the semantic meaning of these keys. * * XFree86 has removed their mail archives of the period, that might have * shed more light on some of these definitions. Until/unless we resurrect * these archives, these are from memory and usage. */ /* * ModeLock * * This one is old, and not really used any more since XKB offers this * functionality. */ #define XF86XK_ModeLock 0x1008FF01 /* Mode Switch Lock */ /* Backlight controls. */ #define XF86XK_MonBrightnessUp 0x1008FF02 /* Monitor/panel brightness */ #define XF86XK_MonBrightnessDown 0x1008FF03 /* Monitor/panel brightness */ #define XF86XK_KbdLightOnOff 0x1008FF04 /* Keyboards may be lit */ #define XF86XK_KbdBrightnessUp 0x1008FF05 /* Keyboards may be lit */ #define XF86XK_KbdBrightnessDown 0x1008FF06 /* Keyboards may be lit */ /* * Keys found on some "Internet" keyboards. */ #define XF86XK_Standby 0x1008FF10 /* System into standby mode */ #define XF86XK_AudioLowerVolume 0x1008FF11 /* Volume control down */ #define XF86XK_AudioMute 0x1008FF12 /* Mute sound from the system */ #define XF86XK_AudioRaiseVolume 0x1008FF13 /* Volume control up */ #define XF86XK_AudioPlay 0x1008FF14 /* Start playing of audio > */ #define XF86XK_AudioStop 0x1008FF15 /* Stop playing audio */ #define XF86XK_AudioPrev 0x1008FF16 /* Previous track */ #define XF86XK_AudioNext 0x1008FF17 /* Next track */ #define XF86XK_HomePage 0x1008FF18 /* Display user's home page */ #define XF86XK_Mail 0x1008FF19 /* Invoke user's mail program */ #define XF86XK_Start 0x1008FF1A /* Start application */ #define XF86XK_Search 0x1008FF1B /* Search */ #define XF86XK_AudioRecord 0x1008FF1C /* Record audio application */ /* These are sometimes found on PDA's (e.g. Palm, PocketPC or elsewhere) */ #define XF86XK_Calculator 0x1008FF1D /* Invoke calculator program */ #define XF86XK_Memo 0x1008FF1E /* Invoke Memo taking program */ #define XF86XK_ToDoList 0x1008FF1F /* Invoke To Do List program */ #define XF86XK_Calendar 0x1008FF20 /* Invoke Calendar program */ #define XF86XK_PowerDown 0x1008FF21 /* Deep sleep the system */ #define XF86XK_ContrastAdjust 0x1008FF22 /* Adjust screen contrast */ #define XF86XK_RockerUp 0x1008FF23 /* Rocker switches exist up */ #define XF86XK_RockerDown 0x1008FF24 /* and down */ #define XF86XK_RockerEnter 0x1008FF25 /* and let you press them */ /* Some more "Internet" keyboard symbols */ #define XF86XK_Back 0x1008FF26 /* Like back on a browser */ #define XF86XK_Forward 0x1008FF27 /* Like forward on a browser */ #define XF86XK_Stop 0x1008FF28 /* Stop current operation */ #define XF86XK_Refresh 0x1008FF29 /* Refresh the page */ #define XF86XK_PowerOff 0x1008FF2A /* Power off system entirely */ #define XF86XK_WakeUp 0x1008FF2B /* Wake up system from sleep */ #define XF86XK_Eject 0x1008FF2C /* Eject device (e.g. DVD) */ #define XF86XK_ScreenSaver 0x1008FF2D /* Invoke screensaver */ #define XF86XK_WWW 0x1008FF2E /* Invoke web browser */ #define XF86XK_Sleep 0x1008FF2F /* Put system to sleep */ #define XF86XK_Favorites 0x1008FF30 /* Show favorite locations */ #define XF86XK_AudioPause 0x1008FF31 /* Pause audio playing */ #define XF86XK_AudioMedia 0x1008FF32 /* Launch media collection app */ #define XF86XK_MyComputer 0x1008FF33 /* Display "My Computer" window */ #define XF86XK_VendorHome 0x1008FF34 /* Display vendor home web site */ #define XF86XK_LightBulb 0x1008FF35 /* Light bulb keys exist */ #define XF86XK_Shop 0x1008FF36 /* Display shopping web site */ #define XF86XK_History 0x1008FF37 /* Show history of web surfing */ #define XF86XK_OpenURL 0x1008FF38 /* Open selected URL */ #define XF86XK_AddFavorite 0x1008FF39 /* Add URL to favorites list */ #define XF86XK_HotLinks 0x1008FF3A /* Show "hot" links */ #define XF86XK_BrightnessAdjust 0x1008FF3B /* Invoke brightness adj. UI */ #define XF86XK_Finance 0x1008FF3C /* Display financial site */ #define XF86XK_Community 0x1008FF3D /* Display user's community */ #define XF86XK_AudioRewind 0x1008FF3E /* "rewind" audio track */ #define XF86XK_BackForward 0x1008FF3F /* ??? */ #define XF86XK_Launch0 0x1008FF40 /* Launch Application */ #define XF86XK_Launch1 0x1008FF41 /* Launch Application */ #define XF86XK_Launch2 0x1008FF42 /* Launch Application */ #define XF86XK_Launch3 0x1008FF43 /* Launch Application */ #define XF86XK_Launch4 0x1008FF44 /* Launch Application */ #define XF86XK_Launch5 0x1008FF45 /* Launch Application */ #define XF86XK_Launch6 0x1008FF46 /* Launch Application */ #define XF86XK_Launch7 0x1008FF47 /* Launch Application */ #define XF86XK_Launch8 0x1008FF48 /* Launch Application */ #define XF86XK_Launch9 0x1008FF49 /* Launch Application */ #define XF86XK_LaunchA 0x1008FF4A /* Launch Application */ #define XF86XK_LaunchB 0x1008FF4B /* Launch Application */ #define XF86XK_LaunchC 0x1008FF4C /* Launch Application */ #define XF86XK_LaunchD 0x1008FF4D /* Launch Application */ #define XF86XK_LaunchE 0x1008FF4E /* Launch Application */ #define XF86XK_LaunchF 0x1008FF4F /* Launch Application */ #define XF86XK_ApplicationLeft 0x1008FF50 /* switch to application, left */ #define XF86XK_ApplicationRight 0x1008FF51 /* switch to application, right*/ #define XF86XK_Book 0x1008FF52 /* Launch bookreader */ #define XF86XK_CD 0x1008FF53 /* Launch CD/DVD player */ #define XF86XK_Calculater 0x1008FF54 /* Launch Calculater */ #define XF86XK_Clear 0x1008FF55 /* Clear window, screen */ #define XF86XK_Close 0x1008FF56 /* Close window */ #define XF86XK_Copy 0x1008FF57 /* Copy selection */ #define XF86XK_Cut 0x1008FF58 /* Cut selection */ #define XF86XK_Display 0x1008FF59 /* Output switch key */ #define XF86XK_DOS 0x1008FF5A /* Launch DOS (emulation) */ #define XF86XK_Documents 0x1008FF5B /* Open documents window */ #define XF86XK_Excel 0x1008FF5C /* Launch spread sheet */ #define XF86XK_Explorer 0x1008FF5D /* Launch file explorer */ #define XF86XK_Game 0x1008FF5E /* Launch game */ #define XF86XK_Go 0x1008FF5F /* Go to URL */ #define XF86XK_iTouch 0x1008FF60 /* Logitch iTouch- don't use */ #define XF86XK_LogOff 0x1008FF61 /* Log off system */ #define XF86XK_Market 0x1008FF62 /* ?? */ #define XF86XK_Meeting 0x1008FF63 /* enter meeting in calendar */ #define XF86XK_MenuKB 0x1008FF65 /* distingush keyboard from PB */ #define XF86XK_MenuPB 0x1008FF66 /* distinuish PB from keyboard */ #define XF86XK_MySites 0x1008FF67 /* Favourites */ #define XF86XK_New 0x1008FF68 /* New (folder, document... */ #define XF86XK_News 0x1008FF69 /* News */ #define XF86XK_OfficeHome 0x1008FF6A /* Office home (old Staroffice)*/ #define XF86XK_Open 0x1008FF6B /* Open */ #define XF86XK_Option 0x1008FF6C /* ?? */ #define XF86XK_Paste 0x1008FF6D /* Paste */ #define XF86XK_Phone 0x1008FF6E /* Launch phone; dial number */ #define XF86XK_Q 0x1008FF70 /* Compaq's Q - don't use */ #define XF86XK_Reply 0x1008FF72 /* Reply e.g., mail */ #define XF86XK_Reload 0x1008FF73 /* Reload web page, file, etc. */ #define XF86XK_RotateWindows 0x1008FF74 /* Rotate windows e.g. xrandr */ #define XF86XK_RotationPB 0x1008FF75 /* don't use */ #define XF86XK_RotationKB 0x1008FF76 /* don't use */ #define XF86XK_Save 0x1008FF77 /* Save (file, document, state */ #define XF86XK_ScrollUp 0x1008FF78 /* Scroll window/contents up */ #define XF86XK_ScrollDown 0x1008FF79 /* Scrool window/contentd down */ #define XF86XK_ScrollClick 0x1008FF7A /* Use XKB mousekeys instead */ #define XF86XK_Send 0x1008FF7B /* Send mail, file, object */ #define XF86XK_Spell 0x1008FF7C /* Spell checker */ #define XF86XK_SplitScreen 0x1008FF7D /* Split window or screen */ #define XF86XK_Support 0x1008FF7E /* Get support (??) */ #define XF86XK_TaskPane 0x1008FF7F /* Show tasks */ #define XF86XK_Terminal 0x1008FF80 /* Launch terminal emulator */ #define XF86XK_Tools 0x1008FF81 /* toolbox of desktop/app. */ #define XF86XK_Travel 0x1008FF82 /* ?? */ #define XF86XK_UserPB 0x1008FF84 /* ?? */ #define XF86XK_User1KB 0x1008FF85 /* ?? */ #define XF86XK_User2KB 0x1008FF86 /* ?? */ #define XF86XK_Video 0x1008FF87 /* Launch video player */ #define XF86XK_WheelButton 0x1008FF88 /* button from a mouse wheel */ #define XF86XK_Word 0x1008FF89 /* Launch word processor */ #define XF86XK_Xfer 0x1008FF8A #define XF86XK_ZoomIn 0x1008FF8B /* zoom in view, map, etc. */ #define XF86XK_ZoomOut 0x1008FF8C /* zoom out view, map, etc. */ #define XF86XK_Away 0x1008FF8D /* mark yourself as away */ #define XF86XK_Messenger 0x1008FF8E /* as in instant messaging */ #define XF86XK_WebCam 0x1008FF8F /* Launch web camera app. */ #define XF86XK_MailForward 0x1008FF90 /* Forward in mail */ #define XF86XK_Pictures 0x1008FF91 /* Show pictures */ #define XF86XK_Music 0x1008FF92 /* Launch music application */ #define XF86XK_Battery 0x1008FF93 /* Display battery information */ #define XF86XK_Bluetooth 0x1008FF94 /* Enable/disable Bluetooth */ #define XF86XK_WLAN 0x1008FF95 /* Enable/disable WLAN */ #define XF86XK_UWB 0x1008FF96 /* Enable/disable UWB */ #define XF86XK_AudioForward 0x1008FF97 /* fast-forward audio track */ #define XF86XK_AudioRepeat 0x1008FF98 /* toggle repeat mode */ #define XF86XK_AudioRandomPlay 0x1008FF99 /* toggle shuffle mode */ #define XF86XK_Subtitle 0x1008FF9A /* cycle through subtitle */ #define XF86XK_AudioCycleTrack 0x1008FF9B /* cycle through audio tracks */ #define XF86XK_CycleAngle 0x1008FF9C /* cycle through angles */ #define XF86XK_FrameBack 0x1008FF9D /* video: go one frame back */ #define XF86XK_FrameForward 0x1008FF9E /* video: go one frame forward */ #define XF86XK_Time 0x1008FF9F /* display, or shows an entry for time seeking */ #define XF86XK_Select 0x1008FFA0 /* Select button on joypads and remotes */ #define XF86XK_View 0x1008FFA1 /* Show a view options/properties */ #define XF86XK_TopMenu 0x1008FFA2 /* Go to a top-level menu in a video */ #define XF86XK_Red 0x1008FFA3 /* Red button */ #define XF86XK_Green 0x1008FFA4 /* Green button */ #define XF86XK_Yellow 0x1008FFA5 /* Yellow button */ #define XF86XK_Blue 0x1008FFA6 /* Blue button */ #define XF86XK_Suspend 0x1008FFA7 /* Sleep to RAM */ #define XF86XK_Hibernate 0x1008FFA8 /* Sleep to disk */ #define XF86XK_TouchpadToggle 0x1008FFA9 /* Toggle between touchpad/trackstick */ #define XF86XK_TouchpadOn 0x1008FFB0 /* The touchpad got switched on */ #define XF86XK_TouchpadOff 0x1008FFB1 /* The touchpad got switched off */ #define XF86XK_AudioMicMute 0x1008FFB2 /* Mute the Mic from the system */ /* Keys for special action keys (hot keys) */ /* Virtual terminals on some operating systems */ #define XF86XK_Switch_VT_1 0x1008FE01 #define XF86XK_Switch_VT_2 0x1008FE02 #define XF86XK_Switch_VT_3 0x1008FE03 #define XF86XK_Switch_VT_4 0x1008FE04 #define XF86XK_Switch_VT_5 0x1008FE05 #define XF86XK_Switch_VT_6 0x1008FE06 #define XF86XK_Switch_VT_7 0x1008FE07 #define XF86XK_Switch_VT_8 0x1008FE08 #define XF86XK_Switch_VT_9 0x1008FE09 #define XF86XK_Switch_VT_10 0x1008FE0A #define XF86XK_Switch_VT_11 0x1008FE0B #define XF86XK_Switch_VT_12 0x1008FE0C #define XF86XK_Ungrab 0x1008FE20 /* force ungrab */ #define XF86XK_ClearGrab 0x1008FE21 /* kill application with grab */ #define XF86XK_Next_VMode 0x1008FE22 /* next video mode available */ #define XF86XK_Prev_VMode 0x1008FE23 /* prev. video mode available */ #define XF86XK_LogWindowTree 0x1008FE24 /* print window tree to log */ #define XF86XK_LogGrabInfo 0x1008FE25 /* print all active grabs to log */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/XKBlib.h ================================================ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Silicon Graphics not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifndef _X11_XKBLIB_H_ #define _X11_XKBLIB_H_ #include #include typedef struct _XkbAnyEvent { int type; /* XkbAnyEvent */ unsigned long serial; /* # of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XKB event minor code */ unsigned int device; /* device ID */ } XkbAnyEvent; typedef struct _XkbNewKeyboardNotify { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbNewKeyboardNotify */ int device; /* device ID */ int old_device; /* device ID of previous keyboard */ int min_key_code; /* minimum key code */ int max_key_code; /* maximum key code */ int old_min_key_code;/* min key code of previous kbd */ int old_max_key_code;/* max key code of previous kbd */ unsigned int changed; /* changed aspects of the keyboard */ char req_major; /* major and minor opcode of req */ char req_minor; /* that caused change, if applicable */ } XkbNewKeyboardNotifyEvent; typedef struct _XkbMapNotifyEvent { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbMapNotify */ int device; /* device ID */ unsigned int changed; /* fields which have been changed */ unsigned int flags; /* reserved */ int first_type; /* first changed key type */ int num_types; /* number of changed key types */ KeyCode min_key_code; KeyCode max_key_code; KeyCode first_key_sym; KeyCode first_key_act; KeyCode first_key_behavior; KeyCode first_key_explicit; KeyCode first_modmap_key; KeyCode first_vmodmap_key; int num_key_syms; int num_key_acts; int num_key_behaviors; int num_key_explicit; int num_modmap_keys; int num_vmodmap_keys; unsigned int vmods; /* mask of changed virtual mods */ } XkbMapNotifyEvent; typedef struct _XkbStateNotifyEvent { int type; /* XkbAnyEvent */ unsigned long serial; /* # of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbStateNotify */ int device; /* device ID */ unsigned int changed; /* mask of changed state components */ int group; /* keyboard group */ int base_group; /* base keyboard group */ int latched_group; /* latched keyboard group */ int locked_group; /* locked keyboard group */ unsigned int mods; /* modifier state */ unsigned int base_mods; /* base modifier state */ unsigned int latched_mods; /* latched modifiers */ unsigned int locked_mods; /* locked modifiers */ int compat_state; /* compatibility state */ unsigned char grab_mods; /* mods used for grabs */ unsigned char compat_grab_mods;/* grab mods for non-XKB clients */ unsigned char lookup_mods; /* mods sent to clients */ unsigned char compat_lookup_mods; /* mods sent to non-XKB clients */ int ptr_buttons; /* pointer button state */ KeyCode keycode; /* keycode that caused the change */ char event_type; /* KeyPress or KeyRelease */ char req_major; /* Major opcode of request */ char req_minor; /* Minor opcode of request */ } XkbStateNotifyEvent; typedef struct _XkbControlsNotify { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbControlsNotify */ int device; /* device ID */ unsigned int changed_ctrls; /* controls with changed sub-values */ unsigned int enabled_ctrls; /* controls currently enabled */ unsigned int enabled_ctrl_changes;/* controls just {en,dis}abled */ int num_groups; /* total groups on keyboard */ KeyCode keycode; /* key that caused change or 0 */ char event_type; /* type of event that caused change */ char req_major; /* if keycode==0, major and minor */ char req_minor; /* opcode of req that caused change */ } XkbControlsNotifyEvent; typedef struct _XkbIndicatorNotify { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbIndicatorNotify */ int device; /* device ID */ unsigned int changed; /* indicators with new state or map */ unsigned int state; /* current state of all indicators */ } XkbIndicatorNotifyEvent; typedef struct _XkbNamesNotify { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbNamesNotify */ int device; /* device ID */ unsigned int changed; /* names that have changed */ int first_type; /* first key type with new name */ int num_types; /* number of key types with new names */ int first_lvl; /* first key type new new level names */ int num_lvls; /* # of key types w/new level names */ int num_aliases; /* total number of key aliases*/ int num_radio_groups;/* total number of radio groups */ unsigned int changed_vmods; /* virtual modifiers with new names */ unsigned int changed_groups; /* groups with new names */ unsigned int changed_indicators;/* indicators with new names */ int first_key; /* first key with new name */ int num_keys; /* number of keys with new names */ } XkbNamesNotifyEvent; typedef struct _XkbCompatMapNotify { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbCompatMapNotify */ int device; /* device ID */ unsigned int changed_groups; /* groups with new compat maps */ int first_si; /* first new symbol interp */ int num_si; /* number of new symbol interps */ int num_total_si; /* total # of symbol interps */ } XkbCompatMapNotifyEvent; typedef struct _XkbBellNotify { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbBellNotify */ int device; /* device ID */ int percent; /* requested volume as a % of maximum */ int pitch; /* requested pitch in Hz */ int duration; /* requested duration in useconds */ int bell_class; /* (input extension) feedback class */ int bell_id; /* (input extension) ID of feedback */ Atom name; /* "name" of requested bell */ Window window; /* window associated with event */ Bool event_only; /* "event only" requested */ } XkbBellNotifyEvent; typedef struct _XkbActionMessage { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbActionMessage */ int device; /* device ID */ KeyCode keycode; /* key that generated the event */ Bool press; /* true if act caused by key press */ Bool key_event_follows;/* true if key event also generated */ int group; /* effective group */ unsigned int mods; /* effective mods */ char message[XkbActionMessageLength+1]; /* message -- leave space for NUL */ } XkbActionMessageEvent; typedef struct _XkbAccessXNotify { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbAccessXNotify */ int device; /* device ID */ int detail; /* XkbAXN_* */ int keycode; /* key of event */ int sk_delay; /* current slow keys delay */ int debounce_delay; /* current debounce delay */ } XkbAccessXNotifyEvent; typedef struct _XkbExtensionDeviceNotify { int type; /* XkbAnyEvent */ unsigned long serial; /* of last req processed by server */ Bool send_event; /* is this from a SendEvent request? */ Display * display; /* Display the event was read from */ Time time; /* milliseconds */ int xkb_type; /* XkbExtensionDeviceNotify */ int device; /* device ID */ unsigned int reason; /* reason for the event */ unsigned int supported; /* mask of supported features */ unsigned int unsupported; /* mask of unsupported features */ /* that some app tried to use */ int first_btn; /* first button that changed */ int num_btns; /* range of buttons changed */ unsigned int leds_defined; /* indicators with names or maps */ unsigned int led_state; /* current state of the indicators */ int led_class; /* feedback class for led changes */ int led_id; /* feedback id for led changes */ } XkbExtensionDeviceNotifyEvent; typedef union _XkbEvent { int type; XkbAnyEvent any; XkbNewKeyboardNotifyEvent new_kbd; XkbMapNotifyEvent map; XkbStateNotifyEvent state; XkbControlsNotifyEvent ctrls; XkbIndicatorNotifyEvent indicators; XkbNamesNotifyEvent names; XkbCompatMapNotifyEvent compat; XkbBellNotifyEvent bell; XkbActionMessageEvent message; XkbAccessXNotifyEvent accessx; XkbExtensionDeviceNotifyEvent device; XEvent core; } XkbEvent; typedef struct _XkbKbdDpyState XkbKbdDpyStateRec,*XkbKbdDpyStatePtr; /* XkbOpenDisplay error codes */ #define XkbOD_Success 0 #define XkbOD_BadLibraryVersion 1 #define XkbOD_ConnectionRefused 2 #define XkbOD_NonXkbServer 3 #define XkbOD_BadServerVersion 4 /* Values for XlibFlags */ #define XkbLC_ForceLatin1Lookup (1<<0) #define XkbLC_ConsumeLookupMods (1<<1) #define XkbLC_AlwaysConsumeShiftAndLock (1<<2) #define XkbLC_IgnoreNewKeyboards (1<<3) #define XkbLC_ControlFallback (1<<4) #define XkbLC_ConsumeKeysOnComposeFail (1<<29) #define XkbLC_ComposeLED (1<<30) #define XkbLC_BeepOnComposeFail (1<<31) #define XkbLC_AllComposeControls (0xc0000000) #define XkbLC_AllControls (0xc000001f) _XFUNCPROTOBEGIN extern Bool XkbIgnoreExtension( Bool /* ignore */ ); extern Display *XkbOpenDisplay( char * /* name */, int * /* ev_rtrn */, int * /* err_rtrn */, int * /* major_rtrn */, int * /* minor_rtrn */, int * /* reason */ ); extern Bool XkbQueryExtension( Display * /* dpy */, int * /* opcodeReturn */, int * /* eventBaseReturn */, int * /* errorBaseReturn */, int * /* majorRtrn */, int * /* minorRtrn */ ); extern Bool XkbUseExtension( Display * /* dpy */, int * /* major_rtrn */, int * /* minor_rtrn */ ); extern Bool XkbLibraryVersion( int * /* libMajorRtrn */, int * /* libMinorRtrn */ ); extern unsigned int XkbSetXlibControls( Display* /* dpy */, unsigned int /* affect */, unsigned int /* values */ ); extern unsigned int XkbGetXlibControls( Display* /* dpy */ ); extern unsigned int XkbXlibControlsImplemented(void); typedef Atom (*XkbInternAtomFunc)( Display * /* dpy */, _Xconst char * /* name */, Bool /* only_if_exists */ ); typedef char * (*XkbGetAtomNameFunc)( Display * /* dpy */, Atom /* atom */ ); extern void XkbSetAtomFuncs( XkbInternAtomFunc /* getAtom */, XkbGetAtomNameFunc /* getName */ ); extern KeySym XkbKeycodeToKeysym( Display * /* dpy */, #if NeedWidePrototypes unsigned int /* kc */, #else KeyCode /* kc */, #endif int /* group */, int /* level */ ); extern unsigned int XkbKeysymToModifiers( Display * /* dpy */, KeySym /* ks */ ); extern Bool XkbLookupKeySym( Display * /* dpy */, KeyCode /* keycode */, unsigned int /* modifiers */, unsigned int * /* modifiers_return */, KeySym * /* keysym_return */ ); extern int XkbLookupKeyBinding( Display * /* dpy */, KeySym /* sym_rtrn */, unsigned int /* mods */, char * /* buffer */, int /* nbytes */, int * /* extra_rtrn */ ); extern Bool XkbTranslateKeyCode( XkbDescPtr /* xkb */, KeyCode /* keycode */, unsigned int /* modifiers */, unsigned int * /* modifiers_return */, KeySym * /* keysym_return */ ); extern int XkbTranslateKeySym( Display * /* dpy */, register KeySym * /* sym_return */, unsigned int /* modifiers */, char * /* buffer */, int /* nbytes */, int * /* extra_rtrn */ ); extern Bool XkbSetAutoRepeatRate( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* delay */, unsigned int /* interval */ ); extern Bool XkbGetAutoRepeatRate( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int * /* delayRtrn */, unsigned int * /* intervalRtrn */ ); extern Bool XkbChangeEnabledControls( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* affect */, unsigned int /* values */ ); extern Bool XkbDeviceBell( Display * /* dpy */, Window /* win */, int /* deviceSpec */, int /* bellClass */, int /* bellID */, int /* percent */, Atom /* name */ ); extern Bool XkbForceDeviceBell( Display * /* dpy */, int /* deviceSpec */, int /* bellClass */, int /* bellID */, int /* percent */ ); extern Bool XkbDeviceBellEvent( Display * /* dpy */, Window /* win */, int /* deviceSpec */, int /* bellClass */, int /* bellID */, int /* percent */, Atom /* name */ ); extern Bool XkbBell( Display * /* dpy */, Window /* win */, int /* percent */, Atom /* name */ ); extern Bool XkbForceBell( Display * /* dpy */, int /* percent */ ); extern Bool XkbBellEvent( Display * /* dpy */, Window /* win */, int /* percent */, Atom /* name */ ); extern Bool XkbSelectEvents( Display * /* dpy */, unsigned int /* deviceID */, unsigned int /* affect */, unsigned int /* values */ ); extern Bool XkbSelectEventDetails( Display * /* dpy */, unsigned int /* deviceID */, unsigned int /* eventType */, unsigned long /* affect */, unsigned long /* details */ ); extern void XkbNoteMapChanges( XkbMapChangesPtr /* old */, XkbMapNotifyEvent * /* new */, unsigned int /* wanted */ ); extern void XkbNoteNameChanges( XkbNameChangesPtr /* old */, XkbNamesNotifyEvent * /* new */, unsigned int /* wanted */ ); extern Status XkbGetIndicatorState( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int * /* pStateRtrn */ ); extern Status XkbGetDeviceIndicatorState( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* ledClass */, unsigned int /* ledID */, unsigned int * /* pStateRtrn */ ); extern Status XkbGetIndicatorMap( Display * /* dpy */, unsigned long /* which */, XkbDescPtr /* desc */ ); extern Bool XkbSetIndicatorMap( Display * /* dpy */, unsigned long /* which */, XkbDescPtr /* desc */ ); #define XkbNoteIndicatorMapChanges(o,n,w) \ ((o)->map_changes|=((n)->map_changes&(w))) #define XkbNoteIndicatorStateChanges(o,n,w)\ ((o)->state_changes|=((n)->state_changes&(w))) #define XkbGetIndicatorMapChanges(d,x,c) \ (XkbGetIndicatorMap((d),(c)->map_changes,x)) #define XkbChangeIndicatorMaps(d,x,c) \ (XkbSetIndicatorMap((d),(c)->map_changes,x)) extern Bool XkbGetNamedIndicator( Display * /* dpy */, Atom /* name */, int * /* pNdxRtrn */, Bool * /* pStateRtrn */, XkbIndicatorMapPtr /* pMapRtrn */, Bool * /* pRealRtrn */ ); extern Bool XkbGetNamedDeviceIndicator( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* ledClass */, unsigned int /* ledID */, Atom /* name */, int * /* pNdxRtrn */, Bool * /* pStateRtrn */, XkbIndicatorMapPtr /* pMapRtrn */, Bool * /* pRealRtrn */ ); extern Bool XkbSetNamedIndicator( Display * /* dpy */, Atom /* name */, Bool /* changeState */, Bool /* state */, Bool /* createNewMap */, XkbIndicatorMapPtr /* pMap */ ); extern Bool XkbSetNamedDeviceIndicator( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* ledClass */, unsigned int /* ledID */, Atom /* name */, Bool /* changeState */, Bool /* state */, Bool /* createNewMap */, XkbIndicatorMapPtr /* pMap */ ); extern Bool XkbLockModifiers( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* affect */, unsigned int /* values */ ); extern Bool XkbLatchModifiers( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* affect */, unsigned int /* values */ ); extern Bool XkbLockGroup( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* group */ ); extern Bool XkbLatchGroup( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* group */ ); extern Bool XkbSetServerInternalMods( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* affectReal */, unsigned int /* realValues */, unsigned int /* affectVirtual */, unsigned int /* virtualValues */ ); extern Bool XkbSetIgnoreLockMods( Display * /* dpy */, unsigned int /* deviceSpec */, unsigned int /* affectReal */, unsigned int /* realValues */, unsigned int /* affectVirtual */, unsigned int /* virtualValues */ ); extern Bool XkbVirtualModsToReal( XkbDescPtr /* xkb */, unsigned int /* virtual_mask */, unsigned int * /* mask_rtrn */ ); extern Bool XkbComputeEffectiveMap( XkbDescPtr /* xkb */, XkbKeyTypePtr /* type */, unsigned char * /* map_rtrn */ ); extern Status XkbInitCanonicalKeyTypes( XkbDescPtr /* xkb */, unsigned int /* which */, int /* keypadVMod */ ); extern XkbDescPtr XkbAllocKeyboard( void ); extern void XkbFreeKeyboard( XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeDesc */ ); extern Status XkbAllocClientMap( XkbDescPtr /* xkb */, unsigned int /* which */, unsigned int /* nTypes */ ); extern Status XkbAllocServerMap( XkbDescPtr /* xkb */, unsigned int /* which */, unsigned int /* nActions */ ); extern void XkbFreeClientMap( XkbDescPtr /* xkb */, unsigned int /* what */, Bool /* freeMap */ ); extern void XkbFreeServerMap( XkbDescPtr /* xkb */, unsigned int /* what */, Bool /* freeMap */ ); extern XkbKeyTypePtr XkbAddKeyType( XkbDescPtr /* xkb */, Atom /* name */, int /* map_count */, Bool /* want_preserve */, int /* num_lvls */ ); extern Status XkbAllocIndicatorMaps( XkbDescPtr /* xkb */ ); extern void XkbFreeIndicatorMaps( XkbDescPtr /* xkb */ ); extern XkbDescPtr XkbGetMap( Display * /* dpy */, unsigned int /* which */, unsigned int /* deviceSpec */ ); extern Status XkbGetUpdatedMap( Display * /* dpy */, unsigned int /* which */, XkbDescPtr /* desc */ ); extern Status XkbGetMapChanges( Display * /* dpy */, XkbDescPtr /* xkb */, XkbMapChangesPtr /* changes */ ); extern Status XkbRefreshKeyboardMapping( XkbMapNotifyEvent * /* event */ ); extern Status XkbGetKeyTypes( Display * /* dpy */, unsigned int /* first */, unsigned int /* num */, XkbDescPtr /* xkb */ ); extern Status XkbGetKeySyms( Display * /* dpy */, unsigned int /* first */, unsigned int /* num */, XkbDescPtr /* xkb */ ); extern Status XkbGetKeyActions( Display * /* dpy */, unsigned int /* first */, unsigned int /* num */, XkbDescPtr /* xkb */ ); extern Status XkbGetKeyBehaviors( Display * /* dpy */, unsigned int /* firstKey */, unsigned int /* nKeys */, XkbDescPtr /* desc */ ); extern Status XkbGetVirtualMods( Display * /* dpy */, unsigned int /* which */, XkbDescPtr /* desc */ ); extern Status XkbGetKeyExplicitComponents( Display * /* dpy */, unsigned int /* firstKey */, unsigned int /* nKeys */, XkbDescPtr /* desc */ ); extern Status XkbGetKeyModifierMap( Display * /* dpy */, unsigned int /* firstKey */, unsigned int /* nKeys */, XkbDescPtr /* desc */ ); extern Status XkbGetKeyVirtualModMap( Display * /* dpy */, unsigned int /* first */, unsigned int /* num */, XkbDescPtr /* xkb */ ); extern Status XkbAllocControls( XkbDescPtr /* xkb */, unsigned int /* which*/ ); extern void XkbFreeControls( XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeMap */ ); extern Status XkbGetControls( Display * /* dpy */, unsigned long /* which */, XkbDescPtr /* desc */ ); extern Bool XkbSetControls( Display * /* dpy */, unsigned long /* which */, XkbDescPtr /* desc */ ); extern void XkbNoteControlsChanges( XkbControlsChangesPtr /* old */, XkbControlsNotifyEvent * /* new */, unsigned int /* wanted */ ); #define XkbGetControlsChanges(d,x,c) XkbGetControls(d,(c)->changed_ctrls,x) #define XkbChangeControls(d,x,c) XkbSetControls(d,(c)->changed_ctrls,x) extern Status XkbAllocCompatMap( XkbDescPtr /* xkb */, unsigned int /* which */, unsigned int /* nInterpret */ ); extern void XkbFreeCompatMap( XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeMap */ ); extern Status XkbGetCompatMap( Display * /* dpy */, unsigned int /* which */, XkbDescPtr /* xkb */ ); extern Bool XkbSetCompatMap( Display * /* dpy */, unsigned int /* which */, XkbDescPtr /* xkb */, Bool /* updateActions */ ); extern XkbSymInterpretPtr XkbAddSymInterpret( XkbDescPtr /* xkb */, XkbSymInterpretPtr /* si */, Bool /* updateMap */, XkbChangesPtr /* changes */ ); extern Status XkbAllocNames( XkbDescPtr /* xkb */, unsigned int /* which */, int /* nTotalRG */, int /* nTotalAliases */ ); extern Status XkbGetNames( Display * /* dpy */, unsigned int /* which */, XkbDescPtr /* desc */ ); extern Bool XkbSetNames( Display * /* dpy */, unsigned int /* which */, unsigned int /* firstType */, unsigned int /* nTypes */, XkbDescPtr /* desc */ ); extern Bool XkbChangeNames( Display * /* dpy */, XkbDescPtr /* xkb */, XkbNameChangesPtr /* changes */ ); extern void XkbFreeNames( XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeMap */ ); extern Status XkbGetState( Display * /* dpy */, unsigned int /* deviceSpec */, XkbStatePtr /* rtrnState */ ); extern Bool XkbSetMap( Display * /* dpy */, unsigned int /* which */, XkbDescPtr /* desc */ ); extern Bool XkbChangeMap( Display* /* dpy */, XkbDescPtr /* desc */, XkbMapChangesPtr /* changes */ ); extern Bool XkbSetDetectableAutoRepeat( Display * /* dpy */, Bool /* detectable */, Bool * /* supported */ ); extern Bool XkbGetDetectableAutoRepeat( Display * /* dpy */, Bool * /* supported */ ); extern Bool XkbSetAutoResetControls( Display * /* dpy */, unsigned int /* changes */, unsigned int * /* auto_ctrls */, unsigned int * /* auto_values */ ); extern Bool XkbGetAutoResetControls( Display * /* dpy */, unsigned int * /* auto_ctrls */, unsigned int * /* auto_ctrl_values */ ); extern Bool XkbSetPerClientControls( Display * /* dpy */, unsigned int /* change */, unsigned int * /* values */ ); extern Bool XkbGetPerClientControls( Display * /* dpy */, unsigned int * /* ctrls */ ); extern Status XkbCopyKeyType( XkbKeyTypePtr /* from */, XkbKeyTypePtr /* into */ ); extern Status XkbCopyKeyTypes( XkbKeyTypePtr /* from */, XkbKeyTypePtr /* into */, int /* num_types */ ); extern Status XkbResizeKeyType( XkbDescPtr /* xkb */, int /* type_ndx */, int /* map_count */, Bool /* want_preserve */, int /* new_num_lvls */ ); extern KeySym *XkbResizeKeySyms( XkbDescPtr /* desc */, int /* forKey */, int /* symsNeeded */ ); extern XkbAction *XkbResizeKeyActions( XkbDescPtr /* desc */, int /* forKey */, int /* actsNeeded */ ); extern Status XkbChangeTypesOfKey( XkbDescPtr /* xkb */, int /* key */, int /* num_groups */, unsigned int /* groups */, int * /* newTypes */, XkbMapChangesPtr /* pChanges */ ); extern Status XkbChangeKeycodeRange( XkbDescPtr /* xkb */, int /* minKC */, int /* maxKC */, XkbChangesPtr /* changes */ ); /***====================================================================***/ extern XkbComponentListPtr XkbListComponents( Display * /* dpy */, unsigned int /* deviceSpec */, XkbComponentNamesPtr /* ptrns */, int * /* max_inout */ ); extern void XkbFreeComponentList( XkbComponentListPtr /* list */ ); extern XkbDescPtr XkbGetKeyboard( Display * /* dpy */, unsigned int /* which */, unsigned int /* deviceSpec */ ); extern XkbDescPtr XkbGetKeyboardByName( Display * /* dpy */, unsigned int /* deviceSpec */, XkbComponentNamesPtr /* names */, unsigned int /* want */, unsigned int /* need */, Bool /* load */ ); /***====================================================================***/ extern int XkbKeyTypesForCoreSymbols( /* returns # of groups */ XkbDescPtr /* xkb */, /* keyboard device */ int /* map_width */, /* width of core KeySym array */ KeySym * /* core_syms */, /* always mapWidth symbols */ unsigned int /* protected */, /* explicit key types */ int * /* types_inout */, /* always four type indices */ KeySym * /* xkb_syms_rtrn */ /* must have enough space */ ); extern Bool XkbApplyCompatMapToKey( /* False only on error */ XkbDescPtr /* xkb */, /* keymap to be edited */ KeyCode /* key */, /* key to be updated */ XkbChangesPtr /* changes */ /* resulting changes to map */ ); extern Bool XkbUpdateMapFromCore( /* False only on error */ XkbDescPtr /* xkb */, /* XKB keyboard to be edited */ KeyCode /* first_key */, /* first changed key */ int /* num_keys */, /* number of changed keys */ int /* map_width */, /* width of core keymap */ KeySym * /* core_keysyms */, /* symbols from core keymap */ XkbChangesPtr /* changes */ /* resulting changes */ ); /***====================================================================***/ extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo( XkbDeviceInfoPtr /* devi */, unsigned int /* ledClass */, unsigned int /* ledId */ ); extern Status XkbResizeDeviceButtonActions( XkbDeviceInfoPtr /* devi */, unsigned int /* newTotal */ ); extern XkbDeviceInfoPtr XkbAllocDeviceInfo( unsigned int /* deviceSpec */, unsigned int /* nButtons */, unsigned int /* szLeds */ ); extern void XkbFreeDeviceInfo( XkbDeviceInfoPtr /* devi */, unsigned int /* which */, Bool /* freeDevI */ ); extern void XkbNoteDeviceChanges( XkbDeviceChangesPtr /* old */, XkbExtensionDeviceNotifyEvent * /* new */, unsigned int /* wanted */ ); extern XkbDeviceInfoPtr XkbGetDeviceInfo( Display * /* dpy */, unsigned int /* which */, unsigned int /* deviceSpec */, unsigned int /* ledClass */, unsigned int /* ledID */ ); extern Status XkbGetDeviceInfoChanges( Display * /* dpy */, XkbDeviceInfoPtr /* devi */, XkbDeviceChangesPtr /* changes */ ); extern Status XkbGetDeviceButtonActions( Display * /* dpy */, XkbDeviceInfoPtr /* devi */, Bool /* all */, unsigned int /* first */, unsigned int /* nBtns */ ); extern Status XkbGetDeviceLedInfo( Display * /* dpy */, XkbDeviceInfoPtr /* devi */, unsigned int /* ledClass (class, XIDflt, XIAll) */, unsigned int /* ledId (id, XIDflt, XIAll) */, unsigned int /* which (XkbXI_Indicator{Names,Map}Mask */ ); extern Bool XkbSetDeviceInfo( Display * /* dpy */, unsigned int /* which */, XkbDeviceInfoPtr /* devi */ ); extern Bool XkbChangeDeviceInfo( Display* /* dpy */, XkbDeviceInfoPtr /* desc */, XkbDeviceChangesPtr /* changes */ ); extern Bool XkbSetDeviceLedInfo( Display * /* dpy */, XkbDeviceInfoPtr /* devi */, unsigned int /* ledClass */, unsigned int /* ledID */, unsigned int /* which */ ); extern Bool XkbSetDeviceButtonActions( Display * /* dpy */, XkbDeviceInfoPtr /* devi */, unsigned int /* first */, unsigned int /* nBtns */ ); /***====================================================================***/ extern char XkbToControl( char /* c */ ); /***====================================================================***/ extern Bool XkbSetDebuggingFlags( Display * /* dpy */, unsigned int /* mask */, unsigned int /* flags */, char * /* msg */, unsigned int /* ctrls_mask */, unsigned int /* ctrls */, unsigned int * /* rtrn_flags */, unsigned int * /* rtrn_ctrls */ ); extern Bool XkbApplyVirtualModChanges( XkbDescPtr /* xkb */, unsigned int /* changed */, XkbChangesPtr /* changes */ ); extern Bool XkbUpdateActionVirtualMods( XkbDescPtr /* xkb */, XkbAction * /* act */, unsigned int /* changed */ ); extern void XkbUpdateKeyTypeVirtualMods( XkbDescPtr /* xkb */, XkbKeyTypePtr /* type */, unsigned int /* changed */, XkbChangesPtr /* changes */ ); _XFUNCPROTOEND #endif /* _X11_XKBLIB_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/XWDFile.h ================================================ /* Copyright 1985, 1986, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * XWDFile.h MIT Project Athena, X Window system window raster * image dumper, dump file format header file. * * Author: Tony Della Fera, DEC * 27-Jun-85 * * Modifier: William F. Wyatt, SAO * 18-Nov-86 - version 6 for saving/restoring color maps */ #ifndef XWDFILE_H #define XWDFILE_H #include #define XWD_FILE_VERSION 7 #define sz_XWDheader 100 #define sz_XWDColor 12 typedef CARD32 xwdval; /* for old broken programs */ /* Values in the file are most significant byte first. */ typedef struct _xwd_file_header { /* header_size = SIZEOF(XWDheader) + length of null-terminated * window name. */ CARD32 header_size B32; CARD32 file_version B32; /* = XWD_FILE_VERSION above */ CARD32 pixmap_format B32; /* ZPixmap or XYPixmap */ CARD32 pixmap_depth B32; /* Pixmap depth */ CARD32 pixmap_width B32; /* Pixmap width */ CARD32 pixmap_height B32; /* Pixmap height */ CARD32 xoffset B32; /* Bitmap x offset, normally 0 */ CARD32 byte_order B32; /* of image data: MSBFirst, LSBFirst */ /* bitmap_unit applies to bitmaps (depth 1 format XY) only. * It is the number of bits that each scanline is padded to. */ CARD32 bitmap_unit B32; CARD32 bitmap_bit_order B32; /* bitmaps only: MSBFirst, LSBFirst */ /* bitmap_pad applies to pixmaps (non-bitmaps) only. * It is the number of bits that each scanline is padded to. */ CARD32 bitmap_pad B32; CARD32 bits_per_pixel B32; /* Bits per pixel */ /* bytes_per_line is pixmap_width padded to bitmap_unit (bitmaps) * or bitmap_pad (pixmaps). It is the delta (in bytes) to get * to the same x position on an adjacent row. */ CARD32 bytes_per_line B32; CARD32 visual_class B32; /* Class of colormap */ CARD32 red_mask B32; /* Z red mask */ CARD32 green_mask B32; /* Z green mask */ CARD32 blue_mask B32; /* Z blue mask */ CARD32 bits_per_rgb B32; /* Log2 of distinct color values */ CARD32 colormap_entries B32; /* Number of entries in colormap; not used? */ CARD32 ncolors B32; /* Number of XWDColor structures */ CARD32 window_width B32; /* Window width */ CARD32 window_height B32; /* Window height */ CARD32 window_x B32; /* Window upper left X coordinate */ CARD32 window_y B32; /* Window upper left Y coordinate */ CARD32 window_bdrwidth B32; /* Window border width */ } XWDFileHeader; /* Null-terminated window name follows the above structure. */ /* Next comes XWDColor structures, at offset XWDFileHeader.header_size in * the file. XWDFileHeader.ncolors tells how many XWDColor structures * there are. */ typedef struct { CARD32 pixel B32; CARD16 red B16; CARD16 green B16; CARD16 blue B16; CARD8 flags; CARD8 pad; } XWDColor; /* Last comes the image data in the format described by XWDFileHeader. */ #endif /* XWDFILE_H */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xalloca.h ================================================ /* Copyright 1995, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * The purpose of this header is to define the macros ALLOCATE_LOCAL and * DEALLOCATE_LOCAL appropriately for the platform being compiled on. * These macros are used to make fast, function-local memory allocations. * Their characteristics are as follows: * * void *ALLOCATE_LOCAL(int size) * Returns a pointer to size bytes of memory, or NULL if the allocation * failed. The memory must be freed with DEALLOCATE_LOCAL before the * function that made the allocation returns. You should not ask for * large blocks of memory with this function, since on many platforms * the memory comes from the stack, which may have limited size. * * void DEALLOCATE_LOCAL(void *) * Frees the memory allocated by ALLOCATE_LOCAL. Omission of this * step may be harmless on some platforms, but will result in * memory leaks or worse on others. * * Before including this file, you should define two macros, * ALLOCATE_LOCAL_FALLBACK and DEALLOCATE_LOCAL_FALLBACK, that have the * same characteristics as ALLOCATE_LOCAL and DEALLOCATE_LOCAL. The * header uses the fallbacks if it doesn't know a "better" way to define * ALLOCATE_LOCAL and DEALLOCATE_LOCAL. Typical usage would be: * * #define ALLOCATE_LOCAL_FALLBACK(_size) malloc(_size) * #define DEALLOCATE_LOCAL_FALLBACK(_ptr) free(_ptr) * #include "Xalloca.h" */ #ifndef XALLOCA_H #define XALLOCA_H 1 #ifndef INCLUDE_ALLOCA_H /* Need to add more here to match Imake *.cf's */ # if defined(HAVE_ALLOCA_H) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) # define INCLUDE_ALLOCA_H # endif #endif #ifdef INCLUDE_ALLOCA_H # include #endif #ifndef NO_ALLOCA /* * os-dependent definition of local allocation and deallocation * If you want something other than (DE)ALLOCATE_LOCAL_FALLBACK * for ALLOCATE/DEALLOCATE_LOCAL then you add that in here. */ # ifdef __GNUC__ # ifndef alloca # define alloca __builtin_alloca # endif /* !alloca */ # define ALLOCATE_LOCAL(size) alloca((int)(size)) # else /* ! __GNUC__ */ /* * warning: old mips alloca (pre 2.10) is unusable, new one is built in * Test is easy, the new one is named __builtin_alloca and comes * from alloca.h which #defines alloca. */ # if defined(__sun) || defined(alloca) /* * Some System V boxes extract alloca.o from /lib/libPW.a; if you * decide that you don't want to use alloca, you might want to fix it here. */ /* alloca might be a macro taking one arg (hi, Sun!), so give it one. */ # if !defined(__cplusplus) # define __Xnullarg /* as nothing */ extern void *alloca(__Xnullarg); # endif # define ALLOCATE_LOCAL(size) alloca((int)(size)) # endif /* who does alloca */ # endif /* __GNUC__ */ #endif /* NO_ALLOCA */ #if !defined(ALLOCATE_LOCAL) # if defined(ALLOCATE_LOCAL_FALLBACK) && defined(DEALLOCATE_LOCAL_FALLBACK) # define ALLOCATE_LOCAL(_size) ALLOCATE_LOCAL_FALLBACK(_size) # define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK(_ptr) # else /* no fallbacks supplied; error */ # define ALLOCATE_LOCAL(_size) ALLOCATE_LOCAL_FALLBACK undefined! # define DEALLOCATE_LOCAL(_ptr) DEALLOCATE_LOCAL_FALLBACK undefined! # endif /* defined(ALLOCATE_LOCAL_FALLBACK && DEALLOCATE_LOCAL_FALLBACK) */ #else # if !defined(DEALLOCATE_LOCAL) # define DEALLOCATE_LOCAL(_ptr) do {} while(0) # endif #endif /* defined(ALLOCATE_LOCAL) */ #endif /* XALLOCA_H */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xarch.h ================================================ #ifndef _XARCH_H_ # define _XARCH_H_ /* * Copyright 1997 Metro Link Incorporated * * All Rights Reserved * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the names of the above listed copyright holder(s) * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. The above listed * copyright holder(s) make(s) no representations about the suitability of * this software for any purpose. It is provided "as is" without express or * implied warranty. * * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM(S) ALL WARRANTIES WITH REGARD * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * Determine the machine's byte order. */ /* See if it is set in the imake config first */ # ifdef X_BYTE_ORDER # define X_BIG_ENDIAN 4321 # define X_LITTLE_ENDIAN 1234 # else # if defined(SVR4) || defined(__SVR4) # include # include # elif defined(CSRG_BASED) # if defined(__NetBSD__) || defined(__OpenBSD__) # include # endif # include # elif defined(linux) # if defined __STRICT_ANSI__ # undef __STRICT_ANSI__ # include # define __STRICT_ANSI__ # else # include # endif /* 'endian.h' might have been included before 'Xarch.h' */ # if !defined(LITTLE_ENDIAN) && defined(__LITTLE_ENDIAN) # define LITTLE_ENDIAN __LITTLE_ENDIAN # endif # if !defined(BIG_ENDIAN) && defined(__BIG_ENDIAN) # define BIG_ENDIAN __BIG_ENDIAN # endif # if !defined(PDP_ENDIAN) && defined(__PDP_ENDIAN) # define PDP_ENDIAN __PDP_ENDIAN # endif # if !defined(BYTE_ORDER) && defined(__BYTE_ORDER) # define BYTE_ORDER __BYTE_ORDER # endif # endif # ifndef BYTE_ORDER # define LITTLE_ENDIAN 1234 # define BIG_ENDIAN 4321 # if defined(__sun) && defined(__SVR4) # include # ifdef _LITTLE_ENDIAN # define BYTE_ORDER LITTLE_ENDIAN # endif # ifdef _BIG_ENDIAN # define BYTE_ORDER BIG_ENDIAN # endif # endif /* sun */ # endif /* BYTE_ORDER */ # define X_BYTE_ORDER BYTE_ORDER # define X_BIG_ENDIAN BIG_ENDIAN # define X_LITTLE_ENDIAN LITTLE_ENDIAN # endif /* not in imake config */ #endif /* _XARCH_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xatom.h ================================================ #ifndef XATOM_H #define XATOM_H 1 /* THIS IS A GENERATED FILE * * Do not change! Changing this file implies a protocol change! */ #define XA_PRIMARY ((Atom) 1) #define XA_SECONDARY ((Atom) 2) #define XA_ARC ((Atom) 3) #define XA_ATOM ((Atom) 4) #define XA_BITMAP ((Atom) 5) #define XA_CARDINAL ((Atom) 6) #define XA_COLORMAP ((Atom) 7) #define XA_CURSOR ((Atom) 8) #define XA_CUT_BUFFER0 ((Atom) 9) #define XA_CUT_BUFFER1 ((Atom) 10) #define XA_CUT_BUFFER2 ((Atom) 11) #define XA_CUT_BUFFER3 ((Atom) 12) #define XA_CUT_BUFFER4 ((Atom) 13) #define XA_CUT_BUFFER5 ((Atom) 14) #define XA_CUT_BUFFER6 ((Atom) 15) #define XA_CUT_BUFFER7 ((Atom) 16) #define XA_DRAWABLE ((Atom) 17) #define XA_FONT ((Atom) 18) #define XA_INTEGER ((Atom) 19) #define XA_PIXMAP ((Atom) 20) #define XA_POINT ((Atom) 21) #define XA_RECTANGLE ((Atom) 22) #define XA_RESOURCE_MANAGER ((Atom) 23) #define XA_RGB_COLOR_MAP ((Atom) 24) #define XA_RGB_BEST_MAP ((Atom) 25) #define XA_RGB_BLUE_MAP ((Atom) 26) #define XA_RGB_DEFAULT_MAP ((Atom) 27) #define XA_RGB_GRAY_MAP ((Atom) 28) #define XA_RGB_GREEN_MAP ((Atom) 29) #define XA_RGB_RED_MAP ((Atom) 30) #define XA_STRING ((Atom) 31) #define XA_VISUALID ((Atom) 32) #define XA_WINDOW ((Atom) 33) #define XA_WM_COMMAND ((Atom) 34) #define XA_WM_HINTS ((Atom) 35) #define XA_WM_CLIENT_MACHINE ((Atom) 36) #define XA_WM_ICON_NAME ((Atom) 37) #define XA_WM_ICON_SIZE ((Atom) 38) #define XA_WM_NAME ((Atom) 39) #define XA_WM_NORMAL_HINTS ((Atom) 40) #define XA_WM_SIZE_HINTS ((Atom) 41) #define XA_WM_ZOOM_HINTS ((Atom) 42) #define XA_MIN_SPACE ((Atom) 43) #define XA_NORM_SPACE ((Atom) 44) #define XA_MAX_SPACE ((Atom) 45) #define XA_END_SPACE ((Atom) 46) #define XA_SUPERSCRIPT_X ((Atom) 47) #define XA_SUPERSCRIPT_Y ((Atom) 48) #define XA_SUBSCRIPT_X ((Atom) 49) #define XA_SUBSCRIPT_Y ((Atom) 50) #define XA_UNDERLINE_POSITION ((Atom) 51) #define XA_UNDERLINE_THICKNESS ((Atom) 52) #define XA_STRIKEOUT_ASCENT ((Atom) 53) #define XA_STRIKEOUT_DESCENT ((Atom) 54) #define XA_ITALIC_ANGLE ((Atom) 55) #define XA_X_HEIGHT ((Atom) 56) #define XA_QUAD_WIDTH ((Atom) 57) #define XA_WEIGHT ((Atom) 58) #define XA_POINT_SIZE ((Atom) 59) #define XA_RESOLUTION ((Atom) 60) #define XA_COPYRIGHT ((Atom) 61) #define XA_NOTICE ((Atom) 62) #define XA_FONT_NAME ((Atom) 63) #define XA_FAMILY_NAME ((Atom) 64) #define XA_FULL_NAME ((Atom) 65) #define XA_CAP_HEIGHT ((Atom) 66) #define XA_WM_CLASS ((Atom) 67) #define XA_WM_TRANSIENT_FOR ((Atom) 68) #define XA_LAST_PREDEFINED ((Atom) 68) #endif /* XATOM_H */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xauth.h ================================================ /* Copyright 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef _Xauth_h #define _Xauth_h /* struct xauth is full of implicit padding to properly align the pointers after the length fields. We can't clean that up without breaking ABI, so tell clang not to bother complaining about it. */ #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif typedef struct xauth { unsigned short family; unsigned short address_length; char *address; unsigned short number_length; char *number; unsigned short name_length; char *name; unsigned short data_length; char *data; } Xauth; #ifdef __clang__ #pragma clang diagnostic pop #endif #ifndef _XAUTH_STRUCT_ONLY # include # include # include # define FamilyLocal (256) /* not part of X standard (i.e. X.h) */ # define FamilyWild (65535) # define FamilyNetname (254) /* not part of X standard */ # define FamilyKrb5Principal (253) /* Kerberos 5 principal name */ # define FamilyLocalHost (252) /* for local non-net authentication */ _XFUNCPROTOBEGIN char *XauFileName(void); Xauth *XauReadAuth( FILE* /* auth_file */ ); int XauLockAuth( _Xconst char* /* file_name */, int /* retries */, int /* timeout */, long /* dead */ ); int XauUnlockAuth( _Xconst char* /* file_name */ ); int XauWriteAuth( FILE* /* auth_file */, Xauth* /* auth */ ); Xauth *XauGetAuthByAddr( #if NeedWidePrototypes unsigned int /* family */, unsigned int /* address_length */, #else unsigned short /* family */, unsigned short /* address_length */, #endif _Xconst char* /* address */, #if NeedWidePrototypes unsigned int /* number_length */, #else unsigned short /* number_length */, #endif _Xconst char* /* number */, #if NeedWidePrototypes unsigned int /* name_length */, #else unsigned short /* name_length */, #endif _Xconst char* /* name */ ); Xauth *XauGetBestAuthByAddr( #if NeedWidePrototypes unsigned int /* family */, unsigned int /* address_length */, #else unsigned short /* family */, unsigned short /* address_length */, #endif _Xconst char* /* address */, #if NeedWidePrototypes unsigned int /* number_length */, #else unsigned short /* number_length */, #endif _Xconst char* /* number */, int /* types_length */, char** /* type_names */, _Xconst int* /* type_lengths */ ); void XauDisposeAuth( Xauth* /* auth */ ); _XFUNCPROTOEND /* Return values from XauLockAuth */ # define LOCK_SUCCESS 0 /* lock succeeded */ # define LOCK_ERROR 1 /* lock unexpectely failed, check errno */ # define LOCK_TIMEOUT 2 /* lock failed, timeouts expired */ #endif /* _XAUTH_STRUCT_ONLY */ #endif /* _Xauth_h */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xcms.h ================================================ /* * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc. * All Rights Reserved * * This file is a component of an X Window System-specific implementation * of Xcms based on the TekColor Color Management System. Permission is * hereby granted to use, copy, modify, sell, and otherwise distribute this * software and its documentation for any purpose and without fee, provided * that this copyright, permission, and disclaimer notice is reproduced in * all copies of this software and in supporting documentation. TekColor * is a trademark of Tektronix, Inc. * * Tektronix makes no representation about the suitability of this software * for any purpose. It is provided "as is" and with all faults. * * TEKTRONIX DISCLAIMS ALL WARRANTIES APPLICABLE TO THIS SOFTWARE, * INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE. IN NO EVENT SHALL TEKTRONIX BE LIABLE FOR ANY * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER * RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER IN AN ACTION OF * CONTRACT, NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR THE PERFORMANCE OF THIS SOFTWARE. * * * DESCRIPTION * Public include file for X Color Management System */ #ifndef _X11_XCMS_H_ #define _X11_XCMS_H_ #include /* The Xcms structs are full of implicit padding to properly align members. We can't clean that up without breaking ABI, so tell clang not to bother complaining about it. */ #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif /* * XCMS Status Values */ #define XcmsFailure 0 #define XcmsSuccess 1 #define XcmsSuccessWithCompression 2 /* * Color Space Format ID's * Color Space ID's are of XcmsColorFormat type. * * bit 31 * 0 == Device-Independent * 1 == Device-Dependent * * bit 30: * 0 == Registered with X Consortium * 1 == Unregistered */ #define XcmsUndefinedFormat (XcmsColorFormat)0x00000000 #define XcmsCIEXYZFormat (XcmsColorFormat)0x00000001 #define XcmsCIEuvYFormat (XcmsColorFormat)0x00000002 #define XcmsCIExyYFormat (XcmsColorFormat)0x00000003 #define XcmsCIELabFormat (XcmsColorFormat)0x00000004 #define XcmsCIELuvFormat (XcmsColorFormat)0x00000005 #define XcmsTekHVCFormat (XcmsColorFormat)0x00000006 #define XcmsRGBFormat (XcmsColorFormat)0x80000000 #define XcmsRGBiFormat (XcmsColorFormat)0x80000001 /* * State of XcmsPerScrnInfo */ #define XcmsInitNone 0x00 /* no initialization attempted */ #define XcmsInitSuccess 0x01 /* initialization successful */ #define XcmsInitFailure 0xff /* failure, use defaults */ #define DisplayOfCCC(ccc) ((ccc)->dpy) #define ScreenNumberOfCCC(ccc) ((ccc)->screenNumber) #define VisualOfCCC(ccc) ((ccc)->visual) #define ClientWhitePointOfCCC(ccc) (&(ccc)->clientWhitePt) #define ScreenWhitePointOfCCC(ccc) (&(ccc)->pPerScrnInfo->screenWhitePt) #define FunctionSetOfCCC(ccc) ((ccc)->pPerScrnInfo->functionSet) typedef unsigned long XcmsColorFormat; /* Color Space Format ID */ typedef double XcmsFloat; /* * Device RGB */ typedef struct { unsigned short red; /* scaled from 0x0000 to 0xffff */ unsigned short green; /* scaled from 0x0000 to 0xffff */ unsigned short blue; /* scaled from 0x0000 to 0xffff */ } XcmsRGB; /* * RGB Intensity */ typedef struct { XcmsFloat red; /* 0.0 - 1.0 */ XcmsFloat green; /* 0.0 - 1.0 */ XcmsFloat blue; /* 0.0 - 1.0 */ } XcmsRGBi; /* * CIE XYZ */ typedef struct { XcmsFloat X; XcmsFloat Y; XcmsFloat Z; } XcmsCIEXYZ; /* * CIE u'v'Y */ typedef struct { XcmsFloat u_prime; /* 0.0 - 1.0 */ XcmsFloat v_prime; /* 0.0 - 1.0 */ XcmsFloat Y; /* 0.0 - 1.0 */ } XcmsCIEuvY; /* * CIE xyY */ typedef struct { XcmsFloat x; /* 0.0 - 1.0 */ XcmsFloat y; /* 0.0 - 1.0 */ XcmsFloat Y; /* 0.0 - 1.0 */ } XcmsCIExyY; /* * CIE L*a*b* */ typedef struct { XcmsFloat L_star; /* 0.0 - 100.0 */ XcmsFloat a_star; XcmsFloat b_star; } XcmsCIELab; /* * CIE L*u*v* */ typedef struct { XcmsFloat L_star; /* 0.0 - 100.0 */ XcmsFloat u_star; XcmsFloat v_star; } XcmsCIELuv; /* * TekHVC */ typedef struct { XcmsFloat H; /* 0.0 - 360.0 */ XcmsFloat V; /* 0.0 - 100.0 */ XcmsFloat C; /* 0.0 - 100.0 */ } XcmsTekHVC; /* * PAD */ typedef struct { XcmsFloat pad0; XcmsFloat pad1; XcmsFloat pad2; XcmsFloat pad3; } XcmsPad; /* * XCMS Color Structure */ typedef struct { union { XcmsRGB RGB; XcmsRGBi RGBi; XcmsCIEXYZ CIEXYZ; XcmsCIEuvY CIEuvY; XcmsCIExyY CIExyY; XcmsCIELab CIELab; XcmsCIELuv CIELuv; XcmsTekHVC TekHVC; XcmsPad Pad; } spec; /* the color specification */ unsigned long pixel; /* pixel value (as needed) */ XcmsColorFormat format; /* the specification format */ } XcmsColor; /* * XCMS Per Screen related data */ typedef struct _XcmsPerScrnInfo { XcmsColor screenWhitePt; /* Screen White point */ XPointer functionSet; /* pointer to Screen Color Characterization */ /* Function Set structure */ XPointer screenData; /* pointer to corresponding Screen Color*/ /* Characterization Data */ unsigned char state; /* XcmsInitNone, XcmsInitSuccess, XcmsInitFailure */ char pad[3]; } XcmsPerScrnInfo; typedef struct _XcmsCCC *XcmsCCC; typedef Status (*XcmsCompressionProc)( /* Gamut Compression Proc */ XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); typedef Status (*XcmsWhiteAdjustProc)( /* White Point Adjust Proc */ XcmsCCC /* ccc */, XcmsColor* /* initial_white_point*/, XcmsColor* /* target_white_point*/, XcmsColorFormat /* target_format */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, Bool* /* compression_flags_return */ ); /* * XCMS Color Conversion Context */ typedef struct _XcmsCCC { Display *dpy; /* X Display */ int screenNumber; /* X screen number */ Visual *visual; /* X Visual */ XcmsColor clientWhitePt; /* Client White Point */ XcmsCompressionProc gamutCompProc; /* Gamut Compression Function */ XPointer gamutCompClientData; /* Gamut Comp Func Client Data */ XcmsWhiteAdjustProc whitePtAdjProc; /* White Point Adjustment Function */ XPointer whitePtAdjClientData; /* White Pt Adj Func Client Data */ XcmsPerScrnInfo *pPerScrnInfo; /* pointer to per screen information */ /* associated with the above display */ /* screenNumber */ } XcmsCCCRec; typedef Status (*XcmsScreenInitProc)( /* Screen Initialization Proc */ Display* /* dpy */, int /* screen_number */, XcmsPerScrnInfo* /* screen_info */ ); typedef void (*XcmsScreenFreeProc)( XPointer /* screenData */ ); /* * Function List Pointer -- pointer to an array of function pointers. * The end of list is indicated by a NULL pointer. */ /* * XXX: The use of the XcmsConversionProc type is broken. The * device-independent colour conversion code uses it as: typedef Status (*XcmsConversionProc)(XcmsCCC, XcmsColor *, XcmsColor *, unsigned int); * while the device-dependent code uses it as: typedef Status (*XcmsConversionProc)(XcmsCCC, XcmsColor *, unsigned int, Bool *); * Until this is reworked, it's probably best to leave it unprotoized. * The code works regardless. */ typedef Status (*XcmsDDConversionProc)( /* using device-dependent version */ XcmsCCC /* ccc */, XcmsColor* /* pcolors_in_out */, unsigned int /* ncolors */, Bool* /* pCompressed */ ); typedef Status (*XcmsDIConversionProc)( /* using device-independent version */ XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* pcolors_in_out */, unsigned int /* ncolors */ ); typedef XcmsDIConversionProc XcmsConversionProc; typedef XcmsConversionProc *XcmsFuncListPtr; typedef int (*XcmsParseStringProc)( /* Color String Parsing Proc */ char* /* color_string */, XcmsColor* /* color_return */ ); /* * Color Space -- per Color Space related data (Device-Independent * or Device-Dependent) */ typedef struct _XcmsColorSpace { const char *prefix; /* Prefix of string format. */ XcmsColorFormat id; /* Format ID number. */ XcmsParseStringProc parseString; /* String format parsing function */ XcmsFuncListPtr to_CIEXYZ; /* Pointer to an array of function */ /* pointers such that when the */ /* functions are executed in sequence */ /* will convert a XcmsColor structure */ /* from this color space to CIEXYZ */ /* space. */ XcmsFuncListPtr from_CIEXYZ;/* Pointer to an array of function */ /* pointers such that when the */ /* functions are executed in sequence */ /* will convert a XcmsColor structure */ /* from CIEXYZ space to this color */ /* space. */ int inverse_flag; /* If 1, indicates that for 0 <= i < n */ /* where n is the number of function */ /* pointers in the lists to_CIEXYZ */ /* and from_CIEXYZ; for each function */ /* to_CIEXYZ[i] its inverse function */ /* is from_CIEXYZ[n - i]. */ } XcmsColorSpace; /* * Screen Color Characterization Function Set -- per device class * color space conversion functions. */ typedef struct _XcmsFunctionSet { XcmsColorSpace **DDColorSpaces; /* Pointer to an array of pointers to */ /* Device-DEPENDENT color spaces */ /* understood by this SCCFuncSet. */ XcmsScreenInitProc screenInitProc; /* Screen initialization function that */ /* reads Screen Color Characterization*/ /* Data off properties on the screen's*/ /* root window. */ XcmsScreenFreeProc screenFreeProc; /* Function that frees the SCCData */ /* structures. */ } XcmsFunctionSet; _XFUNCPROTOBEGIN extern Status XcmsAddColorSpace ( XcmsColorSpace* /* pColorSpace */ ); extern Status XcmsAddFunctionSet ( XcmsFunctionSet* /* functionSet */ ); extern Status XcmsAllocColor ( Display* /* dpy */, Colormap /* colormap */, XcmsColor* /* color_in_out */, XcmsColorFormat /* result_format */ ); extern Status XcmsAllocNamedColor ( Display* /* dpy */, Colormap /* colormap */, _Xconst char* /* color_string */, XcmsColor* /* color_scrn_return */, XcmsColor* /* color_exact_return */, XcmsColorFormat /* result_format */ ); extern XcmsCCC XcmsCCCOfColormap ( Display* /* dpy */, Colormap /* colormap */ ); extern Status XcmsCIELabClipab( XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); extern Status XcmsCIELabClipL( XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); extern Status XcmsCIELabClipLab( XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); extern Status XcmsCIELabQueryMaxC ( XcmsCCC /* ccc */, XcmsFloat /* hue_angle */, XcmsFloat /* L_star */, XcmsColor* /* color_return */ ); extern Status XcmsCIELabQueryMaxL ( XcmsCCC /* ccc */, XcmsFloat /* hue_angle */, XcmsFloat /* chroma */, XcmsColor* /* color_return */ ); extern Status XcmsCIELabQueryMaxLC ( XcmsCCC /* ccc */, XcmsFloat /* hue_angle */, XcmsColor* /* color_return */ ); extern Status XcmsCIELabQueryMinL ( XcmsCCC /* ccc */, XcmsFloat /* hue_angle */, XcmsFloat /* chroma */, XcmsColor* /* color_return */ ); extern Status XcmsCIELabToCIEXYZ ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern Status XcmsCIELabWhiteShiftColors( XcmsCCC /* ccc */, XcmsColor* /* initial_white_point*/, XcmsColor* /* target_white_point*/, XcmsColorFormat /* target_format */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, Bool* /* compression_flags_return */ ); extern Status XcmsCIELuvClipL( XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); extern Status XcmsCIELuvClipLuv( XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); extern Status XcmsCIELuvClipuv( XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); extern Status XcmsCIELuvQueryMaxC ( XcmsCCC /* ccc */, XcmsFloat /* hue_angle */, XcmsFloat /* L_star */, XcmsColor* /* color_return */ ); extern Status XcmsCIELuvQueryMaxL ( XcmsCCC /* ccc */, XcmsFloat /* hue_angle */, XcmsFloat /* chroma */, XcmsColor* /* color_return */ ); extern Status XcmsCIELuvQueryMaxLC ( XcmsCCC /* ccc */, XcmsFloat /* hue_angle */, XcmsColor* /* color_return */ ); extern Status XcmsCIELuvQueryMinL ( XcmsCCC /* ccc */, XcmsFloat /* hue_angle */, XcmsFloat /* chroma */, XcmsColor* /* color_return */ ); extern Status XcmsCIELuvToCIEuvY ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern Status XcmsCIELuvWhiteShiftColors( XcmsCCC /* ccc */, XcmsColor* /* initial_white_point*/, XcmsColor* /* target_white_point*/, XcmsColorFormat /* target_format */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, Bool* /* compression_flags_return */ ); extern Status XcmsCIEXYZToCIELab ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern Status XcmsCIEXYZToCIEuvY ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern Status XcmsCIEXYZToCIExyY ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern Status XcmsCIEXYZToRGBi ( XcmsCCC /* ccc */, XcmsColor* /* colors */, unsigned int /* ncolors */, Bool* /* compression_flags_return */ ); extern Status XcmsCIEuvYToCIELuv ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern Status XcmsCIEuvYToCIEXYZ ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern Status XcmsCIEuvYToTekHVC ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern Status XcmsCIExyYToCIEXYZ ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern XcmsColor *XcmsClientWhitePointOfCCC ( XcmsCCC /* ccc */ ); extern Status XcmsConvertColors ( XcmsCCC /* ccc */, XcmsColor* /* colorArry_in_out */, unsigned int /* nColors */, XcmsColorFormat /* targetFormat */, Bool* /* compArry_return */ ); extern XcmsCCC XcmsCreateCCC ( Display* /* dpy */, int /* screenNumber */, Visual* /* visual */, XcmsColor* /* clientWhitePt */, XcmsCompressionProc /* gamutCompProc */, XPointer /* gamutCompClientData */, XcmsWhiteAdjustProc /* whitePtAdjProc */, XPointer /* whitePtAdjClientData */ ); extern XcmsCCC XcmsDefaultCCC ( Display* /* dpy */, int /* screenNumber */ ); extern Display *XcmsDisplayOfCCC ( XcmsCCC /* ccc */ ); extern XcmsColorFormat XcmsFormatOfPrefix ( char* /* prefix */ ); extern void XcmsFreeCCC ( XcmsCCC /* ccc */ ); extern Status XcmsLookupColor ( Display* /* dpy */, Colormap /* colormap */, _Xconst char* /* color_string */, XcmsColor* /* pColor_exact_in_out */, XcmsColor* /* pColor_scrn_in_out */, XcmsColorFormat /* result_format */ ); extern char *XcmsPrefixOfFormat ( XcmsColorFormat /* id */ ); extern Status XcmsQueryBlack ( XcmsCCC /* ccc */, XcmsColorFormat /* target_format */, XcmsColor* /* color_return */ ); extern Status XcmsQueryBlue ( XcmsCCC /* ccc */, XcmsColorFormat /* target_format */, XcmsColor* /* color_return */ ); extern Status XcmsQueryColor ( Display* /* dpy */, Colormap /* colormap */, XcmsColor* /* pColor_in_out */, XcmsColorFormat /* result_format */ ); extern Status XcmsQueryColors ( Display* /* dpy */, Colormap /* colormap */, XcmsColor* /* colorArry_in_out */, unsigned int /* nColors */, XcmsColorFormat /* result_format */ ); extern Status XcmsQueryGreen ( XcmsCCC /* ccc */, XcmsColorFormat /* target_format */, XcmsColor* /* color_return */ ); extern Status XcmsQueryRed ( XcmsCCC /* ccc */, XcmsColorFormat /* target_format */, XcmsColor* /* color_return */ ); extern Status XcmsQueryWhite ( XcmsCCC /* ccc */, XcmsColorFormat /* target_format */, XcmsColor* /* color_return */ ); extern Status XcmsRGBiToCIEXYZ ( XcmsCCC /* ccc */, XcmsColor* /* colors */, unsigned int /* ncolors */, Bool* /* compression_flags_return */ ); extern Status XcmsRGBiToRGB ( XcmsCCC /* ccc */, XcmsColor* /* colors */, unsigned int /* ncolors */, Bool* /* compression_flags_return */ ); extern Status XcmsRGBToRGBi ( XcmsCCC /* ccc */, XcmsColor* /* colors */, unsigned int /* ncolors */, Bool* /* compression_flags_return */ ); extern int XcmsScreenNumberOfCCC ( XcmsCCC /* ccc */ ); extern XcmsColor *XcmsScreenWhitePointOfCCC ( XcmsCCC /* ccc */ ); extern XcmsCCC XcmsSetCCCOfColormap( Display* /* dpy */, Colormap /* colormap */, XcmsCCC /* ccc */ ); extern XcmsCompressionProc XcmsSetCompressionProc ( XcmsCCC /* ccc */, XcmsCompressionProc /* compression_proc */, XPointer /* client_data */ ); extern XcmsWhiteAdjustProc XcmsSetWhiteAdjustProc ( XcmsCCC /* ccc */, XcmsWhiteAdjustProc /* white_adjust_proc */, XPointer /* client_data */ ); extern Status XcmsSetWhitePoint ( XcmsCCC /* ccc */, XcmsColor* /* color */ ); extern Status XcmsStoreColor ( Display* /* dpy */, Colormap /* colormap */, XcmsColor* /* pColor_in */ ); extern Status XcmsStoreColors ( Display* /* dpy */, Colormap /* colormap */, XcmsColor* /* colorArry_in */, unsigned int /* nColors */, Bool* /* compArry_return */ ); extern Status XcmsTekHVCClipC( XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); extern Status XcmsTekHVCClipV( XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); extern Status XcmsTekHVCClipVC( XcmsCCC /* ccc */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, unsigned int /* index */, Bool* /* compression_flags_return */ ); extern Status XcmsTekHVCQueryMaxC ( XcmsCCC /* ccc */, XcmsFloat /* hue */, XcmsFloat /* value */, XcmsColor* /* color_return */ ); extern Status XcmsTekHVCQueryMaxV ( XcmsCCC /* ccc */, XcmsFloat /* hue */, XcmsFloat /* chroma */, XcmsColor* /* color_return */ ); extern Status XcmsTekHVCQueryMaxVC ( XcmsCCC /* ccc */, XcmsFloat /* hue */, XcmsColor* /* color_return */ ); extern Status XcmsTekHVCQueryMaxVSamples ( XcmsCCC /* ccc */, XcmsFloat /* hue */, XcmsColor* /* colors_return */, unsigned int /* nsamples */ ); extern Status XcmsTekHVCQueryMinV ( XcmsCCC /* ccc */, XcmsFloat /* hue */, XcmsFloat /* chroma */, XcmsColor* /* color_return */ ); extern Status XcmsTekHVCToCIEuvY ( XcmsCCC /* ccc */, XcmsColor* /* white_point */, XcmsColor* /* colors */, unsigned int /* ncolors */ ); extern Status XcmsTekHVCWhiteShiftColors( XcmsCCC /* ccc */, XcmsColor* /* initial_white_point*/, XcmsColor* /* target_white_point*/, XcmsColorFormat /* target_format */, XcmsColor* /* colors_in_out */, unsigned int /* ncolors */, Bool* /* compression_flags_return */ ); extern Visual *XcmsVisualOfCCC ( XcmsCCC /* ccc */ ); #ifdef __clang__ #pragma clang diagnostic pop #endif _XFUNCPROTOEND #endif /* _X11_XCMS_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xdefs.h ================================================ /*********************************************************** Copyright (c) 1999 The XFree86 Project Inc. All Rights Reserved. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The XFree86 Project Inc. shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The XFree86 Project Inc.. */ /** ** Types definitions shared between server and clients **/ #ifndef _XDEFS_H #define _XDEFS_H #ifdef _XSERVER64 #include #endif #ifndef _XTYPEDEF_ATOM # define _XTYPEDEF_ATOM # ifndef _XSERVER64 typedef unsigned long Atom; # else typedef CARD32 Atom; # endif #endif #ifndef Bool # ifndef _XTYPEDEF_BOOL # define _XTYPEDEF_BOOL typedef int Bool; # endif #endif #ifndef _XTYPEDEF_POINTER # define _XTYPEDEF_POINTER typedef void *pointer; #endif #ifndef _XTYPEDEF_CLIENTPTR typedef struct _Client *ClientPtr; # define _XTYPEDEF_CLIENTPTR #endif #ifndef _XTYPEDEF_XID # define _XTYPEDEF_XID # ifndef _XSERVER64 typedef unsigned long XID; # else typedef CARD32 XID; # endif #endif #ifndef _XTYPEDEF_MASK # define _XTYPEDEF_MASK # ifndef _XSERVER64 typedef unsigned long Mask; # else typedef CARD32 Mask; # endif #endif #ifndef _XTYPEDEF_FONTPTR # define _XTYPEDEF_FONTPTR typedef struct _Font *FontPtr; /* also in fonts/include/font.h */ #endif #ifndef _XTYPEDEF_FONT # define _XTYPEDEF_FONT typedef XID Font; #endif #ifndef _XTYPEDEF_FSID # ifndef _XSERVER64 typedef unsigned long FSID; # else typedef CARD32 FSID; # endif #endif typedef FSID AccContext; /* OS independent time value XXX Should probably go in Xos.h */ typedef struct timeval **OSTimePtr; typedef void (* BlockHandlerProcPtr)(void * /* blockData */, OSTimePtr /* pTimeout */, void * /* pReadmask */); #endif ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xdmcp.h ================================================ /* * Copyright 1989 Network Computing Devices, Inc., Mountain View, California. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of N.C.D. not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. N.C.D. makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * */ #ifndef _XDMCP_H_ #define _XDMCP_H_ #include #include _XFUNCPROTOBEGIN #define XDM_PROTOCOL_VERSION 1 #define XDM_UDP_PORT 177 /* IANA has assigned FF0X:0:0:0:0:0:0:12B as the permanently assigned * multicast addresses for XDMCP, where X in the prefix may be replaced * by any valid scope identifier, such as 1 for Node-Local, 2 for Link-Local, * 5 for Site-Local, and so on. We set the default here to the Link-Local * version to most closely match the old IPv4 subnet broadcast behavior. * Both xdm and X -query allow specifying a different address if a different * scope is defined. */ #define XDM_DEFAULT_MCAST_ADDR6 "ff02:0:0:0:0:0:0:12b" #define XDM_MAX_MSGLEN 8192 #define XDM_MIN_RTX 2 #define XDM_MAX_RTX 32 #define XDM_RTX_LIMIT 7 #define XDM_KA_RTX_LIMIT 4 #define XDM_DEF_DORMANCY (3 * 60) /* 3 minutes */ #define XDM_MAX_DORMANCY (24 * 60 * 60) /* 24 hours */ typedef enum { BROADCAST_QUERY = 1, QUERY, INDIRECT_QUERY, FORWARD_QUERY, WILLING, UNWILLING, REQUEST, ACCEPT, DECLINE, MANAGE, REFUSE, FAILED, KEEPALIVE, ALIVE } xdmOpCode; typedef enum { XDM_QUERY, XDM_BROADCAST, XDM_INDIRECT, XDM_COLLECT_QUERY, XDM_COLLECT_BROADCAST_QUERY, XDM_COLLECT_INDIRECT_QUERY, XDM_START_CONNECTION, XDM_AWAIT_REQUEST_RESPONSE, XDM_AWAIT_MANAGE_RESPONSE, XDM_MANAGE, XDM_RUN_SESSION, XDM_OFF, XDM_AWAIT_USER_INPUT, XDM_KEEPALIVE, XDM_AWAIT_ALIVE_RESPONSE, #if defined(IPv6) && defined(AF_INET6) XDM_MULTICAST, XDM_COLLECT_MULTICAST_QUERY, #endif XDM_KEEP_ME_LAST } xdmcp_states; #ifdef NOTDEF /* table of hosts */ #define XDM_MAX_STR_LEN 21 #define XDM_MAX_HOSTS 20 struct xdm_host_table { struct sockaddr_in sockaddr; char name[XDM_MAX_STR_LEN]; char status[XDM_MAX_STR_LEN]; }; #endif /* NOTDEF */ typedef CARD8 *CARD8Ptr; typedef CARD16 *CARD16Ptr; typedef CARD32 *CARD32Ptr; typedef struct _ARRAY8 { CARD16 length; CARD8Ptr data; } ARRAY8, *ARRAY8Ptr; typedef struct _ARRAY16 { CARD8 length; CARD16Ptr data; } ARRAY16, *ARRAY16Ptr; typedef struct _ARRAY32 { CARD8 length; CARD32Ptr data; } ARRAY32, *ARRAY32Ptr; typedef struct _ARRAYofARRAY8 { CARD8 length; ARRAY8Ptr data; } ARRAYofARRAY8, *ARRAYofARRAY8Ptr; typedef struct _XdmcpHeader { CARD16 version, opcode, length; } XdmcpHeader, *XdmcpHeaderPtr; typedef struct _XdmcpBuffer { BYTE *data; int size; /* size of buffer pointed by to data */ int pointer; /* current index into data */ int count; /* bytes read from network into data */ } XdmcpBuffer, *XdmcpBufferPtr; typedef struct _XdmAuthKey { BYTE data[8]; } XdmAuthKeyRec, *XdmAuthKeyPtr; /* implementation-independent network address structure. Equiv to sockaddr* for sockets and netbuf* for STREAMS. */ typedef char *XdmcpNetaddr; extern int XdmcpWriteARRAY16(XdmcpBufferPtr buffer, const ARRAY16Ptr array); extern int XdmcpWriteARRAY32(XdmcpBufferPtr buffer, const ARRAY32Ptr array); extern int XdmcpWriteARRAY8(XdmcpBufferPtr buffer, const ARRAY8Ptr array); extern int XdmcpWriteARRAYofARRAY8(XdmcpBufferPtr buffer, const ARRAYofARRAY8Ptr array); extern int XdmcpWriteCARD16(XdmcpBufferPtr buffer, unsigned value); extern int XdmcpWriteCARD32(XdmcpBufferPtr buffer, unsigned value); extern int XdmcpWriteCARD8(XdmcpBufferPtr buffer, unsigned value); extern int XdmcpWriteHeader(XdmcpBufferPtr buffer, const XdmcpHeaderPtr header); extern int XdmcpFlush(int fd, XdmcpBufferPtr buffer, XdmcpNetaddr to, int tolen); extern int XdmcpReadARRAY16(XdmcpBufferPtr buffer, ARRAY16Ptr array); extern int XdmcpReadARRAY32(XdmcpBufferPtr buffer, ARRAY32Ptr array); extern int XdmcpReadARRAY8(XdmcpBufferPtr buffer, ARRAY8Ptr array); extern int XdmcpReadARRAYofARRAY8(XdmcpBufferPtr buffer, ARRAYofARRAY8Ptr array); extern int XdmcpReadCARD16(XdmcpBufferPtr buffer, CARD16Ptr valuep); extern int XdmcpReadCARD32(XdmcpBufferPtr buffer, CARD32Ptr valuep); extern int XdmcpReadCARD8(XdmcpBufferPtr buffer, CARD8Ptr valuep); extern int XdmcpReadHeader(XdmcpBufferPtr buffer, XdmcpHeaderPtr header); extern int XdmcpFill(int fd, XdmcpBufferPtr buffer, XdmcpNetaddr from, int *fromlen); extern int XdmcpReadRemaining(const XdmcpBufferPtr buffer); extern void XdmcpDisposeARRAY8(ARRAY8Ptr array); extern void XdmcpDisposeARRAY16(ARRAY16Ptr array); extern void XdmcpDisposeARRAY32(ARRAY32Ptr array); extern void XdmcpDisposeARRAYofARRAY8(ARRAYofARRAY8Ptr array); extern int XdmcpCopyARRAY8(const ARRAY8Ptr src, ARRAY8Ptr dst); extern int XdmcpARRAY8Equal(const ARRAY8Ptr array1, const ARRAY8Ptr array2); extern void XdmcpGenerateKey (XdmAuthKeyPtr key); extern void XdmcpIncrementKey (XdmAuthKeyPtr key); extern void XdmcpDecrementKey (XdmAuthKeyPtr key); #ifdef HASXDMAUTH extern void XdmcpWrap(unsigned char *input, unsigned char *wrapper, unsigned char *output, int bytes); extern void XdmcpUnwrap(unsigned char *input, unsigned char *wrapper, unsigned char *output, int bytes); #endif #ifndef TRUE #define TRUE 1 #define FALSE 0 #endif extern int XdmcpCompareKeys (const XdmAuthKeyPtr a, const XdmAuthKeyPtr b); extern int XdmcpAllocARRAY16 (ARRAY16Ptr array, int length); extern int XdmcpAllocARRAY32 (ARRAY32Ptr array, int length); extern int XdmcpAllocARRAY8 (ARRAY8Ptr array, int length); extern int XdmcpAllocARRAYofARRAY8 (ARRAYofARRAY8Ptr array, int length); extern int XdmcpReallocARRAY16 (ARRAY16Ptr array, int length); extern int XdmcpReallocARRAY32 (ARRAY32Ptr array, int length); extern int XdmcpReallocARRAY8 (ARRAY8Ptr array, int length); extern int XdmcpReallocARRAYofARRAY8 (ARRAYofARRAY8Ptr array, int length); _XFUNCPROTOEND #endif /* _XDMCP_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xfuncproto.h ================================================ /* Xfuncproto.h. Generated from Xfuncproto.h.in by configure. */ /* * Copyright 1989, 1991, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * */ /* Definitions to make function prototypes manageable */ #ifndef _XFUNCPROTO_H_ #define _XFUNCPROTO_H_ #ifndef NeedFunctionPrototypes #define NeedFunctionPrototypes 1 #endif /* NeedFunctionPrototypes */ #ifndef NeedVarargsPrototypes #define NeedVarargsPrototypes 1 #endif /* NeedVarargsPrototypes */ #if NeedFunctionPrototypes #ifndef NeedNestedPrototypes #define NeedNestedPrototypes 1 #endif /* NeedNestedPrototypes */ #ifndef _Xconst #define _Xconst const #endif /* _Xconst */ /* Function prototype configuration (see configure for more info) */ #ifndef NARROWPROTO #define NARROWPROTO /**/ #endif #ifndef FUNCPROTO #define FUNCPROTO 15 #endif #ifndef NeedWidePrototypes #ifdef NARROWPROTO #define NeedWidePrototypes 0 #else #define NeedWidePrototypes 1 /* default to make interropt. easier */ #endif #endif /* NeedWidePrototypes */ #endif /* NeedFunctionPrototypes */ #ifndef _XFUNCPROTOBEGIN #if defined(__cplusplus) || defined(c_plusplus) /* for C++ V2.0 */ #define _XFUNCPROTOBEGIN extern "C" { /* do not leave open across includes */ #define _XFUNCPROTOEND } #else #define _XFUNCPROTOBEGIN #define _XFUNCPROTOEND #endif #endif /* _XFUNCPROTOBEGIN */ /* http://clang.llvm.org/docs/LanguageExtensions.html#has-attribute */ #ifndef __has_attribute # define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */ #endif #ifndef __has_feature # define __has_feature(x) 0 /* Compatibility with non-clang compilers. */ #endif #ifndef __has_extension # define __has_extension(x) 0 /* Compatibility with non-clang compilers. */ #endif /* Added in X11R6.9, so available in any version of modular xproto */ #if __has_attribute(__sentinel__) || (defined(__GNUC__) && (__GNUC__ >= 4)) # define _X_SENTINEL(x) __attribute__ ((__sentinel__(x))) #else # define _X_SENTINEL(x) #endif /* GNUC >= 4 */ /* Added in X11R6.9, so available in any version of modular xproto */ #if (__has_attribute(visibility) || (defined(__GNUC__) && (__GNUC__ >= 4))) \ && !defined(__CYGWIN__) && !defined(__MINGW32__) # define _X_EXPORT __attribute__((visibility("default"))) # define _X_HIDDEN __attribute__((visibility("hidden"))) # define _X_INTERNAL __attribute__((visibility("internal"))) #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) # define _X_EXPORT __global # define _X_HIDDEN __hidden # define _X_INTERNAL __hidden #else /* not gcc >= 4 and not Sun Studio >= 8 */ # define _X_EXPORT # define _X_HIDDEN # define _X_INTERNAL #endif /* GNUC >= 4 */ /* Branch prediction hints for individual conditionals */ /* requires xproto >= 7.0.9 */ #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303) # define _X_LIKELY(x) __builtin_expect(!!(x), 1) # define _X_UNLIKELY(x) __builtin_expect(!!(x), 0) #else /* not gcc >= 3.3 */ # define _X_LIKELY(x) (x) # define _X_UNLIKELY(x) (x) #endif /* Bulk branch prediction hints via marking error path functions as "cold" */ /* requires xproto >= 7.0.25 */ #if __has_attribute(__cold__) || \ (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403)) /* 4.3+ */ # define _X_COLD __attribute__((__cold__)) #else # define _X_COLD /* nothing */ #endif /* Added in X11R6.9, so available in any version of modular xproto */ #if __has_attribute(deprecated) \ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)) \ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5130)) # define _X_DEPRECATED __attribute__((deprecated)) #else /* not gcc >= 3.1 */ # define _X_DEPRECATED #endif /* requires xproto >= 7.0.30 */ #if __has_extension(attribute_deprecated_with_message) || \ (defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))) # define _X_DEPRECATED_MSG(_msg) __attribute__((deprecated(_msg))) #else # define _X_DEPRECATED_MSG(_msg) _X_DEPRECATED #endif /* requires xproto >= 7.0.17 */ #if __has_attribute(noreturn) \ || (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205)) \ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) # define _X_NORETURN __attribute((noreturn)) #else # define _X_NORETURN #endif /* GNUC */ /* Added in X11R6.9, so available in any version of modular xproto */ #if __has_attribute(__format__) \ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 203) # define _X_ATTRIBUTE_PRINTF(x,y) __attribute__((__format__(__printf__,x,y))) #else /* not gcc >= 2.3 */ # define _X_ATTRIBUTE_PRINTF(x,y) #endif /* requires xproto >= 7.0.22 - since this uses either gcc or C99 variable argument macros, must be only used inside #ifdef _X_NONNULL guards, as many legacy X clients are compiled in C89 mode still. */ #if __has_attribute(nonnull) \ && defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ #define _X_NONNULL(...) __attribute__((nonnull(__VA_ARGS__))) #elif __has_attribute(nonnull) \ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303) #define _X_NONNULL(args...) __attribute__((nonnull(args))) #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ #define _X_NONNULL(...) /* */ #endif /* requires xproto >= 7.0.22 */ #if __has_attribute(__unused__) \ || defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 205) #define _X_UNUSED __attribute__((__unused__)) #else #define _X_UNUSED /* */ #endif /* C99 keyword "inline" or equivalent extensions in pre-C99 compilers */ /* requires xproto >= 7.0.9 (introduced in 7.0.8 but didn't support all compilers until 7.0.9) */ #if defined(inline) /* assume autoconf set it correctly */ || \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L)) /* C99 */ || \ (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)) # define _X_INLINE inline #elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ # define _X_INLINE __inline__ #else # define _X_INLINE #endif /* C99 keyword "restrict" or equivalent extensions in pre-C99 compilers */ /* requires xproto >= 7.0.21 */ #ifndef _X_RESTRICT_KYWD # if defined(restrict) /* assume autoconf set it correctly */ || \ (defined(__STDC_VERSION__) && (__STDC_VERSION__ - 0 >= 199901L) /* C99 */ \ && !defined(__cplusplus)) /* Workaround g++ issue on Solaris */ # define _X_RESTRICT_KYWD restrict # elif defined(__GNUC__) && !defined(__STRICT_ANSI__) /* gcc w/C89+extensions */ # define _X_RESTRICT_KYWD __restrict__ # else # define _X_RESTRICT_KYWD # endif #endif /* requires xproto >= 7.0.30 */ #if __has_attribute(no_sanitize_thread) # define _X_NOTSAN __attribute__((no_sanitize_thread)) #else # define _X_NOTSAN #endif #endif /* _XFUNCPROTO_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xfuncs.h ================================================ /* * Copyright 1990, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * */ #ifndef _XFUNCS_H_ # define _XFUNCS_H_ # include /* the old Xfuncs.h, for pre-R6 */ # if !(defined(XFree86LOADER) && defined(IN_MODULE)) # ifdef X_USEBFUNCS void bcopy(); void bzero(); int bcmp(); # else # if defined(SYSV) && !defined(__SCO__) && !defined(__sun) && !defined(__UNIXWARE__) && !defined(_AIX) # include void bcopy(); # define bzero(b,len) memset(b, 0, len) # define bcmp(b1,b2,len) memcmp(b1, b2, len) # else # include # if defined(__SCO__) || defined(__sun) || defined(__UNIXWARE__) || defined(__CYGWIN__) || defined(_AIX) || defined(__APPLE__) # include # endif # define _XFUNCS_H_INCLUDED_STRING_H # endif # endif /* X_USEBFUNCS */ /* the new Xfuncs.h */ /* the ANSI C way */ # ifndef _XFUNCS_H_INCLUDED_STRING_H # include # endif # undef bzero # define bzero(b,len) memset(b,0,len) # if defined WIN32 && defined __MINGW32__ # define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len)) # endif # endif /* !(defined(XFree86LOADER) && defined(IN_MODULE)) */ #endif /* _XFUNCS_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xlib.h ================================================ /* Copyright 1985, 1986, 1987, 1991, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * Xlib.h - Header definition and support file for the C subroutine * interface library (Xlib) to the X Window System Protocol (V11). * Structures and symbols starting with "_" are private to the library. */ #ifndef _X11_XLIB_H_ #define _X11_XLIB_H_ #define XlibSpecificationRelease 6 #include #if defined(__SCO__) || defined(__UNIXWARE__) #include #endif #include /* applications should not depend on these two headers being included! */ #include #include #ifndef X_WCHAR #include #else #ifdef __UNIXOS2__ #include #else /* replace this with #include or typedef appropriate for your system */ typedef unsigned long wchar_t; #endif #endif #if defined(ISC) && defined(USE_XMBTOWC) #define wctomb(a,b) _Xwctomb(a,b) #define mblen(a,b) _Xmblen(a,b) #ifndef USE_XWCHAR_STRING #define mbtowc(a,b,c) _Xmbtowc(a,b,c) #endif #endif extern int _Xmblen( #ifdef ISC char const *str, size_t len #else char *str, int len #endif ); /* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in November 2000. Its presence is indicated through the following macro. */ #define X_HAVE_UTF8_STRING 1 /* The Xlib structs are full of implicit padding to properly align members. We can't clean that up without breaking ABI, so tell clang not to bother complaining about it. */ #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif typedef char *XPointer; #define Bool int #define Status int #define True 1 #define False 0 #define QueuedAlready 0 #define QueuedAfterReading 1 #define QueuedAfterFlush 2 #define ConnectionNumber(dpy) (((_XPrivDisplay)dpy)->fd) #define RootWindow(dpy, scr) (ScreenOfDisplay(dpy,scr)->root) #define DefaultScreen(dpy) (((_XPrivDisplay)dpy)->default_screen) #define DefaultRootWindow(dpy) (ScreenOfDisplay(dpy,DefaultScreen(dpy))->root) #define DefaultVisual(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_visual) #define DefaultGC(dpy, scr) (ScreenOfDisplay(dpy,scr)->default_gc) #define BlackPixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->black_pixel) #define WhitePixel(dpy, scr) (ScreenOfDisplay(dpy,scr)->white_pixel) #define AllPlanes ((unsigned long)~0L) #define QLength(dpy) (((_XPrivDisplay)dpy)->qlen) #define DisplayWidth(dpy, scr) (ScreenOfDisplay(dpy,scr)->width) #define DisplayHeight(dpy, scr) (ScreenOfDisplay(dpy,scr)->height) #define DisplayWidthMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mwidth) #define DisplayHeightMM(dpy, scr)(ScreenOfDisplay(dpy,scr)->mheight) #define DisplayPlanes(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) #define DisplayCells(dpy, scr) (DefaultVisual(dpy,scr)->map_entries) #define ScreenCount(dpy) (((_XPrivDisplay)dpy)->nscreens) #define ServerVendor(dpy) (((_XPrivDisplay)dpy)->vendor) #define ProtocolVersion(dpy) (((_XPrivDisplay)dpy)->proto_major_version) #define ProtocolRevision(dpy) (((_XPrivDisplay)dpy)->proto_minor_version) #define VendorRelease(dpy) (((_XPrivDisplay)dpy)->release) #define DisplayString(dpy) (((_XPrivDisplay)dpy)->display_name) #define DefaultDepth(dpy, scr) (ScreenOfDisplay(dpy,scr)->root_depth) #define DefaultColormap(dpy, scr)(ScreenOfDisplay(dpy,scr)->cmap) #define BitmapUnit(dpy) (((_XPrivDisplay)dpy)->bitmap_unit) #define BitmapBitOrder(dpy) (((_XPrivDisplay)dpy)->bitmap_bit_order) #define BitmapPad(dpy) (((_XPrivDisplay)dpy)->bitmap_pad) #define ImageByteOrder(dpy) (((_XPrivDisplay)dpy)->byte_order) #define NextRequest(dpy) (((_XPrivDisplay)dpy)->request + 1) #define LastKnownRequestProcessed(dpy) (((_XPrivDisplay)dpy)->last_request_read) /* macros for screen oriented applications (toolkit) */ #define ScreenOfDisplay(dpy, scr)(&((_XPrivDisplay)dpy)->screens[scr]) #define DefaultScreenOfDisplay(dpy) ScreenOfDisplay(dpy,DefaultScreen(dpy)) #define DisplayOfScreen(s) ((s)->display) #define RootWindowOfScreen(s) ((s)->root) #define BlackPixelOfScreen(s) ((s)->black_pixel) #define WhitePixelOfScreen(s) ((s)->white_pixel) #define DefaultColormapOfScreen(s)((s)->cmap) #define DefaultDepthOfScreen(s) ((s)->root_depth) #define DefaultGCOfScreen(s) ((s)->default_gc) #define DefaultVisualOfScreen(s)((s)->root_visual) #define WidthOfScreen(s) ((s)->width) #define HeightOfScreen(s) ((s)->height) #define WidthMMOfScreen(s) ((s)->mwidth) #define HeightMMOfScreen(s) ((s)->mheight) #define PlanesOfScreen(s) ((s)->root_depth) #define CellsOfScreen(s) (DefaultVisualOfScreen((s))->map_entries) #define MinCmapsOfScreen(s) ((s)->min_maps) #define MaxCmapsOfScreen(s) ((s)->max_maps) #define DoesSaveUnders(s) ((s)->save_unders) #define DoesBackingStore(s) ((s)->backing_store) #define EventMaskOfScreen(s) ((s)->root_input_mask) /* * Extensions need a way to hang private data on some structures. */ typedef struct _XExtData { int number; /* number returned by XRegisterExtension */ struct _XExtData *next; /* next item on list of data for structure */ int (*free_private)( /* called to free private storage */ struct _XExtData *extension ); XPointer private_data; /* data private to this extension. */ } XExtData; /* * This file contains structures used by the extension mechanism. */ typedef struct { /* public to extension, cannot be changed */ int extension; /* extension number */ int major_opcode; /* major op-code assigned by server */ int first_event; /* first event number for the extension */ int first_error; /* first error number for the extension */ } XExtCodes; /* * Data structure for retrieving info about pixmap formats. */ typedef struct { int depth; int bits_per_pixel; int scanline_pad; } XPixmapFormatValues; /* * Data structure for setting graphics context. */ typedef struct { int function; /* logical operation */ unsigned long plane_mask;/* plane mask */ unsigned long foreground;/* foreground pixel */ unsigned long background;/* background pixel */ int line_width; /* line width */ int line_style; /* LineSolid, LineOnOffDash, LineDoubleDash */ int cap_style; /* CapNotLast, CapButt, CapRound, CapProjecting */ int join_style; /* JoinMiter, JoinRound, JoinBevel */ int fill_style; /* FillSolid, FillTiled, FillStippled, FillOpaeueStippled */ int fill_rule; /* EvenOddRule, WindingRule */ int arc_mode; /* ArcChord, ArcPieSlice */ Pixmap tile; /* tile pixmap for tiling operations */ Pixmap stipple; /* stipple 1 plane pixmap for stipping */ int ts_x_origin; /* offset for tile or stipple operations */ int ts_y_origin; Font font; /* default text font for text operations */ int subwindow_mode; /* ClipByChildren, IncludeInferiors */ Bool graphics_exposures;/* boolean, should exposures be generated */ int clip_x_origin; /* origin for clipping */ int clip_y_origin; Pixmap clip_mask; /* bitmap clipping; other calls for rects */ int dash_offset; /* patterned/dashed line information */ char dashes; } XGCValues; /* * Graphics context. The contents of this structure are implementation * dependent. A GC should be treated as opaque by application code. */ typedef struct _XGC #ifdef XLIB_ILLEGAL_ACCESS { XExtData *ext_data; /* hook for extension to hang data */ GContext gid; /* protocol ID for graphics context */ /* there is more to this structure, but it is private to Xlib */ } #endif *GC; /* * Visual structure; contains information about colormapping possible. */ typedef struct { XExtData *ext_data; /* hook for extension to hang data */ VisualID visualid; /* visual id of this visual */ #if defined(__cplusplus) || defined(c_plusplus) int c_class; /* C++ class of screen (monochrome, etc.) */ #else int class; /* class of screen (monochrome, etc.) */ #endif unsigned long red_mask, green_mask, blue_mask; /* mask values */ int bits_per_rgb; /* log base 2 of distinct color values */ int map_entries; /* color map entries */ } Visual; /* * Depth structure; contains information for each possible depth. */ typedef struct { int depth; /* this depth (Z) of the depth */ int nvisuals; /* number of Visual types at this depth */ Visual *visuals; /* list of visuals possible at this depth */ } Depth; /* * Information about the screen. The contents of this structure are * implementation dependent. A Screen should be treated as opaque * by application code. */ struct _XDisplay; /* Forward declare before use for C++ */ typedef struct { XExtData *ext_data; /* hook for extension to hang data */ struct _XDisplay *display;/* back pointer to display structure */ Window root; /* Root window id. */ int width, height; /* width and height of screen */ int mwidth, mheight; /* width and height of in millimeters */ int ndepths; /* number of depths possible */ Depth *depths; /* list of allowable depths on the screen */ int root_depth; /* bits per pixel */ Visual *root_visual; /* root visual */ GC default_gc; /* GC for the root root visual */ Colormap cmap; /* default color map */ unsigned long white_pixel; unsigned long black_pixel; /* White and Black pixel values */ int max_maps, min_maps; /* max and min color maps */ int backing_store; /* Never, WhenMapped, Always */ Bool save_unders; long root_input_mask; /* initial root input mask */ } Screen; /* * Format structure; describes ZFormat data the screen will understand. */ typedef struct { XExtData *ext_data; /* hook for extension to hang data */ int depth; /* depth of this image format */ int bits_per_pixel; /* bits/pixel at this depth */ int scanline_pad; /* scanline must padded to this multiple */ } ScreenFormat; /* * Data structure for setting window attributes. */ typedef struct { Pixmap background_pixmap; /* background or None or ParentRelative */ unsigned long background_pixel; /* background pixel */ Pixmap border_pixmap; /* border of the window */ unsigned long border_pixel; /* border pixel value */ int bit_gravity; /* one of bit gravity values */ int win_gravity; /* one of the window gravity values */ int backing_store; /* NotUseful, WhenMapped, Always */ unsigned long backing_planes;/* planes to be preseved if possible */ unsigned long backing_pixel;/* value to use in restoring planes */ Bool save_under; /* should bits under be saved? (popups) */ long event_mask; /* set of events that should be saved */ long do_not_propagate_mask; /* set of events that should not propagate */ Bool override_redirect; /* boolean value for override-redirect */ Colormap colormap; /* color map to be associated with window */ Cursor cursor; /* cursor to be displayed (or None) */ } XSetWindowAttributes; typedef struct { int x, y; /* location of window */ int width, height; /* width and height of window */ int border_width; /* border width of window */ int depth; /* depth of window */ Visual *visual; /* the associated visual structure */ Window root; /* root of screen containing window */ #if defined(__cplusplus) || defined(c_plusplus) int c_class; /* C++ InputOutput, InputOnly*/ #else int class; /* InputOutput, InputOnly*/ #endif int bit_gravity; /* one of bit gravity values */ int win_gravity; /* one of the window gravity values */ int backing_store; /* NotUseful, WhenMapped, Always */ unsigned long backing_planes;/* planes to be preserved if possible */ unsigned long backing_pixel;/* value to be used when restoring planes */ Bool save_under; /* boolean, should bits under be saved? */ Colormap colormap; /* color map to be associated with window */ Bool map_installed; /* boolean, is color map currently installed*/ int map_state; /* IsUnmapped, IsUnviewable, IsViewable */ long all_event_masks; /* set of events all people have interest in*/ long your_event_mask; /* my event mask */ long do_not_propagate_mask; /* set of events that should not propagate */ Bool override_redirect; /* boolean value for override-redirect */ Screen *screen; /* back pointer to correct screen */ } XWindowAttributes; /* * Data structure for host setting; getting routines. * */ typedef struct { int family; /* for example FamilyInternet */ int length; /* length of address, in bytes */ char *address; /* pointer to where to find the bytes */ } XHostAddress; /* * Data structure for ServerFamilyInterpreted addresses in host routines */ typedef struct { int typelength; /* length of type string, in bytes */ int valuelength; /* length of value string, in bytes */ char *type; /* pointer to where to find the type string */ char *value; /* pointer to where to find the address */ } XServerInterpretedAddress; /* * Data structure for "image" data, used by image manipulation routines. */ typedef struct _XImage { int width, height; /* size of image */ int xoffset; /* number of pixels offset in X direction */ int format; /* XYBitmap, XYPixmap, ZPixmap */ char *data; /* pointer to image data */ int byte_order; /* data byte order, LSBFirst, MSBFirst */ int bitmap_unit; /* quant. of scanline 8, 16, 32 */ int bitmap_bit_order; /* LSBFirst, MSBFirst */ int bitmap_pad; /* 8, 16, 32 either XY or ZPixmap */ int depth; /* depth of image */ int bytes_per_line; /* accelarator to next line */ int bits_per_pixel; /* bits per pixel (ZPixmap) */ unsigned long red_mask; /* bits in z arrangment */ unsigned long green_mask; unsigned long blue_mask; XPointer obdata; /* hook for the object routines to hang on */ struct funcs { /* image manipulation routines */ struct _XImage *(*create_image)( struct _XDisplay* /* display */, Visual* /* visual */, unsigned int /* depth */, int /* format */, int /* offset */, char* /* data */, unsigned int /* width */, unsigned int /* height */, int /* bitmap_pad */, int /* bytes_per_line */); int (*destroy_image) (struct _XImage *); unsigned long (*get_pixel) (struct _XImage *, int, int); int (*put_pixel) (struct _XImage *, int, int, unsigned long); struct _XImage *(*sub_image)(struct _XImage *, int, int, unsigned int, unsigned int); int (*add_pixel) (struct _XImage *, long); } f; } XImage; /* * Data structure for XReconfigureWindow */ typedef struct { int x, y; int width, height; int border_width; Window sibling; int stack_mode; } XWindowChanges; /* * Data structure used by color operations */ typedef struct { unsigned long pixel; unsigned short red, green, blue; char flags; /* do_red, do_green, do_blue */ char pad; } XColor; /* * Data structures for graphics operations. On most machines, these are * congruent with the wire protocol structures, so reformatting the data * can be avoided on these architectures. */ typedef struct { short x1, y1, x2, y2; } XSegment; typedef struct { short x, y; } XPoint; typedef struct { short x, y; unsigned short width, height; } XRectangle; typedef struct { short x, y; unsigned short width, height; short angle1, angle2; } XArc; /* Data structure for XChangeKeyboardControl */ typedef struct { int key_click_percent; int bell_percent; int bell_pitch; int bell_duration; int led; int led_mode; int key; int auto_repeat_mode; /* On, Off, Default */ } XKeyboardControl; /* Data structure for XGetKeyboardControl */ typedef struct { int key_click_percent; int bell_percent; unsigned int bell_pitch, bell_duration; unsigned long led_mask; int global_auto_repeat; char auto_repeats[32]; } XKeyboardState; /* Data structure for XGetMotionEvents. */ typedef struct { Time time; short x, y; } XTimeCoord; /* Data structure for X{Set,Get}ModifierMapping */ typedef struct { int max_keypermod; /* The server's max # of keys per modifier */ KeyCode *modifiermap; /* An 8 by max_keypermod array of modifiers */ } XModifierKeymap; /* * Display datatype maintaining display specific data. * The contents of this structure are implementation dependent. * A Display should be treated as opaque by application code. */ #ifndef XLIB_ILLEGAL_ACCESS typedef struct _XDisplay Display; #endif struct _XPrivate; /* Forward declare before use for C++ */ struct _XrmHashBucketRec; typedef struct #ifdef XLIB_ILLEGAL_ACCESS _XDisplay #endif { XExtData *ext_data; /* hook for extension to hang data */ struct _XPrivate *private1; int fd; /* Network socket. */ int private2; int proto_major_version;/* major version of server's X protocol */ int proto_minor_version;/* minor version of servers X protocol */ char *vendor; /* vendor of the server hardware */ XID private3; XID private4; XID private5; int private6; XID (*resource_alloc)( /* allocator function */ struct _XDisplay* ); int byte_order; /* screen byte order, LSBFirst, MSBFirst */ int bitmap_unit; /* padding and data requirements */ int bitmap_pad; /* padding requirements on bitmaps */ int bitmap_bit_order; /* LeastSignificant or MostSignificant */ int nformats; /* number of pixmap formats in list */ ScreenFormat *pixmap_format; /* pixmap format list */ int private8; int release; /* release of the server */ struct _XPrivate *private9, *private10; int qlen; /* Length of input event queue */ unsigned long last_request_read; /* seq number of last event read */ unsigned long request; /* sequence number of last request. */ XPointer private11; XPointer private12; XPointer private13; XPointer private14; unsigned max_request_size; /* maximum number 32 bit words in request*/ struct _XrmHashBucketRec *db; int (*private15)( struct _XDisplay* ); char *display_name; /* "host:display" string used on this connect*/ int default_screen; /* default screen for operations */ int nscreens; /* number of screens on this server*/ Screen *screens; /* pointer to list of screens */ unsigned long motion_buffer; /* size of motion buffer */ unsigned long private16; int min_keycode; /* minimum defined keycode */ int max_keycode; /* maximum defined keycode */ XPointer private17; XPointer private18; int private19; char *xdefaults; /* contents of defaults from server */ /* there is more to this structure, but it is private to Xlib */ } #ifdef XLIB_ILLEGAL_ACCESS Display, #endif *_XPrivDisplay; #undef _XEVENT_ #ifndef _XEVENT_ /* * Definitions of specific events. */ typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* "event" window it is reported relative to */ Window root; /* root window that the event occurred on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ unsigned int state; /* key or button mask */ unsigned int keycode; /* detail */ Bool same_screen; /* same screen flag */ } XKeyEvent; typedef XKeyEvent XKeyPressedEvent; typedef XKeyEvent XKeyReleasedEvent; typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* "event" window it is reported relative to */ Window root; /* root window that the event occurred on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ unsigned int state; /* key or button mask */ unsigned int button; /* detail */ Bool same_screen; /* same screen flag */ } XButtonEvent; typedef XButtonEvent XButtonPressedEvent; typedef XButtonEvent XButtonReleasedEvent; typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* "event" window reported relative to */ Window root; /* root window that the event occurred on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ unsigned int state; /* key or button mask */ char is_hint; /* detail */ Bool same_screen; /* same screen flag */ } XMotionEvent; typedef XMotionEvent XPointerMovedEvent; typedef struct { int type; /* of event */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* "event" window reported relative to */ Window root; /* root window that the event occurred on */ Window subwindow; /* child window */ Time time; /* milliseconds */ int x, y; /* pointer x, y coordinates in event window */ int x_root, y_root; /* coordinates relative to root */ int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */ int detail; /* * NotifyAncestor, NotifyVirtual, NotifyInferior, * NotifyNonlinear,NotifyNonlinearVirtual */ Bool same_screen; /* same screen flag */ Bool focus; /* boolean focus */ unsigned int state; /* key or button mask */ } XCrossingEvent; typedef XCrossingEvent XEnterWindowEvent; typedef XCrossingEvent XLeaveWindowEvent; typedef struct { int type; /* FocusIn or FocusOut */ unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* window of event */ int mode; /* NotifyNormal, NotifyWhileGrabbed, NotifyGrab, NotifyUngrab */ int detail; /* * NotifyAncestor, NotifyVirtual, NotifyInferior, * NotifyNonlinear,NotifyNonlinearVirtual, NotifyPointer, * NotifyPointerRoot, NotifyDetailNone */ } XFocusChangeEvent; typedef XFocusChangeEvent XFocusInEvent; typedef XFocusChangeEvent XFocusOutEvent; /* generated on EnterWindow and FocusIn when KeyMapState selected */ typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; char key_vector[32]; } XKeymapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; int x, y; int width, height; int count; /* if non-zero, at least this many more */ } XExposeEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Drawable drawable; int x, y; int width, height; int count; /* if non-zero, at least this many more */ int major_code; /* core is CopyArea or CopyPlane */ int minor_code; /* not defined in the core */ } XGraphicsExposeEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Drawable drawable; int major_code; /* core is CopyArea or CopyPlane */ int minor_code; /* not defined in the core */ } XNoExposeEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; int state; /* Visibility state */ } XVisibilityEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window parent; /* parent of the window */ Window window; /* window id of window created */ int x, y; /* window location */ int width, height; /* size of window */ int border_width; /* border width */ Bool override_redirect; /* creation should be overridden */ } XCreateWindowEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; } XDestroyWindowEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; Bool from_configure; } XUnmapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; Bool override_redirect; /* boolean, is override set... */ } XMapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window parent; Window window; } XMapRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; Window parent; int x, y; Bool override_redirect; } XReparentEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; int x, y; int width, height; int border_width; Window above; Bool override_redirect; } XConfigureEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; int x, y; } XGravityEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; int width, height; } XResizeRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window parent; Window window; int x, y; int width, height; int border_width; Window above; int detail; /* Above, Below, TopIf, BottomIf, Opposite */ unsigned long value_mask; } XConfigureRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window event; Window window; int place; /* PlaceOnTop, PlaceOnBottom */ } XCirculateEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window parent; Window window; int place; /* PlaceOnTop, PlaceOnBottom */ } XCirculateRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; Atom atom; Time time; int state; /* NewValue, Deleted */ } XPropertyEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; Atom selection; Time time; } XSelectionClearEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window owner; Window requestor; Atom selection; Atom target; Atom property; Time time; } XSelectionRequestEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window requestor; Atom selection; Atom target; Atom property; /* ATOM or None */ Time time; } XSelectionEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; Colormap colormap; /* COLORMAP or None */ #if defined(__cplusplus) || defined(c_plusplus) Bool c_new; /* C++ */ #else Bool new; #endif int state; /* ColormapInstalled, ColormapUninstalled */ } XColormapEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; Atom message_type; int format; union { char b[20]; short s[10]; long l[5]; } data; } XClientMessageEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display; /* Display the event was read from */ Window window; /* unused */ int request; /* one of MappingModifier, MappingKeyboard, MappingPointer */ int first_keycode; /* first keycode */ int count; /* defines range of change w. first_keycode*/ } XMappingEvent; typedef struct { int type; Display *display; /* Display the event was read from */ XID resourceid; /* resource id */ unsigned long serial; /* serial number of failed request */ unsigned char error_code; /* error code of failed request */ unsigned char request_code; /* Major op-code of failed request */ unsigned char minor_code; /* Minor op-code of failed request */ } XErrorEvent; typedef struct { int type; unsigned long serial; /* # of last request processed by server */ Bool send_event; /* true if this came from a SendEvent request */ Display *display;/* Display the event was read from */ Window window; /* window on which event was requested in event mask */ } XAnyEvent; /*************************************************************** * * GenericEvent. This event is the standard event for all newer extensions. */ typedef struct { int type; /* of event. Always GenericEvent */ unsigned long serial; /* # of last request processed */ Bool send_event; /* true if from SendEvent request */ Display *display; /* Display the event was read from */ int extension; /* major opcode of extension that caused the event */ int evtype; /* actual event type. */ } XGenericEvent; typedef struct { int type; /* of event. Always GenericEvent */ unsigned long serial; /* # of last request processed */ Bool send_event; /* true if from SendEvent request */ Display *display; /* Display the event was read from */ int extension; /* major opcode of extension that caused the event */ int evtype; /* actual event type. */ unsigned int cookie; void *data; } XGenericEventCookie; /* * this union is defined so Xlib can always use the same sized * event structure internally, to avoid memory fragmentation. */ typedef union _XEvent { int type; /* must not be changed; first element */ XAnyEvent xany; XKeyEvent xkey; XButtonEvent xbutton; XMotionEvent xmotion; XCrossingEvent xcrossing; XFocusChangeEvent xfocus; XExposeEvent xexpose; XGraphicsExposeEvent xgraphicsexpose; XNoExposeEvent xnoexpose; XVisibilityEvent xvisibility; XCreateWindowEvent xcreatewindow; XDestroyWindowEvent xdestroywindow; XUnmapEvent xunmap; XMapEvent xmap; XMapRequestEvent xmaprequest; XReparentEvent xreparent; XConfigureEvent xconfigure; XGravityEvent xgravity; XResizeRequestEvent xresizerequest; XConfigureRequestEvent xconfigurerequest; XCirculateEvent xcirculate; XCirculateRequestEvent xcirculaterequest; XPropertyEvent xproperty; XSelectionClearEvent xselectionclear; XSelectionRequestEvent xselectionrequest; XSelectionEvent xselection; XColormapEvent xcolormap; XClientMessageEvent xclient; XMappingEvent xmapping; XErrorEvent xerror; XKeymapEvent xkeymap; XGenericEvent xgeneric; XGenericEventCookie xcookie; long pad[24]; } XEvent; #endif #define XAllocID(dpy) ((*((_XPrivDisplay)dpy)->resource_alloc)((dpy))) /* * per character font metric information. */ typedef struct { short lbearing; /* origin to left edge of raster */ short rbearing; /* origin to right edge of raster */ short width; /* advance to next char's origin */ short ascent; /* baseline to top edge of raster */ short descent; /* baseline to bottom edge of raster */ unsigned short attributes; /* per char flags (not predefined) */ } XCharStruct; /* * To allow arbitrary information with fonts, there are additional properties * returned. */ typedef struct { Atom name; unsigned long card32; } XFontProp; typedef struct { XExtData *ext_data; /* hook for extension to hang data */ Font fid; /* Font id for this font */ unsigned direction; /* hint about direction the font is painted */ unsigned min_char_or_byte2;/* first character */ unsigned max_char_or_byte2;/* last character */ unsigned min_byte1; /* first row that exists */ unsigned max_byte1; /* last row that exists */ Bool all_chars_exist;/* flag if all characters have non-zero size*/ unsigned default_char; /* char to print for undefined character */ int n_properties; /* how many properties there are */ XFontProp *properties; /* pointer to array of additional properties*/ XCharStruct min_bounds; /* minimum bounds over all existing char*/ XCharStruct max_bounds; /* maximum bounds over all existing char*/ XCharStruct *per_char; /* first_char to last_char information */ int ascent; /* log. extent above baseline for spacing */ int descent; /* log. descent below baseline for spacing */ } XFontStruct; /* * PolyText routines take these as arguments. */ typedef struct { char *chars; /* pointer to string */ int nchars; /* number of characters */ int delta; /* delta between strings */ Font font; /* font to print it in, None don't change */ } XTextItem; typedef struct { /* normal 16 bit characters are two bytes */ unsigned char byte1; unsigned char byte2; } XChar2b; typedef struct { XChar2b *chars; /* two byte characters */ int nchars; /* number of characters */ int delta; /* delta between strings */ Font font; /* font to print it in, None don't change */ } XTextItem16; typedef union { Display *display; GC gc; Visual *visual; Screen *screen; ScreenFormat *pixmap_format; XFontStruct *font; } XEDataObject; typedef struct { XRectangle max_ink_extent; XRectangle max_logical_extent; } XFontSetExtents; /* unused: typedef void (*XOMProc)(); */ typedef struct _XOM *XOM; typedef struct _XOC *XOC, *XFontSet; typedef struct { char *chars; int nchars; int delta; XFontSet font_set; } XmbTextItem; typedef struct { wchar_t *chars; int nchars; int delta; XFontSet font_set; } XwcTextItem; #define XNRequiredCharSet "requiredCharSet" #define XNQueryOrientation "queryOrientation" #define XNBaseFontName "baseFontName" #define XNOMAutomatic "omAutomatic" #define XNMissingCharSet "missingCharSet" #define XNDefaultString "defaultString" #define XNOrientation "orientation" #define XNDirectionalDependentDrawing "directionalDependentDrawing" #define XNContextualDrawing "contextualDrawing" #define XNFontInfo "fontInfo" typedef struct { int charset_count; char **charset_list; } XOMCharSetList; typedef enum { XOMOrientation_LTR_TTB, XOMOrientation_RTL_TTB, XOMOrientation_TTB_LTR, XOMOrientation_TTB_RTL, XOMOrientation_Context } XOrientation; typedef struct { int num_orientation; XOrientation *orientation; /* Input Text description */ } XOMOrientation; typedef struct { int num_font; XFontStruct **font_struct_list; char **font_name_list; } XOMFontInfo; typedef struct _XIM *XIM; typedef struct _XIC *XIC; typedef void (*XIMProc)( XIM, XPointer, XPointer ); typedef Bool (*XICProc)( XIC, XPointer, XPointer ); typedef void (*XIDProc)( Display*, XPointer, XPointer ); typedef unsigned long XIMStyle; typedef struct { unsigned short count_styles; XIMStyle *supported_styles; } XIMStyles; #define XIMPreeditArea 0x0001L #define XIMPreeditCallbacks 0x0002L #define XIMPreeditPosition 0x0004L #define XIMPreeditNothing 0x0008L #define XIMPreeditNone 0x0010L #define XIMStatusArea 0x0100L #define XIMStatusCallbacks 0x0200L #define XIMStatusNothing 0x0400L #define XIMStatusNone 0x0800L #define XNVaNestedList "XNVaNestedList" #define XNQueryInputStyle "queryInputStyle" #define XNClientWindow "clientWindow" #define XNInputStyle "inputStyle" #define XNFocusWindow "focusWindow" #define XNResourceName "resourceName" #define XNResourceClass "resourceClass" #define XNGeometryCallback "geometryCallback" #define XNDestroyCallback "destroyCallback" #define XNFilterEvents "filterEvents" #define XNPreeditStartCallback "preeditStartCallback" #define XNPreeditDoneCallback "preeditDoneCallback" #define XNPreeditDrawCallback "preeditDrawCallback" #define XNPreeditCaretCallback "preeditCaretCallback" #define XNPreeditStateNotifyCallback "preeditStateNotifyCallback" #define XNPreeditAttributes "preeditAttributes" #define XNStatusStartCallback "statusStartCallback" #define XNStatusDoneCallback "statusDoneCallback" #define XNStatusDrawCallback "statusDrawCallback" #define XNStatusAttributes "statusAttributes" #define XNArea "area" #define XNAreaNeeded "areaNeeded" #define XNSpotLocation "spotLocation" #define XNColormap "colorMap" #define XNStdColormap "stdColorMap" #define XNForeground "foreground" #define XNBackground "background" #define XNBackgroundPixmap "backgroundPixmap" #define XNFontSet "fontSet" #define XNLineSpace "lineSpace" #define XNCursor "cursor" #define XNQueryIMValuesList "queryIMValuesList" #define XNQueryICValuesList "queryICValuesList" #define XNVisiblePosition "visiblePosition" #define XNR6PreeditCallback "r6PreeditCallback" #define XNStringConversionCallback "stringConversionCallback" #define XNStringConversion "stringConversion" #define XNResetState "resetState" #define XNHotKey "hotKey" #define XNHotKeyState "hotKeyState" #define XNPreeditState "preeditState" #define XNSeparatorofNestedList "separatorofNestedList" #define XBufferOverflow -1 #define XLookupNone 1 #define XLookupChars 2 #define XLookupKeySym 3 #define XLookupBoth 4 typedef void *XVaNestedList; typedef struct { XPointer client_data; XIMProc callback; } XIMCallback; typedef struct { XPointer client_data; XICProc callback; } XICCallback; typedef unsigned long XIMFeedback; #define XIMReverse 1L #define XIMUnderline (1L<<1) #define XIMHighlight (1L<<2) #define XIMPrimary (1L<<5) #define XIMSecondary (1L<<6) #define XIMTertiary (1L<<7) #define XIMVisibleToForward (1L<<8) #define XIMVisibleToBackword (1L<<9) #define XIMVisibleToCenter (1L<<10) typedef struct _XIMText { unsigned short length; XIMFeedback *feedback; Bool encoding_is_wchar; union { char *multi_byte; wchar_t *wide_char; } string; } XIMText; typedef unsigned long XIMPreeditState; #define XIMPreeditUnKnown 0L #define XIMPreeditEnable 1L #define XIMPreeditDisable (1L<<1) typedef struct _XIMPreeditStateNotifyCallbackStruct { XIMPreeditState state; } XIMPreeditStateNotifyCallbackStruct; typedef unsigned long XIMResetState; #define XIMInitialState 1L #define XIMPreserveState (1L<<1) typedef unsigned long XIMStringConversionFeedback; #define XIMStringConversionLeftEdge (0x00000001) #define XIMStringConversionRightEdge (0x00000002) #define XIMStringConversionTopEdge (0x00000004) #define XIMStringConversionBottomEdge (0x00000008) #define XIMStringConversionConcealed (0x00000010) #define XIMStringConversionWrapped (0x00000020) typedef struct _XIMStringConversionText { unsigned short length; XIMStringConversionFeedback *feedback; Bool encoding_is_wchar; union { char *mbs; wchar_t *wcs; } string; } XIMStringConversionText; typedef unsigned short XIMStringConversionPosition; typedef unsigned short XIMStringConversionType; #define XIMStringConversionBuffer (0x0001) #define XIMStringConversionLine (0x0002) #define XIMStringConversionWord (0x0003) #define XIMStringConversionChar (0x0004) typedef unsigned short XIMStringConversionOperation; #define XIMStringConversionSubstitution (0x0001) #define XIMStringConversionRetrieval (0x0002) typedef enum { XIMForwardChar, XIMBackwardChar, XIMForwardWord, XIMBackwardWord, XIMCaretUp, XIMCaretDown, XIMNextLine, XIMPreviousLine, XIMLineStart, XIMLineEnd, XIMAbsolutePosition, XIMDontChange } XIMCaretDirection; typedef struct _XIMStringConversionCallbackStruct { XIMStringConversionPosition position; XIMCaretDirection direction; XIMStringConversionOperation operation; unsigned short factor; XIMStringConversionText *text; } XIMStringConversionCallbackStruct; typedef struct _XIMPreeditDrawCallbackStruct { int caret; /* Cursor offset within pre-edit string */ int chg_first; /* Starting change position */ int chg_length; /* Length of the change in character count */ XIMText *text; } XIMPreeditDrawCallbackStruct; typedef enum { XIMIsInvisible, /* Disable caret feedback */ XIMIsPrimary, /* UI defined caret feedback */ XIMIsSecondary /* UI defined caret feedback */ } XIMCaretStyle; typedef struct _XIMPreeditCaretCallbackStruct { int position; /* Caret offset within pre-edit string */ XIMCaretDirection direction; /* Caret moves direction */ XIMCaretStyle style; /* Feedback of the caret */ } XIMPreeditCaretCallbackStruct; typedef enum { XIMTextType, XIMBitmapType } XIMStatusDataType; typedef struct _XIMStatusDrawCallbackStruct { XIMStatusDataType type; union { XIMText *text; Pixmap bitmap; } data; } XIMStatusDrawCallbackStruct; typedef struct _XIMHotKeyTrigger { KeySym keysym; int modifier; int modifier_mask; } XIMHotKeyTrigger; typedef struct _XIMHotKeyTriggers { int num_hot_key; XIMHotKeyTrigger *key; } XIMHotKeyTriggers; typedef unsigned long XIMHotKeyState; #define XIMHotKeyStateON (0x0001L) #define XIMHotKeyStateOFF (0x0002L) typedef struct { unsigned short count_values; char **supported_values; } XIMValuesList; _XFUNCPROTOBEGIN #if defined(WIN32) && !defined(_XLIBINT_) #define _Xdebug (*_Xdebug_p) #endif extern int _Xdebug; extern XFontStruct *XLoadQueryFont( Display* /* display */, _Xconst char* /* name */ ); extern XFontStruct *XQueryFont( Display* /* display */, XID /* font_ID */ ); extern XTimeCoord *XGetMotionEvents( Display* /* display */, Window /* w */, Time /* start */, Time /* stop */, int* /* nevents_return */ ); extern XModifierKeymap *XDeleteModifiermapEntry( XModifierKeymap* /* modmap */, #if NeedWidePrototypes unsigned int /* keycode_entry */, #else KeyCode /* keycode_entry */, #endif int /* modifier */ ); extern XModifierKeymap *XGetModifierMapping( Display* /* display */ ); extern XModifierKeymap *XInsertModifiermapEntry( XModifierKeymap* /* modmap */, #if NeedWidePrototypes unsigned int /* keycode_entry */, #else KeyCode /* keycode_entry */, #endif int /* modifier */ ); extern XModifierKeymap *XNewModifiermap( int /* max_keys_per_mod */ ); extern XImage *XCreateImage( Display* /* display */, Visual* /* visual */, unsigned int /* depth */, int /* format */, int /* offset */, char* /* data */, unsigned int /* width */, unsigned int /* height */, int /* bitmap_pad */, int /* bytes_per_line */ ); extern Status XInitImage( XImage* /* image */ ); extern XImage *XGetImage( Display* /* display */, Drawable /* d */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */, unsigned long /* plane_mask */, int /* format */ ); extern XImage *XGetSubImage( Display* /* display */, Drawable /* d */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */, unsigned long /* plane_mask */, int /* format */, XImage* /* dest_image */, int /* dest_x */, int /* dest_y */ ); /* * X function declarations. */ extern Display *XOpenDisplay( _Xconst char* /* display_name */ ); extern void XrmInitialize( void ); extern char *XFetchBytes( Display* /* display */, int* /* nbytes_return */ ); extern char *XFetchBuffer( Display* /* display */, int* /* nbytes_return */, int /* buffer */ ); extern char *XGetAtomName( Display* /* display */, Atom /* atom */ ); extern Status XGetAtomNames( Display* /* dpy */, Atom* /* atoms */, int /* count */, char** /* names_return */ ); extern char *XGetDefault( Display* /* display */, _Xconst char* /* program */, _Xconst char* /* option */ ); extern char *XDisplayName( _Xconst char* /* string */ ); extern char *XKeysymToString( KeySym /* keysym */ ); extern int (*XSynchronize( Display* /* display */, Bool /* onoff */ ))( Display* /* display */ ); extern int (*XSetAfterFunction( Display* /* display */, int (*) ( Display* /* display */ ) /* procedure */ ))( Display* /* display */ ); extern Atom XInternAtom( Display* /* display */, _Xconst char* /* atom_name */, Bool /* only_if_exists */ ); extern Status XInternAtoms( Display* /* dpy */, char** /* names */, int /* count */, Bool /* onlyIfExists */, Atom* /* atoms_return */ ); extern Colormap XCopyColormapAndFree( Display* /* display */, Colormap /* colormap */ ); extern Colormap XCreateColormap( Display* /* display */, Window /* w */, Visual* /* visual */, int /* alloc */ ); extern Cursor XCreatePixmapCursor( Display* /* display */, Pixmap /* source */, Pixmap /* mask */, XColor* /* foreground_color */, XColor* /* background_color */, unsigned int /* x */, unsigned int /* y */ ); extern Cursor XCreateGlyphCursor( Display* /* display */, Font /* source_font */, Font /* mask_font */, unsigned int /* source_char */, unsigned int /* mask_char */, XColor _Xconst * /* foreground_color */, XColor _Xconst * /* background_color */ ); extern Cursor XCreateFontCursor( Display* /* display */, unsigned int /* shape */ ); extern Font XLoadFont( Display* /* display */, _Xconst char* /* name */ ); extern GC XCreateGC( Display* /* display */, Drawable /* d */, unsigned long /* valuemask */, XGCValues* /* values */ ); extern GContext XGContextFromGC( GC /* gc */ ); extern void XFlushGC( Display* /* display */, GC /* gc */ ); extern Pixmap XCreatePixmap( Display* /* display */, Drawable /* d */, unsigned int /* width */, unsigned int /* height */, unsigned int /* depth */ ); extern Pixmap XCreateBitmapFromData( Display* /* display */, Drawable /* d */, _Xconst char* /* data */, unsigned int /* width */, unsigned int /* height */ ); extern Pixmap XCreatePixmapFromBitmapData( Display* /* display */, Drawable /* d */, char* /* data */, unsigned int /* width */, unsigned int /* height */, unsigned long /* fg */, unsigned long /* bg */, unsigned int /* depth */ ); extern Window XCreateSimpleWindow( Display* /* display */, Window /* parent */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */, unsigned int /* border_width */, unsigned long /* border */, unsigned long /* background */ ); extern Window XGetSelectionOwner( Display* /* display */, Atom /* selection */ ); extern Window XCreateWindow( Display* /* display */, Window /* parent */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */, unsigned int /* border_width */, int /* depth */, unsigned int /* class */, Visual* /* visual */, unsigned long /* valuemask */, XSetWindowAttributes* /* attributes */ ); extern Colormap *XListInstalledColormaps( Display* /* display */, Window /* w */, int* /* num_return */ ); extern char **XListFonts( Display* /* display */, _Xconst char* /* pattern */, int /* maxnames */, int* /* actual_count_return */ ); extern char **XListFontsWithInfo( Display* /* display */, _Xconst char* /* pattern */, int /* maxnames */, int* /* count_return */, XFontStruct** /* info_return */ ); extern char **XGetFontPath( Display* /* display */, int* /* npaths_return */ ); extern char **XListExtensions( Display* /* display */, int* /* nextensions_return */ ); extern Atom *XListProperties( Display* /* display */, Window /* w */, int* /* num_prop_return */ ); extern XHostAddress *XListHosts( Display* /* display */, int* /* nhosts_return */, Bool* /* state_return */ ); _X_DEPRECATED extern KeySym XKeycodeToKeysym( Display* /* display */, #if NeedWidePrototypes unsigned int /* keycode */, #else KeyCode /* keycode */, #endif int /* index */ ); extern KeySym XLookupKeysym( XKeyEvent* /* key_event */, int /* index */ ); extern KeySym *XGetKeyboardMapping( Display* /* display */, #if NeedWidePrototypes unsigned int /* first_keycode */, #else KeyCode /* first_keycode */, #endif int /* keycode_count */, int* /* keysyms_per_keycode_return */ ); extern KeySym XStringToKeysym( _Xconst char* /* string */ ); extern long XMaxRequestSize( Display* /* display */ ); extern long XExtendedMaxRequestSize( Display* /* display */ ); extern char *XResourceManagerString( Display* /* display */ ); extern char *XScreenResourceString( Screen* /* screen */ ); extern unsigned long XDisplayMotionBufferSize( Display* /* display */ ); extern VisualID XVisualIDFromVisual( Visual* /* visual */ ); /* multithread routines */ extern Status XInitThreads( void ); extern void XLockDisplay( Display* /* display */ ); extern void XUnlockDisplay( Display* /* display */ ); /* routines for dealing with extensions */ extern XExtCodes *XInitExtension( Display* /* display */, _Xconst char* /* name */ ); extern XExtCodes *XAddExtension( Display* /* display */ ); extern XExtData *XFindOnExtensionList( XExtData** /* structure */, int /* number */ ); extern XExtData **XEHeadOfExtensionList( XEDataObject /* object */ ); /* these are routines for which there are also macros */ extern Window XRootWindow( Display* /* display */, int /* screen_number */ ); extern Window XDefaultRootWindow( Display* /* display */ ); extern Window XRootWindowOfScreen( Screen* /* screen */ ); extern Visual *XDefaultVisual( Display* /* display */, int /* screen_number */ ); extern Visual *XDefaultVisualOfScreen( Screen* /* screen */ ); extern GC XDefaultGC( Display* /* display */, int /* screen_number */ ); extern GC XDefaultGCOfScreen( Screen* /* screen */ ); extern unsigned long XBlackPixel( Display* /* display */, int /* screen_number */ ); extern unsigned long XWhitePixel( Display* /* display */, int /* screen_number */ ); extern unsigned long XAllPlanes( void ); extern unsigned long XBlackPixelOfScreen( Screen* /* screen */ ); extern unsigned long XWhitePixelOfScreen( Screen* /* screen */ ); extern unsigned long XNextRequest( Display* /* display */ ); extern unsigned long XLastKnownRequestProcessed( Display* /* display */ ); extern char *XServerVendor( Display* /* display */ ); extern char *XDisplayString( Display* /* display */ ); extern Colormap XDefaultColormap( Display* /* display */, int /* screen_number */ ); extern Colormap XDefaultColormapOfScreen( Screen* /* screen */ ); extern Display *XDisplayOfScreen( Screen* /* screen */ ); extern Screen *XScreenOfDisplay( Display* /* display */, int /* screen_number */ ); extern Screen *XDefaultScreenOfDisplay( Display* /* display */ ); extern long XEventMaskOfScreen( Screen* /* screen */ ); extern int XScreenNumberOfScreen( Screen* /* screen */ ); typedef int (*XErrorHandler) ( /* WARNING, this type not in Xlib spec */ Display* /* display */, XErrorEvent* /* error_event */ ); extern XErrorHandler XSetErrorHandler ( XErrorHandler /* handler */ ); typedef int (*XIOErrorHandler) ( /* WARNING, this type not in Xlib spec */ Display* /* display */ ); extern XIOErrorHandler XSetIOErrorHandler ( XIOErrorHandler /* handler */ ); extern XPixmapFormatValues *XListPixmapFormats( Display* /* display */, int* /* count_return */ ); extern int *XListDepths( Display* /* display */, int /* screen_number */, int* /* count_return */ ); /* ICCCM routines for things that don't require special include files; */ /* other declarations are given in Xutil.h */ extern Status XReconfigureWMWindow( Display* /* display */, Window /* w */, int /* screen_number */, unsigned int /* mask */, XWindowChanges* /* changes */ ); extern Status XGetWMProtocols( Display* /* display */, Window /* w */, Atom** /* protocols_return */, int* /* count_return */ ); extern Status XSetWMProtocols( Display* /* display */, Window /* w */, Atom* /* protocols */, int /* count */ ); extern Status XIconifyWindow( Display* /* display */, Window /* w */, int /* screen_number */ ); extern Status XWithdrawWindow( Display* /* display */, Window /* w */, int /* screen_number */ ); extern Status XGetCommand( Display* /* display */, Window /* w */, char*** /* argv_return */, int* /* argc_return */ ); extern Status XGetWMColormapWindows( Display* /* display */, Window /* w */, Window** /* windows_return */, int* /* count_return */ ); extern Status XSetWMColormapWindows( Display* /* display */, Window /* w */, Window* /* colormap_windows */, int /* count */ ); extern void XFreeStringList( char** /* list */ ); extern int XSetTransientForHint( Display* /* display */, Window /* w */, Window /* prop_window */ ); /* The following are given in alphabetical order */ extern int XActivateScreenSaver( Display* /* display */ ); extern int XAddHost( Display* /* display */, XHostAddress* /* host */ ); extern int XAddHosts( Display* /* display */, XHostAddress* /* hosts */, int /* num_hosts */ ); extern int XAddToExtensionList( struct _XExtData** /* structure */, XExtData* /* ext_data */ ); extern int XAddToSaveSet( Display* /* display */, Window /* w */ ); extern Status XAllocColor( Display* /* display */, Colormap /* colormap */, XColor* /* screen_in_out */ ); extern Status XAllocColorCells( Display* /* display */, Colormap /* colormap */, Bool /* contig */, unsigned long* /* plane_masks_return */, unsigned int /* nplanes */, unsigned long* /* pixels_return */, unsigned int /* npixels */ ); extern Status XAllocColorPlanes( Display* /* display */, Colormap /* colormap */, Bool /* contig */, unsigned long* /* pixels_return */, int /* ncolors */, int /* nreds */, int /* ngreens */, int /* nblues */, unsigned long* /* rmask_return */, unsigned long* /* gmask_return */, unsigned long* /* bmask_return */ ); extern Status XAllocNamedColor( Display* /* display */, Colormap /* colormap */, _Xconst char* /* color_name */, XColor* /* screen_def_return */, XColor* /* exact_def_return */ ); extern int XAllowEvents( Display* /* display */, int /* event_mode */, Time /* time */ ); extern int XAutoRepeatOff( Display* /* display */ ); extern int XAutoRepeatOn( Display* /* display */ ); extern int XBell( Display* /* display */, int /* percent */ ); extern int XBitmapBitOrder( Display* /* display */ ); extern int XBitmapPad( Display* /* display */ ); extern int XBitmapUnit( Display* /* display */ ); extern int XCellsOfScreen( Screen* /* screen */ ); extern int XChangeActivePointerGrab( Display* /* display */, unsigned int /* event_mask */, Cursor /* cursor */, Time /* time */ ); extern int XChangeGC( Display* /* display */, GC /* gc */, unsigned long /* valuemask */, XGCValues* /* values */ ); extern int XChangeKeyboardControl( Display* /* display */, unsigned long /* value_mask */, XKeyboardControl* /* values */ ); extern int XChangeKeyboardMapping( Display* /* display */, int /* first_keycode */, int /* keysyms_per_keycode */, KeySym* /* keysyms */, int /* num_codes */ ); extern int XChangePointerControl( Display* /* display */, Bool /* do_accel */, Bool /* do_threshold */, int /* accel_numerator */, int /* accel_denominator */, int /* threshold */ ); extern int XChangeProperty( Display* /* display */, Window /* w */, Atom /* property */, Atom /* type */, int /* format */, int /* mode */, _Xconst unsigned char* /* data */, int /* nelements */ ); extern int XChangeSaveSet( Display* /* display */, Window /* w */, int /* change_mode */ ); extern int XChangeWindowAttributes( Display* /* display */, Window /* w */, unsigned long /* valuemask */, XSetWindowAttributes* /* attributes */ ); extern Bool XCheckIfEvent( Display* /* display */, XEvent* /* event_return */, Bool (*) ( Display* /* display */, XEvent* /* event */, XPointer /* arg */ ) /* predicate */, XPointer /* arg */ ); extern Bool XCheckMaskEvent( Display* /* display */, long /* event_mask */, XEvent* /* event_return */ ); extern Bool XCheckTypedEvent( Display* /* display */, int /* event_type */, XEvent* /* event_return */ ); extern Bool XCheckTypedWindowEvent( Display* /* display */, Window /* w */, int /* event_type */, XEvent* /* event_return */ ); extern Bool XCheckWindowEvent( Display* /* display */, Window /* w */, long /* event_mask */, XEvent* /* event_return */ ); extern int XCirculateSubwindows( Display* /* display */, Window /* w */, int /* direction */ ); extern int XCirculateSubwindowsDown( Display* /* display */, Window /* w */ ); extern int XCirculateSubwindowsUp( Display* /* display */, Window /* w */ ); extern int XClearArea( Display* /* display */, Window /* w */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */, Bool /* exposures */ ); extern int XClearWindow( Display* /* display */, Window /* w */ ); extern int XCloseDisplay( Display* /* display */ ); extern int XConfigureWindow( Display* /* display */, Window /* w */, unsigned int /* value_mask */, XWindowChanges* /* values */ ); extern int XConnectionNumber( Display* /* display */ ); extern int XConvertSelection( Display* /* display */, Atom /* selection */, Atom /* target */, Atom /* property */, Window /* requestor */, Time /* time */ ); extern int XCopyArea( Display* /* display */, Drawable /* src */, Drawable /* dest */, GC /* gc */, int /* src_x */, int /* src_y */, unsigned int /* width */, unsigned int /* height */, int /* dest_x */, int /* dest_y */ ); extern int XCopyGC( Display* /* display */, GC /* src */, unsigned long /* valuemask */, GC /* dest */ ); extern int XCopyPlane( Display* /* display */, Drawable /* src */, Drawable /* dest */, GC /* gc */, int /* src_x */, int /* src_y */, unsigned int /* width */, unsigned int /* height */, int /* dest_x */, int /* dest_y */, unsigned long /* plane */ ); extern int XDefaultDepth( Display* /* display */, int /* screen_number */ ); extern int XDefaultDepthOfScreen( Screen* /* screen */ ); extern int XDefaultScreen( Display* /* display */ ); extern int XDefineCursor( Display* /* display */, Window /* w */, Cursor /* cursor */ ); extern int XDeleteProperty( Display* /* display */, Window /* w */, Atom /* property */ ); extern int XDestroyWindow( Display* /* display */, Window /* w */ ); extern int XDestroySubwindows( Display* /* display */, Window /* w */ ); extern int XDoesBackingStore( Screen* /* screen */ ); extern Bool XDoesSaveUnders( Screen* /* screen */ ); extern int XDisableAccessControl( Display* /* display */ ); extern int XDisplayCells( Display* /* display */, int /* screen_number */ ); extern int XDisplayHeight( Display* /* display */, int /* screen_number */ ); extern int XDisplayHeightMM( Display* /* display */, int /* screen_number */ ); extern int XDisplayKeycodes( Display* /* display */, int* /* min_keycodes_return */, int* /* max_keycodes_return */ ); extern int XDisplayPlanes( Display* /* display */, int /* screen_number */ ); extern int XDisplayWidth( Display* /* display */, int /* screen_number */ ); extern int XDisplayWidthMM( Display* /* display */, int /* screen_number */ ); extern int XDrawArc( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */, int /* angle1 */, int /* angle2 */ ); extern int XDrawArcs( Display* /* display */, Drawable /* d */, GC /* gc */, XArc* /* arcs */, int /* narcs */ ); extern int XDrawImageString( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, _Xconst char* /* string */, int /* length */ ); extern int XDrawImageString16( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, _Xconst XChar2b* /* string */, int /* length */ ); extern int XDrawLine( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x1 */, int /* y1 */, int /* x2 */, int /* y2 */ ); extern int XDrawLines( Display* /* display */, Drawable /* d */, GC /* gc */, XPoint* /* points */, int /* npoints */, int /* mode */ ); extern int XDrawPoint( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */ ); extern int XDrawPoints( Display* /* display */, Drawable /* d */, GC /* gc */, XPoint* /* points */, int /* npoints */, int /* mode */ ); extern int XDrawRectangle( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */ ); extern int XDrawRectangles( Display* /* display */, Drawable /* d */, GC /* gc */, XRectangle* /* rectangles */, int /* nrectangles */ ); extern int XDrawSegments( Display* /* display */, Drawable /* d */, GC /* gc */, XSegment* /* segments */, int /* nsegments */ ); extern int XDrawString( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, _Xconst char* /* string */, int /* length */ ); extern int XDrawString16( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, _Xconst XChar2b* /* string */, int /* length */ ); extern int XDrawText( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, XTextItem* /* items */, int /* nitems */ ); extern int XDrawText16( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, XTextItem16* /* items */, int /* nitems */ ); extern int XEnableAccessControl( Display* /* display */ ); extern int XEventsQueued( Display* /* display */, int /* mode */ ); extern Status XFetchName( Display* /* display */, Window /* w */, char** /* window_name_return */ ); extern int XFillArc( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */, int /* angle1 */, int /* angle2 */ ); extern int XFillArcs( Display* /* display */, Drawable /* d */, GC /* gc */, XArc* /* arcs */, int /* narcs */ ); extern int XFillPolygon( Display* /* display */, Drawable /* d */, GC /* gc */, XPoint* /* points */, int /* npoints */, int /* shape */, int /* mode */ ); extern int XFillRectangle( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */ ); extern int XFillRectangles( Display* /* display */, Drawable /* d */, GC /* gc */, XRectangle* /* rectangles */, int /* nrectangles */ ); extern int XFlush( Display* /* display */ ); extern int XForceScreenSaver( Display* /* display */, int /* mode */ ); extern int XFree( void* /* data */ ); extern int XFreeColormap( Display* /* display */, Colormap /* colormap */ ); extern int XFreeColors( Display* /* display */, Colormap /* colormap */, unsigned long* /* pixels */, int /* npixels */, unsigned long /* planes */ ); extern int XFreeCursor( Display* /* display */, Cursor /* cursor */ ); extern int XFreeExtensionList( char** /* list */ ); extern int XFreeFont( Display* /* display */, XFontStruct* /* font_struct */ ); extern int XFreeFontInfo( char** /* names */, XFontStruct* /* free_info */, int /* actual_count */ ); extern int XFreeFontNames( char** /* list */ ); extern int XFreeFontPath( char** /* list */ ); extern int XFreeGC( Display* /* display */, GC /* gc */ ); extern int XFreeModifiermap( XModifierKeymap* /* modmap */ ); extern int XFreePixmap( Display* /* display */, Pixmap /* pixmap */ ); extern int XGeometry( Display* /* display */, int /* screen */, _Xconst char* /* position */, _Xconst char* /* default_position */, unsigned int /* bwidth */, unsigned int /* fwidth */, unsigned int /* fheight */, int /* xadder */, int /* yadder */, int* /* x_return */, int* /* y_return */, int* /* width_return */, int* /* height_return */ ); extern int XGetErrorDatabaseText( Display* /* display */, _Xconst char* /* name */, _Xconst char* /* message */, _Xconst char* /* default_string */, char* /* buffer_return */, int /* length */ ); extern int XGetErrorText( Display* /* display */, int /* code */, char* /* buffer_return */, int /* length */ ); extern Bool XGetFontProperty( XFontStruct* /* font_struct */, Atom /* atom */, unsigned long* /* value_return */ ); extern Status XGetGCValues( Display* /* display */, GC /* gc */, unsigned long /* valuemask */, XGCValues* /* values_return */ ); extern Status XGetGeometry( Display* /* display */, Drawable /* d */, Window* /* root_return */, int* /* x_return */, int* /* y_return */, unsigned int* /* width_return */, unsigned int* /* height_return */, unsigned int* /* border_width_return */, unsigned int* /* depth_return */ ); extern Status XGetIconName( Display* /* display */, Window /* w */, char** /* icon_name_return */ ); extern int XGetInputFocus( Display* /* display */, Window* /* focus_return */, int* /* revert_to_return */ ); extern int XGetKeyboardControl( Display* /* display */, XKeyboardState* /* values_return */ ); extern int XGetPointerControl( Display* /* display */, int* /* accel_numerator_return */, int* /* accel_denominator_return */, int* /* threshold_return */ ); extern int XGetPointerMapping( Display* /* display */, unsigned char* /* map_return */, int /* nmap */ ); extern int XGetScreenSaver( Display* /* display */, int* /* timeout_return */, int* /* interval_return */, int* /* prefer_blanking_return */, int* /* allow_exposures_return */ ); extern Status XGetTransientForHint( Display* /* display */, Window /* w */, Window* /* prop_window_return */ ); extern int XGetWindowProperty( Display* /* display */, Window /* w */, Atom /* property */, long /* long_offset */, long /* long_length */, Bool /* delete */, Atom /* req_type */, Atom* /* actual_type_return */, int* /* actual_format_return */, unsigned long* /* nitems_return */, unsigned long* /* bytes_after_return */, unsigned char** /* prop_return */ ); extern Status XGetWindowAttributes( Display* /* display */, Window /* w */, XWindowAttributes* /* window_attributes_return */ ); extern int XGrabButton( Display* /* display */, unsigned int /* button */, unsigned int /* modifiers */, Window /* grab_window */, Bool /* owner_events */, unsigned int /* event_mask */, int /* pointer_mode */, int /* keyboard_mode */, Window /* confine_to */, Cursor /* cursor */ ); extern int XGrabKey( Display* /* display */, int /* keycode */, unsigned int /* modifiers */, Window /* grab_window */, Bool /* owner_events */, int /* pointer_mode */, int /* keyboard_mode */ ); extern int XGrabKeyboard( Display* /* display */, Window /* grab_window */, Bool /* owner_events */, int /* pointer_mode */, int /* keyboard_mode */, Time /* time */ ); extern int XGrabPointer( Display* /* display */, Window /* grab_window */, Bool /* owner_events */, unsigned int /* event_mask */, int /* pointer_mode */, int /* keyboard_mode */, Window /* confine_to */, Cursor /* cursor */, Time /* time */ ); extern int XGrabServer( Display* /* display */ ); extern int XHeightMMOfScreen( Screen* /* screen */ ); extern int XHeightOfScreen( Screen* /* screen */ ); extern int XIfEvent( Display* /* display */, XEvent* /* event_return */, Bool (*) ( Display* /* display */, XEvent* /* event */, XPointer /* arg */ ) /* predicate */, XPointer /* arg */ ); extern int XImageByteOrder( Display* /* display */ ); extern int XInstallColormap( Display* /* display */, Colormap /* colormap */ ); extern KeyCode XKeysymToKeycode( Display* /* display */, KeySym /* keysym */ ); extern int XKillClient( Display* /* display */, XID /* resource */ ); extern Status XLookupColor( Display* /* display */, Colormap /* colormap */, _Xconst char* /* color_name */, XColor* /* exact_def_return */, XColor* /* screen_def_return */ ); extern int XLowerWindow( Display* /* display */, Window /* w */ ); extern int XMapRaised( Display* /* display */, Window /* w */ ); extern int XMapSubwindows( Display* /* display */, Window /* w */ ); extern int XMapWindow( Display* /* display */, Window /* w */ ); extern int XMaskEvent( Display* /* display */, long /* event_mask */, XEvent* /* event_return */ ); extern int XMaxCmapsOfScreen( Screen* /* screen */ ); extern int XMinCmapsOfScreen( Screen* /* screen */ ); extern int XMoveResizeWindow( Display* /* display */, Window /* w */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */ ); extern int XMoveWindow( Display* /* display */, Window /* w */, int /* x */, int /* y */ ); extern int XNextEvent( Display* /* display */, XEvent* /* event_return */ ); extern int XNoOp( Display* /* display */ ); extern Status XParseColor( Display* /* display */, Colormap /* colormap */, _Xconst char* /* spec */, XColor* /* exact_def_return */ ); extern int XParseGeometry( _Xconst char* /* parsestring */, int* /* x_return */, int* /* y_return */, unsigned int* /* width_return */, unsigned int* /* height_return */ ); extern int XPeekEvent( Display* /* display */, XEvent* /* event_return */ ); extern int XPeekIfEvent( Display* /* display */, XEvent* /* event_return */, Bool (*) ( Display* /* display */, XEvent* /* event */, XPointer /* arg */ ) /* predicate */, XPointer /* arg */ ); extern int XPending( Display* /* display */ ); extern int XPlanesOfScreen( Screen* /* screen */ ); extern int XProtocolRevision( Display* /* display */ ); extern int XProtocolVersion( Display* /* display */ ); extern int XPutBackEvent( Display* /* display */, XEvent* /* event */ ); extern int XPutImage( Display* /* display */, Drawable /* d */, GC /* gc */, XImage* /* image */, int /* src_x */, int /* src_y */, int /* dest_x */, int /* dest_y */, unsigned int /* width */, unsigned int /* height */ ); extern int XQLength( Display* /* display */ ); extern Status XQueryBestCursor( Display* /* display */, Drawable /* d */, unsigned int /* width */, unsigned int /* height */, unsigned int* /* width_return */, unsigned int* /* height_return */ ); extern Status XQueryBestSize( Display* /* display */, int /* class */, Drawable /* which_screen */, unsigned int /* width */, unsigned int /* height */, unsigned int* /* width_return */, unsigned int* /* height_return */ ); extern Status XQueryBestStipple( Display* /* display */, Drawable /* which_screen */, unsigned int /* width */, unsigned int /* height */, unsigned int* /* width_return */, unsigned int* /* height_return */ ); extern Status XQueryBestTile( Display* /* display */, Drawable /* which_screen */, unsigned int /* width */, unsigned int /* height */, unsigned int* /* width_return */, unsigned int* /* height_return */ ); extern int XQueryColor( Display* /* display */, Colormap /* colormap */, XColor* /* def_in_out */ ); extern int XQueryColors( Display* /* display */, Colormap /* colormap */, XColor* /* defs_in_out */, int /* ncolors */ ); extern Bool XQueryExtension( Display* /* display */, _Xconst char* /* name */, int* /* major_opcode_return */, int* /* first_event_return */, int* /* first_error_return */ ); extern int XQueryKeymap( Display* /* display */, char [32] /* keys_return */ ); extern Bool XQueryPointer( Display* /* display */, Window /* w */, Window* /* root_return */, Window* /* child_return */, int* /* root_x_return */, int* /* root_y_return */, int* /* win_x_return */, int* /* win_y_return */, unsigned int* /* mask_return */ ); extern int XQueryTextExtents( Display* /* display */, XID /* font_ID */, _Xconst char* /* string */, int /* nchars */, int* /* direction_return */, int* /* font_ascent_return */, int* /* font_descent_return */, XCharStruct* /* overall_return */ ); extern int XQueryTextExtents16( Display* /* display */, XID /* font_ID */, _Xconst XChar2b* /* string */, int /* nchars */, int* /* direction_return */, int* /* font_ascent_return */, int* /* font_descent_return */, XCharStruct* /* overall_return */ ); extern Status XQueryTree( Display* /* display */, Window /* w */, Window* /* root_return */, Window* /* parent_return */, Window** /* children_return */, unsigned int* /* nchildren_return */ ); extern int XRaiseWindow( Display* /* display */, Window /* w */ ); extern int XReadBitmapFile( Display* /* display */, Drawable /* d */, _Xconst char* /* filename */, unsigned int* /* width_return */, unsigned int* /* height_return */, Pixmap* /* bitmap_return */, int* /* x_hot_return */, int* /* y_hot_return */ ); extern int XReadBitmapFileData( _Xconst char* /* filename */, unsigned int* /* width_return */, unsigned int* /* height_return */, unsigned char** /* data_return */, int* /* x_hot_return */, int* /* y_hot_return */ ); extern int XRebindKeysym( Display* /* display */, KeySym /* keysym */, KeySym* /* list */, int /* mod_count */, _Xconst unsigned char* /* string */, int /* bytes_string */ ); extern int XRecolorCursor( Display* /* display */, Cursor /* cursor */, XColor* /* foreground_color */, XColor* /* background_color */ ); extern int XRefreshKeyboardMapping( XMappingEvent* /* event_map */ ); extern int XRemoveFromSaveSet( Display* /* display */, Window /* w */ ); extern int XRemoveHost( Display* /* display */, XHostAddress* /* host */ ); extern int XRemoveHosts( Display* /* display */, XHostAddress* /* hosts */, int /* num_hosts */ ); extern int XReparentWindow( Display* /* display */, Window /* w */, Window /* parent */, int /* x */, int /* y */ ); extern int XResetScreenSaver( Display* /* display */ ); extern int XResizeWindow( Display* /* display */, Window /* w */, unsigned int /* width */, unsigned int /* height */ ); extern int XRestackWindows( Display* /* display */, Window* /* windows */, int /* nwindows */ ); extern int XRotateBuffers( Display* /* display */, int /* rotate */ ); extern int XRotateWindowProperties( Display* /* display */, Window /* w */, Atom* /* properties */, int /* num_prop */, int /* npositions */ ); extern int XScreenCount( Display* /* display */ ); extern int XSelectInput( Display* /* display */, Window /* w */, long /* event_mask */ ); extern Status XSendEvent( Display* /* display */, Window /* w */, Bool /* propagate */, long /* event_mask */, XEvent* /* event_send */ ); extern int XSetAccessControl( Display* /* display */, int /* mode */ ); extern int XSetArcMode( Display* /* display */, GC /* gc */, int /* arc_mode */ ); extern int XSetBackground( Display* /* display */, GC /* gc */, unsigned long /* background */ ); extern int XSetClipMask( Display* /* display */, GC /* gc */, Pixmap /* pixmap */ ); extern int XSetClipOrigin( Display* /* display */, GC /* gc */, int /* clip_x_origin */, int /* clip_y_origin */ ); extern int XSetClipRectangles( Display* /* display */, GC /* gc */, int /* clip_x_origin */, int /* clip_y_origin */, XRectangle* /* rectangles */, int /* n */, int /* ordering */ ); extern int XSetCloseDownMode( Display* /* display */, int /* close_mode */ ); extern int XSetCommand( Display* /* display */, Window /* w */, char** /* argv */, int /* argc */ ); extern int XSetDashes( Display* /* display */, GC /* gc */, int /* dash_offset */, _Xconst char* /* dash_list */, int /* n */ ); extern int XSetFillRule( Display* /* display */, GC /* gc */, int /* fill_rule */ ); extern int XSetFillStyle( Display* /* display */, GC /* gc */, int /* fill_style */ ); extern int XSetFont( Display* /* display */, GC /* gc */, Font /* font */ ); extern int XSetFontPath( Display* /* display */, char** /* directories */, int /* ndirs */ ); extern int XSetForeground( Display* /* display */, GC /* gc */, unsigned long /* foreground */ ); extern int XSetFunction( Display* /* display */, GC /* gc */, int /* function */ ); extern int XSetGraphicsExposures( Display* /* display */, GC /* gc */, Bool /* graphics_exposures */ ); extern int XSetIconName( Display* /* display */, Window /* w */, _Xconst char* /* icon_name */ ); extern int XSetInputFocus( Display* /* display */, Window /* focus */, int /* revert_to */, Time /* time */ ); extern int XSetLineAttributes( Display* /* display */, GC /* gc */, unsigned int /* line_width */, int /* line_style */, int /* cap_style */, int /* join_style */ ); extern int XSetModifierMapping( Display* /* display */, XModifierKeymap* /* modmap */ ); extern int XSetPlaneMask( Display* /* display */, GC /* gc */, unsigned long /* plane_mask */ ); extern int XSetPointerMapping( Display* /* display */, _Xconst unsigned char* /* map */, int /* nmap */ ); extern int XSetScreenSaver( Display* /* display */, int /* timeout */, int /* interval */, int /* prefer_blanking */, int /* allow_exposures */ ); extern int XSetSelectionOwner( Display* /* display */, Atom /* selection */, Window /* owner */, Time /* time */ ); extern int XSetState( Display* /* display */, GC /* gc */, unsigned long /* foreground */, unsigned long /* background */, int /* function */, unsigned long /* plane_mask */ ); extern int XSetStipple( Display* /* display */, GC /* gc */, Pixmap /* stipple */ ); extern int XSetSubwindowMode( Display* /* display */, GC /* gc */, int /* subwindow_mode */ ); extern int XSetTSOrigin( Display* /* display */, GC /* gc */, int /* ts_x_origin */, int /* ts_y_origin */ ); extern int XSetTile( Display* /* display */, GC /* gc */, Pixmap /* tile */ ); extern int XSetWindowBackground( Display* /* display */, Window /* w */, unsigned long /* background_pixel */ ); extern int XSetWindowBackgroundPixmap( Display* /* display */, Window /* w */, Pixmap /* background_pixmap */ ); extern int XSetWindowBorder( Display* /* display */, Window /* w */, unsigned long /* border_pixel */ ); extern int XSetWindowBorderPixmap( Display* /* display */, Window /* w */, Pixmap /* border_pixmap */ ); extern int XSetWindowBorderWidth( Display* /* display */, Window /* w */, unsigned int /* width */ ); extern int XSetWindowColormap( Display* /* display */, Window /* w */, Colormap /* colormap */ ); extern int XStoreBuffer( Display* /* display */, _Xconst char* /* bytes */, int /* nbytes */, int /* buffer */ ); extern int XStoreBytes( Display* /* display */, _Xconst char* /* bytes */, int /* nbytes */ ); extern int XStoreColor( Display* /* display */, Colormap /* colormap */, XColor* /* color */ ); extern int XStoreColors( Display* /* display */, Colormap /* colormap */, XColor* /* color */, int /* ncolors */ ); extern int XStoreName( Display* /* display */, Window /* w */, _Xconst char* /* window_name */ ); extern int XStoreNamedColor( Display* /* display */, Colormap /* colormap */, _Xconst char* /* color */, unsigned long /* pixel */, int /* flags */ ); extern int XSync( Display* /* display */, Bool /* discard */ ); extern int XTextExtents( XFontStruct* /* font_struct */, _Xconst char* /* string */, int /* nchars */, int* /* direction_return */, int* /* font_ascent_return */, int* /* font_descent_return */, XCharStruct* /* overall_return */ ); extern int XTextExtents16( XFontStruct* /* font_struct */, _Xconst XChar2b* /* string */, int /* nchars */, int* /* direction_return */, int* /* font_ascent_return */, int* /* font_descent_return */, XCharStruct* /* overall_return */ ); extern int XTextWidth( XFontStruct* /* font_struct */, _Xconst char* /* string */, int /* count */ ); extern int XTextWidth16( XFontStruct* /* font_struct */, _Xconst XChar2b* /* string */, int /* count */ ); extern Bool XTranslateCoordinates( Display* /* display */, Window /* src_w */, Window /* dest_w */, int /* src_x */, int /* src_y */, int* /* dest_x_return */, int* /* dest_y_return */, Window* /* child_return */ ); extern int XUndefineCursor( Display* /* display */, Window /* w */ ); extern int XUngrabButton( Display* /* display */, unsigned int /* button */, unsigned int /* modifiers */, Window /* grab_window */ ); extern int XUngrabKey( Display* /* display */, int /* keycode */, unsigned int /* modifiers */, Window /* grab_window */ ); extern int XUngrabKeyboard( Display* /* display */, Time /* time */ ); extern int XUngrabPointer( Display* /* display */, Time /* time */ ); extern int XUngrabServer( Display* /* display */ ); extern int XUninstallColormap( Display* /* display */, Colormap /* colormap */ ); extern int XUnloadFont( Display* /* display */, Font /* font */ ); extern int XUnmapSubwindows( Display* /* display */, Window /* w */ ); extern int XUnmapWindow( Display* /* display */, Window /* w */ ); extern int XVendorRelease( Display* /* display */ ); extern int XWarpPointer( Display* /* display */, Window /* src_w */, Window /* dest_w */, int /* src_x */, int /* src_y */, unsigned int /* src_width */, unsigned int /* src_height */, int /* dest_x */, int /* dest_y */ ); extern int XWidthMMOfScreen( Screen* /* screen */ ); extern int XWidthOfScreen( Screen* /* screen */ ); extern int XWindowEvent( Display* /* display */, Window /* w */, long /* event_mask */, XEvent* /* event_return */ ); extern int XWriteBitmapFile( Display* /* display */, _Xconst char* /* filename */, Pixmap /* bitmap */, unsigned int /* width */, unsigned int /* height */, int /* x_hot */, int /* y_hot */ ); extern Bool XSupportsLocale (void); extern char *XSetLocaleModifiers( const char* /* modifier_list */ ); extern XOM XOpenOM( Display* /* display */, struct _XrmHashBucketRec* /* rdb */, _Xconst char* /* res_name */, _Xconst char* /* res_class */ ); extern Status XCloseOM( XOM /* om */ ); extern char *XSetOMValues( XOM /* om */, ... ) _X_SENTINEL(0); extern char *XGetOMValues( XOM /* om */, ... ) _X_SENTINEL(0); extern Display *XDisplayOfOM( XOM /* om */ ); extern char *XLocaleOfOM( XOM /* om */ ); extern XOC XCreateOC( XOM /* om */, ... ) _X_SENTINEL(0); extern void XDestroyOC( XOC /* oc */ ); extern XOM XOMOfOC( XOC /* oc */ ); extern char *XSetOCValues( XOC /* oc */, ... ) _X_SENTINEL(0); extern char *XGetOCValues( XOC /* oc */, ... ) _X_SENTINEL(0); extern XFontSet XCreateFontSet( Display* /* display */, _Xconst char* /* base_font_name_list */, char*** /* missing_charset_list */, int* /* missing_charset_count */, char** /* def_string */ ); extern void XFreeFontSet( Display* /* display */, XFontSet /* font_set */ ); extern int XFontsOfFontSet( XFontSet /* font_set */, XFontStruct*** /* font_struct_list */, char*** /* font_name_list */ ); extern char *XBaseFontNameListOfFontSet( XFontSet /* font_set */ ); extern char *XLocaleOfFontSet( XFontSet /* font_set */ ); extern Bool XContextDependentDrawing( XFontSet /* font_set */ ); extern Bool XDirectionalDependentDrawing( XFontSet /* font_set */ ); extern Bool XContextualDrawing( XFontSet /* font_set */ ); extern XFontSetExtents *XExtentsOfFontSet( XFontSet /* font_set */ ); extern int XmbTextEscapement( XFontSet /* font_set */, _Xconst char* /* text */, int /* bytes_text */ ); extern int XwcTextEscapement( XFontSet /* font_set */, _Xconst wchar_t* /* text */, int /* num_wchars */ ); extern int Xutf8TextEscapement( XFontSet /* font_set */, _Xconst char* /* text */, int /* bytes_text */ ); extern int XmbTextExtents( XFontSet /* font_set */, _Xconst char* /* text */, int /* bytes_text */, XRectangle* /* overall_ink_return */, XRectangle* /* overall_logical_return */ ); extern int XwcTextExtents( XFontSet /* font_set */, _Xconst wchar_t* /* text */, int /* num_wchars */, XRectangle* /* overall_ink_return */, XRectangle* /* overall_logical_return */ ); extern int Xutf8TextExtents( XFontSet /* font_set */, _Xconst char* /* text */, int /* bytes_text */, XRectangle* /* overall_ink_return */, XRectangle* /* overall_logical_return */ ); extern Status XmbTextPerCharExtents( XFontSet /* font_set */, _Xconst char* /* text */, int /* bytes_text */, XRectangle* /* ink_extents_buffer */, XRectangle* /* logical_extents_buffer */, int /* buffer_size */, int* /* num_chars */, XRectangle* /* overall_ink_return */, XRectangle* /* overall_logical_return */ ); extern Status XwcTextPerCharExtents( XFontSet /* font_set */, _Xconst wchar_t* /* text */, int /* num_wchars */, XRectangle* /* ink_extents_buffer */, XRectangle* /* logical_extents_buffer */, int /* buffer_size */, int* /* num_chars */, XRectangle* /* overall_ink_return */, XRectangle* /* overall_logical_return */ ); extern Status Xutf8TextPerCharExtents( XFontSet /* font_set */, _Xconst char* /* text */, int /* bytes_text */, XRectangle* /* ink_extents_buffer */, XRectangle* /* logical_extents_buffer */, int /* buffer_size */, int* /* num_chars */, XRectangle* /* overall_ink_return */, XRectangle* /* overall_logical_return */ ); extern void XmbDrawText( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, XmbTextItem* /* text_items */, int /* nitems */ ); extern void XwcDrawText( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, XwcTextItem* /* text_items */, int /* nitems */ ); extern void Xutf8DrawText( Display* /* display */, Drawable /* d */, GC /* gc */, int /* x */, int /* y */, XmbTextItem* /* text_items */, int /* nitems */ ); extern void XmbDrawString( Display* /* display */, Drawable /* d */, XFontSet /* font_set */, GC /* gc */, int /* x */, int /* y */, _Xconst char* /* text */, int /* bytes_text */ ); extern void XwcDrawString( Display* /* display */, Drawable /* d */, XFontSet /* font_set */, GC /* gc */, int /* x */, int /* y */, _Xconst wchar_t* /* text */, int /* num_wchars */ ); extern void Xutf8DrawString( Display* /* display */, Drawable /* d */, XFontSet /* font_set */, GC /* gc */, int /* x */, int /* y */, _Xconst char* /* text */, int /* bytes_text */ ); extern void XmbDrawImageString( Display* /* display */, Drawable /* d */, XFontSet /* font_set */, GC /* gc */, int /* x */, int /* y */, _Xconst char* /* text */, int /* bytes_text */ ); extern void XwcDrawImageString( Display* /* display */, Drawable /* d */, XFontSet /* font_set */, GC /* gc */, int /* x */, int /* y */, _Xconst wchar_t* /* text */, int /* num_wchars */ ); extern void Xutf8DrawImageString( Display* /* display */, Drawable /* d */, XFontSet /* font_set */, GC /* gc */, int /* x */, int /* y */, _Xconst char* /* text */, int /* bytes_text */ ); extern XIM XOpenIM( Display* /* dpy */, struct _XrmHashBucketRec* /* rdb */, char* /* res_name */, char* /* res_class */ ); extern Status XCloseIM( XIM /* im */ ); extern char *XGetIMValues( XIM /* im */, ... ) _X_SENTINEL(0); extern char *XSetIMValues( XIM /* im */, ... ) _X_SENTINEL(0); extern Display *XDisplayOfIM( XIM /* im */ ); extern char *XLocaleOfIM( XIM /* im*/ ); extern XIC XCreateIC( XIM /* im */, ... ) _X_SENTINEL(0); extern void XDestroyIC( XIC /* ic */ ); extern void XSetICFocus( XIC /* ic */ ); extern void XUnsetICFocus( XIC /* ic */ ); extern wchar_t *XwcResetIC( XIC /* ic */ ); extern char *XmbResetIC( XIC /* ic */ ); extern char *Xutf8ResetIC( XIC /* ic */ ); extern char *XSetICValues( XIC /* ic */, ... ) _X_SENTINEL(0); extern char *XGetICValues( XIC /* ic */, ... ) _X_SENTINEL(0); extern XIM XIMOfIC( XIC /* ic */ ); extern Bool XFilterEvent( XEvent* /* event */, Window /* window */ ); extern int XmbLookupString( XIC /* ic */, XKeyPressedEvent* /* event */, char* /* buffer_return */, int /* bytes_buffer */, KeySym* /* keysym_return */, Status* /* status_return */ ); extern int XwcLookupString( XIC /* ic */, XKeyPressedEvent* /* event */, wchar_t* /* buffer_return */, int /* wchars_buffer */, KeySym* /* keysym_return */, Status* /* status_return */ ); extern int Xutf8LookupString( XIC /* ic */, XKeyPressedEvent* /* event */, char* /* buffer_return */, int /* bytes_buffer */, KeySym* /* keysym_return */, Status* /* status_return */ ); extern XVaNestedList XVaCreateNestedList( int /*unused*/, ... ) _X_SENTINEL(0); /* internal connections for IMs */ extern Bool XRegisterIMInstantiateCallback( Display* /* dpy */, struct _XrmHashBucketRec* /* rdb */, char* /* res_name */, char* /* res_class */, XIDProc /* callback */, XPointer /* client_data */ ); extern Bool XUnregisterIMInstantiateCallback( Display* /* dpy */, struct _XrmHashBucketRec* /* rdb */, char* /* res_name */, char* /* res_class */, XIDProc /* callback */, XPointer /* client_data */ ); typedef void (*XConnectionWatchProc)( Display* /* dpy */, XPointer /* client_data */, int /* fd */, Bool /* opening */, /* open or close flag */ XPointer* /* watch_data */ /* open sets, close uses */ ); extern Status XInternalConnectionNumbers( Display* /* dpy */, int** /* fd_return */, int* /* count_return */ ); extern void XProcessInternalConnection( Display* /* dpy */, int /* fd */ ); extern Status XAddConnectionWatch( Display* /* dpy */, XConnectionWatchProc /* callback */, XPointer /* client_data */ ); extern void XRemoveConnectionWatch( Display* /* dpy */, XConnectionWatchProc /* callback */, XPointer /* client_data */ ); extern void XSetAuthorization( char * /* name */, int /* namelen */, char * /* data */, int /* datalen */ ); extern int _Xmbtowc( wchar_t * /* wstr */, #ifdef ISC char const * /* str */, size_t /* len */ #else char * /* str */, int /* len */ #endif ); extern int _Xwctomb( char * /* str */, wchar_t /* wc */ ); extern Bool XGetEventData( Display* /* dpy */, XGenericEventCookie* /* cookie*/ ); extern void XFreeEventData( Display* /* dpy */, XGenericEventCookie* /* cookie*/ ); #ifdef __clang__ #pragma clang diagnostic pop #endif _XFUNCPROTOEND #endif /* _X11_XLIB_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/XlibConf.h ================================================ /* include/X11/XlibConf.h. Generated from XlibConf.h.in by configure. */ /* * Copyright © 2005 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Keith Packard not be used in * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Keith Packard makes no * representations about the suitability of this software for any purpose. It * is provided "as is" without express or implied warranty. * * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ #ifndef _XLIBCONF_H_ #define _XLIBCONF_H_ /* * This header file exports defines necessary to correctly * use Xlibint.h both inside Xlib and by external libraries * such as extensions. */ /* Threading support? */ #define XTHREADS 1 /* Use multi-threaded libc functions? */ #define XUSE_MTSAFE_API 1 #endif /* _XLIBCONF_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xlibint.h ================================================ /* Copyright 1984, 1985, 1987, 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef _X11_XLIBINT_H_ #define _X11_XLIBINT_H_ 1 /* * Xlibint.h - Header definition and support file for the internal * support routines used by the C subroutine interface * library (Xlib) to the X Window System. * * Warning, there be dragons here.... */ #include #include /* to declare xEvent */ #include /* for configured options like XTHREADS */ /* The Xlib structs are full of implicit padding to properly align members. We can't clean that up without breaking ABI, so tell clang not to bother complaining about it. */ #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif #ifdef WIN32 #define _XFlush _XFlushIt #endif /* * If your BytesReadable correctly detects broken connections, then * you should NOT define XCONN_CHECK_FREQ. */ #ifndef XCONN_CHECK_FREQ #define XCONN_CHECK_FREQ 256 #endif struct _XGC { XExtData *ext_data; /* hook for extension to hang data */ GContext gid; /* protocol ID for graphics context */ Bool rects; /* boolean: TRUE if clipmask is list of rectangles */ Bool dashes; /* boolean: TRUE if dash-list is really a list */ unsigned long dirty;/* cache dirty bits */ XGCValues values; /* shadow structure of values */ }; struct _XDisplay { XExtData *ext_data; /* hook for extension to hang data */ struct _XFreeFuncs *free_funcs; /* internal free functions */ int fd; /* Network socket. */ int conn_checker; /* ugly thing used by _XEventsQueued */ int proto_major_version;/* maj. version of server's X protocol */ int proto_minor_version;/* minor version of server's X protocol */ char *vendor; /* vendor of the server hardware */ XID resource_base; /* resource ID base */ XID resource_mask; /* resource ID mask bits */ XID resource_id; /* allocator current ID */ int resource_shift; /* allocator shift to correct bits */ XID (*resource_alloc)( /* allocator function */ struct _XDisplay* ); int byte_order; /* screen byte order, LSBFirst, MSBFirst */ int bitmap_unit; /* padding and data requirements */ int bitmap_pad; /* padding requirements on bitmaps */ int bitmap_bit_order; /* LeastSignificant or MostSignificant */ int nformats; /* number of pixmap formats in list */ ScreenFormat *pixmap_format; /* pixmap format list */ int vnumber; /* Xlib's X protocol version number. */ int release; /* release of the server */ struct _XSQEvent *head, *tail; /* Input event queue. */ int qlen; /* Length of input event queue */ unsigned long last_request_read; /* seq number of last event read */ unsigned long request; /* sequence number of last request. */ char *last_req; /* beginning of last request, or dummy */ char *buffer; /* Output buffer starting address. */ char *bufptr; /* Output buffer index pointer. */ char *bufmax; /* Output buffer maximum+1 address. */ unsigned max_request_size; /* maximum number 32 bit words in request*/ struct _XrmHashBucketRec *db; int (*synchandler)( /* Synchronization handler */ struct _XDisplay* ); char *display_name; /* "host:display" string used on this connect*/ int default_screen; /* default screen for operations */ int nscreens; /* number of screens on this server*/ Screen *screens; /* pointer to list of screens */ unsigned long motion_buffer; /* size of motion buffer */ volatile unsigned long flags; /* internal connection flags */ int min_keycode; /* minimum defined keycode */ int max_keycode; /* maximum defined keycode */ KeySym *keysyms; /* This server's keysyms */ XModifierKeymap *modifiermap; /* This server's modifier keymap */ int keysyms_per_keycode;/* number of rows */ char *xdefaults; /* contents of defaults from server */ char *scratch_buffer; /* place to hang scratch buffer */ unsigned long scratch_length; /* length of scratch buffer */ int ext_number; /* extension number on this display */ struct _XExten *ext_procs; /* extensions initialized on this display */ /* * the following can be fixed size, as the protocol defines how * much address space is available. * While this could be done using the extension vector, there * may be MANY events processed, so a search through the extension * list to find the right procedure for each event might be * expensive if many extensions are being used. */ Bool (*event_vec[128])( /* vector for wire to event */ Display * /* dpy */, XEvent * /* re */, xEvent * /* event */ ); Status (*wire_vec[128])( /* vector for event to wire */ Display * /* dpy */, XEvent * /* re */, xEvent * /* event */ ); KeySym lock_meaning; /* for XLookupString */ struct _XLockInfo *lock; /* multi-thread state, display lock */ struct _XInternalAsync *async_handlers; /* for internal async */ unsigned long bigreq_size; /* max size of big requests */ struct _XLockPtrs *lock_fns; /* pointers to threads functions */ void (*idlist_alloc)( /* XID list allocator function */ Display * /* dpy */, XID * /* ids */, int /* count */ ); /* things above this line should not move, for binary compatibility */ struct _XKeytrans *key_bindings; /* for XLookupString */ Font cursor_font; /* for XCreateFontCursor */ struct _XDisplayAtoms *atoms; /* for XInternAtom */ unsigned int mode_switch; /* keyboard group modifiers */ unsigned int num_lock; /* keyboard numlock modifiers */ struct _XContextDB *context_db; /* context database */ Bool (**error_vec)( /* vector for wire to error */ Display * /* display */, XErrorEvent * /* he */, xError * /* we */ ); /* * Xcms information */ struct { XPointer defaultCCCs; /* pointer to an array of default XcmsCCC */ XPointer clientCmaps; /* pointer to linked list of XcmsCmapRec */ XPointer perVisualIntensityMaps; /* linked list of XcmsIntensityMap */ } cms; struct _XIMFilter *im_filters; struct _XSQEvent *qfree; /* unallocated event queue elements */ unsigned long next_event_serial_num; /* inserted into next queue elt */ struct _XExten *flushes; /* Flush hooks */ struct _XConnectionInfo *im_fd_info; /* _XRegisterInternalConnection */ int im_fd_length; /* number of im_fd_info */ struct _XConnWatchInfo *conn_watchers; /* XAddConnectionWatch */ int watcher_count; /* number of conn_watchers */ XPointer filedes; /* struct pollfd cache for _XWaitForReadable */ int (*savedsynchandler)( /* user synchandler when Xlib usurps */ Display * /* dpy */ ); XID resource_max; /* allocator max ID */ int xcmisc_opcode; /* major opcode for XC-MISC */ struct _XkbInfoRec *xkb_info; /* XKB info */ struct _XtransConnInfo *trans_conn; /* transport connection object */ struct _X11XCBPrivate *xcb; /* XCB glue private data */ /* Generic event cookie handling */ unsigned int next_cookie; /* next event cookie */ /* vector for wire to generic event, index is (extension - 128) */ Bool (*generic_event_vec[128])( Display * /* dpy */, XGenericEventCookie * /* Xlib event */, xEvent * /* wire event */); /* vector for event copy, index is (extension - 128) */ Bool (*generic_event_copy_vec[128])( Display * /* dpy */, XGenericEventCookie * /* in */, XGenericEventCookie * /* out*/); void *cookiejar; /* cookie events returned but not claimed */ }; #define XAllocIDs(dpy,ids,n) (*(dpy)->idlist_alloc)(dpy,ids,n) #ifndef _XEVENT_ /* * _QEvent datatype for use in input queueing. */ typedef struct _XSQEvent { struct _XSQEvent *next; XEvent event; unsigned long qserial_num; /* so multi-threaded code can find new ones */ } _XQEvent; #endif #include #ifdef __sgi #define _SGI_MP_SOURCE /* turn this on to get MP safe errno */ #endif #include #define _XBCOPYFUNC _Xbcopy #include #include /* Utek leaves kernel macros around in include files (bleah) */ #ifdef dirty #undef dirty #endif #include #include #include _XFUNCPROTOBEGIN /* * The following definitions can be used for locking requests in multi-threaded * address spaces. */ #ifdef XTHREADS /* Author: Stephen Gildea, MIT X Consortium * * declarations for C Threads locking */ typedef struct _LockInfoRec *LockInfoPtr; /* interfaces for locking.c */ struct _XLockPtrs { /* used by all, including extensions; do not move */ void (*lock_display)( Display *dpy #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) , char *file , int line #endif ); void (*unlock_display)( Display *dpy #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) , char *file , int line #endif ); }; #if defined(WIN32) && !defined(_XLIBINT_) #define _XCreateMutex_fn (*_XCreateMutex_fn_p) #define _XFreeMutex_fn (*_XFreeMutex_fn_p) #define _XLockMutex_fn (*_XLockMutex_fn_p) #define _XUnlockMutex_fn (*_XUnlockMutex_fn_p) #define _Xglobal_lock (*_Xglobal_lock_p) #endif /* in XlibInt.c */ extern void (*_XCreateMutex_fn)( LockInfoPtr /* lock */ ); extern void (*_XFreeMutex_fn)( LockInfoPtr /* lock */ ); extern void (*_XLockMutex_fn)( LockInfoPtr /* lock */ #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) , char * /* file */ , int /* line */ #endif ); extern void (*_XUnlockMutex_fn)( LockInfoPtr /* lock */ #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) , char * /* file */ , int /* line */ #endif ); extern LockInfoPtr _Xglobal_lock; #if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) #define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)((d),__FILE__,__LINE__) #define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)((d),__FILE__,__LINE__) #define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock,__FILE__,__LINE__) #define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock,__FILE__,__LINE__) #else /* used everywhere, so must be fast if not using threads */ #define LockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->lock_display)(d) #define UnlockDisplay(d) if ((d)->lock_fns) (*(d)->lock_fns->unlock_display)(d) #define _XLockMutex(lock) if (_XLockMutex_fn) (*_XLockMutex_fn)(lock) #define _XUnlockMutex(lock) if (_XUnlockMutex_fn) (*_XUnlockMutex_fn)(lock) #endif #define _XCreateMutex(lock) if (_XCreateMutex_fn) (*_XCreateMutex_fn)(lock); #define _XFreeMutex(lock) if (_XFreeMutex_fn) (*_XFreeMutex_fn)(lock); #else /* XTHREADS */ #define LockDisplay(dis) #define _XLockMutex(lock) #define _XUnlockMutex(lock) #define UnlockDisplay(dis) #define _XCreateMutex(lock) #define _XFreeMutex(lock) #endif #define Xfree(ptr) free((ptr)) /* * Note that some machines do not return a valid pointer for malloc(0), in * which case we provide an alternate under the control of the * define MALLOC_0_RETURNS_NULL. This is necessary because some * Xlib code expects malloc(0) to return a valid pointer to storage. */ #if defined(MALLOC_0_RETURNS_NULL) || defined(__clang_analyzer__) # define Xmalloc(size) malloc(((size) == 0 ? 1 : (size))) # define Xrealloc(ptr, size) realloc((ptr), ((size) == 0 ? 1 : (size))) # define Xcalloc(nelem, elsize) calloc(((nelem) == 0 ? 1 : (nelem)), (elsize)) #else # define Xmalloc(size) malloc((size)) # define Xrealloc(ptr, size) realloc((ptr), (size)) # define Xcalloc(nelem, elsize) calloc((nelem), (elsize)) #endif #include #define LOCKED 1 #define UNLOCKED 0 #ifndef BUFSIZE #define BUFSIZE 2048 /* X output buffer size. */ #endif #ifndef PTSPERBATCH #define PTSPERBATCH 1024 /* point batching */ #endif #ifndef WLNSPERBATCH #define WLNSPERBATCH 50 /* wide line batching */ #endif #ifndef ZLNSPERBATCH #define ZLNSPERBATCH 1024 /* thin line batching */ #endif #ifndef WRCTSPERBATCH #define WRCTSPERBATCH 10 /* wide line rectangle batching */ #endif #ifndef ZRCTSPERBATCH #define ZRCTSPERBATCH 256 /* thin line rectangle batching */ #endif #ifndef FRCTSPERBATCH #define FRCTSPERBATCH 256 /* filled rectangle batching */ #endif #ifndef FARCSPERBATCH #define FARCSPERBATCH 256 /* filled arc batching */ #endif #ifndef CURSORFONT #define CURSORFONT "cursor" /* standard cursor fonts */ #endif /* * Display flags */ #define XlibDisplayIOError (1L << 0) #define XlibDisplayClosing (1L << 1) #define XlibDisplayNoXkb (1L << 2) #define XlibDisplayPrivSync (1L << 3) #define XlibDisplayProcConni (1L << 4) /* in _XProcessInternalConnection */ #define XlibDisplayReadEvents (1L << 5) /* in _XReadEvents */ #define XlibDisplayReply (1L << 5) /* in _XReply */ #define XlibDisplayWriting (1L << 6) /* in _XFlushInt, _XSend */ #define XlibDisplayDfltRMDB (1L << 7) /* mark if RM db from XGetDefault */ /* * X Protocol packetizing macros. */ /* Leftover from CRAY support - was defined empty on all non-Cray systems */ #define WORD64ALIGN /** * Return a len-sized request buffer for the request type. This function may * flush the output queue. * * @param dpy The display connection * @param type The request type * @param len Length of the request in bytes * * @returns A pointer to the request buffer with a few default values * initialized. */ extern void *_XGetRequest(Display *dpy, CARD8 type, size_t len); /* GetReqSized is the same as GetReq but allows the caller to specify the * size in bytes. 'sz' must be a multiple of 4! */ #define GetReqSized(name, sz, req) \ req = (x##name##Req *) _XGetRequest(dpy, X_##name, sz) /* * GetReq - Get the next available X request packet in the buffer and * return it. * * "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc. * "req" is the name of the request pointer. * */ #define GetReq(name, req) \ GetReqSized(name, SIZEOF(x##name##Req), req) /* GetReqExtra is the same as GetReq, but allocates "n" additional bytes after the request. "n" must be a multiple of 4! */ #define GetReqExtra(name, n, req) \ GetReqSized(name, SIZEOF(x##name##Req) + n, req) /* * GetResReq is for those requests that have a resource ID * (Window, Pixmap, GContext, etc.) as their single argument. * "rid" is the name of the resource. */ #define GetResReq(name, rid, req) \ req = (xResourceReq *) _XGetRequest(dpy, X_##name, SIZEOF(xResourceReq)); \ req->id = (rid) /* * GetEmptyReq is for those requests that have no arguments * at all. */ #define GetEmptyReq(name, req) \ req = (xReq *) _XGetRequest(dpy, X_##name, SIZEOF(xReq)) /* * MakeBigReq sets the CARD16 "req->length" to 0 and inserts a new CARD32 * length, after req->length, before the data in the request. The new length * includes the "n" extra 32-bit words. * * Do not use MakeBigReq if there is no data already in the request. * req->length must already be >= 2. */ #ifdef LONG64 #define MakeBigReq(req,n) \ { \ CARD64 _BRdat; \ CARD32 _BRlen = req->length - 1; \ req->length = 0; \ _BRdat = ((CARD32 *)req)[_BRlen]; \ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \ ((CARD32 *)req)[1] = _BRlen + n + 2; \ Data32(dpy, &_BRdat, 4); \ } #else #define MakeBigReq(req,n) \ { \ CARD32 _BRdat; \ CARD32 _BRlen = req->length - 1; \ req->length = 0; \ _BRdat = ((CARD32 *)req)[_BRlen]; \ memmove(((char *)req) + 8, ((char *)req) + 4, (_BRlen - 1) << 2); \ ((CARD32 *)req)[1] = _BRlen + n + 2; \ Data32(dpy, &_BRdat, 4); \ } #endif /* * SetReqLen increases the count of 32-bit words in the request by "n", * or by "badlen" if "n" is too large. * * Do not use SetReqLen if "req" does not already have data after the * xReq header. req->length must already be >= 2. */ #ifndef __clang_analyzer__ #define SetReqLen(req,n,badlen) \ if ((req->length + n) > (unsigned)65535) { \ if (dpy->bigreq_size) { \ MakeBigReq(req,n) \ } else { \ n = badlen; \ req->length += n; \ } \ } else \ req->length += n #else #define SetReqLen(req,n,badlen) \ req->length += n #endif #define SyncHandle() \ if (dpy->synchandler) (*dpy->synchandler)(dpy) extern void _XFlushGCCache(Display *dpy, GC gc); #define FlushGC(dpy, gc) \ if ((gc)->dirty) _XFlushGCCache((dpy), (gc)) /* * Data - Place data in the buffer and pad the end to provide * 32 bit word alignment. Transmit if the buffer fills. * * "dpy" is a pointer to a Display. * "data" is a pointer to a data buffer. * "len" is the length of the data buffer. */ #ifndef DataRoutineIsProcedure #define Data(dpy, data, len) {\ if (dpy->bufptr + (len) <= dpy->bufmax) {\ memcpy(dpy->bufptr, data, (int)len);\ dpy->bufptr += ((len) + 3) & ~3;\ } else\ _XSend(dpy, data, len);\ } #endif /* DataRoutineIsProcedure */ /* Allocate bytes from the buffer. No padding is done, so if * the length is not a multiple of 4, the caller must be * careful to leave the buffer aligned after sending the * current request. * * "type" is the type of the pointer being assigned to. * "ptr" is the pointer being assigned to. * "n" is the number of bytes to allocate. * * Example: * xTextElt *elt; * BufAlloc (xTextElt *, elt, nbytes) */ #define BufAlloc(type, ptr, n) \ if (dpy->bufptr + (n) > dpy->bufmax) \ _XFlush (dpy); \ ptr = (type) dpy->bufptr; \ memset(ptr, '\0', n); \ dpy->bufptr += (n); #define Data16(dpy, data, len) Data((dpy), (_Xconst char *)(data), (len)) #define _XRead16Pad(dpy, data, len) _XReadPad((dpy), (char *)(data), (len)) #define _XRead16(dpy, data, len) _XRead((dpy), (char *)(data), (len)) #ifdef LONG64 #define Data32(dpy, data, len) _XData32(dpy, (_Xconst long *)data, len) extern int _XData32( Display *dpy, register _Xconst long *data, unsigned len ); extern void _XRead32( Display *dpy, register long *data, long len ); #else #define Data32(dpy, data, len) Data((dpy), (_Xconst char *)(data), (len)) #define _XRead32(dpy, data, len) _XRead((dpy), (char *)(data), (len)) #endif #define PackData16(dpy,data,len) Data16 (dpy, data, len) #define PackData32(dpy,data,len) Data32 (dpy, data, len) /* Xlib manual is bogus */ #define PackData(dpy,data,len) PackData16 (dpy, data, len) #define min(a,b) (((a) < (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b)) #define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \ (((cs)->rbearing|(cs)->lbearing| \ (cs)->ascent|(cs)->descent) == 0)) /* * CI_GET_CHAR_INFO_1D - return the charinfo struct for the indicated 8bit * character. If the character is in the column and exists, then return the * appropriate metrics (note that fonts with common per-character metrics will * return min_bounds). If none of these hold true, try again with the default * char. */ #define CI_GET_CHAR_INFO_1D(fs,col,def,cs) \ { \ cs = def; \ if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ if (fs->per_char == NULL) { \ cs = &fs->min_bounds; \ } else { \ cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \ if (CI_NONEXISTCHAR(cs)) cs = def; \ } \ } \ } #define CI_GET_DEFAULT_INFO_1D(fs,cs) \ CI_GET_CHAR_INFO_1D (fs, fs->default_char, NULL, cs) /* * CI_GET_CHAR_INFO_2D - return the charinfo struct for the indicated row and * column. This is used for fonts that have more than row zero. */ #define CI_GET_CHAR_INFO_2D(fs,row,col,def,cs) \ { \ cs = def; \ if (row >= fs->min_byte1 && row <= fs->max_byte1 && \ col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \ if (fs->per_char == NULL) { \ cs = &fs->min_bounds; \ } else { \ cs = &fs->per_char[((row - fs->min_byte1) * \ (fs->max_char_or_byte2 - \ fs->min_char_or_byte2 + 1)) + \ (col - fs->min_char_or_byte2)]; \ if (CI_NONEXISTCHAR(cs)) cs = def; \ } \ } \ } #define CI_GET_DEFAULT_INFO_2D(fs,cs) \ { \ unsigned int r = (fs->default_char >> 8); \ unsigned int c = (fs->default_char & 0xff); \ CI_GET_CHAR_INFO_2D (fs, r, c, NULL, cs); \ } /* srcvar must be a variable for large architecture version */ #define OneDataCard32(dpy,dstaddr,srcvar) \ { *(CARD32 *)(dstaddr) = (srcvar); } typedef struct _XInternalAsync { struct _XInternalAsync *next; /* * handler arguments: * rep is the generic reply that caused this handler * to be invoked. It must also be passed to _XGetAsyncReply. * buf and len are opaque values that must be passed to * _XGetAsyncReply or _XGetAsyncData. * data is the closure stored in this struct. * The handler returns True iff it handled this reply. */ Bool (*handler)( Display* /* dpy */, xReply* /* rep */, char* /* buf */, int /* len */, XPointer /* data */ ); XPointer data; } _XAsyncHandler; typedef struct _XAsyncEState { unsigned long min_sequence_number; unsigned long max_sequence_number; unsigned char error_code; unsigned char major_opcode; unsigned short minor_opcode; unsigned char last_error_received; int error_count; } _XAsyncErrorState; extern void _XDeqAsyncHandler(Display *dpy, _XAsyncHandler *handler); #define DeqAsyncHandler(dpy,handler) { \ if (dpy->async_handlers == (handler)) \ dpy->async_handlers = (handler)->next; \ else \ _XDeqAsyncHandler(dpy, handler); \ } typedef void (*FreeFuncType) ( Display* /* display */ ); typedef int (*FreeModmapType) ( XModifierKeymap* /* modmap */ ); /* * This structure is private to the library. */ typedef struct _XFreeFuncs { FreeFuncType atoms; /* _XFreeAtomTable */ FreeModmapType modifiermap; /* XFreeModifiermap */ FreeFuncType key_bindings; /* _XFreeKeyBindings */ FreeFuncType context_db; /* _XFreeContextDB */ FreeFuncType defaultCCCs; /* _XcmsFreeDefaultCCCs */ FreeFuncType clientCmaps; /* _XcmsFreeClientCmaps */ FreeFuncType intensityMaps; /* _XcmsFreeIntensityMaps */ FreeFuncType im_filters; /* _XFreeIMFilters */ FreeFuncType xkb; /* _XkbFreeInfo */ } _XFreeFuncRec; /* types for InitExt.c */ typedef int (*CreateGCType) ( Display* /* display */, GC /* gc */, XExtCodes* /* codes */ ); typedef int (*CopyGCType)( Display* /* display */, GC /* gc */, XExtCodes* /* codes */ ); typedef int (*FlushGCType) ( Display* /* display */, GC /* gc */, XExtCodes* /* codes */ ); typedef int (*FreeGCType) ( Display* /* display */, GC /* gc */, XExtCodes* /* codes */ ); typedef int (*CreateFontType) ( Display* /* display */, XFontStruct* /* fs */, XExtCodes* /* codes */ ); typedef int (*FreeFontType) ( Display* /* display */, XFontStruct* /* fs */, XExtCodes* /* codes */ ); typedef int (*CloseDisplayType) ( Display* /* display */, XExtCodes* /* codes */ ); typedef int (*ErrorType) ( Display* /* display */, xError* /* err */, XExtCodes* /* codes */, int* /* ret_code */ ); typedef char* (*ErrorStringType) ( Display* /* display */, int /* code */, XExtCodes* /* codes */, char* /* buffer */, int /* nbytes */ ); typedef void (*PrintErrorType)( Display* /* display */, XErrorEvent* /* ev */, void* /* fp */ ); typedef void (*BeforeFlushType)( Display* /* display */, XExtCodes* /* codes */, _Xconst char* /* data */, long /* len */ ); /* * This structure is private to the library. */ typedef struct _XExten { /* private to extension mechanism */ struct _XExten *next; /* next in list */ XExtCodes codes; /* public information, all extension told */ CreateGCType create_GC; /* routine to call when GC created */ CopyGCType copy_GC; /* routine to call when GC copied */ FlushGCType flush_GC; /* routine to call when GC flushed */ FreeGCType free_GC; /* routine to call when GC freed */ CreateFontType create_Font; /* routine to call when Font created */ FreeFontType free_Font; /* routine to call when Font freed */ CloseDisplayType close_display; /* routine to call when connection closed */ ErrorType error; /* who to call when an error occurs */ ErrorStringType error_string; /* routine to supply error string */ char *name; /* name of this extension */ PrintErrorType error_values; /* routine to supply error values */ BeforeFlushType before_flush; /* routine to call when sending data */ struct _XExten *next_flush; /* next in list of those with flushes */ } _XExtension; /* Temporary definition until we can depend on an xproto release with it */ #ifdef _X_COLD # define _XLIB_COLD _X_COLD #elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 403) /* 4.3+ */ # define _XLIB_COLD __attribute__((__cold__)) #else # define _XLIB_COLD /* nothing */ #endif /* extension hooks */ #ifdef DataRoutineIsProcedure extern void Data(Display *dpy, char *data, long len); #endif extern int _XError( Display* /* dpy */, xError* /* rep */ ); extern int _XIOError( Display* /* dpy */ ) _X_NORETURN; extern int (*_XIOErrorFunction)( Display* /* dpy */ ); extern int (*_XErrorFunction)( Display* /* dpy */, XErrorEvent* /* error_event */ ); extern void _XEatData( Display* /* dpy */, unsigned long /* n */ ) _XLIB_COLD; extern void _XEatDataWords( Display* /* dpy */, unsigned long /* n */ ) _XLIB_COLD; #if defined(__SUNPRO_C) /* Studio compiler alternative to "cold" attribute */ # pragma rarely_called(_XEatData, _XEatDataWords) #endif extern char *_XAllocScratch( Display* /* dpy */, unsigned long /* nbytes */ ); extern char *_XAllocTemp( Display* /* dpy */, unsigned long /* nbytes */ ); extern void _XFreeTemp( Display* /* dpy */, char* /* buf */, unsigned long /* nbytes */ ); extern Visual *_XVIDtoVisual( Display* /* dpy */, VisualID /* id */ ); extern unsigned long _XSetLastRequestRead( Display* /* dpy */, xGenericReply* /* rep */ ); extern int _XGetHostname( char* /* buf */, int /* maxlen */ ); extern Screen *_XScreenOfWindow( Display* /* dpy */, Window /* w */ ); extern Bool _XAsyncErrorHandler( Display* /* dpy */, xReply* /* rep */, char* /* buf */, int /* len */, XPointer /* data */ ); extern char *_XGetAsyncReply( Display* /* dpy */, char* /* replbuf */, xReply* /* rep */, char* /* buf */, int /* len */, int /* extra */, Bool /* discard */ ); extern void _XGetAsyncData( Display* /* dpy */, char * /* data */, char * /* buf */, int /* len */, int /* skip */, int /* datalen */, int /* discardtotal */ ); extern void _XFlush( Display* /* dpy */ ); extern int _XEventsQueued( Display* /* dpy */, int /* mode */ ); extern void _XReadEvents( Display* /* dpy */ ); extern int _XRead( Display* /* dpy */, char* /* data */, long /* size */ ); extern void _XReadPad( Display* /* dpy */, char* /* data */, long /* size */ ); extern void _XSend( Display* /* dpy */, _Xconst char* /* data */, long /* size */ ); extern Status _XReply( Display* /* dpy */, xReply* /* rep */, int /* extra */, Bool /* discard */ ); extern void _XEnq( Display* /* dpy */, xEvent* /* event */ ); extern void _XDeq( Display* /* dpy */, _XQEvent* /* prev */, _XQEvent* /* qelt */ ); extern Bool _XUnknownWireEvent( Display* /* dpy */, XEvent* /* re */, xEvent* /* event */ ); extern Bool _XUnknownWireEventCookie( Display* /* dpy */, XGenericEventCookie* /* re */, xEvent* /* event */ ); extern Bool _XUnknownCopyEventCookie( Display* /* dpy */, XGenericEventCookie* /* in */, XGenericEventCookie* /* out */ ); extern Status _XUnknownNativeEvent( Display* /* dpy */, XEvent* /* re */, xEvent* /* event */ ); extern Bool _XWireToEvent(Display *dpy, XEvent *re, xEvent *event); extern Bool _XDefaultWireError(Display *display, XErrorEvent *he, xError *we); extern Bool _XPollfdCacheInit(Display *dpy); extern void _XPollfdCacheAdd(Display *dpy, int fd); extern void _XPollfdCacheDel(Display *dpy, int fd); extern XID _XAllocID(Display *dpy); extern void _XAllocIDs(Display *dpy, XID *ids, int count); extern int _XFreeExtData( XExtData* /* extension */ ); extern int (*XESetCreateGC( Display* /* display */, int /* extension */, int (*) ( Display* /* display */, GC /* gc */, XExtCodes* /* codes */ ) /* proc */ ))( Display*, GC, XExtCodes* ); extern int (*XESetCopyGC( Display* /* display */, int /* extension */, int (*) ( Display* /* display */, GC /* gc */, XExtCodes* /* codes */ ) /* proc */ ))( Display*, GC, XExtCodes* ); extern int (*XESetFlushGC( Display* /* display */, int /* extension */, int (*) ( Display* /* display */, GC /* gc */, XExtCodes* /* codes */ ) /* proc */ ))( Display*, GC, XExtCodes* ); extern int (*XESetFreeGC( Display* /* display */, int /* extension */, int (*) ( Display* /* display */, GC /* gc */, XExtCodes* /* codes */ ) /* proc */ ))( Display*, GC, XExtCodes* ); extern int (*XESetCreateFont( Display* /* display */, int /* extension */, int (*) ( Display* /* display */, XFontStruct* /* fs */, XExtCodes* /* codes */ ) /* proc */ ))( Display*, XFontStruct*, XExtCodes* ); extern int (*XESetFreeFont( Display* /* display */, int /* extension */, int (*) ( Display* /* display */, XFontStruct* /* fs */, XExtCodes* /* codes */ ) /* proc */ ))( Display*, XFontStruct*, XExtCodes* ); extern int (*XESetCloseDisplay( Display* /* display */, int /* extension */, int (*) ( Display* /* display */, XExtCodes* /* codes */ ) /* proc */ ))( Display*, XExtCodes* ); extern int (*XESetError( Display* /* display */, int /* extension */, int (*) ( Display* /* display */, xError* /* err */, XExtCodes* /* codes */, int* /* ret_code */ ) /* proc */ ))( Display*, xError*, XExtCodes*, int* ); extern char* (*XESetErrorString( Display* /* display */, int /* extension */, char* (*) ( Display* /* display */, int /* code */, XExtCodes* /* codes */, char* /* buffer */, int /* nbytes */ ) /* proc */ ))( Display*, int, XExtCodes*, char*, int ); extern void (*XESetPrintErrorValues ( Display* /* display */, int /* extension */, void (*)( Display* /* display */, XErrorEvent* /* ev */, void* /* fp */ ) /* proc */ ))( Display*, XErrorEvent*, void* ); extern Bool (*XESetWireToEvent( Display* /* display */, int /* event_number */, Bool (*) ( Display* /* display */, XEvent* /* re */, xEvent* /* event */ ) /* proc */ ))( Display*, XEvent*, xEvent* ); extern Bool (*XESetWireToEventCookie( Display* /* display */, int /* extension */, Bool (*) ( Display* /* display */, XGenericEventCookie* /* re */, xEvent* /* event */ ) /* proc */ ))( Display*, XGenericEventCookie*, xEvent* ); extern Bool (*XESetCopyEventCookie( Display* /* display */, int /* extension */, Bool (*) ( Display* /* display */, XGenericEventCookie* /* in */, XGenericEventCookie* /* out */ ) /* proc */ ))( Display*, XGenericEventCookie*, XGenericEventCookie* ); extern Status (*XESetEventToWire( Display* /* display */, int /* event_number */, Status (*) ( Display* /* display */, XEvent* /* re */, xEvent* /* event */ ) /* proc */ ))( Display*, XEvent*, xEvent* ); extern Bool (*XESetWireToError( Display* /* display */, int /* error_number */, Bool (*) ( Display* /* display */, XErrorEvent* /* he */, xError* /* we */ ) /* proc */ ))( Display*, XErrorEvent*, xError* ); extern void (*XESetBeforeFlush( Display* /* display */, int /* error_number */, void (*) ( Display* /* display */, XExtCodes* /* codes */, _Xconst char* /* data */, long /* len */ ) /* proc */ ))( Display*, XExtCodes*, _Xconst char*, long ); /* internal connections for IMs */ typedef void (*_XInternalConnectionProc)( Display* /* dpy */, int /* fd */, XPointer /* call_data */ ); extern Status _XRegisterInternalConnection( Display* /* dpy */, int /* fd */, _XInternalConnectionProc /* callback */, XPointer /* call_data */ ); extern void _XUnregisterInternalConnection( Display* /* dpy */, int /* fd */ ); extern void _XProcessInternalConnection( Display* /* dpy */, struct _XConnectionInfo* /* conn_info */ ); /* Display structure has pointers to these */ struct _XConnectionInfo { /* info from _XRegisterInternalConnection */ int fd; _XInternalConnectionProc read_callback; XPointer call_data; XPointer *watch_data; /* set/used by XConnectionWatchProc */ struct _XConnectionInfo *next; }; struct _XConnWatchInfo { /* info from XAddConnectionWatch */ XConnectionWatchProc fn; XPointer client_data; struct _XConnWatchInfo *next; }; #ifdef __UNIXOS2__ extern char* __XOS2RedirRoot( char* ); #endif extern int _XTextHeight( XFontStruct* /* font_struct */, _Xconst char* /* string */, int /* count */ ); extern int _XTextHeight16( XFontStruct* /* font_struct */, _Xconst XChar2b* /* string */, int /* count */ ); #if defined(WIN32) extern int _XOpenFile( _Xconst char* /* path */, int /* flags */ ); extern int _XOpenFileMode( _Xconst char* /* path */, int /* flags */, mode_t /* mode */ ); extern void* _XFopenFile( _Xconst char* /* path */, _Xconst char* /* mode */ ); extern int _XAccessFile( _Xconst char* /* path */ ); #else #define _XOpenFile(path,flags) open(path,flags) #define _XOpenFileMode(path,flags,mode) open(path,flags,mode) #define _XFopenFile(path,mode) fopen(path,mode) #endif /* EvToWire.c */ extern Status _XEventToWire(Display *dpy, XEvent *re, xEvent *event); extern int _XF86LoadQueryLocaleFont( Display* /* dpy */, _Xconst char* /* name*/, XFontStruct** /* xfp*/, Font* /* fidp */ ); extern void _XProcessWindowAttributes ( register Display *dpy, xChangeWindowAttributesReq *req, register unsigned long valuemask, register XSetWindowAttributes *attributes); extern int _XDefaultError( Display *dpy, XErrorEvent *event); extern int _XDefaultIOError( Display *dpy); extern void _XSetClipRectangles ( register Display *dpy, GC gc, int clip_x_origin, int clip_y_origin, XRectangle *rectangles, int n, int ordering); Status _XGetWindowAttributes( register Display *dpy, Window w, XWindowAttributes *attr); int _XPutBackEvent ( register Display *dpy, register XEvent *event); extern Bool _XIsEventCookie( Display *dpy, XEvent *ev); extern void _XFreeEventCookies( Display *dpy); extern void _XStoreEventCookie( Display *dpy, XEvent *ev); extern Bool _XFetchEventCookie( Display *dpy, XGenericEventCookie *ev); extern Bool _XCopyEventCookie( Display *dpy, XGenericEventCookie *in, XGenericEventCookie *out); /* lcFile.c */ extern void xlocaledir( char *buf, int buf_len ); #ifdef __clang__ #pragma clang diagnostic pop #endif _XFUNCPROTOEND #endif /* _X11_XLIBINT_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xlocale.h ================================================ /* Copyright 1991, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef _X11_XLOCALE_H_ #define _X11_XLOCALE_H_ #include #include #ifndef X_LOCALE #include #else #define LC_ALL 0 #define LC_COLLATE 1 #define LC_CTYPE 2 #define LC_MONETARY 3 #define LC_NUMERIC 4 #define LC_TIME 5 _XFUNCPROTOBEGIN extern char *_Xsetlocale( int /* category */, _Xconst char* /* name */ ); _XFUNCPROTOEND #define setlocale _Xsetlocale #include #endif /* X_LOCALE */ #endif /* _X11_XLOCALE_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xmd.h ================================================ /*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifndef XMD_H # define XMD_H 1 /* * Xmd.h: MACHINE DEPENDENT DECLARATIONS. */ /* * Special per-machine configuration flags. */ # if defined(__sun) && defined(__SVR4) # include /* Solaris: defines _LP64 if necessary */ # endif # if defined (_LP64) || defined(__LP64__) || \ defined(__alpha) || defined(__alpha__) || \ defined(__ia64__) || defined(ia64) || \ defined(__sparc64__) || \ defined(__s390x__) || \ defined(__amd64__) || defined(amd64) || \ defined(__powerpc64__) # if !defined(__ILP32__) /* amd64-x32 is 32bit */ # define LONG64 /* 32/64-bit architecture */ # endif /* !__ILP32__ */ # endif /* * Definition of macro used to set constants for size of network structures; * machines with preprocessors that can't handle all of the sz_ symbols * can define this macro to be sizeof(x) if and only if their compiler doesn't * pad out structures (esp. the xTextElt structure which contains only two * one-byte fields). Network structures should always define sz_symbols. * * The sz_ prefix is used instead of something more descriptive so that the * symbols are no more than 32 characters long (which causes problems for some * compilers and preprocessors). * * The extra indirection is to get macro arguments to expand correctly before * the concatenation, rather than afterward. */ # define _SIZEOF(x) sz_##x # define SIZEOF(x) _SIZEOF(x) /* * Bitfield suffixes for the protocol structure elements, if you * need them. Note that bitfields are not guaranteed to be signed * (or even unsigned) according to ANSI C. */ # define B32 /* bitfield not needed on architectures with native 32-bit type */ # define B16 /* bitfield not needed on architectures with native 16-bit type */ # ifdef LONG64 typedef long INT64; typedef int INT32; # else typedef long INT32; # endif typedef short INT16; typedef signed char INT8; # ifdef LONG64 typedef unsigned long CARD64; typedef unsigned int CARD32; # else typedef unsigned long long CARD64; typedef unsigned long CARD32; # endif typedef unsigned short CARD16; typedef unsigned char CARD8; typedef CARD32 BITS32; typedef CARD16 BITS16; typedef CARD8 BYTE; typedef CARD8 BOOL; /* * was definitions for sign-extending bitfields on architectures without * native types smaller than 64-bit, now just backwards compatibility */ # define cvtINT8toInt(val) (val) # define cvtINT16toInt(val) (val) # define cvtINT32toInt(val) (val) # define cvtINT8toShort(val) (val) # define cvtINT16toShort(val) (val) # define cvtINT32toShort(val) (val) # define cvtINT8toLong(val) (val) # define cvtINT16toLong(val) (val) # define cvtINT32toLong(val) (val) /* * this version should leave result of type (t *), but that should only be * used when not in MUSTCOPY */ # define NEXTPTR(p,t) (((t *)(p)) + 1) #endif /* XMD_H */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xos.h ================================================ /* * Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * * The X Window System is a Trademark of The Open Group. * */ /* This is a collection of things to try and minimize system dependencies * in a "significant" number of source files. */ #ifndef _XOS_H_ # define _XOS_H_ # include /* * Get major data types (esp. caddr_t) */ # include # if defined(__SCO__) || defined(__UNIXWARE__) # include # endif /* * Just about everyone needs the strings routines. We provide both forms here, * index/rindex and strchr/strrchr, so any systems that don't provide them all * need to have #defines here. * * These macros are defined this way, rather than, e.g.: * #defined index(s,c) strchr(s,c) * because someone might be using them as function pointers, and such * a change would break compatibility for anyone who's relying on them * being the way they currently are. So we're stuck with them this way, * which can be really inconvenient. :-( */ # include # if defined(__SCO__) || defined(__UNIXWARE__) || defined(__sun) || defined(__CYGWIN__) || defined(_AIX) || defined(__APPLE__) # include # else # ifndef index # define index(s,c) (strchr((s),(c))) # endif # ifndef rindex # define rindex(s,c) (strrchr((s),(c))) # endif # endif /* * Get open(2) constants */ # if defined(X_NOT_POSIX) # include # if defined(USL) || defined(__i386__) && (defined(SYSV) || defined(SVR4)) # include # endif # ifdef WIN32 # include # else # include # endif # else /* X_NOT_POSIX */ # include # include # endif /* X_NOT_POSIX else */ /* * Get struct timeval and struct tm */ # if defined(_POSIX_SOURCE) && defined(SVR4) /* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */ # undef _POSIX_SOURCE # include # define _POSIX_SOURCE # elif defined(WIN32) # include # if !defined(_WINSOCKAPI_) && !defined(_WILLWINSOCK_) && !defined(_TIMEVAL_DEFINED) && !defined(_STRUCT_TIMEVAL) struct timeval { long tv_sec; /* seconds */ long tv_usec; /* and microseconds */ }; # define _TIMEVAL_DEFINED # endif # include # define gettimeofday(t) \ { \ struct _timeb _gtodtmp; \ _ftime (&_gtodtmp); \ (t)->tv_sec = _gtodtmp.time; \ (t)->tv_usec = _gtodtmp.millitm * 1000; \ } # else # include # include # endif /* defined(_POSIX_SOURCE) && defined(SVR4) */ /* define X_GETTIMEOFDAY macro, a portable gettimeofday() */ # if defined(_XOPEN_XPG4) || defined(_XOPEN_UNIX) /* _XOPEN_UNIX is XPG4.2 */ # define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0) # else # if defined(SVR4) || defined(__SVR4) || defined(WIN32) # define X_GETTIMEOFDAY(t) gettimeofday(t) # else # define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*)0) # endif # endif /* XPG4 else */ # ifdef __GNU__ # define PATH_MAX 4096 # define MAXPATHLEN 4096 # define OPEN_MAX 256 /* We define a reasonable limit. */ # endif /* use POSIX name for signal */ # if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD) # define SIGCHLD SIGCLD # endif # include #endif /* _XOS_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xos_r.h ================================================ /* Copyright 1996, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * Various and sundry Thread-Safe functions used by X11, Motif, and CDE. * * Use this file in MT-safe code where you would have included * for readdir() * for getgrgid() or getgrnam() * for gethostbyname(), gethostbyaddr(), or getservbyname() * for getpwnam() or getpwuid() * for strtok() * for asctime(), ctime(), localtime(), or gmtime() * for getlogin() or ttyname() * or their thread-safe analogs. * * If you are on a platform that defines XTHREADS but does not have * MT-safe system API (e.g. UnixWare) you must define _Xos_processLock * and _Xos_processUnlock macros before including this header. * * For convenience XOS_USE_XLIB_LOCKING or XOS_USE_XT_LOCKING may be defined * to obtain either Xlib-only or Xt-based versions of these macros. These * macros won't result in truly thread-safe calls, but they are better than * nothing. If you do not want locking in this situation define * XOS_USE_NO_LOCKING. * * NOTE: On systems lacking appropriate _r functions Gethostbyname(), * Gethostbyaddr(), and Getservbyname() do NOT copy the host or * protocol lists! * * NOTE: On systems lacking appropriate _r functions Getgrgid() and * Getgrnam() do NOT copy the list of group members! * * This header is nominally intended to simplify porting X11, Motif, and * CDE; it may be useful to other people too. The structure below is * complicated, mostly because P1003.1c (the IEEE POSIX Threads spec) * went through lots of drafts, and some vendors shipped systems based * on draft API that were changed later. Unfortunately POSIX did not * provide a feature-test macro for distinguishing each of the drafts. */ /* * This header has several parts. Search for "Effective prototypes" * to locate the beginning of a section. */ /* This header can be included multiple times with different defines! */ #ifndef _XOS_R_H_ # define _XOS_R_H_ # include # include # ifndef X_NOT_POSIX # ifdef _POSIX_SOURCE # include # else # define _POSIX_SOURCE # include # undef _POSIX_SOURCE # endif # ifndef LINE_MAX # define X_LINE_MAX 2048 # else # define X_LINE_MAX LINE_MAX # endif # endif #endif /* _XOS_R_H */ #ifndef WIN32 #ifdef __cplusplus extern "C" { #endif # if defined(XOS_USE_XLIB_LOCKING) # ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */ typedef struct _LockInfoRec *LockInfoPtr; extern LockInfoPtr _Xglobal_lock; # endif # ifndef _Xos_isThreadInitialized # define _Xos_isThreadInitialized (_Xglobal_lock) # endif # if defined(XTHREADS_WARN) || defined(XTHREADS_FILE_LINE) # ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */ # include /* for NeedFunctionPrototypes */ extern void (*_XLockMutex_fn)( # if NeedFunctionPrototypes LockInfoPtr /* lock */, char * /* file */, int /* line */ # endif ); extern void (*_XUnlockMutex_fn)( # if NeedFunctionPrototypes LockInfoPtr /* lock */, char * /* file */, int /* line */ # endif ); # endif # ifndef _Xos_processLock # define _Xos_processLock \ (_XLockMutex_fn ? (*_XLockMutex_fn)(_Xglobal_lock,__FILE__,__LINE__) : 0) # endif # ifndef _Xos_processUnlock # define _Xos_processUnlock \ (_XUnlockMutex_fn ? (*_XUnlockMutex_fn)(_Xglobal_lock,__FILE__,__LINE__) : 0) # endif # else # ifndef XAllocIDs /* Xlibint.h does not have multiple include protection */ # include /* for NeedFunctionPrototypes */ extern void (*_XLockMutex_fn)( # if NeedFunctionPrototypes LockInfoPtr /* lock */ # endif ); extern void (*_XUnlockMutex_fn)( # if NeedFunctionPrototypes LockInfoPtr /* lock */ # endif ); # endif # ifndef _Xos_processLock # define _Xos_processLock \ (_XLockMutex_fn ? ((*_XLockMutex_fn)(_Xglobal_lock), 0) : 0) # endif # ifndef _Xos_processUnlock # define _Xos_processUnlock \ (_XUnlockMutex_fn ? ((*_XUnlockMutex_fn)(_Xglobal_lock), 0) : 0) # endif # endif # elif defined(XOS_USE_XT_LOCKING) # ifndef _XtThreadsI_h extern void (*_XtProcessLock)(void); # endif # ifndef _XtintrinsicP_h # include /* for NeedFunctionPrototypes */ extern void XtProcessLock( # if NeedFunctionPrototypes void # endif ); extern void XtProcessUnlock( # if NeedFunctionPrototypes void # endif ); # endif # ifndef _Xos_isThreadInitialized # define _Xos_isThreadInitialized _XtProcessLock # endif # ifndef _Xos_processLock # define _Xos_processLock XtProcessLock() # endif # ifndef _Xos_processUnlock # define _Xos_processUnlock XtProcessUnlock() # endif # elif defined(XOS_USE_NO_LOCKING) # ifndef _Xos_isThreadInitialized # define _Xos_isThreadInitialized 0 # endif # ifndef _Xos_processLock # define _Xos_processLock 0 # endif # ifndef _Xos_processUnlock # define _Xos_processUnlock 0 # endif # endif #endif /* !defined WIN32 */ /* * Solaris defines the POSIX thread-safe feature test macro, but * uses the older SVR4 thread-safe functions unless the POSIX ones * are specifically requested. Fix the feature test macro. */ #if defined(__sun) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && \ (_POSIX_C_SOURCE - 0 < 199506L) && !defined(_POSIX_PTHREAD_SEMANTICS) # undef _POSIX_THREAD_SAFE_FUNCTIONS #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_PWD_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xgetpwparams; * * struct passwd* _XGetpwnam(const char *name, _Xgetpwparams); * struct passwd* _XGetpwuid(uid_t uid, _Xgetpwparams); */ #if defined(X_INCLUDE_PWD_H) && !defined(_XOS_INCLUDED_PWD_H) # include # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_PWDAPI) # define XOS_USE_MTSAFE_PWDAPI 1 # endif #endif #undef X_NEEDS_PWPARAMS #if !defined(X_INCLUDE_PWD_H) || defined(_XOS_INCLUDED_PWD_H) /* Do nothing */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ # if defined(X_NOT_POSIX) && !defined(__i386__) && !defined(SYSV) extern struct passwd *getpwuid(), *getpwnam(); # endif typedef int _Xgetpwparams; /* dummy */ # define _XGetpwuid(u,p) getpwuid((u)) # define _XGetpwnam(u,p) getpwnam((u)) #elif !defined(XOS_USE_MTSAFE_PWDAPI) || defined(XNO_MTSAFE_PWDAPI) /* UnixWare 2.0, or other systems with thread support but no _r API. */ # define X_NEEDS_PWPARAMS typedef struct { struct passwd pws; char pwbuf[1024]; struct passwd* pwp; size_t len; } _Xgetpwparams; /* * NetBSD and FreeBSD, at least, are missing several of the unixware passwd * fields. */ #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \ defined(__APPLE__) || defined(__DragonFly__) static __inline__ void _Xpw_copyPasswd(_Xgetpwparams p) { memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)); (p).pws.pw_name = (p).pwbuf; (p).len = strlen((p).pwp->pw_name); strcpy((p).pws.pw_name, (p).pwp->pw_name); (p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1; (p).len = strlen((p).pwp->pw_passwd); strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd); (p).pws.pw_class = (p).pws.pw_passwd + (p).len + 1; (p).len = strlen((p).pwp->pw_class); strcpy((p).pws.pw_class, (p).pwp->pw_class); (p).pws.pw_gecos = (p).pws.pw_class + (p).len + 1; (p).len = strlen((p).pwp->pw_gecos); strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos); (p).pws.pw_dir = (p).pws.pw_gecos + (p).len + 1; (p).len = strlen((p).pwp->pw_dir); strcpy((p).pws.pw_dir, (p).pwp->pw_dir); (p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1; (p).len = strlen((p).pwp->pw_shell); strcpy((p).pws.pw_shell, (p).pwp->pw_shell); (p).pwp = &(p).pws; } #else # define _Xpw_copyPasswd(p) \ (memcpy(&(p).pws, (p).pwp, sizeof(struct passwd)), \ ((p).pws.pw_name = (p).pwbuf), \ ((p).len = strlen((p).pwp->pw_name)), \ strcpy((p).pws.pw_name, (p).pwp->pw_name), \ ((p).pws.pw_passwd = (p).pws.pw_name + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_passwd)), \ strcpy((p).pws.pw_passwd,(p).pwp->pw_passwd), \ ((p).pws.pw_age = (p).pws.pw_passwd + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_age)), \ strcpy((p).pws.pw_age, (p).pwp->pw_age), \ ((p).pws.pw_comment = (p).pws.pw_age + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_comment)), \ strcpy((p).pws.pw_comment, (p).pwp->pw_comment), \ ((p).pws.pw_gecos = (p).pws.pw_comment + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_gecos)), \ strcpy((p).pws.pw_gecos, (p).pwp->pw_gecos), \ ((p).pws.pw_dir = (p).pws.pw_comment + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_dir)), \ strcpy((p).pws.pw_dir, (p).pwp->pw_dir), \ ((p).pws.pw_shell = (p).pws.pw_dir + (p).len + 1), \ ((p).len = strlen((p).pwp->pw_shell)), \ strcpy((p).pws.pw_shell, (p).pwp->pw_shell), \ ((p).pwp = &(p).pws), \ 0 ) #endif # define _XGetpwuid(u,p) \ ( (_Xos_processLock), \ (((p).pwp = getpwuid((u))) ? _Xpw_copyPasswd(p), 0 : 0), \ (_Xos_processUnlock), \ (p).pwp ) # define _XGetpwnam(u,p) \ ( (_Xos_processLock), \ (((p).pwp = getpwnam((u))) ? _Xpw_copyPasswd(p), 0 : 0), \ (_Xos_processUnlock), \ (p).pwp ) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(__APPLE__) # define X_NEEDS_PWPARAMS typedef struct { struct passwd pws; char pwbuf[X_LINE_MAX]; } _Xgetpwparams; # if defined(_POSIX_REENTRANT_FUNCTIONS) || !defined(SVR4) # define _XGetpwuid(u,p) \ ((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) # define _XGetpwnam(u,p) \ ((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == -1) ? NULL : &(p).pws) # else /* SVR4 */ # define _XGetpwuid(u,p) \ ((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws) # define _XGetpwnam(u,p) \ ((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf)) == NULL) ? NULL : &(p).pws) # endif /* SVR4 */ #else /* _POSIX_THREAD_SAFE_FUNCTIONS */ # define X_NEEDS_PWPARAMS typedef struct { struct passwd pws; char pwbuf[X_LINE_MAX]; struct passwd* pwp; } _Xgetpwparams; typedef int _Xgetpwret; # define _XGetpwuid(u,p) \ ((getpwuid_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == 0) ? \ (p).pwp : NULL) # define _XGetpwnam(u,p) \ ((getpwnam_r((u),&(p).pws,(p).pwbuf,sizeof((p).pwbuf),&(p).pwp) == 0) ? \ (p).pwp : NULL) #endif /* X_INCLUDE_PWD_H */ #if defined(X_INCLUDE_PWD_H) && !defined(_XOS_INCLUDED_PWD_H) # define _XOS_INCLUDED_PWD_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * NOTE: On systems lacking the appropriate _r functions Gethostbyname(), * Gethostbyaddr(), and Getservbyname() do NOT copy the host or * protocol lists! * * #define X_INCLUDE_NETDB_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xgethostbynameparams; * typedef ... _Xgetservbynameparams; * * struct hostent* _XGethostbyname(const char* name,_Xgethostbynameparams); * struct hostent* _XGethostbyaddr(const char* addr, int len, int type, * _Xgethostbynameparams); * struct servent* _XGetservbyname(const char* name, const char* proto, * _Xgetservbynameparams); */ #undef XTHREADS_NEEDS_BYNAMEPARAMS #if defined(X_INCLUDE_NETDB_H) && !defined(_XOS_INCLUDED_NETDB_H) \ && !defined(WIN32) # include # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_NETDBAPI) # define XOS_USE_MTSAFE_NETDBAPI 1 # endif #endif #if !defined(X_INCLUDE_NETDB_H) || defined(_XOS_INCLUDED_NETDB_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xgethostbynameparams; /* dummy */ typedef int _Xgetservbynameparams; /* dummy */ # define _XGethostbyname(h,hp) gethostbyname((h)) # define _XGethostbyaddr(a,al,t,hp) gethostbyaddr((a),(al),(t)) # define _XGetservbyname(s,p,sp) getservbyname((s),(p)) #elif !defined(XOS_USE_MTSAFE_NETDBAPI) || defined(XNO_MTSAFE_NETDBAPI) /* WARNING: The h_addr_list and s_aliases values are *not* copied! */ #if defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) #include #endif typedef struct { struct hostent hent; char h_name[MAXHOSTNAMELEN]; struct hostent *hptr; } _Xgethostbynameparams; typedef struct { struct servent sent; char s_name[255]; char s_proto[255]; struct servent *sptr; } _Xgetservbynameparams; # define XTHREADS_NEEDS_BYNAMEPARAMS # define _Xg_copyHostent(hp) \ (memcpy(&(hp).hent, (hp).hptr, sizeof(struct hostent)), \ strcpy((hp).h_name, (hp).hptr->h_name), \ ((hp).hent.h_name = (hp).h_name), \ ((hp).hptr = &(hp).hent), \ 0 ) # define _Xg_copyServent(sp) \ (memcpy(&(sp).sent, (sp).sptr, sizeof(struct servent)), \ strcpy((sp).s_name, (sp).sptr->s_name), \ ((sp).sent.s_name = (sp).s_name), \ strcpy((sp).s_proto, (sp).sptr->s_proto), \ ((sp).sent.s_proto = (sp).s_proto), \ ((sp).sptr = &(sp).sent), \ 0 ) # define _XGethostbyname(h,hp) \ ((_Xos_processLock), \ (((hp).hptr = gethostbyname((h))) ? _Xg_copyHostent(hp) : 0), \ (_Xos_processUnlock), \ (hp).hptr ) # define _XGethostbyaddr(a,al,t,hp) \ ((_Xos_processLock), \ (((hp).hptr = gethostbyaddr((a),(al),(t))) ? _Xg_copyHostent(hp) : 0), \ (_Xos_processUnlock), \ (hp).hptr ) # define _XGetservbyname(s,p,sp) \ ((_Xos_processLock), \ (((sp).sptr = getservbyname((s),(p))) ? _Xg_copyServent(sp) : 0), \ (_Xos_processUnlock), \ (sp).sptr ) #elif defined(XUSE_NETDB_R_API) /* * POSIX does not specify _r equivalents for API, but some * vendors provide them anyway. Use them only when explicitly asked. */ # ifdef _POSIX_REENTRANT_FUNCTIONS # ifndef _POSIX_THREAD_SAFE_FUNCTIONS # endif # endif # ifdef _POSIX_THREAD_SAFE_FUNCTIONS # define X_POSIX_THREAD_SAFE_FUNCTIONS 1 # endif # define XTHREADS_NEEDS_BYNAMEPARAMS # ifndef X_POSIX_THREAD_SAFE_FUNCTIONS typedef struct { struct hostent hent; char hbuf[X_LINE_MAX]; int herr; } _Xgethostbynameparams; typedef struct { struct servent sent; char sbuf[X_LINE_MAX]; } _Xgetservbynameparams; # define _XGethostbyname(h,hp) \ gethostbyname_r((h),&(hp).hent,(hp).hbuf,sizeof((hp).hbuf),&(hp).herr) # define _XGethostbyaddr(a,al,t,hp) \ gethostbyaddr_r((a),(al),(t),&(hp).hent,(hp).hbuf,sizeof((hp).hbuf),&(hp).herr) # define _XGetservbyname(s,p,sp) \ getservbyname_r((s),(p),&(sp).sent,(sp).sbuf,sizeof((sp).sbuf)) # else typedef struct { struct hostent hent; struct hostent_data hdata; } _Xgethostbynameparams; typedef struct { struct servent sent; struct servent_data sdata; } _Xgetservbynameparams; # define _XGethostbyname(h,hp) \ (bzero((char*)&(hp).hdata,sizeof((hp).hdata)), \ ((gethostbyname_r((h),&(hp).hent,&(hp).hdata) == -1) ? NULL : &(hp).hent)) # define _XGethostbyaddr(a,al,t,hp) \ (bzero((char*)&(hp).hdata,sizeof((hp).hdata)), \ ((gethostbyaddr_r((a),(al),(t),&(hp).hent,&(hp).hdata) == -1) ? NULL : &(hp).hent)) # define _XGetservbyname(s,p,sp) \ (bzero((char*)&(sp).sdata,sizeof((sp).sdata)), \ ((getservbyname_r((s),(p),&(sp).sent,&(sp).sdata) == -1) ? NULL : &(sp).sent) ) # endif # ifdef X_POSIX_THREAD_SAFE_FUNCTIONS # undef X_POSIX_THREAD_SAFE_FUNCTIONS # endif #else /* The regular API is assumed to be MT-safe under POSIX. */ typedef int _Xgethostbynameparams; /* dummy */ typedef int _Xgetservbynameparams; /* dummy */ # define _XGethostbyname(h,hp) gethostbyname((h)) # define _XGethostbyaddr(a,al,t,hp) gethostbyaddr((a),(al),(t)) # define _XGetservbyname(s,p,sp) getservbyname((s),(p)) #endif /* X_INCLUDE_NETDB_H */ #if defined(X_INCLUDE_NETDB_H) && !defined(_XOS_INCLUDED_NETDB_H) # define _XOS_INCLUDED_NETDB_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_DIRENT_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xreaddirparams; * * struct dirent *_XReaddir(DIR *dir_pointer, _Xreaddirparams); */ #if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H) # include # if !defined(X_NOT_POSIX) || defined(SYSV) # include # else # include # ifndef dirent # define dirent direct # endif # endif # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_DIRENTAPI) # define XOS_USE_MTSAFE_DIRENTAPI 1 # endif #endif #if !defined(X_INCLUDE_DIRENT_H) || defined(_XOS_INCLUDED_DIRENT_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xreaddirparams; /* dummy */ # define _XReaddir(d,p) readdir(d) #elif !defined(XOS_USE_MTSAFE_DIRENTAPI) || defined(XNO_MTSAFE_DIRENTAPI) /* Systems with thread support but no _r API. */ typedef struct { struct dirent *result; struct dirent dir_entry; # ifdef _POSIX_PATH_MAX char buf[_POSIX_PATH_MAX]; # elif defined(NAME_MAX) char buf[NAME_MAX]; # else char buf[255]; # endif } _Xreaddirparams; # define _XReaddir(d,p) \ ( (_Xos_processLock), \ (((p).result = readdir((d))) ? \ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \ ((p).result = &(p).dir_entry), 0) : \ 0), \ (_Xos_processUnlock), \ (p).result ) #else typedef struct { struct dirent *result; struct dirent dir_entry; # ifdef _POSIX_PATH_MAX char buf[_POSIX_PATH_MAX]; # elif defined(NAME_MAX) char buf[NAME_MAX]; # else char buf[255]; # endif } _Xreaddirparams; # if defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(__APPLE__) /* POSIX final API, returns (int)0 on success. */ # define _XReaddir(d,p) \ (readdir_r((d), &((p).dir_entry), &((p).result)) ? NULL : (p).result) # elif defined(_POSIX_REENTRANT_FUNCTIONS) /* POSIX draft API, returns (int)0 on success. */ # define _XReaddir(d,p) \ (readdir_r((d),&((p).dir_entry)) ? NULL : &((p).dir_entry)) # elif defined(SVR4) /* Pre-POSIX API, returns non-NULL on success. */ # define _XReaddir(d,p) (readdir_r((d), &(p).dir_entry)) # else /* We have no idea what is going on. Fake it all using process locks. */ # define _XReaddir(d,p) \ ( (_Xos_processLock), \ (((p).result = readdir((d))) ? \ (memcpy(&((p).dir_entry), (p).result, (p).result->d_reclen), \ ((p).result = &(p).dir_entry), 0) : \ 0), \ (_Xos_processUnlock), \ (p).result ) # endif #endif /* X_INCLUDE_DIRENT_H */ #if defined(X_INCLUDE_DIRENT_H) && !defined(_XOS_INCLUDED_DIRENT_H) # define _XOS_INCLUDED_DIRENT_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_UNISTD_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xgetloginparams; * typedef ... _Xttynameparams; * * char *_XGetlogin(_Xgetloginparams); * char *_XTtyname(int, _Xttynameparams); */ #if defined(X_INCLUDE_UNISTD_H) && !defined(_XOS_INCLUDED_UNISTD_H) /* already included by */ # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_UNISTDAPI) # define XOS_USE_MTSAFE_UNISTDAPI 1 # endif #endif #if !defined(X_INCLUDE_UNISTD_H) || defined(_XOS_INCLUDED_UNISTD_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xgetloginparams; /* dummy */ typedef int _Xttynameparams; /* dummy */ # define _XGetlogin(p) getlogin() # define _XTtyname(f) ttyname((f)) #elif !defined(XOS_USE_MTSAFE_UNISTDAPI) || defined(XNO_MTSAFE_UNISTDAPI) /* Systems with thread support but no _r API. */ typedef struct { char *result; # if defined(MAXLOGNAME) char buf[MAXLOGNAME]; # elif defined(LOGIN_NAME_MAX) char buf[LOGIN_NAME_MAX]; # else char buf[64]; # endif } _Xgetloginparams; typedef struct { char *result; # ifdef TTY_NAME_MAX char buf[TTY_NAME_MAX]; # elif defined(_POSIX_TTY_NAME_MAX) char buf[_POSIX_TTY_NAME_MAX]; # elif defined(_POSIX_PATH_MAX) char buf[_POSIX_PATH_MAX]; # else char buf[256]; # endif } _Xttynameparams; # define _XGetlogin(p) \ ( (_Xos_processLock), \ (((p).result = getlogin()) ? \ (strncpy((p).buf, (p).result, sizeof((p).buf)), \ ((p).buf[sizeof((p).buf)-1] = '\0'), \ ((p).result = (p).buf), 0) : 0), \ (_Xos_processUnlock), \ (p).result ) #define _XTtyname(f,p) \ ( (_Xos_processLock), \ (((p).result = ttyname(f)) ? \ (strncpy((p).buf, (p).result, sizeof((p).buf)), \ ((p).buf[sizeof((p).buf)-1] = '\0'), \ ((p).result = (p).buf), 0) : 0), \ (_Xos_processUnlock), \ (p).result ) #elif defined(_POSIX_THREAD_SAFE_FUNCTIONS) || defined(_POSIX_REENTRANT_FUNCTIONS) /* POSIX API. * * extern int getlogin_r(char *, size_t); * extern int ttyname_r(int, char *, size_t); */ typedef struct { # if defined(MAXLOGNAME) char buf[MAXLOGNAME]; # elif defined(LOGIN_NAME_MAX) char buf[LOGIN_NAME_MAX]; # else char buf[64]; # endif } _Xgetloginparams; typedef struct { # ifdef TTY_NAME_MAX char buf[TTY_NAME_MAX]; # elif defined(_POSIX_TTY_NAME_MAX) char buf[_POSIX_TTY_NAME_MAX]; # elif defined(_POSIX_PATH_MAX) char buf[_POSIX_PATH_MAX]; # else char buf[256]; # endif } _Xttynameparams; # define _XGetlogin(p) (getlogin_r((p).buf, sizeof((p).buf)) ? NULL : (p).buf) # define _XTtyname(f,p) \ (ttyname_r((f), (p).buf, sizeof((p).buf)) ? NULL : (p).buf) #else /* Pre-POSIX API. * * extern char *getlogin_r(char *, size_t); * extern char *ttyname_r(int, char *, size_t); */ typedef struct { # if defined(MAXLOGNAME) char buf[MAXLOGNAME]; # elif defined(LOGIN_NAME_MAX) char buf[LOGIN_NAME_MAX]; # else char buf[64]; # endif } _Xgetloginparams; typedef struct { # ifdef TTY_NAME_MAX char buf[TTY_NAME_MAX]; # elif defined(_POSIX_TTY_NAME_MAX) char buf[_POSIX_TTY_NAME_MAX]; # elif defined(_POSIX_PATH_MAX) char buf[_POSIX_PATH_MAX]; # else char buf[256]; # endif } _Xttynameparams; # define _XGetlogin(p) getlogin_r((p).buf, sizeof((p).buf)) # define _XTtyname(f,p) ttyname_r((f), (p).buf, sizeof((p).buf)) #endif /* X_INCLUDE_UNISTD_H */ #if defined(X_INCLUDE_UNISTD_H) && !defined(_XOS_INCLUDED_UNISTD_H) # define _XOS_INCLUDED_UNISTD_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_STRING_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xstrtokparams; * * char *_XStrtok(char *, const char*, _Xstrtokparams); */ #if defined(X_INCLUDE_STRING_H) && !defined(_XOS_INCLUDED_STRING_H) /* has already been included by */ # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_STRINGAPI) # define XOS_USE_MTSAFE_STRINGAPI 1 # endif #endif #if !defined(X_INCLUDE_STRING_H) || defined(_XOS_INCLUDED_STRING_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xstrtokparams; /* dummy */ # define _XStrtok(s1,s2,p) \ ( p = 0, (void)p, strtok((s1),(s2)) ) #elif !defined(XOS_USE_MTSAFE_STRINGAPI) || defined(XNO_MTSAFE_STRINGAPI) /* Systems with thread support but no _r API. */ typedef char *_Xstrtokparams; # define _XStrtok(s1,s2,p) \ ( (_Xos_processLock), \ ((p) = strtok((s1),(s2))), \ (_Xos_processUnlock), \ (p) ) #else /* POSIX or pre-POSIX API. */ typedef char * _Xstrtokparams; # define _XStrtok(s1,s2,p) strtok_r((s1),(s2),&(p)) #endif /* X_INCLUDE_STRING_H */ /***** wrappers *****/ /* * Effective prototypes for wrappers: * * #define X_INCLUDE_TIME_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xatimeparams; * typedef ... _Xctimeparams; * typedef ... _Xgtimeparams; * typedef ... _Xltimeparams; * * char *_XAsctime(const struct tm *, _Xatimeparams); * char *_XCtime(const time_t *, _Xctimeparams); * struct tm *_XGmtime(const time_t *, _Xgtimeparams); * struct tm *_XLocaltime(const time_t *, _Xltimeparams); */ #if defined(X_INCLUDE_TIME_H) && !defined(_XOS_INCLUDED_TIME_H) # include # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_TIMEAPI) # define XOS_USE_MTSAFE_TIMEAPI 1 # endif #endif #if !defined(X_INCLUDE_TIME_H) || defined(_XOS_INCLUDED_TIME_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xatimeparams; /* dummy */ # define _XAsctime(t,p) asctime((t)) typedef int _Xctimeparams; /* dummy */ # define _XCtime(t,p) ctime((t)) typedef int _Xgtimeparams; /* dummy */ # define _XGmtime(t,p) gmtime((t)) typedef int _Xltimeparams; /* dummy */ # define _XLocaltime(t,p) localtime((t)) #elif !defined(XOS_USE_MTSAFE_TIMEAPI) || defined(XNO_MTSAFE_TIMEAPI) /* Systems with thread support but no _r API. */ typedef struct { # ifdef TIMELEN char buf[TIMELEN]; # else char buf[26]; # endif char *result; } _Xctimeparams, _Xatimeparams; typedef struct { struct tm buf; struct tm *result; } _Xgtimeparams, _Xltimeparams; # define _XAsctime(t,p) \ ( (_Xos_processLock), \ (((p).result = asctime((t))) ? \ (strncpy((p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \ 0), \ (_Xos_processUnlock), \ (p).result ) # define _XCtime(t,p) \ ( (_Xos_processLock), \ (((p).result = ctime((t))) ? \ (strncpy((p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \ 0), \ (_Xos_processUnlock), \ (p).result ) # define _XGmtime(t,p) \ ( (_Xos_processLock), \ (((p).result = gmtime(t)) ? \ (memcpy(&(p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \ 0), \ (_Xos_processUnlock), \ (p).result ) # define _XLocaltime(t,p) \ ( (_Xos_processLock), \ (((p).result = localtime(t)) ? \ (memcpy(&(p).buf, (p).result, sizeof((p).buf)), (p).result = &(p).buf) : \ 0), \ (_Xos_processUnlock), \ (p).result ) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(hpV4) /* Returns (int)0 on success. * * extern int asctime_r(const struct tm *timeptr, char *buffer, int buflen); * extern int ctime_r(const time_t *timer, char *buffer, int buflen); * extern int gmtime_r(const time_t *timer, struct tm *result); * extern int localtime_r(const time_t *timer, struct tm *result); */ # ifdef TIMELEN typedef char _Xatimeparams[TIMELEN]; typedef char _Xctimeparams[TIMELEN]; # else typedef char _Xatimeparams[26]; typedef char _Xctimeparams[26]; # endif typedef struct tm _Xgtimeparams; typedef struct tm _Xltimeparams; # define _XAsctime(t,p) (asctime_r((t),(p),sizeof((p))) ? NULL : (p)) # define _XCtime(t,p) (ctime_r((t),(p),sizeof((p))) ? NULL : (p)) # define _XGmtime(t,p) (gmtime_r((t),&(p)) ? NULL : &(p)) # define _XLocaltime(t,p) (localtime_r((t),&(p)) ? NULL : &(p)) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(__sun) /* Returns NULL on failure. Solaris 2.5 * * extern char *asctime_r(const struct tm *tm,char *buf, int buflen); * extern char *ctime_r(const time_t *clock, char *buf, int buflen); * extern struct tm *gmtime_r(const time_t *clock, struct tm *res); * extern struct tm *localtime_r(const time_t *clock, struct tm *res); */ # ifdef TIMELEN typedef char _Xatimeparams[TIMELEN]; typedef char _Xctimeparams[TIMELEN]; # else typedef char _Xatimeparams[26]; typedef char _Xctimeparams[26]; # endif typedef struct tm _Xgtimeparams; typedef struct tm _Xltimeparams; # define _XAsctime(t,p) asctime_r((t),(p),sizeof((p))) # define _XCtime(t,p) ctime_r((t),(p),sizeof((p))) # define _XGmtime(t,p) gmtime_r((t),&(p)) # define _XLocaltime(t,p) localtime_r((t),&(p)) #else /* defined(_POSIX_THREAD_SAFE_FUNCTIONS) */ /* POSIX final API. * extern char *asctime_r(const struct tm *timeptr, char *buffer); * extern char *ctime_r(const time_t *timer, char *buffer); * extern struct tm *gmtime_r(const time_t *timer, struct tm *result); * extern struct tm *localtime_r(const time_t *timer, struct tm *result); */ # ifdef TIMELEN typedef char _Xatimeparams[TIMELEN]; typedef char _Xctimeparams[TIMELEN]; # else typedef char _Xatimeparams[26]; typedef char _Xctimeparams[26]; # endif typedef struct tm _Xgtimeparams; typedef struct tm _Xltimeparams; # define _XAsctime(t,p) asctime_r((t),(p)) # define _XCtime(t,p) ctime_r((t),(p)) # define _XGmtime(t,p) gmtime_r((t),&(p)) # define _XLocaltime(t,p) localtime_r((t),&(p)) #endif /* X_INCLUDE_TIME_H */ #if defined(X_INCLUDE_TIME_H) && !defined(_XOS_INCLUDED_TIME_H) # define _XOS_INCLUDED_TIME_H #endif /***** wrappers *****/ /* * Effective prototypes for wrappers: * * NOTE: On systems lacking appropriate _r functions Getgrgid() and * Getgrnam() do NOT copy the list of group members! * * Remember that fgetgrent(), setgrent(), getgrent(), and endgrent() * are not included in POSIX. * * #define X_INCLUDE_GRP_H * #define XOS_USE_..._LOCKING * #include * * typedef ... _Xgetgrparams; * * struct group *_XGetgrgid(gid_t, _Xgetgrparams); * struct group *_XGetgrnam(const char *, _Xgetgrparams); */ #if defined(X_INCLUDE_GRP_H) && !defined(_XOS_INCLUDED_GRP_H) # include # if defined(XUSE_MTSAFE_API) || defined(XUSE_MTSAFE_GRPAPI) # define XOS_USE_MTSAFE_GRPAPI 1 # endif #endif #if !defined(X_INCLUDE_GRP_H) || defined(_XOS_INCLUDED_GRP_H) /* Do nothing. */ #elif !defined(XTHREADS) && !defined(X_FORCE_USE_MTSAFE_API) /* Use regular, unsafe API. */ typedef int _Xgetgrparams; /* dummy */ #define _XGetgrgid(g,p) getgrgid((g)) #define _XGetgrnam(n,p) getgrnam((n)) #elif !defined(XOS_USE_MTSAFE_GRPAPI) || defined(XNO_MTSAFE_GRPAPI) /* Systems with thread support but no _r API. UnixWare 2.0. */ typedef struct { struct group grp; char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */ struct group *pgrp; size_t len; } _Xgetgrparams; #ifdef SVR4 /* Copy the gr_passwd field too. */ # define _Xgrp_copyGroup(p) \ ( memcpy(&(p).grp, (p).pgrp, sizeof(struct group)), \ ((p).grp.gr_name = (p).buf), \ ((p).len = strlen((p).pgrp->gr_name)), \ strcpy((p).grp.gr_name, (p).pgrp->gr_name), \ ((p).grp.gr_passwd = (p).grp.gr_name + (p).len + 1), \ ((p).pgrp = &(p).grp), \ 0 ) #else # define _Xgrp_copyGroup(p) \ ( memcpy(&(p).grp, (p).pgrp, sizeof(struct group)), \ ((p).grp.gr_name = (p).buf), \ strcpy((p).grp.gr_name, (p).pgrp->gr_name), \ ((p).pgrp = &(p).grp), \ 0 ) #endif #define _XGetgrgid(g,p) \ ( (_Xos_processLock), \ (((p).pgrp = getgrgid((g))) ? _Xgrp_copyGroup(p) : 0), \ (_Xos_processUnlock), \ (p).pgrp ) #define _XGetgrnam(n,p) \ ( (_Xos_processLock), \ (((p).pgrp = getgrnam((n))) ? _Xgrp_copyGroup(p) : 0), \ (_Xos_processUnlock), \ (p).pgrp ) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(__sun) /* Non-POSIX API. Solaris. * * extern struct group *getgrgid_r(gid_t, struct group *, char *, int); * extern struct group *getgrnam_r(const char *, struct group *, char *, int); */ typedef struct { struct group grp; char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */ } _Xgetgrparams; #define _XGetgrgid(g,p) getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf)) #define _XGetgrnam(n,p) getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf)) #elif !defined(_POSIX_THREAD_SAFE_FUNCTIONS) /* Non-POSIX API. * extern int getgrgid_r(gid_t, struct group *, char *, int); * extern int getgrnam_r(const char *, struct group *, char *, int); */ typedef struct { struct group grp; char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */ } _Xgetgrparams; #define _XGetgrgid(g,p) \ ((getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf)) ? NULL : &(p).grp)) #define _XGetgrnam(n,p) \ ((getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf)) ? NULL : &(p).grp)) #else /* POSIX final API. * * int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); * int getgrnam_r(const char *, struct group *, char *, size_t, struct group **); */ typedef struct { struct group grp; char buf[X_LINE_MAX]; /* Should be sysconf(_SC_GETGR_R_SIZE_MAX)? */ struct group *result; } _Xgetgrparams; #define _XGetgrgid(g,p) \ ((getgrgid_r((g), &(p).grp, (p).buf, sizeof((p).buf), &(p).result) ? \ NULL : (p).result)) #define _XGetgrnam(n,p) \ ((getgrnam_r((n), &(p).grp, (p).buf, sizeof((p).buf), &(p).result) ? \ NULL : (p).result)) #endif #if defined(X_INCLUDE_GRP_H) && !defined(_XOS_INCLUDED_GRP_H) # define _XOS_INCLUDED_GRP_H #endif #ifdef __cplusplus } /* Close scope of 'extern "C"' declaration which encloses file. */ #endif ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xosdefs.h ================================================ /* * O/S-dependent (mis)feature macro definitions * Copyright 1991, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef _XOSDEFS_H_ # define _XOSDEFS_H_ /* * X_NOT_POSIX means does not have POSIX header files. Lack of this * symbol does NOT mean that the POSIX environment is the default. * You may still have to define _POSIX_SOURCE to get it. */ # ifdef _SCO_DS # ifndef __SCO__ # define __SCO__ # endif # endif # ifdef __i386__ # ifdef SYSV # if !defined(__SCO__) && \ !defined(__UNIXWARE__) && !defined(__sun) # if !defined(_POSIX_SOURCE) # define X_NOT_POSIX # endif # endif # endif # endif # ifdef __sun /* Imake configs define SVR4 on Solaris, but cc & gcc only define __SVR4 * This check allows non-Imake configured programs to build correctly. */ # if defined(__SVR4) && !defined(SVR4) # define SVR4 1 # endif # ifdef SVR4 /* define this to whatever it needs to be */ # define X_POSIX_C_SOURCE 199300L # endif # endif # ifdef WIN32 # ifndef _POSIX_ # define X_NOT_POSIX # endif # endif # ifdef __APPLE__ # define NULL_NOT_ZERO /* Defining any of these will sanitize the namespace to JUST want is defined by * that particular standard. If that happens, we don't get some expected * prototypes, typedefs, etc (like fd_mask). We can define _DARWIN_C_SOURCE to * loosen our belts a tad. */ # if defined(_XOPEN_SOURCE) || defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) # ifndef _DARWIN_C_SOURCE # define _DARWIN_C_SOURCE # endif # endif # endif # ifdef __GNU__ # ifndef PATH_MAX # define PATH_MAX 4096 # endif # ifndef MAXPATHLEN # define MAXPATHLEN 4096 # endif # endif # if defined(__SCO__) || defined(__UNIXWARE__) # ifndef PATH_MAX # define PATH_MAX 1024 # endif # ifndef MAXPATHLEN # define MAXPATHLEN 1024 # endif # endif # if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) \ || defined(__APPLE__) || defined(__DragonFly__) # ifndef CSRG_BASED # define CSRG_BASED # endif # endif #endif /* _XOSDEFS_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xpoll.h ================================================ /* Copyright 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * Copyright © 2005 Daniel Stone * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name of Daniel Stone not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. Daniel Stone makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * DANIEL STONE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL * DANIEL STONE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _XPOLL_H_ #define _XPOLL_H_ #if !defined(WIN32) || defined(__CYGWIN__) #ifndef USE_POLL #include #include /* Get the FD_* macros. */ #include #ifdef CSRG_BASED #include # if BSD < 199103 typedef long fd_mask; # endif #endif #if defined(FD_SETSIZE) && FD_SETSIZE < 512 # define XFD_SETSIZE FD_SETSIZE #else # define XFD_SETSIZE 512 # ifndef FD_SETSIZE # define FD_SETSIZE XFD_SETSIZE # endif #endif #ifndef NBBY #define NBBY 8 /* number of bits in a byte */ #endif #ifndef NFDBITS #define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ #endif #ifndef howmany #define howmany(x,y) (((x)+((y)-1))/(y)) #endif #if defined(BSD) && BSD < 198911 typedef struct fd_set { fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; } fd_set; #endif # define Select(n,r,w,e,t) select(n,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) #define __X_FDS_BITS __fds_bits #ifndef __FDS_BITS # define __FDS_BITS(p) ((p)->__X_FDS_BITS) #endif #define __XFDS_BITS(p, n) (__FDS_BITS(p))[n] #ifndef FD_SET #define FD_SET(n, p) (__XFDS_BITS(p, ((n)/NFDBITS)) |= ((fd_mask)1 << ((n) % NFDBITS))) #endif #ifndef FD_CLR #define FD_CLR(n, p) (__XFDS_BITS((p), ((n)/NFDBITS)) &= ~((fd_mask)1 << ((n) % NFDBITS))) #endif #ifndef FD_ISSET #define FD_ISSET(n, p) ((__XFDS_BITS((p), ((n)/NFDBITS))) & ((fd_mask)1 << ((n) % NFDBITS))) #endif #ifndef FD_ZERO #define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) #endif /* * The howmany(FD_SETSIZE, NFDBITS) computes the number of elements in the * array. before accessing an element in the array we check it exists. * If it does not exist then the compiler discards the code to access it. */ #define XFD_ANYSET(p) \ ((howmany(FD_SETSIZE, NFDBITS) > 0 && (__XFDS_BITS(p, 0))) || \ (howmany(FD_SETSIZE, NFDBITS) > 1 && (__XFDS_BITS(p, 1))) || \ (howmany(FD_SETSIZE, NFDBITS) > 2 && (__XFDS_BITS(p, 2))) || \ (howmany(FD_SETSIZE, NFDBITS) > 3 && (__XFDS_BITS(p, 3))) || \ (howmany(FD_SETSIZE, NFDBITS) > 4 && (__XFDS_BITS(p, 4))) || \ (howmany(FD_SETSIZE, NFDBITS) > 5 && (__XFDS_BITS(p, 5))) || \ (howmany(FD_SETSIZE, NFDBITS) > 6 && (__XFDS_BITS(p, 6))) || \ (howmany(FD_SETSIZE, NFDBITS) > 7 && (__XFDS_BITS(p, 7))) || \ (howmany(FD_SETSIZE, NFDBITS) > 8 && (__XFDS_BITS(p, 8))) || \ (howmany(FD_SETSIZE, NFDBITS) > 9 && (__XFDS_BITS(p, 9))) || \ (howmany(FD_SETSIZE, NFDBITS) > 10 && (__XFDS_BITS(p, 10))) || \ (howmany(FD_SETSIZE, NFDBITS) > 11 && (__XFDS_BITS(p, 11))) || \ (howmany(FD_SETSIZE, NFDBITS) > 12 && (__XFDS_BITS(p, 12))) || \ (howmany(FD_SETSIZE, NFDBITS) > 13 && (__XFDS_BITS(p, 13))) || \ (howmany(FD_SETSIZE, NFDBITS) > 14 && (__XFDS_BITS(p, 14))) || \ (howmany(FD_SETSIZE, NFDBITS) > 15 && (__XFDS_BITS(p, 15)))) #define XFD_COPYSET(src,dst) { \ int __i__; \ for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ __XFDS_BITS((dst), __i__) = __XFDS_BITS((src), __i__); \ } #define XFD_ANDSET(dst,b1,b2) { \ int __i__; \ for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) & (__XFDS_BITS((b2), __i__))); \ } #define XFD_ORSET(dst,b1,b2) { \ int __i__; \ for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ __XFDS_BITS((dst), __i__) = ((__XFDS_BITS((b1), __i__)) | (__XFDS_BITS((b2), __i__))); \ } #define XFD_UNSET(dst,b1) { \ int __i__; \ for (__i__ = 0; __i__ < howmany(FD_SETSIZE, NFDBITS); __i__++) \ __XFDS_BITS((dst), __i__) &= ~(__XFDS_BITS((b1), __i__)); \ } #else /* USE_POLL */ #include #endif /* USE_POLL */ #else /* WIN32 */ #define XFD_SETSIZE 512 #ifndef FD_SETSIZE #define FD_SETSIZE XFD_SETSIZE #endif #include #define Select(n,r,w,e,t) select(0,(fd_set*)r,(fd_set*)w,(fd_set*)e,(struct timeval*)t) #define XFD_SETCOUNT(p) (((fd_set FAR *)(p))->fd_count) #define XFD_FD(p,i) (((fd_set FAR *)(p))->fd_array[i]) #define XFD_ANYSET(p) XFD_SETCOUNT(p) #define XFD_COPYSET(src,dst) { \ u_int __i; \ FD_ZERO(dst); \ for (__i = 0; __i < XFD_SETCOUNT(src) ; __i++) { \ XFD_FD(dst,__i) = XFD_FD(src,__i); \ } \ XFD_SETCOUNT(dst) = XFD_SETCOUNT(src); \ } #define XFD_ANDSET(dst,b1,b2) { \ u_int __i; \ FD_ZERO(dst); \ for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ if (FD_ISSET(XFD_FD(b1,__i), b2)) \ FD_SET(XFD_FD(b1,__i), dst); \ } \ } #define XFD_ORSET(dst,b1,b2) { \ u_int __i; \ if (dst != b1) XFD_COPYSET(b1,dst); \ for (__i = 0; __i < XFD_SETCOUNT(b2) ; __i++) { \ if (!FD_ISSET(XFD_FD(b2,__i), dst)) \ FD_SET(XFD_FD(b2,__i), dst); \ } \ } /* this one is really sub-optimal */ #define XFD_UNSET(dst,b1) { \ u_int __i; \ for (__i = 0; __i < XFD_SETCOUNT(b1) ; __i++) { \ FD_CLR(XFD_FD(b1,__i), dst); \ } \ } /* we have to pay the price of having an array here, unlike with bitmasks calling twice FD_SET with the same fd is not transparent, so be careful */ #undef FD_SET #define FD_SET(fd,set) do { \ if (XFD_SETCOUNT(set) < FD_SETSIZE && !FD_ISSET(fd,set)) \ XFD_FD(set,XFD_SETCOUNT(set)++)=(fd); \ } while(0) #define getdtablesize() FD_SETSIZE #endif /* WIN32 */ #endif /* _XPOLL_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xproto.h ================================================ /* Definitions for the X window system used by server and c bindings */ /* * This packet-construction scheme makes the following assumptions: * * 1. The compiler is able * to generate code which addresses one- and two-byte quantities. * In the worst case, this would be done with bit-fields. If bit-fields * are used it may be necessary to reorder the request fields in this file, * depending on the order in which the machine assigns bit fields to * machine words. There may also be a problem with sign extension, * as K+R specify that bitfields are always unsigned. * * 2. 2- and 4-byte fields in packet structures must be ordered by hand * such that they are naturally-aligned, so that no compiler will ever * insert padding bytes. * * 3. All packets are hand-padded to a multiple of 4 bytes, for * the same reason. */ #ifndef XPROTO_H #define XPROTO_H /*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #include #include /* * Define constants for the sizes of the network packets. The sz_ prefix is * used instead of something more descriptive so that the symbols are no more * than 32 characters in length (which causes problems for some compilers). */ #define sz_xSegment 8 #define sz_xPoint 4 #define sz_xRectangle 8 #define sz_xArc 12 #define sz_xConnClientPrefix 12 #define sz_xConnSetupPrefix 8 #define sz_xConnSetup 32 #define sz_xPixmapFormat 8 #define sz_xDepth 8 #define sz_xVisualType 24 #define sz_xWindowRoot 40 #define sz_xTimecoord 8 #define sz_xHostEntry 4 #define sz_xCharInfo 12 #define sz_xFontProp 8 #define sz_xTextElt 2 #define sz_xColorItem 12 #define sz_xrgb 8 #define sz_xGenericReply 32 #define sz_xGetWindowAttributesReply 44 #define sz_xGetGeometryReply 32 #define sz_xQueryTreeReply 32 #define sz_xInternAtomReply 32 #define sz_xGetAtomNameReply 32 #define sz_xGetPropertyReply 32 #define sz_xListPropertiesReply 32 #define sz_xGetSelectionOwnerReply 32 #define sz_xGrabPointerReply 32 #define sz_xQueryPointerReply 32 #define sz_xGetMotionEventsReply 32 #define sz_xTranslateCoordsReply 32 #define sz_xGetInputFocusReply 32 #define sz_xQueryKeymapReply 40 #define sz_xQueryFontReply 60 #define sz_xQueryTextExtentsReply 32 #define sz_xListFontsReply 32 #define sz_xGetFontPathReply 32 #define sz_xGetImageReply 32 #define sz_xListInstalledColormapsReply 32 #define sz_xAllocColorReply 32 #define sz_xAllocNamedColorReply 32 #define sz_xAllocColorCellsReply 32 #define sz_xAllocColorPlanesReply 32 #define sz_xQueryColorsReply 32 #define sz_xLookupColorReply 32 #define sz_xQueryBestSizeReply 32 #define sz_xQueryExtensionReply 32 #define sz_xListExtensionsReply 32 #define sz_xSetMappingReply 32 #define sz_xGetKeyboardControlReply 52 #define sz_xGetPointerControlReply 32 #define sz_xGetScreenSaverReply 32 #define sz_xListHostsReply 32 #define sz_xSetModifierMappingReply 32 #define sz_xError 32 #define sz_xEvent 32 #define sz_xKeymapEvent 32 #define sz_xReq 4 #define sz_xResourceReq 8 #define sz_xCreateWindowReq 32 #define sz_xChangeWindowAttributesReq 12 #define sz_xChangeSaveSetReq 8 #define sz_xReparentWindowReq 16 #define sz_xConfigureWindowReq 12 #define sz_xCirculateWindowReq 8 #define sz_xInternAtomReq 8 #define sz_xChangePropertyReq 24 #define sz_xDeletePropertyReq 12 #define sz_xGetPropertyReq 24 #define sz_xSetSelectionOwnerReq 16 #define sz_xConvertSelectionReq 24 #define sz_xSendEventReq 44 #define sz_xGrabPointerReq 24 #define sz_xGrabButtonReq 24 #define sz_xUngrabButtonReq 12 #define sz_xChangeActivePointerGrabReq 16 #define sz_xGrabKeyboardReq 16 #define sz_xGrabKeyReq 16 #define sz_xUngrabKeyReq 12 #define sz_xAllowEventsReq 8 #define sz_xGetMotionEventsReq 16 #define sz_xTranslateCoordsReq 16 #define sz_xWarpPointerReq 24 #define sz_xSetInputFocusReq 12 #define sz_xOpenFontReq 12 #define sz_xQueryTextExtentsReq 8 #define sz_xListFontsReq 8 #define sz_xSetFontPathReq 8 #define sz_xCreatePixmapReq 16 #define sz_xCreateGCReq 16 #define sz_xChangeGCReq 12 #define sz_xCopyGCReq 16 #define sz_xSetDashesReq 12 #define sz_xSetClipRectanglesReq 12 #define sz_xCopyAreaReq 28 #define sz_xCopyPlaneReq 32 #define sz_xPolyPointReq 12 #define sz_xPolySegmentReq 12 #define sz_xFillPolyReq 16 #define sz_xPutImageReq 24 #define sz_xGetImageReq 20 #define sz_xPolyTextReq 16 #define sz_xImageTextReq 16 #define sz_xCreateColormapReq 16 #define sz_xCopyColormapAndFreeReq 12 #define sz_xAllocColorReq 16 #define sz_xAllocNamedColorReq 12 #define sz_xAllocColorCellsReq 12 #define sz_xAllocColorPlanesReq 16 #define sz_xFreeColorsReq 12 #define sz_xStoreColorsReq 8 #define sz_xStoreNamedColorReq 16 #define sz_xQueryColorsReq 8 #define sz_xLookupColorReq 12 #define sz_xCreateCursorReq 32 #define sz_xCreateGlyphCursorReq 32 #define sz_xRecolorCursorReq 20 #define sz_xQueryBestSizeReq 12 #define sz_xQueryExtensionReq 8 #define sz_xChangeKeyboardControlReq 8 #define sz_xBellReq 4 #define sz_xChangePointerControlReq 12 #define sz_xSetScreenSaverReq 12 #define sz_xChangeHostsReq 8 #define sz_xListHostsReq 4 #define sz_xChangeModeReq 4 #define sz_xRotatePropertiesReq 12 #define sz_xReply 32 #define sz_xGrabKeyboardReply 32 #define sz_xListFontsWithInfoReply 60 #define sz_xSetPointerMappingReply 32 #define sz_xGetKeyboardMappingReply 32 #define sz_xGetPointerMappingReply 32 #define sz_xGetModifierMappingReply 32 #define sz_xListFontsWithInfoReq 8 #define sz_xPolyLineReq 12 #define sz_xPolyArcReq 12 #define sz_xPolyRectangleReq 12 #define sz_xPolyFillRectangleReq 12 #define sz_xPolyFillArcReq 12 #define sz_xPolyText8Req 16 #define sz_xPolyText16Req 16 #define sz_xImageText8Req 16 #define sz_xImageText16Req 16 #define sz_xSetPointerMappingReq 4 #define sz_xForceScreenSaverReq 4 #define sz_xSetCloseDownModeReq 4 #define sz_xClearAreaReq 16 #define sz_xSetAccessControlReq 4 #define sz_xGetKeyboardMappingReq 8 #define sz_xSetModifierMappingReq 4 #define sz_xPropIconSize 24 #define sz_xChangeKeyboardMappingReq 8 /* For the purpose of the structure definitions in this file, we must redefine the following types in terms of Xmd.h's types, which may include bit fields. All of these are #undef'd at the end of this file, restoring the definitions in X.h. */ #define Window CARD32 #define Drawable CARD32 #define Font CARD32 #define Pixmap CARD32 #define Cursor CARD32 #define Colormap CARD32 #define GContext CARD32 #define Atom CARD32 #define VisualID CARD32 #define Time CARD32 #define KeyCode CARD8 #define KeySym CARD32 #define X_TCP_PORT 6000 /* add display number */ #define xTrue 1 #define xFalse 0 typedef CARD16 KeyButMask; /***************** Connection setup structures. See Chapter 8: Connection Setup of the X Window System Protocol specification for details. *****************/ /* Client initiates handshake with this data, followed by the strings * for the auth protocol & data. */ typedef struct { CARD8 byteOrder; BYTE pad; CARD16 majorVersion B16, minorVersion B16; CARD16 nbytesAuthProto B16; /* Authorization protocol */ CARD16 nbytesAuthString B16; /* Authorization string */ CARD16 pad2 B16; } xConnClientPrefix; /* Server response to xConnClientPrefix. * * If success == Success, this is followed by xConnSetup and * numRoots xWindowRoot structs. * * If success == Failure, this is followed by a reason string. * * The protocol also defines a case of success == Authenticate, but * that doesn't seem to have ever been implemented by the X Consortium. */ typedef struct { CARD8 success; BYTE lengthReason; /*num bytes in string following if failure */ CARD16 majorVersion B16, minorVersion B16; CARD16 length B16; /* 1/4 additional bytes in setup info */ } xConnSetupPrefix; typedef struct { CARD32 release B32; CARD32 ridBase B32, ridMask B32; CARD32 motionBufferSize B32; CARD16 nbytesVendor B16; /* number of bytes in vendor string */ CARD16 maxRequestSize B16; CARD8 numRoots; /* number of roots structs to follow */ CARD8 numFormats; /* number of pixmap formats */ CARD8 imageByteOrder; /* LSBFirst, MSBFirst */ CARD8 bitmapBitOrder; /* LeastSignificant, MostSign...*/ CARD8 bitmapScanlineUnit, /* 8, 16, 32 */ bitmapScanlinePad; /* 8, 16, 32 */ KeyCode minKeyCode, maxKeyCode; CARD32 pad2 B32; } xConnSetup; typedef struct { CARD8 depth; CARD8 bitsPerPixel; CARD8 scanLinePad; CARD8 pad1; CARD32 pad2 B32; } xPixmapFormat; /* window root */ typedef struct { CARD8 depth; CARD8 pad1; CARD16 nVisuals B16; /* number of xVisualType structures following */ CARD32 pad2 B32; } xDepth; typedef struct { VisualID visualID B32; #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 bitsPerRGB; CARD16 colormapEntries B16; CARD32 redMask B32, greenMask B32, blueMask B32; CARD32 pad B32; } xVisualType; typedef struct { Window windowId B32; Colormap defaultColormap B32; CARD32 whitePixel B32, blackPixel B32; CARD32 currentInputMask B32; CARD16 pixWidth B16, pixHeight B16; CARD16 mmWidth B16, mmHeight B16; CARD16 minInstalledMaps B16, maxInstalledMaps B16; VisualID rootVisualID B32; CARD8 backingStore; BOOL saveUnders; CARD8 rootDepth; CARD8 nDepths; /* number of xDepth structures following */ } xWindowRoot; /***************************************************************** * Structure Defns * Structures needed for replies *****************************************************************/ /* Used in GetMotionEvents */ typedef struct { CARD32 time B32; INT16 x B16, y B16; } xTimecoord; typedef struct { CARD8 family; BYTE pad; CARD16 length B16; } xHostEntry; typedef struct { INT16 leftSideBearing B16, rightSideBearing B16, characterWidth B16, ascent B16, descent B16; CARD16 attributes B16; } xCharInfo; typedef struct { Atom name B32; CARD32 value B32; } xFontProp; /* * non-aligned big-endian font ID follows this struct */ typedef struct { /* followed by string */ CARD8 len; /* number of *characters* in string, or FontChange (255) for font change, or 0 if just delta given */ INT8 delta; } xTextElt; typedef struct { CARD32 pixel B32; CARD16 red B16, green B16, blue B16; CARD8 flags; /* DoRed, DoGreen, DoBlue booleans */ CARD8 pad; } xColorItem; typedef struct { CARD16 red B16, green B16, blue B16, pad B16; } xrgb; typedef CARD8 KEYCODE; /***************** * XRep: * meant to be 32 byte quantity *****************/ /* GenericReply is the common format of all replies. The "data" items are specific to each individual reply type. */ typedef struct { BYTE type; /* X_Reply */ BYTE data1; /* depends on reply type */ CARD16 sequenceNumber B16; /* of last request received by server */ CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */ CARD32 data00 B32; CARD32 data01 B32; CARD32 data02 B32; CARD32 data03 B32; CARD32 data04 B32; CARD32 data05 B32; } xGenericReply; /* Individual reply formats. */ typedef struct { BYTE type; /* X_Reply */ CARD8 backingStore; CARD16 sequenceNumber B16; CARD32 length B32; /* NOT 0; this is an extra-large reply */ VisualID visualID B32; #if defined(__cplusplus) || defined(c_plusplus) CARD16 c_class B16; #else CARD16 class B16; #endif CARD8 bitGravity; CARD8 winGravity; CARD32 backingBitPlanes B32; CARD32 backingPixel B32; BOOL saveUnder; BOOL mapInstalled; CARD8 mapState; BOOL override; Colormap colormap B32; CARD32 allEventMasks B32; CARD32 yourEventMask B32; CARD16 doNotPropagateMask B16; CARD16 pad B16; } xGetWindowAttributesReply; typedef struct { BYTE type; /* X_Reply */ CARD8 depth; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ Window root B32; INT16 x B16, y B16; CARD16 width B16, height B16; CARD16 borderWidth B16; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; } xGetGeometryReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; Window root B32, parent B32; CARD16 nChildren B16; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xQueryTreeReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ Atom atom B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xInternAtomReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* of additional bytes */ CARD16 nameLength B16; /* # of characters in name */ CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xGetAtomNameReply; typedef struct { BYTE type; /* X_Reply */ CARD8 format; CARD16 sequenceNumber B16; CARD32 length B32; /* of additional bytes */ Atom propertyType B32; CARD32 bytesAfter B32; CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */ CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; } xGetPropertyReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nProperties B16; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xListPropertiesReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ Window owner B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xGetSelectionOwnerReply; typedef struct { BYTE type; /* X_Reply */ BYTE status; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xGrabPointerReply; typedef xGrabPointerReply xGrabKeyboardReply; typedef struct { BYTE type; /* X_Reply */ BOOL sameScreen; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ Window root B32, child B32; INT16 rootX B16, rootY B16, winX B16, winY B16; CARD16 mask B16; CARD16 pad1 B16; CARD32 pad B32; } xQueryPointerReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 nEvents B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xGetMotionEventsReply; typedef struct { BYTE type; /* X_Reply */ BOOL sameScreen; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ Window child B32; INT16 dstX B16, dstY B16; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xTranslateCoordsReply; typedef struct { BYTE type; /* X_Reply */ CARD8 revertTo; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ Window focus B32; CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xGetInputFocusReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 2, NOT 0; this is an extra-large reply */ BYTE map[32]; } xQueryKeymapReply; /* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */ typedef struct _xQueryFontReply { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* definitely > 0, even if "nCharInfos" is 0 */ xCharInfo minBounds; CARD32 walign1 B32; xCharInfo maxBounds; CARD32 walign2 B32; CARD16 minCharOrByte2 B16, maxCharOrByte2 B16; CARD16 defaultChar B16; CARD16 nFontProps B16; /* followed by this many xFontProp structures */ CARD8 drawDirection; CARD8 minByte1, maxByte1; BOOL allCharsExist; INT16 fontAscent B16, fontDescent B16; CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */ } xQueryFontReply; typedef struct { BYTE type; /* X_Reply */ CARD8 drawDirection; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ INT16 fontAscent B16, fontDescent B16; INT16 overallAscent B16, overallDescent B16; INT32 overallWidth B32, overallLeft B32, overallRight B32; CARD32 pad B32; } xQueryTextExtentsReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nFonts B16; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xListFontsReply; /* Warning: this MUST match (up to component renaming) xQueryFontReply */ typedef struct { BYTE type; /* X_Reply */ CARD8 nameLength; /* 0 indicates end-of-reply-sequence */ CARD16 sequenceNumber B16; CARD32 length B32; /* definitely > 0, even if "nameLength" is 0 */ xCharInfo minBounds; CARD32 walign1 B32; xCharInfo maxBounds; CARD32 walign2 B32; CARD16 minCharOrByte2 B16, maxCharOrByte2 B16; CARD16 defaultChar B16; CARD16 nFontProps B16; /* followed by this many xFontProp structures */ CARD8 drawDirection; CARD8 minByte1, maxByte1; BOOL allCharsExist; INT16 fontAscent B16, fontDescent B16; CARD32 nReplies B32; /* hint as to how many more replies might be coming */ } xListFontsWithInfoReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nPaths B16; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xGetFontPathReply; typedef struct { BYTE type; /* X_Reply */ CARD8 depth; CARD16 sequenceNumber B16; CARD32 length B32; VisualID visual B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xGetImageReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nColormaps B16; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xListInstalledColormapsReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD16 red B16, green B16, blue B16; CARD16 pad2 B16; CARD32 pixel B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xAllocColorReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD32 pixel B32; CARD16 exactRed B16, exactGreen B16, exactBlue B16; CARD16 screenRed B16, screenGreen B16, screenBlue B16; CARD32 pad2 B32; CARD32 pad3 B32; } xAllocNamedColorReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nPixels B16, nMasks B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xAllocColorCellsReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nPixels B16; CARD16 pad2 B16; CARD32 redMask B32, greenMask B32, blueMask B32; CARD32 pad3 B32; CARD32 pad4 B32; } xAllocColorPlanesReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nColors B16; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xQueryColorsReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD16 exactRed B16, exactGreen B16, exactBlue B16; CARD16 screenRed B16, screenGreen B16, screenBlue B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xLookupColorReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD16 width B16, height B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xQueryBestSizeReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ BOOL present; CARD8 major_opcode; CARD8 first_event; CARD8 first_error; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xQueryExtensionReply; typedef struct { BYTE type; /* X_Reply */ CARD8 nExtensions; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xListExtensionsReply; typedef struct { BYTE type; /* X_Reply */ CARD8 success; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xSetMappingReply; typedef xSetMappingReply xSetPointerMappingReply; typedef xSetMappingReply xSetModifierMappingReply; typedef struct { BYTE type; /* X_Reply */ CARD8 nElts; /* how many elements does the map have */ CARD16 sequenceNumber B16; CARD32 length B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xGetPointerMappingReply; typedef struct { BYTE type; CARD8 keySymsPerKeyCode; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xGetKeyboardMappingReply; typedef struct { BYTE type; CARD8 numKeyPerModifier; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xGetModifierMappingReply; typedef struct { BYTE type; /* X_Reply */ BOOL globalAutoRepeat; CARD16 sequenceNumber B16; CARD32 length B32; /* 5 */ CARD32 ledMask B32; CARD8 keyClickPercent, bellPercent; CARD16 bellPitch B16, bellDuration B16; CARD16 pad B16; BYTE map[32]; /* bit masks start here */ } xGetKeyboardControlReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD16 accelNumerator B16, accelDenominator B16; CARD16 threshold B16; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xGetPointerControlReply; typedef struct { BYTE type; /* X_Reply */ BYTE pad1; CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD16 timeout B16, interval B16; BOOL preferBlanking; BOOL allowExposures; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xGetScreenSaverReply; typedef struct { BYTE type; /* X_Reply */ BOOL enabled; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nHosts B16; CARD16 pad1 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xListHostsReply; /***************************************************************** * Xerror * All errors are 32 bytes *****************************************************************/ typedef struct { BYTE type; /* X_Error */ BYTE errorCode; CARD16 sequenceNumber B16; /* the nth request from this client */ CARD32 resourceID B32; CARD16 minorCode B16; CARD8 majorCode; BYTE pad1; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xError; /***************************************************************** * xEvent * All events are 32 bytes *****************************************************************/ typedef struct _xEvent { union { struct { BYTE type; BYTE detail; CARD16 sequenceNumber B16; } u; struct { CARD32 pad00 B32; Time time B32; Window root B32, event B32, child B32; INT16 rootX B16, rootY B16, eventX B16, eventY B16; KeyButMask state B16; BOOL sameScreen; BYTE pad1; } keyButtonPointer; struct { CARD32 pad00 B32; Time time B32; Window root B32, event B32, child B32; INT16 rootX B16, rootY B16, eventX B16, eventY B16; KeyButMask state B16; BYTE mode; /* really XMode */ BYTE flags; /* sameScreen and focus booleans, packed together */ #define ELFlagFocus (1<<0) #define ELFlagSameScreen (1<<1) } enterLeave; struct { CARD32 pad00 B32; Window window B32; BYTE mode; /* really XMode */ BYTE pad1, pad2, pad3; } focus; struct { CARD32 pad00 B32; Window window B32; CARD16 x B16, y B16, width B16, height B16; CARD16 count B16; CARD16 pad2 B16; } expose; struct { CARD32 pad00 B32; Drawable drawable B32; CARD16 x B16, y B16, width B16, height B16; CARD16 minorEvent B16; CARD16 count B16; BYTE majorEvent; BYTE pad1, pad2, pad3; } graphicsExposure; struct { CARD32 pad00 B32; Drawable drawable B32; CARD16 minorEvent B16; BYTE majorEvent; BYTE bpad; } noExposure; struct { CARD32 pad00 B32; Window window B32; CARD8 state; BYTE pad1, pad2, pad3; } visibility; struct { CARD32 pad00 B32; Window parent B32, window B32; INT16 x B16, y B16; CARD16 width B16, height B16, borderWidth B16; BOOL override; BYTE bpad; } createNotify; /* * The event fields in the structures for DestroyNotify, UnmapNotify, * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify, * must be at the same offset because server internal code is depending upon * this to patch up the events before they are delivered. * Also note that MapRequest, ConfigureRequest and CirculateRequest have * the same offset for the event window. */ struct { CARD32 pad00 B32; Window event B32, window B32; } destroyNotify; struct { CARD32 pad00 B32; Window event B32, window B32; BOOL fromConfigure; BYTE pad1, pad2, pad3; } unmapNotify; struct { CARD32 pad00 B32; Window event B32, window B32; BOOL override; BYTE pad1, pad2, pad3; } mapNotify; struct { CARD32 pad00 B32; Window parent B32, window B32; } mapRequest; struct { CARD32 pad00 B32; Window event B32, window B32, parent B32; INT16 x B16, y B16; BOOL override; BYTE pad1, pad2, pad3; } reparent; struct { CARD32 pad00 B32; Window event B32, window B32, aboveSibling B32; INT16 x B16, y B16; CARD16 width B16, height B16, borderWidth B16; BOOL override; BYTE bpad; } configureNotify; struct { CARD32 pad00 B32; Window parent B32, window B32, sibling B32; INT16 x B16, y B16; CARD16 width B16, height B16, borderWidth B16; CARD16 valueMask B16; CARD32 pad1 B32; } configureRequest; struct { CARD32 pad00 B32; Window event B32, window B32; INT16 x B16, y B16; CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32; } gravity; struct { CARD32 pad00 B32; Window window B32; CARD16 width B16, height B16; } resizeRequest; struct { /* The event field in the circulate record is really the parent when this is used as a CirculateRequest instead of a CirculateNotify */ CARD32 pad00 B32; Window event B32, window B32, parent B32; BYTE place; /* Top or Bottom */ BYTE pad1, pad2, pad3; } circulate; struct { CARD32 pad00 B32; Window window B32; Atom atom B32; Time time B32; BYTE state; /* NewValue or Deleted */ BYTE pad1; CARD16 pad2 B16; } property; struct { CARD32 pad00 B32; Time time B32; Window window B32; Atom atom B32; } selectionClear; struct { CARD32 pad00 B32; Time time B32; Window owner B32, requestor B32; Atom selection B32, target B32, property B32; } selectionRequest; struct { CARD32 pad00 B32; Time time B32; Window requestor B32; Atom selection B32, target B32, property B32; } selectionNotify; struct { CARD32 pad00 B32; Window window B32; Colormap colormap B32; #if defined(__cplusplus) || defined(c_plusplus) BOOL c_new; #else BOOL new; #endif BYTE state; /* Installed or UnInstalled */ BYTE pad1, pad2; } colormap; struct { CARD32 pad00 B32; CARD8 request; KeyCode firstKeyCode; CARD8 count; BYTE pad1; } mappingNotify; struct { CARD32 pad00 B32; Window window B32; union { struct { Atom type B32; INT32 longs0 B32; INT32 longs1 B32; INT32 longs2 B32; INT32 longs3 B32; INT32 longs4 B32; } l; struct { Atom type B32; INT16 shorts0 B16; INT16 shorts1 B16; INT16 shorts2 B16; INT16 shorts3 B16; INT16 shorts4 B16; INT16 shorts5 B16; INT16 shorts6 B16; INT16 shorts7 B16; INT16 shorts8 B16; INT16 shorts9 B16; } s; struct { Atom type B32; INT8 bytes[20]; } b; } u; } clientMessage; } u; } xEvent; /********************************************************* * * Generic event * * Those events are not part of the core protocol spec and can be used by * various extensions. * type is always GenericEvent * extension is the minor opcode of the extension the event belongs to. * evtype is the actual event type, unique __per extension__. * * GenericEvents can be longer than 32 bytes, with the length field * specifying the number of 4 byte blocks after the first 32 bytes. * * */ typedef struct { BYTE type; CARD8 extension; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 evtype B16; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xGenericEvent; /* KeymapNotify events are not included in the above union because they are different from all other events: they do not have a "detail" or "sequenceNumber", so there is room for a 248-bit key mask. */ typedef struct { BYTE type; BYTE map[31]; } xKeymapEvent; #define XEventSize (sizeof(xEvent)) /* XReply is the union of all the replies above whose "fixed part" fits in 32 bytes. It does NOT include GetWindowAttributesReply, QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply ListFontsWithInfoReply */ typedef union { xGenericReply generic; xGetGeometryReply geom; xQueryTreeReply tree; xInternAtomReply atom; xGetAtomNameReply atomName; xGetPropertyReply property; xListPropertiesReply listProperties; xGetSelectionOwnerReply selection; xGrabPointerReply grabPointer; xGrabKeyboardReply grabKeyboard; xQueryPointerReply pointer; xGetMotionEventsReply motionEvents; xTranslateCoordsReply coords; xGetInputFocusReply inputFocus; xQueryTextExtentsReply textExtents; xListFontsReply fonts; xGetFontPathReply fontPath; xGetImageReply image; xListInstalledColormapsReply colormaps; xAllocColorReply allocColor; xAllocNamedColorReply allocNamedColor; xAllocColorCellsReply colorCells; xAllocColorPlanesReply colorPlanes; xQueryColorsReply colors; xLookupColorReply lookupColor; xQueryBestSizeReply bestSize; xQueryExtensionReply extension; xListExtensionsReply extensions; xSetModifierMappingReply setModifierMapping; xGetModifierMappingReply getModifierMapping; xSetPointerMappingReply setPointerMapping; xGetKeyboardMappingReply getKeyboardMapping; xGetPointerMappingReply getPointerMapping; xGetPointerControlReply pointerControl; xGetScreenSaverReply screenSaver; xListHostsReply hosts; xError error; xEvent event; } xReply; /***************************************************************** * REQUESTS *****************************************************************/ /* Request structure */ typedef struct _xReq { CARD8 reqType; CARD8 data; /* meaning depends on request type */ CARD16 length B16; /* length in 4 bytes quantities of whole request, including this header */ } xReq; /***************************************************************** * structures that follow request. *****************************************************************/ /* ResourceReq is used for any request which has a resource ID (or Atom or Time) as its one and only argument. */ typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; CARD32 id B32; /* a Window, Drawable, Font, GContext, Pixmap, etc. */ } xResourceReq; typedef struct { CARD8 reqType; CARD8 depth; CARD16 length B16; Window wid B32, parent B32; INT16 x B16, y B16; CARD16 width B16, height B16, borderWidth B16; #if defined(__cplusplus) || defined(c_plusplus) CARD16 c_class B16; #else CARD16 class B16; #endif VisualID visual B32; CARD32 mask B32; } xCreateWindowReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Window window B32; CARD32 valueMask B32; } xChangeWindowAttributesReq; typedef struct { CARD8 reqType; BYTE mode; CARD16 length B16; Window window B32; } xChangeSaveSetReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Window window B32, parent B32; INT16 x B16, y B16; } xReparentWindowReq; typedef struct { CARD8 reqType; CARD8 pad; CARD16 length B16; Window window B32; CARD16 mask B16; CARD16 pad2 B16; } xConfigureWindowReq; typedef struct { CARD8 reqType; CARD8 direction; CARD16 length B16; Window window B32; } xCirculateWindowReq; typedef struct { /* followed by padded string */ CARD8 reqType; BOOL onlyIfExists; CARD16 length B16; CARD16 nbytes B16; /* number of bytes in string */ CARD16 pad B16; } xInternAtomReq; typedef struct { CARD8 reqType; CARD8 mode; CARD16 length B16; Window window B32; Atom property B32, type B32; CARD8 format; BYTE pad[3]; CARD32 nUnits B32; /* length of stuff following, depends on format */ } xChangePropertyReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Window window B32; Atom property B32; } xDeletePropertyReq; typedef struct { CARD8 reqType; #if defined(__cplusplus) || defined(c_plusplus) BOOL c_delete; #else BOOL delete; #endif CARD16 length B16; Window window B32; Atom property B32, type B32; CARD32 longOffset B32; CARD32 longLength B32; } xGetPropertyReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Window window B32; Atom selection B32; Time time B32; } xSetSelectionOwnerReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Window requestor B32; Atom selection B32, target B32, property B32; Time time B32; } xConvertSelectionReq; typedef struct { CARD8 reqType; BOOL propagate; CARD16 length B16; Window destination B32; CARD32 eventMask B32; xEvent event; } xSendEventReq; typedef struct { CARD8 reqType; BOOL ownerEvents; CARD16 length B16; Window grabWindow B32; CARD16 eventMask B16; BYTE pointerMode, keyboardMode; Window confineTo B32; Cursor cursor B32; Time time B32; } xGrabPointerReq; typedef struct { CARD8 reqType; BOOL ownerEvents; CARD16 length B16; Window grabWindow B32; CARD16 eventMask B16; BYTE pointerMode, keyboardMode; Window confineTo B32; Cursor cursor B32; CARD8 button; BYTE pad; CARD16 modifiers B16; } xGrabButtonReq; typedef struct { CARD8 reqType; CARD8 button; CARD16 length B16; Window grabWindow B32; CARD16 modifiers B16; CARD16 pad B16; } xUngrabButtonReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Cursor cursor B32; Time time B32; CARD16 eventMask B16; CARD16 pad2 B16; } xChangeActivePointerGrabReq; typedef struct { CARD8 reqType; BOOL ownerEvents; CARD16 length B16; Window grabWindow B32; Time time B32; BYTE pointerMode, keyboardMode; CARD16 pad B16; } xGrabKeyboardReq; typedef struct { CARD8 reqType; BOOL ownerEvents; CARD16 length B16; Window grabWindow B32; CARD16 modifiers B16; CARD8 key; BYTE pointerMode, keyboardMode; BYTE pad1, pad2, pad3; } xGrabKeyReq; typedef struct { CARD8 reqType; CARD8 key; CARD16 length B16; Window grabWindow B32; CARD16 modifiers B16; CARD16 pad B16; } xUngrabKeyReq; typedef struct { CARD8 reqType; CARD8 mode; CARD16 length B16; Time time B32; } xAllowEventsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Window window B32; Time start B32, stop B32; } xGetMotionEventsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Window srcWid B32, dstWid B32; INT16 srcX B16, srcY B16; } xTranslateCoordsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Window srcWid B32, dstWid B32; INT16 srcX B16, srcY B16; CARD16 srcWidth B16, srcHeight B16; INT16 dstX B16, dstY B16; } xWarpPointerReq; typedef struct { CARD8 reqType; CARD8 revertTo; CARD16 length B16; Window focus B32; Time time B32; } xSetInputFocusReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Font fid B32; CARD16 nbytes B16; BYTE pad1, pad2; /* string follows on word boundary */ } xOpenFontReq; typedef struct { CARD8 reqType; BOOL oddLength; CARD16 length B16; Font fid B32; } xQueryTextExtentsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; CARD16 maxNames B16; CARD16 nbytes B16; /* followed immediately by string bytes */ } xListFontsReq; typedef xListFontsReq xListFontsWithInfoReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; CARD16 nFonts B16; BYTE pad1, pad2; /* LISTofSTRING8 follows on word boundary */ } xSetFontPathReq; typedef struct { CARD8 reqType; CARD8 depth; CARD16 length B16; Pixmap pid B32; Drawable drawable B32; CARD16 width B16, height B16; } xCreatePixmapReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; GContext gc B32; Drawable drawable B32; CARD32 mask B32; } xCreateGCReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; GContext gc B32; CARD32 mask B32; } xChangeGCReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; GContext srcGC B32, dstGC B32; CARD32 mask B32; } xCopyGCReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; GContext gc B32; CARD16 dashOffset B16; CARD16 nDashes B16; /* length LISTofCARD8 of values following */ } xSetDashesReq; typedef struct { CARD8 reqType; BYTE ordering; CARD16 length B16; GContext gc B32; INT16 xOrigin B16, yOrigin B16; } xSetClipRectanglesReq; typedef struct { CARD8 reqType; BOOL exposures; CARD16 length B16; Window window B32; INT16 x B16, y B16; CARD16 width B16, height B16; } xClearAreaReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Drawable srcDrawable B32, dstDrawable B32; GContext gc B32; INT16 srcX B16, srcY B16, dstX B16, dstY B16; CARD16 width B16, height B16; } xCopyAreaReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Drawable srcDrawable B32, dstDrawable B32; GContext gc B32; INT16 srcX B16, srcY B16, dstX B16, dstY B16; CARD16 width B16, height B16; CARD32 bitPlane B32; } xCopyPlaneReq; typedef struct { CARD8 reqType; BYTE coordMode; CARD16 length B16; Drawable drawable B32; GContext gc B32; } xPolyPointReq; typedef xPolyPointReq xPolyLineReq; /* same request structure */ /* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */ typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Drawable drawable B32; GContext gc B32; } xPolySegmentReq; typedef xPolySegmentReq xPolyArcReq; typedef xPolySegmentReq xPolyRectangleReq; typedef xPolySegmentReq xPolyFillRectangleReq; typedef xPolySegmentReq xPolyFillArcReq; typedef struct _FillPolyReq { CARD8 reqType; BYTE pad; CARD16 length B16; Drawable drawable B32; GContext gc B32; BYTE shape; BYTE coordMode; CARD16 pad1 B16; } xFillPolyReq; typedef struct _PutImageReq { CARD8 reqType; CARD8 format; CARD16 length B16; Drawable drawable B32; GContext gc B32; CARD16 width B16, height B16; INT16 dstX B16, dstY B16; CARD8 leftPad; CARD8 depth; CARD16 pad B16; } xPutImageReq; typedef struct { CARD8 reqType; CARD8 format; CARD16 length B16; Drawable drawable B32; INT16 x B16, y B16; CARD16 width B16, height B16; CARD32 planeMask B32; } xGetImageReq; /* the following used by PolyText8 and PolyText16 */ typedef struct { CARD8 reqType; CARD8 pad; CARD16 length B16; Drawable drawable B32; GContext gc B32; INT16 x B16, y B16; /* items (xTextElt) start after struct */ } xPolyTextReq; typedef xPolyTextReq xPolyText8Req; typedef xPolyTextReq xPolyText16Req; typedef struct { CARD8 reqType; BYTE nChars; CARD16 length B16; Drawable drawable B32; GContext gc B32; INT16 x B16, y B16; } xImageTextReq; typedef xImageTextReq xImageText8Req; typedef xImageTextReq xImageText16Req; typedef struct { CARD8 reqType; BYTE alloc; CARD16 length B16; Colormap mid B32; Window window B32; VisualID visual B32; } xCreateColormapReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Colormap mid B32; Colormap srcCmap B32; } xCopyColormapAndFreeReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Colormap cmap B32; CARD16 red B16, green B16, blue B16; CARD16 pad2 B16; } xAllocColorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Colormap cmap B32; CARD16 nbytes B16; /* followed by structure */ BYTE pad1, pad2; } xAllocNamedColorReq; typedef struct { CARD8 reqType; BOOL contiguous; CARD16 length B16; Colormap cmap B32; CARD16 colors B16, planes B16; } xAllocColorCellsReq; typedef struct { CARD8 reqType; BOOL contiguous; CARD16 length B16; Colormap cmap B32; CARD16 colors B16, red B16, green B16, blue B16; } xAllocColorPlanesReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Colormap cmap B32; CARD32 planeMask B32; } xFreeColorsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Colormap cmap B32; } xStoreColorsReq; typedef struct { CARD8 reqType; CARD8 flags; /* DoRed, DoGreen, DoBlue, as in xColorItem */ CARD16 length B16; Colormap cmap B32; CARD32 pixel B32; CARD16 nbytes B16; /* number of name string bytes following structure */ BYTE pad1, pad2; } xStoreNamedColorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Colormap cmap B32; } xQueryColorsReq; typedef struct { /* followed by string of length len */ CARD8 reqType; BYTE pad; CARD16 length B16; Colormap cmap B32; CARD16 nbytes B16; /* number of string bytes following structure*/ BYTE pad1, pad2; } xLookupColorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Cursor cid B32; Pixmap source B32, mask B32; CARD16 foreRed B16, foreGreen B16, foreBlue B16; CARD16 backRed B16, backGreen B16, backBlue B16; CARD16 x B16, y B16; } xCreateCursorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Cursor cid B32; Font source B32, mask B32; CARD16 sourceChar B16, maskChar B16; CARD16 foreRed B16, foreGreen B16, foreBlue B16; CARD16 backRed B16, backGreen B16, backBlue B16; } xCreateGlyphCursorReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; Cursor cursor B32; CARD16 foreRed B16, foreGreen B16, foreBlue B16; CARD16 backRed B16, backGreen B16, backBlue B16; } xRecolorCursorReq; typedef struct { CARD8 reqType; #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD16 length B16; Drawable drawable B32; CARD16 width B16, height B16; } xQueryBestSizeReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; CARD16 nbytes B16; /* number of string bytes following structure */ BYTE pad1, pad2; } xQueryExtensionReq; typedef struct { CARD8 reqType; CARD8 numKeyPerModifier; CARD16 length B16; } xSetModifierMappingReq; typedef struct { CARD8 reqType; CARD8 nElts; /* how many elements in the map */ CARD16 length B16; } xSetPointerMappingReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; KeyCode firstKeyCode; CARD8 count; CARD16 pad1 B16; } xGetKeyboardMappingReq; typedef struct { CARD8 reqType; CARD8 keyCodes; CARD16 length B16; KeyCode firstKeyCode; CARD8 keySymsPerKeyCode; CARD16 pad1 B16; } xChangeKeyboardMappingReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; CARD32 mask B32; } xChangeKeyboardControlReq; typedef struct { CARD8 reqType; INT8 percent; /* -100 to 100 */ CARD16 length B16; } xBellReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; INT16 accelNum B16, accelDenum B16; INT16 threshold B16; BOOL doAccel, doThresh; } xChangePointerControlReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; INT16 timeout B16, interval B16; BYTE preferBlank, allowExpose; CARD16 pad2 B16; } xSetScreenSaverReq; typedef struct { CARD8 reqType; BYTE mode; CARD16 length B16; CARD8 hostFamily; BYTE pad; CARD16 hostLength B16; } xChangeHostsReq; typedef struct { CARD8 reqType; BYTE pad; CARD16 length B16; } xListHostsReq; typedef struct { CARD8 reqType; BYTE mode; CARD16 length B16; } xChangeModeReq; typedef xChangeModeReq xSetAccessControlReq; typedef xChangeModeReq xSetCloseDownModeReq; typedef xChangeModeReq xForceScreenSaverReq; typedef struct { /* followed by LIST of ATOM */ CARD8 reqType; BYTE pad; CARD16 length B16; Window window B32; CARD16 nAtoms B16; INT16 nPositions B16; } xRotatePropertiesReq; /* Reply codes */ #define X_Reply 1 /* Normal reply */ #define X_Error 0 /* Error */ /* Request codes */ #define X_CreateWindow 1 #define X_ChangeWindowAttributes 2 #define X_GetWindowAttributes 3 #define X_DestroyWindow 4 #define X_DestroySubwindows 5 #define X_ChangeSaveSet 6 #define X_ReparentWindow 7 #define X_MapWindow 8 #define X_MapSubwindows 9 #define X_UnmapWindow 10 #define X_UnmapSubwindows 11 #define X_ConfigureWindow 12 #define X_CirculateWindow 13 #define X_GetGeometry 14 #define X_QueryTree 15 #define X_InternAtom 16 #define X_GetAtomName 17 #define X_ChangeProperty 18 #define X_DeleteProperty 19 #define X_GetProperty 20 #define X_ListProperties 21 #define X_SetSelectionOwner 22 #define X_GetSelectionOwner 23 #define X_ConvertSelection 24 #define X_SendEvent 25 #define X_GrabPointer 26 #define X_UngrabPointer 27 #define X_GrabButton 28 #define X_UngrabButton 29 #define X_ChangeActivePointerGrab 30 #define X_GrabKeyboard 31 #define X_UngrabKeyboard 32 #define X_GrabKey 33 #define X_UngrabKey 34 #define X_AllowEvents 35 #define X_GrabServer 36 #define X_UngrabServer 37 #define X_QueryPointer 38 #define X_GetMotionEvents 39 #define X_TranslateCoords 40 #define X_WarpPointer 41 #define X_SetInputFocus 42 #define X_GetInputFocus 43 #define X_QueryKeymap 44 #define X_OpenFont 45 #define X_CloseFont 46 #define X_QueryFont 47 #define X_QueryTextExtents 48 #define X_ListFonts 49 #define X_ListFontsWithInfo 50 #define X_SetFontPath 51 #define X_GetFontPath 52 #define X_CreatePixmap 53 #define X_FreePixmap 54 #define X_CreateGC 55 #define X_ChangeGC 56 #define X_CopyGC 57 #define X_SetDashes 58 #define X_SetClipRectangles 59 #define X_FreeGC 60 #define X_ClearArea 61 #define X_CopyArea 62 #define X_CopyPlane 63 #define X_PolyPoint 64 #define X_PolyLine 65 #define X_PolySegment 66 #define X_PolyRectangle 67 #define X_PolyArc 68 #define X_FillPoly 69 #define X_PolyFillRectangle 70 #define X_PolyFillArc 71 #define X_PutImage 72 #define X_GetImage 73 #define X_PolyText8 74 #define X_PolyText16 75 #define X_ImageText8 76 #define X_ImageText16 77 #define X_CreateColormap 78 #define X_FreeColormap 79 #define X_CopyColormapAndFree 80 #define X_InstallColormap 81 #define X_UninstallColormap 82 #define X_ListInstalledColormaps 83 #define X_AllocColor 84 #define X_AllocNamedColor 85 #define X_AllocColorCells 86 #define X_AllocColorPlanes 87 #define X_FreeColors 88 #define X_StoreColors 89 #define X_StoreNamedColor 90 #define X_QueryColors 91 #define X_LookupColor 92 #define X_CreateCursor 93 #define X_CreateGlyphCursor 94 #define X_FreeCursor 95 #define X_RecolorCursor 96 #define X_QueryBestSize 97 #define X_QueryExtension 98 #define X_ListExtensions 99 #define X_ChangeKeyboardMapping 100 #define X_GetKeyboardMapping 101 #define X_ChangeKeyboardControl 102 #define X_GetKeyboardControl 103 #define X_Bell 104 #define X_ChangePointerControl 105 #define X_GetPointerControl 106 #define X_SetScreenSaver 107 #define X_GetScreenSaver 108 #define X_ChangeHosts 109 #define X_ListHosts 110 #define X_SetAccessControl 111 #define X_SetCloseDownMode 112 #define X_KillClient 113 #define X_RotateProperties 114 #define X_ForceScreenSaver 115 #define X_SetPointerMapping 116 #define X_GetPointerMapping 117 #define X_SetModifierMapping 118 #define X_GetModifierMapping 119 #define X_NoOperation 127 /* restore these definitions back to the typedefs in X.h */ #undef Window #undef Drawable #undef Font #undef Pixmap #undef Cursor #undef Colormap #undef GContext #undef Atom #undef VisualID #undef Time #undef KeyCode #undef KeySym #endif /* XPROTO_H */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xprotostr.h ================================================ #ifndef XPROTOSTRUCTS_H #define XPROTOSTRUCTS_H /*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #include /* Used by PolySegment */ typedef struct _xSegment { INT16 x1 B16, y1 B16, x2 B16, y2 B16; } xSegment; /* POINT */ typedef struct _xPoint { INT16 x B16, y B16; } xPoint; typedef struct _xRectangle { INT16 x B16, y B16; CARD16 width B16, height B16; } xRectangle; /* ARC */ typedef struct _xArc { INT16 x B16, y B16; CARD16 width B16, height B16; INT16 angle1 B16, angle2 B16; } xArc; #endif /* XPROTOSTRUCTS_H */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xregion.h ================================================ /************************************************************************ Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ************************************************************************/ #ifndef _X11_XREGION_H_ #define _X11_XREGION_H_ typedef struct { short x1, x2, y1, y2; } Box, BOX, BoxRec, *BoxPtr; typedef struct { short x, y, width, height; }RECTANGLE, RectangleRec, *RectanglePtr; #define TRUE 1 #define FALSE 0 #define MAXSHORT 32767 #define MINSHORT -MAXSHORT #ifndef MAX #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #endif #ifndef MIN #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif /* * clip region */ typedef struct _XRegion { long size; long numRects; BOX *rects; BOX extents; } REGION; /* Xutil.h contains the declaration: * typedef struct _XRegion *Region; */ /* 1 if two BOXs overlap. * 0 if two BOXs do not overlap. * Remember, x2 and y2 are not in the region */ #define EXTENTCHECK(r1, r2) \ ((r1)->x2 > (r2)->x1 && \ (r1)->x1 < (r2)->x2 && \ (r1)->y2 > (r2)->y1 && \ (r1)->y1 < (r2)->y2) /* * update region extents */ #define EXTENTS(r,idRect){\ if((r)->x1 < (idRect)->extents.x1)\ (idRect)->extents.x1 = (r)->x1;\ if((r)->y1 < (idRect)->extents.y1)\ (idRect)->extents.y1 = (r)->y1;\ if((r)->x2 > (idRect)->extents.x2)\ (idRect)->extents.x2 = (r)->x2;\ if((r)->y2 > (idRect)->extents.y2)\ (idRect)->extents.y2 = (r)->y2;\ } /* * Check to see if there is enough memory in the present region. */ #define MEMCHECK(reg, rect, firstrect){\ if ((reg)->numRects >= ((reg)->size - 1)){\ BoxPtr tmpRect = Xrealloc ((firstrect), \ (2 * (sizeof(BOX)) * ((reg)->size))); \ if (tmpRect == NULL) \ return(0);\ (firstrect) = tmpRect; \ (reg)->size *= 2;\ (rect) = &(firstrect)[(reg)->numRects];\ }\ } /* this routine checks to see if the previous rectangle is the same * or subsumes the new rectangle to add. */ #define CHECK_PREVIOUS(Reg, R, Rx1, Ry1, Rx2, Ry2)\ (!(((Reg)->numRects > 0)&&\ ((R-1)->y1 == (Ry1)) &&\ ((R-1)->y2 == (Ry2)) &&\ ((R-1)->x1 <= (Rx1)) &&\ ((R-1)->x2 >= (Rx2)))) /* add a rectangle to the given Region */ #define ADDRECT(reg, r, rx1, ry1, rx2, ry2){\ if (((rx1) < (rx2)) && ((ry1) < (ry2)) &&\ CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ (r)->x1 = (rx1);\ (r)->y1 = (ry1);\ (r)->x2 = (rx2);\ (r)->y2 = (ry2);\ EXTENTS((r), (reg));\ (reg)->numRects++;\ (r)++;\ }\ } /* add a rectangle to the given Region */ #define ADDRECTNOX(reg, r, rx1, ry1, rx2, ry2){\ if ((rx1 < rx2) && (ry1 < ry2) &&\ CHECK_PREVIOUS((reg), (r), (rx1), (ry1), (rx2), (ry2))){\ (r)->x1 = (rx1);\ (r)->y1 = (ry1);\ (r)->x2 = (rx2);\ (r)->y2 = (ry2);\ (reg)->numRects++;\ (r)++;\ }\ } #define EMPTY_REGION(pReg) pReg->numRects = 0 #define REGION_NOT_EMPTY(pReg) pReg->numRects #define INBOX(r, x, y) \ ( ( ((r).x2 > x)) && \ ( ((r).x1 <= x)) && \ ( ((r).y2 > y)) && \ ( ((r).y1 <= y)) ) /* * number of points to buffer before sending them off * to scanlines() : Must be an even number */ #define NUMPTSTOBUFFER 200 /* * used to allocate buffers for points and link * the buffers together */ typedef struct _POINTBLOCK { XPoint pts[NUMPTSTOBUFFER]; struct _POINTBLOCK *next; } POINTBLOCK; #endif /* _X11_XREGION_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xresource.h ================================================ /*********************************************************** Copyright 1987, 1988, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifndef _X11_XRESOURCE_H_ #define _X11_XRESOURCE_H_ #ifndef _XP_PRINT_SERVER_ #include #endif /**************************************************************** **************************************************************** *** *** *** *** *** X Resource Manager Intrinsics *** *** *** *** *** **************************************************************** ****************************************************************/ _XFUNCPROTOBEGIN /**************************************************************** * * Memory Management * ****************************************************************/ extern char *Xpermalloc( unsigned int /* size */ ); /**************************************************************** * * Quark Management * ****************************************************************/ typedef int XrmQuark, *XrmQuarkList; #define NULLQUARK ((XrmQuark) 0) typedef char *XrmString; #define NULLSTRING ((XrmString) 0) /* find quark for string, create new quark if none already exists */ extern XrmQuark XrmStringToQuark( _Xconst char* /* string */ ); extern XrmQuark XrmPermStringToQuark( _Xconst char* /* string */ ); /* find string for quark */ extern XrmString XrmQuarkToString( XrmQuark /* quark */ ); extern XrmQuark XrmUniqueQuark( void ); #define XrmStringsEqual(a1, a2) (strcmp(a1, a2) == 0) /**************************************************************** * * Conversion of Strings to Lists * ****************************************************************/ typedef enum {XrmBindTightly, XrmBindLoosely} XrmBinding, *XrmBindingList; extern void XrmStringToQuarkList( _Xconst char* /* string */, XrmQuarkList /* quarks_return */ ); extern void XrmStringToBindingQuarkList( _Xconst char* /* string */, XrmBindingList /* bindings_return */, XrmQuarkList /* quarks_return */ ); /**************************************************************** * * Name and Class lists. * ****************************************************************/ typedef XrmQuark XrmName; typedef XrmQuarkList XrmNameList; #define XrmNameToString(name) XrmQuarkToString(name) #define XrmStringToName(string) XrmStringToQuark(string) #define XrmStringToNameList(str, name) XrmStringToQuarkList(str, name) typedef XrmQuark XrmClass; typedef XrmQuarkList XrmClassList; #define XrmClassToString(c_class) XrmQuarkToString(c_class) #define XrmStringToClass(c_class) XrmStringToQuark(c_class) #define XrmStringToClassList(str,c_class) XrmStringToQuarkList(str, c_class) /**************************************************************** * * Resource Representation Types and Values * ****************************************************************/ typedef XrmQuark XrmRepresentation; #define XrmStringToRepresentation(string) XrmStringToQuark(string) #define XrmRepresentationToString(type) XrmQuarkToString(type) typedef struct { unsigned int size; XPointer addr; } XrmValue, *XrmValuePtr; /**************************************************************** * * Resource Manager Functions * ****************************************************************/ typedef struct _XrmHashBucketRec *XrmHashBucket; typedef XrmHashBucket *XrmHashTable; typedef XrmHashTable XrmSearchList[]; typedef struct _XrmHashBucketRec *XrmDatabase; extern void XrmDestroyDatabase( XrmDatabase /* database */ ); extern void XrmQPutResource( XrmDatabase* /* database */, XrmBindingList /* bindings */, XrmQuarkList /* quarks */, XrmRepresentation /* type */, XrmValue* /* value */ ); extern void XrmPutResource( XrmDatabase* /* database */, _Xconst char* /* specifier */, _Xconst char* /* type */, XrmValue* /* value */ ); extern void XrmQPutStringResource( XrmDatabase* /* database */, XrmBindingList /* bindings */, XrmQuarkList /* quarks */, _Xconst char* /* value */ ); extern void XrmPutStringResource( XrmDatabase* /* database */, _Xconst char* /* specifier */, _Xconst char* /* value */ ); extern void XrmPutLineResource( XrmDatabase* /* database */, _Xconst char* /* line */ ); extern Bool XrmQGetResource( XrmDatabase /* database */, XrmNameList /* quark_name */, XrmClassList /* quark_class */, XrmRepresentation* /* quark_type_return */, XrmValue* /* value_return */ ); extern Bool XrmGetResource( XrmDatabase /* database */, _Xconst char* /* str_name */, _Xconst char* /* str_class */, char** /* str_type_return */, XrmValue* /* value_return */ ); extern Bool XrmQGetSearchList( XrmDatabase /* database */, XrmNameList /* names */, XrmClassList /* classes */, XrmSearchList /* list_return */, int /* list_length */ ); extern Bool XrmQGetSearchResource( XrmSearchList /* list */, XrmName /* name */, XrmClass /* class */, XrmRepresentation* /* type_return */, XrmValue* /* value_return */ ); /**************************************************************** * * Resource Database Management * ****************************************************************/ #ifndef _XP_PRINT_SERVER_ extern void XrmSetDatabase( Display* /* display */, XrmDatabase /* database */ ); extern XrmDatabase XrmGetDatabase( Display* /* display */ ); #endif /* !_XP_PRINT_SERVER_ */ extern XrmDatabase XrmGetFileDatabase( _Xconst char* /* filename */ ); extern Status XrmCombineFileDatabase( _Xconst char* /* filename */, XrmDatabase* /* target */, Bool /* override */ ); extern XrmDatabase XrmGetStringDatabase( _Xconst char* /* data */ /* null terminated string */ ); extern void XrmPutFileDatabase( XrmDatabase /* database */, _Xconst char* /* filename */ ); extern void XrmMergeDatabases( XrmDatabase /* source_db */, XrmDatabase* /* target_db */ ); extern void XrmCombineDatabase( XrmDatabase /* source_db */, XrmDatabase* /* target_db */, Bool /* override */ ); #define XrmEnumAllLevels 0 #define XrmEnumOneLevel 1 extern Bool XrmEnumerateDatabase( XrmDatabase /* db */, XrmNameList /* name_prefix */, XrmClassList /* class_prefix */, int /* mode */, Bool (*)( XrmDatabase* /* db */, XrmBindingList /* bindings */, XrmQuarkList /* quarks */, XrmRepresentation* /* type */, XrmValue* /* value */, XPointer /* closure */ ) /* proc */, XPointer /* closure */ ); extern const char *XrmLocaleOfDatabase( XrmDatabase /* database */ ); /**************************************************************** * * Command line option mapping to resource entries * ****************************************************************/ typedef enum { XrmoptionNoArg, /* Value is specified in OptionDescRec.value */ XrmoptionIsArg, /* Value is the option string itself */ XrmoptionStickyArg, /* Value is characters immediately following option */ XrmoptionSepArg, /* Value is next argument in argv */ XrmoptionResArg, /* Resource and value in next argument in argv */ XrmoptionSkipArg, /* Ignore this option and the next argument in argv */ XrmoptionSkipLine, /* Ignore this option and the rest of argv */ XrmoptionSkipNArgs /* Ignore this option and the next OptionDescRes.value arguments in argv */ } XrmOptionKind; typedef struct { char *option; /* Option abbreviation in argv */ char *specifier; /* Resource specifier */ XrmOptionKind argKind; /* Which style of option it is */ XPointer value; /* Value to provide if XrmoptionNoArg */ } XrmOptionDescRec, *XrmOptionDescList; extern void XrmParseCommand( XrmDatabase* /* database */, XrmOptionDescList /* table */, int /* table_count */, _Xconst char* /* name */, int* /* argc_in_out */, char** /* argv_in_out */ ); _XFUNCPROTOEND #endif /* _X11_XRESOURCE_H_ */ /* DON'T ADD STUFF AFTER THIS #endif */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xthreads.h ================================================ /* * Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * * */ #ifndef _XTHREADS_H_ # define _XTHREADS_H_ /* Redefine these to XtMalloc/XtFree or whatever you want before including * this header file. */ # ifndef xmalloc # define xmalloc malloc # endif # ifndef xfree # define xfree free # endif # ifdef CTHREADS # include typedef cthread_t xthread_t; typedef struct condition xcondition_rec; typedef struct mutex xmutex_rec; # define xthread_init() cthread_init() # define xthread_self cthread_self # define xthread_fork(func,closure) cthread_fork(func,closure) # define xthread_yield() cthread_yield() # define xthread_exit(v) cthread_exit(v) # define xthread_set_name(t,str) cthread_set_name(t,str) # define xmutex_init(m) mutex_init(m) # define xmutex_clear(m) mutex_clear(m) # define xmutex_lock(m) mutex_lock(m) # define xmutex_unlock(m) mutex_unlock(m) # define xmutex_set_name(m,str) mutex_set_name(m,str) # define xcondition_init(cv) condition_init(cv) # define xcondition_clear(cv) condition_clear(cv) # define xcondition_wait(cv,m) condition_wait(cv,m) # define xcondition_signal(cv) condition_signal(cv) # define xcondition_broadcast(cv) condition_broadcast(cv) # define xcondition_set_name(cv,str) condition_set_name(cv,str) # else /* !CTHREADS */ # if defined(SVR4) # include # include typedef thread_t xthread_t; typedef thread_key_t xthread_key_t; typedef cond_t xcondition_rec; typedef mutex_t xmutex_rec; # if defined(__UNIXWARE__) extern xthread_t (*_x11_thr_self)(); # define xthread_self (_x11_thr_self) # else # define xthread_self thr_self # endif # define xthread_fork(func,closure) thr_create(NULL,0,func,closure,THR_NEW_LWP|THR_DETACHED,NULL) # define xthread_yield() thr_yield() # define xthread_exit(v) thr_exit(v) # define xthread_key_create(kp,d) thr_keycreate(kp,d) # ifdef __sun # define xthread_key_delete(k) 0 # else # define xthread_key_delete(k) thr_keydelete(k) # endif # define xthread_set_specific(k,v) thr_setspecific(k,v) # define xthread_get_specific(k,vp) thr_getspecific(k,vp) # define xmutex_init(m) mutex_init(m,USYNC_THREAD,0) # define xmutex_clear(m) mutex_destroy(m) # define xmutex_lock(m) mutex_lock(m) # define xmutex_unlock(m) mutex_unlock(m) # define xcondition_init(cv) cond_init(cv,USYNC_THREAD,0) # define xcondition_clear(cv) cond_destroy(cv) # define xcondition_wait(cv,m) cond_wait(cv,m) # define xcondition_signal(cv) cond_signal(cv) # define xcondition_broadcast(cv) cond_broadcast(cv) # else /* !SVR4 */ # ifdef WIN32 # include typedef DWORD xthread_t; typedef DWORD xthread_key_t; struct _xthread_waiter { HANDLE sem; struct _xthread_waiter *next; }; typedef struct { CRITICAL_SECTION cs; struct _xthread_waiter *waiters; } xcondition_rec; typedef CRITICAL_SECTION xmutex_rec; extern void _Xthread_init(void); # define xthread_init() _Xthread_init() # define xthread_self GetCurrentThreadId # define xthread_fork(func,closure) { \ DWORD _tmptid; \ CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)func, (LPVOID)closure, 0, \ &_tmptid); \ } # define xthread_yield() Sleep(0) # define xthread_exit(v) ExitThread((DWORD)(v)) # define xthread_key_create(kp,d) *(kp) = TlsAlloc() # define xthread_key_delete(k) TlsFree(k) # define xthread_set_specific(k,v) TlsSetValue(k,v) # define xthread_get_specific(k,vp) TlsGetValue(k) # define xmutex_init(m) InitializeCriticalSection(m) # define xmutex_clear(m) DeleteCriticalSection(m) # define _XMUTEX_NESTS # define xmutex_lock(m) EnterCriticalSection(m) # define xmutex_unlock(m) LeaveCriticalSection(m) # define xcondition_init(cv) { \ InitializeCriticalSection(&(cv)->cs); \ (cv)->waiters = NULL; \ } # define xcondition_clear(cv) DeleteCriticalSection(&(cv)->cs) extern struct _xthread_waiter *_Xthread_waiter(); # define xcondition_wait(cv,m) { \ struct _xthread_waiter *_tmpthr = _Xthread_waiter(); \ EnterCriticalSection(&(cv)->cs); \ _tmpthr->next = (cv)->waiters; \ (cv)->waiters = _tmpthr; \ LeaveCriticalSection(&(cv)->cs); \ LeaveCriticalSection(m); \ WaitForSingleObject(_tmpthr->sem, INFINITE); \ EnterCriticalSection(m); \ } # define xcondition_signal(cv) { \ EnterCriticalSection(&(cv)->cs); \ if ((cv)->waiters) { \ ReleaseSemaphore((cv)->waiters->sem, 1, NULL); \ (cv)->waiters = (cv)->waiters->next; \ } \ LeaveCriticalSection(&(cv)->cs); \ } # define xcondition_broadcast(cv) { \ struct _xthread_waiter *_tmpthr; \ EnterCriticalSection(&(cv)->cs); \ for (_tmpthr = (cv)->waiters; _tmpthr; _tmpthr = _tmpthr->next) \ ReleaseSemaphore(_tmpthr->sem, 1, NULL); \ (cv)->waiters = NULL; \ LeaveCriticalSection(&(cv)->cs); \ } # else /* !WIN32 */ # ifdef USE_TIS_SUPPORT /* * TIS support is intended for thread safe libraries. * This should not be used for general client programming. */ # include typedef pthread_t xthread_t; typedef pthread_key_t xthread_key_t; typedef pthread_cond_t xcondition_rec; typedef pthread_mutex_t xmutex_rec; # define xthread_self tis_self # define xthread_fork(func,closure) { pthread_t _tmpxthr; \ pthread_create(&_tmpxthr,NULL,func,closure); } # define xthread_yield() pthread_yield_np() # define xthread_exit(v) pthread_exit(v) # define xthread_key_create(kp,d) tis_key_create(kp,d) # define xthread_key_delete(k) tis_key_delete(k) # define xthread_set_specific(k,v) tis_setspecific(k,v) # define xthread_get_specific(k,vp) *(vp) = tis_getspecific(k) # define XMUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER # define xmutex_init(m) tis_mutex_init(m) # define xmutex_clear(m) tis_mutex_destroy(m) # define xmutex_lock(m) tis_mutex_lock(m) # define xmutex_unlock(m) tis_mutex_unlock(m) # define xcondition_init(c) tis_cond_init(c) # define xcondition_clear(c) tis_cond_destroy(c) # define xcondition_wait(c,m) tis_cond_wait(c,m) # define xcondition_signal(c) tis_cond_signal(c) # define xcondition_broadcast(c) tis_cond_broadcast(c) # else # ifdef USE_NBSD_THREADLIB /* * NetBSD threadlib support is intended for thread safe libraries. * This should not be used for general client programming. */ # include typedef thr_t xthread_t; typedef thread_key_t xthread_key_t; typedef cond_t xcondition_rec; typedef mutex_t xmutex_rec; # define xthread_self thr_self # define xthread_fork(func,closure) { thr_t _tmpxthr; \ /* XXX Create it detached? --thorpej */ \ thr_create(&_tmpxthr,NULL,func,closure); } # define xthread_yield() thr_yield() # define xthread_exit(v) thr_exit(v) # define xthread_key_create(kp,d) thr_keycreate(kp,d) # define xthread_key_delete(k) thr_keydelete(k) # define xthread_set_specific(k,v) thr_setspecific(k,v) # define xthread_get_specific(k,vp) *(vp) = thr_getspecific(k) # define XMUTEX_INITIALIZER MUTEX_INITIALIZER # define xmutex_init(m) mutex_init(m, 0) # define xmutex_clear(m) mutex_destroy(m) # define xmutex_lock(m) mutex_lock(m) # define xmutex_unlock(m) mutex_unlock(m) # define xcondition_init(c) cond_init(c, 0, 0) # define xcondition_clear(c) cond_destroy(c) # define xcondition_wait(c,m) cond_wait(c,m) # define xcondition_signal(c) cond_signal(c) # define xcondition_broadcast(c) cond_broadcast(c) # else # include typedef pthread_t xthread_t; typedef pthread_key_t xthread_key_t; typedef pthread_cond_t xcondition_rec; typedef pthread_mutex_t xmutex_rec; # define xthread_self pthread_self # define xthread_yield() pthread_yield() # define xthread_exit(v) pthread_exit(v) # define xthread_set_specific(k,v) pthread_setspecific(k,v) # define xmutex_clear(m) pthread_mutex_destroy(m) # define xmutex_lock(m) pthread_mutex_lock(m) # define xmutex_unlock(m) pthread_mutex_unlock(m) # ifndef XPRE_STANDARD_API # define xthread_key_create(kp,d) pthread_key_create(kp,d) # define xthread_key_delete(k) pthread_key_delete(k) # define xthread_get_specific(k,vp) *(vp) = pthread_getspecific(k) # define xthread_fork(func,closure) { pthread_t _tmpxthr; \ pthread_create(&_tmpxthr,NULL,func,closure); } # define XMUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER # define xmutex_init(m) pthread_mutex_init(m, NULL) # define xcondition_init(c) pthread_cond_init(c, NULL) # else /* XPRE_STANDARD_API */ # define xthread_key_create(kp,d) pthread_keycreate(kp,d) # define xthread_key_delete(k) 0 # define xthread_get_specific(k,vp) pthread_getspecific(k,vp) # define xthread_fork(func,closure) { pthread_t _tmpxthr; \ pthread_create(&_tmpxthr,pthread_attr_default,func,closure); } # define xmutex_init(m) pthread_mutex_init(m, pthread_mutexattr_default) # define xcondition_init(c) pthread_cond_init(c, pthread_condattr_default) # endif /* XPRE_STANDARD_API */ # define xcondition_clear(c) pthread_cond_destroy(c) # define xcondition_wait(c,m) pthread_cond_wait(c,m) # define xcondition_signal(c) pthread_cond_signal(c) # define xcondition_broadcast(c) pthread_cond_broadcast(c) # if defined(_DECTHREADS_) static xthread_t _X_no_thread_id; # define xthread_have_id(id) !pthread_equal(id, _X_no_thread_id) # define xthread_clear_id(id) id = _X_no_thread_id # define xthread_equal(id1,id2) pthread_equal(id1, id2) # endif /* _DECTHREADS_ */ # if defined(__linux__) # define xthread_have_id(id) !pthread_equal(id, 0) # define xthread_clear_id(id) id = 0 # define xthread_equal(id1,id2) pthread_equal(id1, id2) # endif /* linux */ # if defined(_CMA_VENDOR_) && defined(_CMA__IBM) && (_CMA_VENDOR_ == _CMA__IBM) # ifdef DEBUG /* too much of a hack to enable normally */ /* see also cma__obj_set_name() */ # define xmutex_set_name(m,str) ((char**)(m)->field1)[5] = (str) # define xcondition_set_name(cv,str) ((char**)(cv)->field1)[5] = (str) # endif /* DEBUG */ # endif /* _CMA_VENDOR_ == _CMA__IBM */ # endif /* USE_NBSD_THREADLIB */ # endif /* USE_TIS_SUPPORT */ # endif /* WIN32 */ # endif /* SVR4 */ # endif /* CTHREADS */ typedef xcondition_rec *xcondition_t; typedef xmutex_rec *xmutex_t; # ifndef xcondition_malloc # define xcondition_malloc() (xcondition_t)xmalloc(sizeof(xcondition_rec)) # endif # ifndef xcondition_free # define xcondition_free(c) xfree((char *)c) # endif # ifndef xmutex_malloc # define xmutex_malloc() (xmutex_t)xmalloc(sizeof(xmutex_rec)) # endif # ifndef xmutex_free # define xmutex_free(m) xfree((char *)m) # endif # ifndef xthread_have_id # define xthread_have_id(id) id # endif # ifndef xthread_clear_id # define xthread_clear_id(id) id = 0 # endif # ifndef xthread_equal # define xthread_equal(id1,id2) ((id1) == (id2)) # endif /* aids understood by some debuggers */ # ifndef xthread_set_name # define xthread_set_name(t,str) # endif # ifndef xmutex_set_name # define xmutex_set_name(m,str) # endif # ifndef xcondition_set_name # define xcondition_set_name(cv,str) # endif #endif /* _XTHREADS_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xtrans/Xtrans.c ================================================ /* Copyright 1993, 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name NCR not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. NCR makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include #ifdef HAVE_SYSTEMD_DAEMON #include #endif /* * The transport table contains a definition for every transport (protocol) * family. All operations that can be made on the transport go through this * table. * * Each transport is assigned a unique transport id. * * New transports can be added by adding an entry in this table. * For compatiblity, the transport ids should never be renumbered. * Always add to the end of the list. */ #define TRANS_TLI_INET_INDEX 1 #define TRANS_TLI_TCP_INDEX 2 #define TRANS_TLI_TLI_INDEX 3 #define TRANS_SOCKET_UNIX_INDEX 4 #define TRANS_SOCKET_LOCAL_INDEX 5 #define TRANS_SOCKET_INET_INDEX 6 #define TRANS_SOCKET_TCP_INDEX 7 #define TRANS_DNET_INDEX 8 #define TRANS_LOCAL_LOCAL_INDEX 9 #define TRANS_LOCAL_PTS_INDEX 10 #define TRANS_LOCAL_NAMED_INDEX 11 /* 12 used to be ISC, but that's gone. */ #define TRANS_LOCAL_SCO_INDEX 13 #define TRANS_SOCKET_INET6_INDEX 14 #define TRANS_LOCAL_PIPE_INDEX 15 static Xtransport_table Xtransports[] = { #if defined(TCPCONN) { &TRANS(SocketTCPFuncs), TRANS_SOCKET_TCP_INDEX }, #if defined(IPv6) && defined(AF_INET6) { &TRANS(SocketINET6Funcs), TRANS_SOCKET_INET6_INDEX }, #endif /* IPv6 */ { &TRANS(SocketINETFuncs), TRANS_SOCKET_INET_INDEX }, #endif /* TCPCONN */ #if defined(UNIXCONN) #if !defined(LOCALCONN) { &TRANS(SocketLocalFuncs), TRANS_SOCKET_LOCAL_INDEX }, #endif /* !LOCALCONN */ { &TRANS(SocketUNIXFuncs), TRANS_SOCKET_UNIX_INDEX }, #endif /* UNIXCONN */ #if defined(LOCALCONN) { &TRANS(LocalFuncs), TRANS_LOCAL_LOCAL_INDEX }, #ifndef sun { &TRANS(PTSFuncs), TRANS_LOCAL_PTS_INDEX }, #endif /* sun */ #if defined(SVR4) || defined(__SVR4) { &TRANS(NAMEDFuncs), TRANS_LOCAL_NAMED_INDEX }, #endif #ifdef sun { &TRANS(PIPEFuncs), TRANS_LOCAL_PIPE_INDEX }, #endif /* sun */ #if defined(__SCO__) || defined(__UNIXWARE__) { &TRANS(SCOFuncs), TRANS_LOCAL_SCO_INDEX }, #endif /* __SCO__ || __UNIXWARE__ */ #endif /* LOCALCONN */ }; #define NUMTRANS (sizeof(Xtransports)/sizeof(Xtransport_table)) #ifdef WIN32 #define ioctl ioctlsocket #endif /* * These are a few utility function used by the public interface functions. */ void TRANS(FreeConnInfo) (XtransConnInfo ciptr) { prmsg (3,"FreeConnInfo(%p)\n", ciptr); if (ciptr->addr) free (ciptr->addr); if (ciptr->peeraddr) free (ciptr->peeraddr); if (ciptr->port) free (ciptr->port); free (ciptr); } #define PROTOBUFSIZE 20 static Xtransport * TRANS(SelectTransport) (const char *protocol) { char protobuf[PROTOBUFSIZE]; int i; prmsg (3,"SelectTransport(%s)\n", protocol); /* * Force Protocol to be lowercase as a way of doing * a case insensitive match. */ strncpy (protobuf, protocol, PROTOBUFSIZE - 1); protobuf[PROTOBUFSIZE-1] = '\0'; for (i = 0; i < PROTOBUFSIZE && protobuf[i] != '\0'; i++) if (isupper ((unsigned char)protobuf[i])) protobuf[i] = tolower ((unsigned char)protobuf[i]); /* Look at all of the configured protocols */ for (i = 0; i < NUMTRANS; i++) { if (!strcmp (protobuf, Xtransports[i].transport->TransName)) return Xtransports[i].transport; } return NULL; } #ifndef TEST_t static #endif /* TEST_t */ int TRANS(ParseAddress) (const char *address, char **protocol, char **host, char **port) { /* * For the font library, the address is a string formatted * as "protocol/host:port[/catalogue]". Note that the catologue * is optional. At this time, the catologue info is ignored, but * we have to parse it anyways. * * Other than fontlib, the address is a string formatted * as "protocol/host:port". * * If the protocol part is missing, then assume TCP. * If the protocol part and host part are missing, then assume local. * If a "::" is found then assume DNET. */ char *mybuf, *tmpptr; const char *_protocol; char *_host, *_port; char hostnamebuf[256]; int _host_len; prmsg (3,"ParseAddress(%s)\n", address); /* Copy the string so it can be changed */ tmpptr = mybuf = strdup (address); /* Parse the string to get each component */ /* Get the protocol part */ _protocol = mybuf; if ( ((mybuf = strchr (mybuf,'/')) == NULL) && ((mybuf = strrchr (tmpptr,':')) == NULL) ) { /* address is in a bad format */ *protocol = NULL; *host = NULL; *port = NULL; free (tmpptr); return 0; } if (*mybuf == ':') { /* * If there is a hostname, then assume tcp, otherwise * it must be local. */ if (mybuf == tmpptr) { /* There is neither a protocol or host specified */ _protocol = "local"; } else { /* There is a hostname specified */ _protocol = "tcp"; mybuf = tmpptr; /* reset to the begining of the host ptr */ } } else { /* *mybuf == '/' */ *mybuf ++= '\0'; /* put a null at the end of the protocol */ if (strlen(_protocol) == 0) { /* * If there is a hostname, then assume tcp, otherwise * it must be local. */ if (*mybuf != ':') _protocol = "tcp"; else _protocol = "local"; } } /* Get the host part */ _host = mybuf; if ((mybuf = strrchr (mybuf,':')) == NULL) { *protocol = NULL; *host = NULL; *port = NULL; free (tmpptr); return 0; } *mybuf ++= '\0'; _host_len = strlen(_host); if (_host_len == 0) { TRANS(GetHostname) (hostnamebuf, sizeof (hostnamebuf)); _host = hostnamebuf; } #if defined(IPv6) && defined(AF_INET6) /* hostname in IPv6 [numeric_addr]:0 form? */ else if ( (_host_len > 3) && ((strcmp(_protocol, "tcp") == 0) || (strcmp(_protocol, "inet6") == 0)) && (*_host == '[') && (*(_host + _host_len - 1) == ']') ) { struct sockaddr_in6 sin6; *(_host + _host_len - 1) = '\0'; /* Verify address is valid IPv6 numeric form */ if (inet_pton(AF_INET6, _host + 1, &sin6) == 1) { /* It is. Use it as such. */ _host++; _protocol = "inet6"; } else { /* It's not, restore it just in case some other code can use it. */ *(_host + _host_len - 1) = ']'; } } #endif /* Get the port */ _port = mybuf; #if defined(FONT_t) || defined(FS_t) /* * Is there an optional catalogue list? */ if ((mybuf = strchr (mybuf,'/')) != NULL) *mybuf ++= '\0'; /* * The rest, if any, is the (currently unused) catalogue list. * * _catalogue = mybuf; */ #endif #ifdef HAVE_LAUNCHD /* launchd sockets will look like 'local//tmp/launch-XgkNns/:0' */ if(address != NULL && strlen(address)>8 && (!strncmp(address,"local//",7))) { _protocol="local"; _host=""; _port=address+6; } #endif /* * Now that we have all of the components, allocate new * string space for them. */ if ((*protocol = strdup (_protocol)) == NULL) { /* Malloc failed */ *port = NULL; *host = NULL; *protocol = NULL; free (tmpptr); return 0; } if ((*host = strdup (_host)) == NULL) { /* Malloc failed */ *port = NULL; *host = NULL; free (*protocol); *protocol = NULL; free (tmpptr); return 0; } if ((*port = strdup (_port)) == NULL) { /* Malloc failed */ *port = NULL; free (*host); *host = NULL; free (*protocol); *protocol = NULL; free (tmpptr); return 0; } free (tmpptr); return 1; } /* * TRANS(Open) does all of the real work opening a connection. The only * funny part about this is the type parameter which is used to decide which * type of open to perform. */ static XtransConnInfo TRANS(Open) (int type, const char *address) { char *protocol = NULL, *host = NULL, *port = NULL; XtransConnInfo ciptr = NULL; Xtransport *thistrans; prmsg (2,"Open(%d,%s)\n", type, address); #if defined(WIN32) && defined(TCPCONN) if (TRANS(WSAStartup)()) { prmsg (1,"Open: WSAStartup failed\n"); return NULL; } #endif /* Parse the Address */ if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0) { prmsg (1,"Open: Unable to Parse address %s\n", address); return NULL; } /* Determine the transport type */ if ((thistrans = TRANS(SelectTransport) (protocol)) == NULL) { prmsg (1,"Open: Unable to find transport for %s\n", protocol); free (protocol); free (host); free (port); return NULL; } /* Open the transport */ switch (type) { case XTRANS_OPEN_COTS_CLIENT: #ifdef TRANS_CLIENT ciptr = thistrans->OpenCOTSClient(thistrans, protocol, host, port); #endif /* TRANS_CLIENT */ break; case XTRANS_OPEN_COTS_SERVER: #ifdef TRANS_SERVER ciptr = thistrans->OpenCOTSServer(thistrans, protocol, host, port); #endif /* TRANS_SERVER */ break; case XTRANS_OPEN_CLTS_CLIENT: #ifdef TRANS_CLIENT ciptr = thistrans->OpenCLTSClient(thistrans, protocol, host, port); #endif /* TRANS_CLIENT */ break; case XTRANS_OPEN_CLTS_SERVER: #ifdef TRANS_SERVER ciptr = thistrans->OpenCLTSServer(thistrans, protocol, host, port); #endif /* TRANS_SERVER */ break; default: prmsg (1,"Open: Unknown Open type %d\n", type); } if (ciptr == NULL) { if (!(thistrans->flags & TRANS_DISABLED)) { prmsg (1,"Open: transport open failed for %s/%s:%s\n", protocol, host, port); } free (protocol); free (host); free (port); return NULL; } ciptr->transptr = thistrans; ciptr->port = port; /* We need this for TRANS(Reopen) */ free (protocol); free (host); return ciptr; } #ifdef TRANS_REOPEN /* * We might want to create an XtransConnInfo object based on a previously * opened connection. For example, the font server may clone itself and * pass file descriptors to the parent. */ static XtransConnInfo TRANS(Reopen) (int type, int trans_id, int fd, const char *port) { XtransConnInfo ciptr = NULL; Xtransport *thistrans = NULL; char *save_port; int i; prmsg (2,"Reopen(%d,%d,%s)\n", trans_id, fd, port); /* Determine the transport type */ for (i = 0; i < NUMTRANS; i++) if (Xtransports[i].transport_id == trans_id) { thistrans = Xtransports[i].transport; break; } if (thistrans == NULL) { prmsg (1,"Reopen: Unable to find transport id %d\n", trans_id); return NULL; } if ((save_port = strdup (port)) == NULL) { prmsg (1,"Reopen: Unable to malloc port string\n"); return NULL; } /* Get a new XtransConnInfo object */ switch (type) { case XTRANS_OPEN_COTS_SERVER: ciptr = thistrans->ReopenCOTSServer(thistrans, fd, port); break; case XTRANS_OPEN_CLTS_SERVER: ciptr = thistrans->ReopenCLTSServer(thistrans, fd, port); break; default: prmsg (1,"Reopen: Bad Open type %d\n", type); } if (ciptr == NULL) { prmsg (1,"Reopen: transport open failed\n"); free (save_port); return NULL; } ciptr->transptr = thistrans; ciptr->port = save_port; return ciptr; } #endif /* TRANS_REOPEN */ /* * These are the public interfaces to this Transport interface. * These are the only functions that should have knowledge of the transport * table. */ #ifdef TRANS_CLIENT XtransConnInfo TRANS(OpenCOTSClient) (const char *address) { prmsg (2,"OpenCOTSClient(%s)\n", address); return TRANS(Open) (XTRANS_OPEN_COTS_CLIENT, address); } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER XtransConnInfo TRANS(OpenCOTSServer) (const char *address) { prmsg (2,"OpenCOTSServer(%s)\n", address); return TRANS(Open) (XTRANS_OPEN_COTS_SERVER, address); } #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT XtransConnInfo TRANS(OpenCLTSClient) (const char *address) { prmsg (2,"OpenCLTSClient(%s)\n", address); return TRANS(Open) (XTRANS_OPEN_CLTS_CLIENT, address); } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER XtransConnInfo TRANS(OpenCLTSServer) (const char *address) { prmsg (2,"OpenCLTSServer(%s)\n", address); return TRANS(Open) (XTRANS_OPEN_CLTS_SERVER, address); } #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN XtransConnInfo TRANS(ReopenCOTSServer) (int trans_id, int fd, const char *port) { prmsg (2,"ReopenCOTSServer(%d, %d, %s)\n", trans_id, fd, port); return TRANS(Reopen) (XTRANS_OPEN_COTS_SERVER, trans_id, fd, port); } XtransConnInfo TRANS(ReopenCLTSServer) (int trans_id, int fd, const char *port) { prmsg (2,"ReopenCLTSServer(%d, %d, %s)\n", trans_id, fd, port); return TRANS(Reopen) (XTRANS_OPEN_CLTS_SERVER, trans_id, fd, port); } int TRANS(GetReopenInfo) (XtransConnInfo ciptr, int *trans_id, int *fd, char **port) { int i; for (i = 0; i < NUMTRANS; i++) if (Xtransports[i].transport == ciptr->transptr) { *trans_id = Xtransports[i].transport_id; *fd = ciptr->fd; if ((*port = strdup (ciptr->port)) == NULL) return 0; else return 1; } return 0; } #endif /* TRANS_REOPEN */ int TRANS(SetOption) (XtransConnInfo ciptr, int option, int arg) { int fd = ciptr->fd; int ret = 0; prmsg (2,"SetOption(%d,%d,%d)\n", fd, option, arg); /* * For now, all transport type use the same stuff for setting options. * As long as this is true, we can put the common code here. Once a more * complicated transport such as shared memory or an OSI implementation * that uses the session and application libraries is implemented, this * code may have to move to a transport dependent function. * * ret = ciptr->transptr->SetOption (ciptr, option, arg); */ switch (option) { case TRANS_NONBLOCKING: switch (arg) { case 0: /* Set to blocking mode */ break; case 1: /* Set to non-blocking mode */ #if defined(O_NONBLOCK) && !defined(SCO325) ret = fcntl (fd, F_GETFL, 0); if (ret != -1) ret = fcntl (fd, F_SETFL, ret | O_NONBLOCK); #else #ifdef FIOSNBIO { int arg; arg = 1; ret = ioctl (fd, FIOSNBIO, &arg); } #else #if defined(WIN32) { #ifdef WIN32 u_long arg; #else int arg; #endif arg = 1; /* IBM TCP/IP understands this option too well: it causes TRANS(Read) to fail * eventually with EWOULDBLOCK */ ret = ioctl (fd, FIONBIO, &arg); } #else ret = fcntl (fd, F_GETFL, 0); #ifdef FNDELAY ret = fcntl (fd, F_SETFL, ret | FNDELAY); #else ret = fcntl (fd, F_SETFL, ret | O_NDELAY); #endif #endif /* AIXV3 || uniosu */ #endif /* FIOSNBIO */ #endif /* O_NONBLOCK */ break; default: /* Unknown option */ break; } break; case TRANS_CLOSEONEXEC: #ifdef F_SETFD #ifdef FD_CLOEXEC ret = fcntl (fd, F_SETFD, FD_CLOEXEC); #else ret = fcntl (fd, F_SETFD, 1); #endif /* FD_CLOEXEC */ #endif /* F_SETFD */ break; } return ret; } #ifdef TRANS_SERVER int TRANS(CreateListener) (XtransConnInfo ciptr, const char *port, unsigned int flags) { return ciptr->transptr->CreateListener (ciptr, port, flags); } int TRANS(Received) (const char * protocol) { Xtransport *trans; int i = 0, ret = 0; prmsg (5, "Received(%s)\n", protocol); if ((trans = TRANS(SelectTransport)(protocol)) == NULL) { prmsg (1,"Received: unable to find transport: %s\n", protocol); return -1; } if (trans->flags & TRANS_ALIAS) { if (trans->nolisten) while (trans->nolisten[i]) { ret |= TRANS(Received)(trans->nolisten[i]); i++; } } trans->flags |= TRANS_RECEIVED; return ret; } int TRANS(NoListen) (const char * protocol) { Xtransport *trans; int i = 0, ret = 0; if ((trans = TRANS(SelectTransport)(protocol)) == NULL) { prmsg (1,"TransNoListen: unable to find transport: %s\n", protocol); return -1; } if (trans->flags & TRANS_ALIAS) { if (trans->nolisten) while (trans->nolisten[i]) { ret |= TRANS(NoListen)(trans->nolisten[i]); i++; } } trans->flags |= TRANS_NOLISTEN; return ret; } int TRANS(Listen) (const char * protocol) { Xtransport *trans; int i = 0, ret = 0; if ((trans = TRANS(SelectTransport)(protocol)) == NULL) { prmsg (1,"TransListen: unable to find transport: %s\n", protocol); return -1; } if (trans->flags & TRANS_ALIAS) { if (trans->nolisten) while (trans->nolisten[i]) { ret |= TRANS(Listen)(trans->nolisten[i]); i++; } } trans->flags &= ~TRANS_NOLISTEN; return ret; } int TRANS(IsListening) (const char * protocol) { Xtransport *trans; if ((trans = TRANS(SelectTransport)(protocol)) == NULL) { prmsg (1,"TransIsListening: unable to find transport: %s\n", protocol); return 0; } return !(trans->flags & TRANS_NOLISTEN); } int TRANS(ResetListener) (XtransConnInfo ciptr) { if (ciptr->transptr->ResetListener) return ciptr->transptr->ResetListener (ciptr); else return TRANS_RESET_NOOP; } XtransConnInfo TRANS(Accept) (XtransConnInfo ciptr, int *status) { XtransConnInfo newciptr; prmsg (2,"Accept(%d)\n", ciptr->fd); newciptr = ciptr->transptr->Accept (ciptr, status); if (newciptr) newciptr->transptr = ciptr->transptr; return newciptr; } #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT int TRANS(Connect) (XtransConnInfo ciptr, const char *address) { char *protocol; char *host; char *port; int ret; prmsg (2,"Connect(%d,%s)\n", ciptr->fd, address); if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0) { prmsg (1,"Connect: Unable to Parse address %s\n", address); return -1; } #ifdef HAVE_LAUNCHD if (!host) host=strdup(""); #endif if (!port || !*port) { prmsg (1,"Connect: Missing port specification in %s\n", address); if (protocol) free (protocol); if (host) free (host); return -1; } ret = ciptr->transptr->Connect (ciptr, host, port); if (protocol) free (protocol); if (host) free (host); if (port) free (port); return ret; } #endif /* TRANS_CLIENT */ int TRANS(BytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend) { return ciptr->transptr->BytesReadable (ciptr, pend); } int TRANS(Read) (XtransConnInfo ciptr, char *buf, int size) { return ciptr->transptr->Read (ciptr, buf, size); } int TRANS(Write) (XtransConnInfo ciptr, char *buf, int size) { return ciptr->transptr->Write (ciptr, buf, size); } int TRANS(Readv) (XtransConnInfo ciptr, struct iovec *buf, int size) { return ciptr->transptr->Readv (ciptr, buf, size); } int TRANS(Writev) (XtransConnInfo ciptr, struct iovec *buf, int size) { return ciptr->transptr->Writev (ciptr, buf, size); } #if XTRANS_SEND_FDS int TRANS(SendFd) (XtransConnInfo ciptr, int fd, int do_close) { return ciptr->transptr->SendFd(ciptr, fd, do_close); } int TRANS(RecvFd) (XtransConnInfo ciptr) { return ciptr->transptr->RecvFd(ciptr); } #endif int TRANS(Disconnect) (XtransConnInfo ciptr) { return ciptr->transptr->Disconnect (ciptr); } int TRANS(Close) (XtransConnInfo ciptr) { int ret; prmsg (2,"Close(%d)\n", ciptr->fd); ret = ciptr->transptr->Close (ciptr); TRANS(FreeConnInfo) (ciptr); return ret; } int TRANS(CloseForCloning) (XtransConnInfo ciptr) { int ret; prmsg (2,"CloseForCloning(%d)\n", ciptr->fd); ret = ciptr->transptr->CloseForCloning (ciptr); TRANS(FreeConnInfo) (ciptr); return ret; } int TRANS(IsLocal) (XtransConnInfo ciptr) { return (ciptr->family == AF_UNIX); } int TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, Xtransaddr **addrp) { prmsg (2,"GetMyAddr(%d)\n", ciptr->fd); *familyp = ciptr->family; *addrlenp = ciptr->addrlen; if ((*addrp = malloc (ciptr->addrlen)) == NULL) { prmsg (1,"GetMyAddr: malloc failed\n"); return -1; } memcpy(*addrp, ciptr->addr, ciptr->addrlen); return 0; } int TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, Xtransaddr **addrp) { prmsg (2,"GetPeerAddr(%d)\n", ciptr->fd); *familyp = ciptr->family; *addrlenp = ciptr->peeraddrlen; if ((*addrp = malloc (ciptr->peeraddrlen)) == NULL) { prmsg (1,"GetPeerAddr: malloc failed\n"); return -1; } memcpy(*addrp, ciptr->peeraddr, ciptr->peeraddrlen); return 0; } int TRANS(GetConnectionNumber) (XtransConnInfo ciptr) { return ciptr->fd; } /* * These functions are really utility functions, but they require knowledge * of the internal data structures, so they have to be part of the Transport * Independant API. */ #ifdef TRANS_SERVER static int complete_network_count (void) { int count = 0; int found_local = 0; int i; /* * For a complete network, we only need one LOCALCONN transport to work */ for (i = 0; i < NUMTRANS; i++) { if (Xtransports[i].transport->flags & TRANS_ALIAS || Xtransports[i].transport->flags & TRANS_NOLISTEN) continue; if (Xtransports[i].transport->flags & TRANS_LOCAL) found_local = 1; else count++; } return (count + found_local); } static int receive_listening_fds(const char* port, XtransConnInfo* temp_ciptrs, int* count_ret) { #ifdef HAVE_SYSTEMD_DAEMON XtransConnInfo ciptr; int i, systemd_listen_fds; systemd_listen_fds = sd_listen_fds(1); if (systemd_listen_fds < 0) { prmsg (1, "receive_listening_fds: sd_listen_fds error: %s\n", strerror(-systemd_listen_fds)); return -1; } for (i = 0; i < systemd_listen_fds && *count_ret < NUMTRANS; i++) { struct sockaddr_storage a; int ti; const char* tn; socklen_t al; al = sizeof(a); if (getsockname(i + SD_LISTEN_FDS_START, (struct sockaddr*)&a, &al) < 0) { prmsg (1, "receive_listening_fds: getsockname error: %s\n", strerror(errno)); return -1; } switch (a.ss_family) { case AF_UNIX: ti = TRANS_SOCKET_UNIX_INDEX; if (*((struct sockaddr_un*)&a)->sun_path == '\0' && al > sizeof(sa_family_t)) tn = "local"; else tn = "unix"; break; case AF_INET: ti = TRANS_SOCKET_INET_INDEX; tn = "inet"; break; #if defined(IPv6) && defined(AF_INET6) case AF_INET6: ti = TRANS_SOCKET_INET6_INDEX; tn = "inet6"; break; #endif /* IPv6 */ default: prmsg (1, "receive_listening_fds:" "Got unknown socket address family\n"); return -1; } ciptr = TRANS(ReopenCOTSServer)(ti, i + SD_LISTEN_FDS_START, port); if (!ciptr) { prmsg (1, "receive_listening_fds:" "Got NULL while trying to reopen socket received from systemd.\n"); return -1; } prmsg (5, "receive_listening_fds: received listener for %s, %d\n", tn, ciptr->fd); temp_ciptrs[(*count_ret)++] = ciptr; TRANS(Received)(tn); } #endif /* HAVE_SYSTEMD_DAEMON */ return 0; } #ifdef XQUARTZ_EXPORTS_LAUNCHD_FD extern int xquartz_launchd_fd; #endif int TRANS(MakeAllCOTSServerListeners) (const char *port, int *partial, int *count_ret, XtransConnInfo **ciptrs_ret) { char buffer[256]; /* ??? What size ?? */ XtransConnInfo ciptr, temp_ciptrs[NUMTRANS]; int status, i, j; #if defined(IPv6) && defined(AF_INET6) int ipv6_succ = 0; #endif prmsg (2,"MakeAllCOTSServerListeners(%s,%p)\n", port ? port : "NULL", ciptrs_ret); *count_ret = 0; #ifdef XQUARTZ_EXPORTS_LAUNCHD_FD fprintf(stderr, "Launchd socket fd: %d\n", xquartz_launchd_fd); if(xquartz_launchd_fd != -1) { if((ciptr = TRANS(ReopenCOTSServer(TRANS_SOCKET_LOCAL_INDEX, xquartz_launchd_fd, getenv("DISPLAY"))))==NULL) fprintf(stderr,"Got NULL while trying to Reopen launchd port\n"); else temp_ciptrs[(*count_ret)++] = ciptr; } #endif if (receive_listening_fds(port, temp_ciptrs, count_ret) < 0) return -1; for (i = 0; i < NUMTRANS; i++) { Xtransport *trans = Xtransports[i].transport; unsigned int flags = 0; if (trans->flags&TRANS_ALIAS || trans->flags&TRANS_NOLISTEN || trans->flags&TRANS_RECEIVED) continue; snprintf(buffer, sizeof(buffer), "%s/:%s", trans->TransName, port ? port : ""); prmsg (5,"MakeAllCOTSServerListeners: opening %s\n", buffer); if ((ciptr = TRANS(OpenCOTSServer(buffer))) == NULL) { if (trans->flags & TRANS_DISABLED) continue; prmsg (1, "MakeAllCOTSServerListeners: failed to open listener for %s\n", trans->TransName); continue; } #if defined(IPv6) && defined(AF_INET6) if ((Xtransports[i].transport_id == TRANS_SOCKET_INET_INDEX && ipv6_succ)) flags |= ADDR_IN_USE_ALLOWED; #endif if ((status = TRANS(CreateListener (ciptr, port, flags))) < 0) { if (status == TRANS_ADDR_IN_USE) { /* * We failed to bind to the specified address because the * address is in use. It must be that a server is already * running at this address, and this function should fail. */ prmsg (1, "MakeAllCOTSServerListeners: server already running\n"); for (j = 0; j < *count_ret; j++) TRANS(Close) (temp_ciptrs[j]); *count_ret = 0; *ciptrs_ret = NULL; *partial = 0; return -1; } else { prmsg (1, "MakeAllCOTSServerListeners: failed to create listener for %s\n", trans->TransName); continue; } } #if defined(IPv6) && defined(AF_INET6) if (Xtransports[i].transport_id == TRANS_SOCKET_INET6_INDEX) ipv6_succ = 1; #endif prmsg (5, "MakeAllCOTSServerListeners: opened listener for %s, %d\n", trans->TransName, ciptr->fd); temp_ciptrs[*count_ret] = ciptr; (*count_ret)++; } *partial = (*count_ret < complete_network_count()); prmsg (5, "MakeAllCOTSServerListeners: partial=%d, actual=%d, complete=%d \n", *partial, *count_ret, complete_network_count()); if (*count_ret > 0) { if ((*ciptrs_ret = malloc ( *count_ret * sizeof (XtransConnInfo))) == NULL) { return -1; } for (i = 0; i < *count_ret; i++) { (*ciptrs_ret)[i] = temp_ciptrs[i]; } } else *ciptrs_ret = NULL; return 0; } int TRANS(MakeAllCLTSServerListeners) (const char *port, int *partial, int *count_ret, XtransConnInfo **ciptrs_ret) { char buffer[256]; /* ??? What size ?? */ XtransConnInfo ciptr, temp_ciptrs[NUMTRANS]; int status, i, j; prmsg (2,"MakeAllCLTSServerListeners(%s,%p)\n", port ? port : "NULL", ciptrs_ret); *count_ret = 0; for (i = 0; i < NUMTRANS; i++) { Xtransport *trans = Xtransports[i].transport; if (trans->flags&TRANS_ALIAS || trans->flags&TRANS_NOLISTEN) continue; snprintf(buffer, sizeof(buffer), "%s/:%s", trans->TransName, port ? port : ""); prmsg (5,"MakeAllCLTSServerListeners: opening %s\n", buffer); if ((ciptr = TRANS(OpenCLTSServer (buffer))) == NULL) { prmsg (1, "MakeAllCLTSServerListeners: failed to open listener for %s\n", trans->TransName); continue; } if ((status = TRANS(CreateListener (ciptr, port, 0))) < 0) { if (status == TRANS_ADDR_IN_USE) { /* * We failed to bind to the specified address because the * address is in use. It must be that a server is already * running at this address, and this function should fail. */ prmsg (1, "MakeAllCLTSServerListeners: server already running\n"); for (j = 0; j < *count_ret; j++) TRANS(Close) (temp_ciptrs[j]); *count_ret = 0; *ciptrs_ret = NULL; *partial = 0; return -1; } else { prmsg (1, "MakeAllCLTSServerListeners: failed to create listener for %s\n", trans->TransName); continue; } } prmsg (5, "MakeAllCLTSServerListeners: opened listener for %s, %d\n", trans->TransName, ciptr->fd); temp_ciptrs[*count_ret] = ciptr; (*count_ret)++; } *partial = (*count_ret < complete_network_count()); prmsg (5, "MakeAllCLTSServerListeners: partial=%d, actual=%d, complete=%d \n", *partial, *count_ret, complete_network_count()); if (*count_ret > 0) { if ((*ciptrs_ret = malloc ( *count_ret * sizeof (XtransConnInfo))) == NULL) { return -1; } for (i = 0; i < *count_ret; i++) { (*ciptrs_ret)[i] = temp_ciptrs[i]; } } else *ciptrs_ret = NULL; return 0; } #endif /* TRANS_SERVER */ /* * These routines are not part of the X Transport Interface, but they * may be used by it. */ #if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) /* * emulate readv */ static int TRANS(ReadV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt) { int i, len, total; char *base; ESET(0); for (i = 0, total = 0; i < iovcnt; i++, iov++) { len = iov->iov_len; base = iov->iov_base; while (len > 0) { register int nbytes; nbytes = TRANS(Read) (ciptr, base, len); if (nbytes < 0 && total == 0) return -1; if (nbytes <= 0) return total; ESET(0); len -= nbytes; total += nbytes; base += nbytes; } } return total; } #endif /* SYSV && __i386__ || WIN32 || __sxg__ */ #if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) /* * emulate writev */ static int TRANS(WriteV) (XtransConnInfo ciptr, struct iovec *iov, int iovcnt) { int i, len, total; char *base; ESET(0); for (i = 0, total = 0; i < iovcnt; i++, iov++) { len = iov->iov_len; base = iov->iov_base; while (len > 0) { register int nbytes; nbytes = TRANS(Write) (ciptr, base, len); if (nbytes < 0 && total == 0) return -1; if (nbytes <= 0) return total; ESET(0); len -= nbytes; total += nbytes; base += nbytes; } } return total; } #endif /* SYSV && __i386__ || WIN32 || __sxg__ */ #if defined(_POSIX_SOURCE) || defined(USG) || defined(SVR4) || defined(__SVR4) || defined(__SCO__) #ifndef NEED_UTSNAME #define NEED_UTSNAME #endif #include #endif /* * TRANS(GetHostname) - similar to gethostname but allows special processing. */ int TRANS(GetHostname) (char *buf, int maxlen) { int len; #ifdef NEED_UTSNAME struct utsname name; uname (&name); len = strlen (name.nodename); if (len >= maxlen) len = maxlen - 1; strncpy (buf, name.nodename, len); buf[len] = '\0'; #else buf[0] = '\0'; (void) gethostname (buf, maxlen); buf [maxlen - 1] = '\0'; len = strlen(buf); #endif /* NEED_UTSNAME */ return len; } ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xtrans/Xtrans.h ================================================ /* Copyright 1993, 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name NCR not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. NCR makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _XTRANS_H_ #define _XTRANS_H_ #include #include #ifndef WIN32 #include #endif #ifdef __clang__ /* Not all clients make use of all provided statics */ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" #endif /* * Set the functions names according to where this code is being compiled. */ #ifdef X11_t #define TRANS(func) _X11Trans##func #ifdef XTRANSDEBUG static const char *__xtransname = "_X11Trans"; #endif #endif /* X11_t */ #ifdef XSERV_t #define TRANS(func) _XSERVTrans##func #ifdef XTRANSDEBUG static const char *__xtransname = "_XSERVTrans"; #endif #define X11_t #endif /* XSERV_t */ #ifdef XIM_t #define TRANS(func) _XimXTrans##func #ifdef XTRANSDEBUG static const char *__xtransname = "_XimTrans"; #endif #endif /* XIM_t */ #ifdef FS_t #define TRANS(func) _FSTrans##func #ifdef XTRANSDEBUG static const char *__xtransname = "_FSTrans"; #endif #endif /* FS_t */ #ifdef FONT_t #define TRANS(func) _FontTrans##func #ifdef XTRANSDEBUG static const char *__xtransname = "_FontTrans"; #endif #endif /* FONT_t */ #ifdef ICE_t #define TRANS(func) _IceTrans##func #ifdef XTRANSDEBUG static const char *__xtransname = "_IceTrans"; #endif #endif /* ICE_t */ #ifdef TEST_t #define TRANS(func) _TESTTrans##func #ifdef XTRANSDEBUG static const char *__xtransname = "_TESTTrans"; #endif #endif /* TEST_t */ #ifdef LBXPROXY_t #define TRANS(func) _LBXPROXYTrans##func #define X11_t /* The server defines this - so should the LBX proxy */ #ifdef XTRANSDEBUG static const char *__xtransname = "_LBXPROXYTrans"; #endif #endif /* LBXPROXY_t */ #if !defined(TRANS) #define TRANS(func) _XTrans##func #ifdef XTRANSDEBUG static const char *__xtransname = "_XTrans"; #endif #endif /* !TRANS */ #ifdef __clang__ #pragma clang diagnostic pop #endif /* * Create a single address structure that can be used wherever * an address structure is needed. struct sockaddr is not big enough * to hold a sockadd_un, so we create this definition to have a single * structure that is big enough for all the structures we might need. * * This structure needs to be independent of the socket/TLI interface used. */ #if defined(IPv6) && defined(AF_INET6) typedef struct sockaddr_storage Xtransaddr; #else #define XTRANS_MAX_ADDR_LEN 128 /* large enough to hold sun_path */ typedef struct { unsigned char addr[XTRANS_MAX_ADDR_LEN]; } Xtransaddr; #endif #ifdef LONG64 typedef int BytesReadable_t; #else typedef long BytesReadable_t; #endif #if defined(WIN32) || defined(USG) /* * TRANS(Readv) and TRANS(Writev) use struct iovec, normally found * in Berkeley systems in . See the readv(2) and writev(2) * manual pages for details. */ struct iovec { caddr_t iov_base; int iov_len; }; #else #include #endif typedef struct _XtransConnInfo *XtransConnInfo; /* * Transport Option definitions */ #define TRANS_NONBLOCKING 1 #define TRANS_CLOSEONEXEC 2 /* * Return values of Connect (0 is success) */ #define TRANS_CONNECT_FAILED -1 #define TRANS_TRY_CONNECT_AGAIN -2 #define TRANS_IN_PROGRESS -3 /* * Return values of CreateListener (0 is success) */ #define TRANS_CREATE_LISTENER_FAILED -1 #define TRANS_ADDR_IN_USE -2 /* * Return values of Accept (0 is success) */ #define TRANS_ACCEPT_BAD_MALLOC -1 #define TRANS_ACCEPT_FAILED -2 #define TRANS_ACCEPT_MISC_ERROR -3 /* * ResetListener return values */ #define TRANS_RESET_NOOP 1 #define TRANS_RESET_NEW_FD 2 #define TRANS_RESET_FAILURE 3 /* * Function prototypes for the exposed interface */ void TRANS(FreeConnInfo) ( XtransConnInfo /* ciptr */ ); #ifdef TRANS_CLIENT XtransConnInfo TRANS(OpenCOTSClient)( const char * /* address */ ); #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER XtransConnInfo TRANS(OpenCOTSServer)( const char * /* address */ ); #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT XtransConnInfo TRANS(OpenCLTSClient)( const char * /* address */ ); #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER XtransConnInfo TRANS(OpenCLTSServer)( const char * /* address */ ); #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN XtransConnInfo TRANS(ReopenCOTSServer)( int, /* trans_id */ int, /* fd */ const char * /* port */ ); XtransConnInfo TRANS(ReopenCLTSServer)( int, /* trans_id */ int, /* fd */ const char * /* port */ ); int TRANS(GetReopenInfo)( XtransConnInfo, /* ciptr */ int *, /* trans_id */ int *, /* fd */ char ** /* port */ ); #endif /* TRANS_REOPEN */ int TRANS(SetOption)( XtransConnInfo, /* ciptr */ int, /* option */ int /* arg */ ); #ifdef TRANS_SERVER int TRANS(CreateListener)( XtransConnInfo, /* ciptr */ const char *, /* port */ unsigned int /* flags */ ); int TRANS(Received) ( const char* /* protocol*/ ); int TRANS(NoListen) ( const char* /* protocol*/ ); int TRANS(Listen) ( const char* /* protocol*/ ); int TRANS(IsListening) ( const char* /* protocol*/ ); int TRANS(ResetListener)( XtransConnInfo /* ciptr */ ); XtransConnInfo TRANS(Accept)( XtransConnInfo, /* ciptr */ int * /* status */ ); #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT int TRANS(Connect)( XtransConnInfo, /* ciptr */ const char * /* address */ ); #endif /* TRANS_CLIENT */ int TRANS(BytesReadable)( XtransConnInfo, /* ciptr */ BytesReadable_t * /* pend */ ); int TRANS(Read)( XtransConnInfo, /* ciptr */ char *, /* buf */ int /* size */ ); int TRANS(Write)( XtransConnInfo, /* ciptr */ char *, /* buf */ int /* size */ ); int TRANS(Readv)( XtransConnInfo, /* ciptr */ struct iovec *, /* buf */ int /* size */ ); int TRANS(Writev)( XtransConnInfo, /* ciptr */ struct iovec *, /* buf */ int /* size */ ); int TRANS(SendFd) (XtransConnInfo ciptr, int fd, int do_close); int TRANS(RecvFd) (XtransConnInfo ciptr); int TRANS(Disconnect)( XtransConnInfo /* ciptr */ ); int TRANS(Close)( XtransConnInfo /* ciptr */ ); int TRANS(CloseForCloning)( XtransConnInfo /* ciptr */ ); int TRANS(IsLocal)( XtransConnInfo /* ciptr */ ); int TRANS(GetMyAddr)( XtransConnInfo, /* ciptr */ int *, /* familyp */ int *, /* addrlenp */ Xtransaddr ** /* addrp */ ); int TRANS(GetPeerAddr)( XtransConnInfo, /* ciptr */ int *, /* familyp */ int *, /* addrlenp */ Xtransaddr ** /* addrp */ ); int TRANS(GetConnectionNumber)( XtransConnInfo /* ciptr */ ); #ifdef TRANS_SERVER int TRANS(MakeAllCOTSServerListeners)( const char *, /* port */ int *, /* partial */ int *, /* count_ret */ XtransConnInfo ** /* ciptrs_ret */ ); int TRANS(MakeAllCLTSServerListeners)( const char *, /* port */ int *, /* partial */ int *, /* count_ret */ XtransConnInfo ** /* ciptrs_ret */ ); #endif /* TRANS_SERVER */ /* * Function Prototypes for Utility Functions. */ #ifdef X11_t int TRANS(ConvertAddress)( int *, /* familyp */ int *, /* addrlenp */ Xtransaddr ** /* addrp */ ); #endif /* X11_t */ #ifdef ICE_t char * TRANS(GetMyNetworkId)( XtransConnInfo /* ciptr */ ); char * TRANS(GetPeerNetworkId)( XtransConnInfo /* ciptr */ ); #endif /* ICE_t */ int TRANS(GetHostname) ( char * /* buf */, int /* maxlen */ ); #if defined(WIN32) && defined(TCPCONN) int TRANS(WSAStartup)(); #endif #endif /* _XTRANS_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xtrans/Xtransint.h ================================================ /* Copyright 1993, 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name NCR not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. NCR makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _XTRANSINT_H_ #define _XTRANSINT_H_ /* * XTRANSDEBUG will enable the PRMSG() macros used in the X Transport * Interface code. Each use of the PRMSG macro has a level associated with * it. XTRANSDEBUG is defined to be a level. If the invocation level is =< * the value of XTRANSDEBUG, then the message will be printed out to stderr. * Recommended levels are: * * XTRANSDEBUG=1 Error messages * XTRANSDEBUG=2 API Function Tracing * XTRANSDEBUG=3 All Function Tracing * XTRANSDEBUG=4 printing of intermediate values * XTRANSDEBUG=5 really detailed stuff #define XTRANSDEBUG 2 * * Defining XTRANSDEBUGTIMESTAMP will cause printing timestamps with each * message. */ #if !defined(XTRANSDEBUG) && defined(XTRANS_TRANSPORT_C) # define XTRANSDEBUG 1 #endif #ifdef WIN32 # define _WILLWINSOCK_ #endif #include "Xtrans.h" #ifndef _X_UNUSED /* Defined in Xfuncproto.h in xproto >= 7.0.22 */ # define _X_UNUSED /* */ #endif #ifdef XTRANSDEBUG # include #endif /* XTRANSDEBUG */ #include #ifndef WIN32 # include # include # include /* * Moved the setting of NEED_UTSNAME to this header file from Xtrans.c, * to avoid a race condition. JKJ (6/5/97) */ # if defined(_POSIX_SOURCE) || defined(USG) || defined(SVR4) || defined(__SVR4) || defined(__SCO__) # ifndef NEED_UTSNAME # define NEED_UTSNAME # endif # include # endif # define ESET(val) errno = val # define EGET() errno #else /* WIN32 */ # include /* for USHRT_MAX */ # define ESET(val) WSASetLastError(val) # define EGET() WSAGetLastError() #endif /* WIN32 */ #include #ifdef X11_t #define X_TCP_PORT 6000 #endif #if XTRANS_SEND_FDS struct _XtransConnFd { struct _XtransConnFd *next; int fd; int do_close; }; #endif struct _XtransConnInfo { struct _Xtransport *transptr; int index; char *priv; int flags; int fd; char *port; int family; char *addr; int addrlen; char *peeraddr; int peeraddrlen; struct _XtransConnFd *recv_fds; struct _XtransConnFd *send_fds; }; #define XTRANS_OPEN_COTS_CLIENT 1 #define XTRANS_OPEN_COTS_SERVER 2 #define XTRANS_OPEN_CLTS_CLIENT 3 #define XTRANS_OPEN_CLTS_SERVER 4 typedef struct _Xtransport { const char *TransName; int flags; #ifdef TRANS_CLIENT XtransConnInfo (*OpenCOTSClient)( struct _Xtransport *, /* transport */ const char *, /* protocol */ const char *, /* host */ const char * /* port */ ); #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER const char ** nolisten; XtransConnInfo (*OpenCOTSServer)( struct _Xtransport *, /* transport */ const char *, /* protocol */ const char *, /* host */ const char * /* port */ ); #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT XtransConnInfo (*OpenCLTSClient)( struct _Xtransport *, /* transport */ const char *, /* protocol */ const char *, /* host */ const char * /* port */ ); #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER XtransConnInfo (*OpenCLTSServer)( struct _Xtransport *, /* transport */ const char *, /* protocol */ const char *, /* host */ const char * /* port */ ); #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN XtransConnInfo (*ReopenCOTSServer)( struct _Xtransport *, /* transport */ int, /* fd */ const char * /* port */ ); XtransConnInfo (*ReopenCLTSServer)( struct _Xtransport *, /* transport */ int, /* fd */ const char * /* port */ ); #endif /* TRANS_REOPEN */ int (*SetOption)( XtransConnInfo, /* connection */ int, /* option */ int /* arg */ ); #ifdef TRANS_SERVER /* Flags */ # define ADDR_IN_USE_ALLOWED 1 int (*CreateListener)( XtransConnInfo, /* connection */ const char *, /* port */ unsigned int /* flags */ ); int (*ResetListener)( XtransConnInfo /* connection */ ); XtransConnInfo (*Accept)( XtransConnInfo, /* connection */ int * /* status */ ); #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT int (*Connect)( XtransConnInfo, /* connection */ const char *, /* host */ const char * /* port */ ); #endif /* TRANS_CLIENT */ int (*BytesReadable)( XtransConnInfo, /* connection */ BytesReadable_t * /* pend */ ); int (*Read)( XtransConnInfo, /* connection */ char *, /* buf */ int /* size */ ); int (*Write)( XtransConnInfo, /* connection */ char *, /* buf */ int /* size */ ); int (*Readv)( XtransConnInfo, /* connection */ struct iovec *, /* buf */ int /* size */ ); int (*Writev)( XtransConnInfo, /* connection */ struct iovec *, /* buf */ int /* size */ ); #if XTRANS_SEND_FDS int (*SendFd)( XtransConnInfo, /* connection */ int, /* fd */ int /* do_close */ ); int (*RecvFd)( XtransConnInfo /* connection */ ); #endif int (*Disconnect)( XtransConnInfo /* connection */ ); int (*Close)( XtransConnInfo /* connection */ ); int (*CloseForCloning)( XtransConnInfo /* connection */ ); } Xtransport; typedef struct _Xtransport_table { Xtransport *transport; int transport_id; } Xtransport_table; /* * Flags for the flags member of Xtransport. */ #define TRANS_ALIAS (1<<0) /* record is an alias, don't create server */ #define TRANS_LOCAL (1<<1) /* local transport */ #define TRANS_DISABLED (1<<2) /* Don't open this one */ #define TRANS_NOLISTEN (1<<3) /* Don't listen on this one */ #define TRANS_NOUNLINK (1<<4) /* Don't unlink transport endpoints */ #define TRANS_ABSTRACT (1<<5) /* Use abstract sockets if available */ #define TRANS_NOXAUTH (1<<6) /* Don't verify authentication (because it's secure some other way at the OS layer) */ #define TRANS_RECEIVED (1<<7) /* The fd for this has already been opened by someone else. */ /* Flags to preserve when setting others */ #define TRANS_KEEPFLAGS (TRANS_NOUNLINK|TRANS_ABSTRACT) #ifdef XTRANS_TRANSPORT_C /* only provide static function prototypes when building the transport.c file that has them in */ #ifdef __clang__ /* Not all clients make use of all provided statics */ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" #endif /* * readv() and writev() don't exist or don't work correctly on some * systems, so they may be emulated. */ #if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) #define READV(ciptr, iov, iovcnt) TRANS(ReadV)(ciptr, iov, iovcnt) static int TRANS(ReadV)( XtransConnInfo, /* ciptr */ struct iovec *, /* iov */ int /* iovcnt */ ); #else #define READV(ciptr, iov, iovcnt) readv(ciptr->fd, iov, iovcnt) #endif /* CRAY || (SYSV && __i386__) || WIN32 || __sxg__ || */ #if defined(SYSV) && defined(__i386__) && !defined(__SCO__) && !defined(sun) || defined(WIN32) #define WRITEV(ciptr, iov, iovcnt) TRANS(WriteV)(ciptr, iov, iovcnt) static int TRANS(WriteV)( XtransConnInfo, /* ciptr */ struct iovec *, /* iov */ int /* iovcnt */ ); #else #define WRITEV(ciptr, iov, iovcnt) writev(ciptr->fd, iov, iovcnt) #endif /* CRAY || WIN32 || __sxg__ */ static int is_numeric ( const char * /* str */ ); #ifdef TRANS_SERVER static int trans_mkdir ( const char *, /* path */ int /* mode */ ); #endif #ifdef __clang__ #pragma clang diagnostic pop #endif /* * Some XTRANSDEBUG stuff */ #ifdef XTRANSDEBUG #include /* * The X server provides ErrorF() & VErrorF(), for other software that uses * xtrans, we provide our own simple versions. */ # if defined(XSERV_t) && defined(TRANS_SERVER) # include "os.h" # else static inline void _X_ATTRIBUTE_PRINTF(1, 0) VErrorF(const char *f, va_list args) { vfprintf(stderr, f, args); fflush(stderr); } static inline void _X_ATTRIBUTE_PRINTF(1, 2) ErrorF(const char *f, ...) { va_list args; va_start(args, f); VErrorF(f, args); va_end(args); } # endif /* xserver */ #endif /* XTRANSDEBUG */ static inline void _X_ATTRIBUTE_PRINTF(2, 3) prmsg(int lvl, const char *f, ...) { #ifdef XTRANSDEBUG va_list args; va_start(args, f); if (lvl <= XTRANSDEBUG) { int saveerrno = errno; ErrorF("%s", __xtransname); VErrorF(f, args); # ifdef XTRANSDEBUGTIMESTAMP { struct timeval tp; gettimeofday(&tp, 0); ErrorF("timestamp (ms): %d\n", tp.tv_sec * 1000 + tp.tv_usec / 1000); } # endif errno = saveerrno; } va_end(args); #endif /* XTRANSDEBUG */ } #endif /* XTRANS_TRANSPORT_C */ #endif /* _XTRANSINT_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xtrans/Xtranslcl.c ================================================ /* Copyright 1993, 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name NCR not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. NCR makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * * The connection code/ideas in lib/X and server/os for SVR4/Intel * environments was contributed by the following companies/groups: * * MetroLink Inc * NCR * Pittsburgh Powercomputing Corporation (PPc)/Quarterdeck Office Systems * SGCS * Unix System Laboratories (USL) / Novell * XFree86 * * The goal is to have common connection code among all SVR4/Intel vendors. * * ALL THE ABOVE COMPANIES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, * IN NO EVENT SHALL THESE COMPANIES * BE LIABLE FOR ANY SPECIAL, INDIRECT * OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE * OR PERFORMANCE OF THIS SOFTWARE. */ #include #include #include #include #include #if defined(SVR4) || defined(__SVR4) #include #endif #ifdef sun # include #else # include #endif #include #include /* * The local transports should be treated the same as a UNIX domain socket * wrt authentication, etc. Because of this, we will use struct sockaddr_un * for the address format. This will simplify the code in other places like * The X Server. */ #include #ifndef X_NO_SYS_UN #include #endif /* Types of local connections supported: * - PTS * - named pipes * - SCO */ #if !defined(sun) # define LOCAL_TRANS_PTS #endif #if defined(SVR4) || defined(__SVR4) # define LOCAL_TRANS_NAMED #endif #if defined(__SCO__) || defined(__UNIXWARE__) # define LOCAL_TRANS_SCO #endif static int TRANS(LocalClose)(XtransConnInfo ciptr); /* * These functions actually implement the local connection mechanisms. */ /* Type Not Supported */ static int TRANS(OpenFail)(XtransConnInfo ciptr _X_UNUSED, const char *port _X_UNUSED) { return -1; } #ifdef TRANS_REOPEN static int TRANS(ReopenFail)(XtransConnInfo ciptr _X_UNUSED, int fd _X_UNUSED, const char *port _X_UNUSED) { return 0; } #endif /* TRANS_REOPEN */ #if XTRANS_SEND_FDS static int TRANS(LocalRecvFdInvalid)(XtransConnInfo ciptr) { errno = EINVAL; return -1; } static int TRANS(LocalSendFdInvalid)(XtransConnInfo ciptr, int fd, int do_close) { errno = EINVAL; return -1; } #endif static int TRANS(FillAddrInfo)(XtransConnInfo ciptr, const char *sun_path, const char *peer_sun_path) { struct sockaddr_un *sunaddr; struct sockaddr_un *p_sunaddr; ciptr->family = AF_UNIX; ciptr->addrlen = sizeof (struct sockaddr_un); if ((sunaddr = malloc (ciptr->addrlen)) == NULL) { prmsg(1,"FillAddrInfo: failed to allocate memory for addr\n"); return 0; } sunaddr->sun_family = AF_UNIX; if (strlen(sun_path) > sizeof(sunaddr->sun_path) - 1) { prmsg(1, "FillAddrInfo: path too long\n"); free((char *) sunaddr); return 0; } strcpy (sunaddr->sun_path, sun_path); #if defined(BSD44SOCKETS) sunaddr->sun_len = strlen (sunaddr->sun_path); #endif ciptr->addr = (char *) sunaddr; ciptr->peeraddrlen = sizeof (struct sockaddr_un); if ((p_sunaddr = malloc (ciptr->peeraddrlen)) == NULL) { prmsg(1, "FillAddrInfo: failed to allocate memory for peer addr\n"); free (sunaddr); ciptr->addr = NULL; return 0; } p_sunaddr->sun_family = AF_UNIX; if (strlen(peer_sun_path) > sizeof(p_sunaddr->sun_path) - 1) { prmsg(1, "FillAddrInfo: peer path too long\n"); free((char *) p_sunaddr); return 0; } strcpy (p_sunaddr->sun_path, peer_sun_path); #if defined(BSD44SOCKETS) p_sunaddr->sun_len = strlen (p_sunaddr->sun_path); #endif ciptr->peeraddr = (char *) p_sunaddr; return 1; } #ifdef LOCAL_TRANS_PTS /* PTS */ #if defined(SYSV) && !defined(__SCO__) #define SIGNAL_T int #else #define SIGNAL_T void #endif /* SYSV */ typedef SIGNAL_T (*PFV)(); extern PFV signal(); extern char *ptsname( int ); static void _dummy(int sig _X_UNUSED) { } #endif /* LOCAL_TRANS_PTS */ #ifndef sun #define X_STREAMS_DIR "/dev/X" #define DEV_SPX "/dev/spx" #else #ifndef X11_t #define X_STREAMS_DIR "/dev/X" #else #define X_STREAMS_DIR "/tmp/.X11-pipe" #endif #endif #define DEV_PTMX "/dev/ptmx" #if defined(X11_t) #define PTSNODENAME "/dev/X/server." #ifdef sun #define NAMEDNODENAME "/tmp/.X11-pipe/X" #else #define NAMEDNODENAME "/dev/X/Nserver." #define SCORNODENAME "/dev/X%1sR" #define SCOSNODENAME "/dev/X%1sS" #endif /* !sun */ #endif #if defined(XIM_t) #ifdef sun #define NAMEDNODENAME "/tmp/.XIM-pipe/XIM" #else #define PTSNODENAME "/dev/X/XIM." #define NAMEDNODENAME "/dev/X/NXIM." #define SCORNODENAME "/dev/XIM.%sR" #define SCOSNODENAME "/dev/XIM.%sS" #endif #endif #if defined(FS_t) || defined (FONT_t) #ifdef sun #define NAMEDNODENAME "/tmp/.font-pipe/fs" #else /* * USL has already defined something here. We need to check with them * and see if their choice is usable here. */ #define PTSNODENAME "/dev/X/fontserver." #define NAMEDNODENAME "/dev/X/Nfontserver." #define SCORNODENAME "/dev/fontserver.%sR" #define SCOSNODENAME "/dev/fontserver.%sS" #endif #endif #if defined(ICE_t) #ifdef sun #define NAMEDNODENAME "/tmp/.ICE-pipe/" #else #define PTSNODENAME "/dev/X/ICE." #define NAMEDNODENAME "/dev/X/NICE." #define SCORNODENAME "/dev/ICE.%sR" #define SCOSNODENAME "/dev/ICE.%sS" #endif #endif #if defined(TEST_t) #ifdef sun #define NAMEDNODENAME "/tmp/.Test-unix/test" #endif #define PTSNODENAME "/dev/X/transtest." #define NAMEDNODENAME "/dev/X/Ntranstest." #define SCORNODENAME "/dev/transtest.%sR" #define SCOSNODENAME "/dev/transtest.%sS" #endif #ifdef LOCAL_TRANS_PTS #ifdef TRANS_CLIENT static int TRANS(PTSOpenClient)(XtransConnInfo ciptr, const char *port) { #ifdef PTSNODENAME int fd,server,exitval,alarm_time,ret; char server_path[64]; char *slave, namelen; char buf[20]; /* MAX_PATH_LEN?? */ PFV savef; pid_t saved_pid; #endif prmsg(2,"PTSOpenClient(%s)\n", port); #if !defined(PTSNODENAME) prmsg(1,"PTSOpenClient: Protocol is not supported by a pts connection\n"); return -1; #else if (port && *port ) { if( *port == '/' ) { /* A full pathname */ snprintf(server_path, sizeof(server_path), "%s", port); } else { snprintf(server_path, sizeof(server_path), "%s%s", PTSNODENAME, port); } } else { snprintf(server_path, sizeof(server_path), "%s%d", PTSNODENAME, getpid()); } /* * Open the node the on which the server is listening. */ if ((server = open (server_path, O_RDWR)) < 0) { prmsg(1,"PTSOpenClient: failed to open %s\n", server_path); return -1; } /* * Open the streams based pipe that will be this connection. */ if ((fd = open(DEV_PTMX, O_RDWR)) < 0) { prmsg(1,"PTSOpenClient: failed to open %s\n", DEV_PTMX); close(server); return(-1); } (void) grantpt(fd); (void) unlockpt(fd); slave = ptsname(fd); /* get name */ if( slave == NULL ) { prmsg(1,"PTSOpenClient: failed to get ptsname()\n"); close(fd); close(server); return -1; } /* * This is neccesary for the case where a program is setuid to non-root. * grantpt() calls /usr/lib/pt_chmod which is set-uid root. This program will * set the owner of the pt device incorrectly if the uid is not restored * before it is called. The problem is that once it gets restored, it * cannot be changed back to its original condition, hence the fork(). */ if(!(saved_pid=fork())) { uid_t saved_euid; saved_euid = geteuid(); /** sets the euid to the actual/real uid **/ if (setuid( getuid() ) == -1) { exit(1); } if( chown( slave, saved_euid, -1 ) < 0 ) { exit( 1 ); } exit( 0 ); } waitpid(saved_pid, &exitval, 0); if (WIFEXITED(exitval) && WEXITSTATUS(exitval) != 0) { close(fd); close(server); prmsg(1, "PTSOpenClient: cannot set the owner of %s\n", slave); return(-1); } if (chmod(slave, 0666) < 0) { close(fd); close(server); prmsg(1,"PTSOpenClient: Cannot chmod %s\n", slave); return(-1); } /* * write slave name to server */ namelen = strlen(slave); buf[0] = namelen; (void) sprintf(&buf[1], slave); (void) write(server, buf, namelen+1); (void) close(server); /* * wait for server to respond */ savef = signal(SIGALRM, _dummy); alarm_time = alarm (30); /* CONNECT_TIMEOUT */ ret = read(fd, buf, 1); (void) alarm(alarm_time); (void) signal(SIGALRM, savef); if (ret != 1) { prmsg(1, "PTSOpenClient: failed to get acknoledgement from server\n"); (void) close(fd); fd = -1; } /* * Everything looks good: fill in the XtransConnInfo structure. */ if (TRANS(FillAddrInfo) (ciptr, slave, server_path) == 0) { prmsg(1,"PTSOpenClient: failed to fill in addr info\n"); close(fd); return -1; } return(fd); #endif /* !PTSNODENAME */ } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER static int TRANS(PTSOpenServer)(XtransConnInfo ciptr, const char *port) { #ifdef PTSNODENAME int fd, server; char server_path[64], *slave; int mode; #endif prmsg(2,"PTSOpenServer(%s)\n", port); #if !defined(PTSNODENAME) prmsg(1,"PTSOpenServer: Protocol is not supported by a pts connection\n"); return -1; #else if (port && *port ) { if( *port == '/' ) { /* A full pathname */ (void) sprintf(server_path, "%s", port); } else { (void) sprintf(server_path, "%s%s", PTSNODENAME, port); } } else { (void) sprintf(server_path, "%s%d", PTSNODENAME, getpid()); } #ifdef HAS_STICKY_DIR_BIT mode = 01777; #else mode = 0777; #endif if (trans_mkdir(X_STREAMS_DIR, mode) == -1) { prmsg (1, "PTSOpenServer: mkdir(%s) failed, errno = %d\n", X_STREAMS_DIR, errno); return(-1); } #if 0 if( (fd=open(server_path, O_RDWR)) >= 0 ) { /* * This doesn't prevent the server from starting up, and doesn't * prevent clients from trying to connect to the in-use PTS (which * is often in use by something other than another server). */ prmsg(1, "PTSOpenServer: A server is already running on port %s\n", port); prmsg(1, "PTSOpenServer: Remove %s if this is incorrect.\n", server_path); close(fd); return(-1); } #else /* Just remove the old path (which is what happens with UNIXCONN) */ #endif unlink(server_path); if( (fd=open(DEV_PTMX, O_RDWR)) < 0) { prmsg(1, "PTSOpenServer: Unable to open %s\n", DEV_PTMX); return(-1); } grantpt(fd); unlockpt(fd); if( (slave=ptsname(fd)) == NULL) { prmsg(1, "PTSOpenServer: Unable to get slave device name\n"); close(fd); return(-1); } if( link(slave,server_path) < 0 ) { prmsg(1, "PTSOpenServer: Unable to link %s to %s\n", slave, server_path); close(fd); return(-1); } if( chmod(server_path, 0666) < 0 ) { prmsg(1, "PTSOpenServer: Unable to chmod %s to 0666\n", server_path); close(fd); return(-1); } if( (server=open(server_path, O_RDWR)) < 0 ) { prmsg(1, "PTSOpenServer: Unable to open server device %s\n", server_path); close(fd); return(-1); } close(server); /* * Everything looks good: fill in the XtransConnInfo structure. */ if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { prmsg(1,"PTSOpenServer: failed to fill in addr info\n"); close(fd); return -1; } return fd; #endif /* !PTSNODENAME */ } static int TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) { int newfd; int in; unsigned char length; char buf[256]; struct sockaddr_un *sunaddr; prmsg(2,"PTSAccept(%x->%d)\n",ciptr,ciptr->fd); if( (in=read(ciptr->fd,&length,1)) <= 0 ){ if( !in ) { prmsg(2, "PTSAccept: Incoming connection closed\n"); } else { prmsg(1, "PTSAccept: Error reading incoming connection. errno=%d \n", errno); } *status = TRANS_ACCEPT_MISC_ERROR; return -1; } if( (in=read(ciptr->fd,buf,length)) <= 0 ){ if( !in ) { prmsg(2, "PTSAccept: Incoming connection closed\n"); } else { prmsg(1, "PTSAccept: Error reading device name for new connection. errno=%d \n", errno); } *status = TRANS_ACCEPT_MISC_ERROR; return -1; } buf[length] = '\0'; if( (newfd=open(buf,O_RDWR)) < 0 ) { prmsg(1, "PTSAccept: Failed to open %s\n",buf); *status = TRANS_ACCEPT_MISC_ERROR; return -1; } write(newfd,"1",1); /* * Everything looks good: fill in the XtransConnInfo structure. */ newciptr->addrlen=ciptr->addrlen; if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) { prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n"); close(newfd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; } memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); newciptr->peeraddrlen=sizeof(struct sockaddr_un); if( (sunaddr = malloc(newciptr->peeraddrlen)) == NULL ) { prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n"); free(newciptr->addr); close(newfd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; } sunaddr->sun_family=AF_UNIX; strcpy(sunaddr->sun_path,buf); #if defined(BSD44SOCKETS) sunaddr->sun_len=strlen(sunaddr->sun_path); #endif newciptr->peeraddr=(char *)sunaddr; *status = 0; return newfd; } #endif /* TRANS_SERVER */ #endif /* LOCAL_TRANS_PTS */ #ifdef LOCAL_TRANS_NAMED /* NAMED */ #ifdef TRANS_CLIENT static int TRANS(NAMEDOpenClient)(XtransConnInfo ciptr, const char *port) { #ifdef NAMEDNODENAME int fd; char server_path[64]; struct stat filestat; # ifndef sun extern int isastream(int); # endif #endif prmsg(2,"NAMEDOpenClient(%s)\n", port); #if !defined(NAMEDNODENAME) prmsg(1,"NAMEDOpenClient: Protocol is not supported by a NAMED connection\n"); return -1; #else if ( port && *port ) { if( *port == '/' ) { /* A full pathname */ (void) snprintf(server_path, sizeof(server_path), "%s", port); } else { (void) snprintf(server_path, sizeof(server_path), "%s%s", NAMEDNODENAME, port); } } else { (void) snprintf(server_path, sizeof(server_path), "%s%ld", NAMEDNODENAME, (long)getpid()); } if ((fd = open(server_path, O_RDWR)) < 0) { prmsg(1,"NAMEDOpenClient: Cannot open %s for NAMED connection\n", server_path); return -1; } if (fstat(fd, &filestat) < 0 ) { prmsg(1,"NAMEDOpenClient: Cannot stat %s for NAMED connection\n", server_path); (void) close(fd); return -1; } if ((filestat.st_mode & S_IFMT) != S_IFIFO) { prmsg(1,"NAMEDOpenClient: Device %s is not a FIFO\n", server_path); /* Is this really a failure? */ (void) close(fd); return -1; } if (isastream(fd) <= 0) { prmsg(1,"NAMEDOpenClient: %s is not a streams device\n", server_path); (void) close(fd); return -1; } /* * Everything looks good: fill in the XtransConnInfo structure. */ if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { prmsg(1,"NAMEDOpenClient: failed to fill in addr info\n"); close(fd); return -1; } return(fd); #endif /* !NAMEDNODENAME */ } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER #ifdef NAMEDNODENAME static int TRANS(NAMEDOpenPipe)(const char *server_path) { int fd, pipefd[2]; struct stat sbuf; int mode; prmsg(2,"NAMEDOpenPipe(%s)\n", server_path); #ifdef HAS_STICKY_DIR_BIT mode = 01777; #else mode = 0777; #endif if (trans_mkdir(X_STREAMS_DIR, mode) == -1) { prmsg (1, "NAMEDOpenPipe: mkdir(%s) failed, errno = %d\n", X_STREAMS_DIR, errno); return(-1); } if(stat(server_path, &sbuf) != 0) { if (errno == ENOENT) { if ((fd = creat(server_path, (mode_t)0666)) == -1) { prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path); return(-1); } close(fd); if (chmod(server_path, (mode_t)0666) < 0) { prmsg(1, "NAMEDOpenPipe: Can't open %s\n", server_path); return(-1); } } else { prmsg(1, "NAMEDOpenPipe: stat on %s failed\n", server_path); return(-1); } } if( pipe(pipefd) != 0) { prmsg(1, "NAMEDOpenPipe: pipe() failed, errno=%d\n",errno); return(-1); } if( ioctl(pipefd[0], I_PUSH, "connld") != 0) { prmsg(1, "NAMEDOpenPipe: ioctl(I_PUSH,\"connld\") failed, errno=%d\n",errno); close(pipefd[0]); close(pipefd[1]); return(-1); } if( fattach(pipefd[0], server_path) != 0) { prmsg(1, "NAMEDOpenPipe: fattach(%s) failed, errno=%d\n", server_path,errno); close(pipefd[0]); close(pipefd[1]); return(-1); } return(pipefd[1]); } #endif static int TRANS(NAMEDOpenServer)(XtransConnInfo ciptr, const char *port) { #ifdef NAMEDNODENAME int fd; char server_path[64]; #endif prmsg(2,"NAMEDOpenServer(%s)\n", port); #if !defined(NAMEDNODENAME) prmsg(1,"NAMEDOpenServer: Protocol is not supported by a NAMED connection\n"); return -1; #else if ( port && *port ) { if( *port == '/' ) { /* A full pathname */ (void) snprintf(server_path, sizeof(server_path), "%s", port); } else { (void) snprintf(server_path, sizeof(server_path), "%s%s", NAMEDNODENAME, port); } } else { (void) snprintf(server_path, sizeof(server_path), "%s%ld", NAMEDNODENAME, (long)getpid()); } fd = TRANS(NAMEDOpenPipe)(server_path); if (fd < 0) { return -1; } /* * Everything looks good: fill in the XtransConnInfo structure. */ if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { prmsg(1,"NAMEDOpenServer: failed to fill in addr info\n"); TRANS(LocalClose)(ciptr); return -1; } return fd; #endif /* !NAMEDNODENAME */ } static int TRANS(NAMEDResetListener) (XtransConnInfo ciptr) { struct sockaddr_un *sockname=(struct sockaddr_un *) ciptr->addr; struct stat statb; prmsg(2,"NAMEDResetListener(%p, %d)\n", ciptr, ciptr->fd); if (ciptr->fd != -1) { /* * see if the pipe has disappeared */ if (stat (sockname->sun_path, &statb) == -1 || (statb.st_mode & S_IFMT) != S_IFIFO) { prmsg(3, "Pipe %s trashed, recreating\n", sockname->sun_path); TRANS(LocalClose)(ciptr); ciptr->fd = TRANS(NAMEDOpenPipe)(sockname->sun_path); if (ciptr->fd >= 0) return TRANS_RESET_NEW_FD; else return TRANS_CREATE_LISTENER_FAILED; } } return TRANS_RESET_NOOP; } static int TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) { struct strrecvfd str; prmsg(2,"NAMEDAccept(%p->%d)\n", ciptr, ciptr->fd); if( ioctl(ciptr->fd, I_RECVFD, &str ) < 0 ) { prmsg(1, "NAMEDAccept: ioctl(I_RECVFD) failed, errno=%d\n", errno); *status = TRANS_ACCEPT_MISC_ERROR; return(-1); } /* * Everything looks good: fill in the XtransConnInfo structure. */ newciptr->family=ciptr->family; newciptr->addrlen=ciptr->addrlen; if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) { prmsg(1, "NAMEDAccept: failed to allocate memory for pipe addr\n"); close(str.fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; } memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); newciptr->peeraddrlen=newciptr->addrlen; if( (newciptr->peeraddr = malloc(newciptr->peeraddrlen)) == NULL ) { prmsg(1, "NAMEDAccept: failed to allocate memory for peer addr\n"); free(newciptr->addr); close(str.fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; } memcpy(newciptr->peeraddr,newciptr->addr,newciptr->peeraddrlen); *status = 0; return str.fd; } #endif /* TRANS_SERVER */ #endif /* LOCAL_TRANS_NAMED */ #if defined(LOCAL_TRANS_SCO) /* * connect_spipe is used by the SCO connection type. */ static int connect_spipe(int fd1, int fd2) { long temp; struct strfdinsert sbuf; sbuf.databuf.maxlen = -1; sbuf.databuf.len = -1; sbuf.databuf.buf = NULL; sbuf.ctlbuf.maxlen = sizeof(long); sbuf.ctlbuf.len = sizeof(long); sbuf.ctlbuf.buf = (caddr_t)&temp; sbuf.offset = 0; sbuf.fildes = fd2; sbuf.flags = 0; if( ioctl(fd1, I_FDINSERT, &sbuf) < 0 ) return(-1); return(0); } /* * named_spipe is used by the SCO connection type. */ static int named_spipe(int fd, char *path) { int oldUmask, ret; struct stat sbuf; oldUmask = umask(0); (void) fstat(fd, &sbuf); ret = mknod(path, 0020666, sbuf.st_rdev); umask(oldUmask); if (ret < 0) { ret = -1; } else { ret = fd; } return(ret); } #endif /* defined(LOCAL_TRANS_SCO) */ #ifdef LOCAL_TRANS_SCO /* SCO */ /* * 2002-11-09 (jkj@sco.com) * * This code has been modified to match what is in the actual SCO X server. * This greatly helps inter-operability between X11R6 and X11R5 (the native * SCO server). Mainly, it relies on streams nodes existing in /dev, not * creating them or unlinking them, which breaks the native X server. * * However, this is only for the X protocol. For all other protocols, we * do in fact create the nodes, as only X11R6 will use them, and this makes * it possible to have both types of clients running, otherwise we get all * kinds of nasty errors on startup for anything that doesnt use the X * protocol (like SM, when KDE starts up). */ #ifdef TRANS_CLIENT static int TRANS(SCOOpenClient)(XtransConnInfo ciptr, const char *port) { #ifdef SCORNODENAME int fd, server, fl, ret; char server_path[64]; struct strbuf ctlbuf; unsigned long alarm_time; void (*savef)(); long temp; extern int getmsg(), putmsg(); #endif prmsg(2,"SCOOpenClient(%s)\n", port); if (!port || !port[0]) port = "0"; #if !defined(SCORNODENAME) prmsg(2,"SCOOpenClient: Protocol is not supported by a SCO connection\n"); return -1; #else (void) sprintf(server_path, SCORNODENAME, port); if ((server = open(server_path, O_RDWR)) < 0) { prmsg(1,"SCOOpenClient: failed to open %s\n", server_path); return -1; } if ((fd = open(DEV_SPX, O_RDWR)) < 0) { prmsg(1,"SCOOpenClient: failed to open %s\n", DEV_SPX); close(server); return -1; } (void) write(server, &server, 1); ctlbuf.len = 0; ctlbuf.maxlen = sizeof(long); ctlbuf.buf = (caddr_t)&temp; fl = 0; savef = signal(SIGALRM, _dummy); alarm_time = alarm(10); ret = getmsg(server, &ctlbuf, 0, &fl); (void) alarm(alarm_time); (void) signal(SIGALRM, savef); if (ret < 0) { prmsg(1,"SCOOpenClient: error from getmsg\n"); close(fd); close(server); return -1; } /* The msg we got via getmsg is the result of an * I_FDINSERT, so if we do a putmsg with whatever * we recieved, we're doing another I_FDINSERT ... */ (void) putmsg(fd, &ctlbuf, 0, 0); (void) fcntl(fd,F_SETFL,fcntl(fd,F_GETFL,0)|O_NDELAY); (void) close(server); /* * Everything looks good: fill in the XtransConnInfo structure. */ #if defined(X11_t) && defined(__SCO__) ciptr->flags |= TRANS_NOUNLINK; #endif if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { prmsg(1,"SCOOpenClient: failed to fill addr info\n"); close(fd); return -1; } return(fd); #endif /* !SCORNODENAME */ } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER static int TRANS(SCOOpenServer)(XtransConnInfo ciptr, const char *port) { #ifdef SCORNODENAME char serverR_path[64]; char serverS_path[64]; struct flock mylock; int fdr = -1; int fds = -1; #endif prmsg(2,"SCOOpenServer(%s)\n", port); if (!port || !port[0]) port = "0"; #if !defined(SCORNODENAME) prmsg(1,"SCOOpenServer: Protocol is not supported by a SCO connection\n"); return -1; #else (void) sprintf(serverR_path, SCORNODENAME, port); (void) sprintf(serverS_path, SCOSNODENAME, port); #if !defined(X11_t) || !defined(__SCO__) unlink(serverR_path); unlink(serverS_path); if ((fds = open(DEV_SPX, O_RDWR)) < 0 || (fdr = open(DEV_SPX, O_RDWR)) < 0 ) { prmsg(1,"SCOOpenServer: failed to open %s\n", DEV_SPX); if (fds >= 0) close(fds); if (fdr >= 0) close(fdr); return -1; } if (named_spipe (fds, serverS_path) == -1) { prmsg(1,"SCOOpenServer: failed to create %s\n", serverS_path); close (fdr); close (fds); return -1; } if (named_spipe (fdr, serverR_path) == -1) { prmsg(1,"SCOOpenServer: failed to create %s\n", serverR_path); close (fdr); close (fds); return -1; } #else /* X11_t */ fds = open (serverS_path, O_RDWR | O_NDELAY); if (fds < 0) { prmsg(1,"SCOOpenServer: failed to open %s\n", serverS_path); return -1; } /* * Lock the connection device for the duration of the server. * This resolves multiple server starts especially on SMP machines. */ mylock.l_type = F_WRLCK; mylock.l_whence = 0; mylock.l_start = 0; mylock.l_len = 0; if (fcntl (fds, F_SETLK, &mylock) < 0) { prmsg(1,"SCOOpenServer: failed to lock %s\n", serverS_path); close (fds); return -1; } fdr = open (serverR_path, O_RDWR | O_NDELAY); if (fdr < 0) { prmsg(1,"SCOOpenServer: failed to open %s\n", serverR_path); close (fds); return -1; } #endif /* X11_t */ if (connect_spipe(fds, fdr)) { prmsg(1,"SCOOpenServer: ioctl(I_FDINSERT) failed on %s\n", serverS_path); close (fdr); close (fds); return -1; } /* * Everything looks good: fill in the XtransConnInfo structure. */ #if defined(X11_t) && defined(__SCO__) ciptr->flags |= TRANS_NOUNLINK; #endif if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0) { prmsg(1,"SCOOpenServer: failed to fill in addr info\n"); close(fds); close(fdr); return -1; } return(fds); #endif /* !SCORNODENAME */ } static int TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) { char c; int fd; prmsg(2,"SCOAccept(%d)\n", ciptr->fd); if (read(ciptr->fd, &c, 1) < 0) { prmsg(1,"SCOAccept: can't read from client\n"); *status = TRANS_ACCEPT_MISC_ERROR; return(-1); } if( (fd = open(DEV_SPX, O_RDWR)) < 0 ) { prmsg(1,"SCOAccept: can't open \"%s\"\n",DEV_SPX); *status = TRANS_ACCEPT_MISC_ERROR; return(-1); } if (connect_spipe (ciptr->fd, fd) < 0) { prmsg(1,"SCOAccept: ioctl(I_FDINSERT) failed\n"); close (fd); *status = TRANS_ACCEPT_MISC_ERROR; return -1; } /* * Everything looks good: fill in the XtransConnInfo structure. */ newciptr->addrlen=ciptr->addrlen; if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) { prmsg(1, "SCOAccept: failed to allocate memory for peer addr\n"); close(fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; } memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); #if defined(__SCO__) newciptr->flags |= TRANS_NOUNLINK; #endif newciptr->peeraddrlen=newciptr->addrlen; if( (newciptr->peeraddr = malloc(newciptr->peeraddrlen)) == NULL ) { prmsg(1, "SCOAccept: failed to allocate memory for peer addr\n"); free(newciptr->addr); close(fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; } memcpy(newciptr->peeraddr,newciptr->addr,newciptr->peeraddrlen); *status = 0; return(fd); } #endif /* TRANS_SERVER */ #endif /* LOCAL_TRANS_SCO */ #ifdef TRANS_REOPEN #ifdef LOCAL_TRANS_PTS static int TRANS(PTSReopenServer)(XtransConnInfo ciptr, int fd, const char *port) { #ifdef PTSNODENAME char server_path[64]; #endif prmsg(2,"PTSReopenServer(%d,%s)\n", fd, port); #if !defined(PTSNODENAME) prmsg(1,"PTSReopenServer: Protocol is not supported by a pts connection\n"); return 0; #else if (port && *port ) { if( *port == '/' ) { /* A full pathname */ snprintf(server_path, sizeof(server_path), "%s", port); } else { snprintf(server_path, sizeof(server_path), "%s%s", PTSNODENAME, port); } } else { snprintf(server_path, sizeof(server_path), "%s%ld", PTSNODENAME, (long)getpid()); } if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { prmsg(1,"PTSReopenServer: failed to fill in addr info\n"); return 0; } return 1; #endif /* !PTSNODENAME */ } #endif /* LOCAL_TRANS_PTS */ #ifdef LOCAL_TRANS_NAMED static int TRANS(NAMEDReopenServer)(XtransConnInfo ciptr, int fd _X_UNUSED, const char *port) { #ifdef NAMEDNODENAME char server_path[64]; #endif prmsg(2,"NAMEDReopenServer(%s)\n", port); #if !defined(NAMEDNODENAME) prmsg(1,"NAMEDReopenServer: Protocol is not supported by a NAMED connection\n"); return 0; #else if ( port && *port ) { if( *port == '/' ) { /* A full pathname */ snprintf(server_path, sizeof(server_path),"%s", port); } else { snprintf(server_path, sizeof(server_path), "%s%s", NAMEDNODENAME, port); } } else { snprintf(server_path, sizeof(server_path), "%s%ld", NAMEDNODENAME, (long)getpid()); } if (TRANS(FillAddrInfo) (ciptr, server_path, server_path) == 0) { prmsg(1,"NAMEDReopenServer: failed to fill in addr info\n"); return 0; } return 1; #endif /* !NAMEDNODENAME */ } #endif /* LOCAL_TRANS_NAMED */ #ifdef LOCAL_TRANS_SCO static int TRANS(SCOReopenServer)(XtransConnInfo ciptr, int fd, const char *port) { #ifdef SCORNODENAME char serverR_path[64], serverS_path[64]; #endif prmsg(2,"SCOReopenServer(%s)\n", port); if (!port || !port[0]) port = "0"; #if !defined(SCORNODENAME) prmsg(2,"SCOReopenServer: Protocol is not supported by a SCO connection\n"); return 0; #else (void) sprintf(serverR_path, SCORNODENAME, port); (void) sprintf(serverS_path, SCOSNODENAME, port); #if defined(X11_t) && defined(__SCO__) ciptr->flags |= TRANS_NOUNLINK; #endif if (TRANS(FillAddrInfo) (ciptr, serverS_path, serverR_path) == 0) { prmsg(1, "SCOReopenServer: failed to fill in addr info\n"); return 0; } return 1; #endif /* SCORNODENAME */ } #endif /* LOCAL_TRANS_SCO */ #endif /* TRANS_REOPEN */ /* * This table contains all of the entry points for the different local * connection mechanisms. */ typedef struct _LOCALtrans2dev { const char *transname; #ifdef TRANS_CLIENT int (*devcotsopenclient)( XtransConnInfo, const char * /*port*/ ); #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER int (*devcotsopenserver)( XtransConnInfo, const char * /*port*/ ); #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT int (*devcltsopenclient)( XtransConnInfo, const char * /*port*/ ); #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER int (*devcltsopenserver)( XtransConnInfo, const char * /*port*/ ); #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN int (*devcotsreopenserver)( XtransConnInfo, int, /* fd */ const char * /* port */ ); int (*devcltsreopenserver)( XtransConnInfo, int, /* fd */ const char * /* port */ ); #endif /* TRANS_REOPEN */ #ifdef TRANS_SERVER int (*devreset)( XtransConnInfo /* ciptr */ ); int (*devaccept)( XtransConnInfo, XtransConnInfo, int * ); #endif /* TRANS_SERVER */ } LOCALtrans2dev; static LOCALtrans2dev LOCALtrans2devtab[] = { #ifdef LOCAL_TRANS_PTS {"", #ifdef TRANS_CLIENT TRANS(PTSOpenClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(PTSOpenServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(OpenFail), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(OpenFail), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(PTSReopenServer), TRANS(ReopenFail), #endif #ifdef TRANS_SERVER NULL, /* ResetListener */ TRANS(PTSAccept) #endif /* TRANS_SERVER */ }, {"local", #ifdef TRANS_CLIENT TRANS(PTSOpenClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(PTSOpenServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(OpenFail), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(OpenFail), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(PTSReopenServer), TRANS(ReopenFail), #endif #ifdef TRANS_SERVER NULL, /* ResetListener */ TRANS(PTSAccept) #endif /* TRANS_SERVER */ }, {"pts", #ifdef TRANS_CLIENT TRANS(PTSOpenClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(PTSOpenServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(OpenFail), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(OpenFail), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(PTSReopenServer), TRANS(ReopenFail), #endif #ifdef TRANS_SERVER NULL, /* ResetListener */ TRANS(PTSAccept) #endif /* TRANS_SERVER */ }, #else /* !LOCAL_TRANS_PTS */ {"", #ifdef TRANS_CLIENT TRANS(NAMEDOpenClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(NAMEDOpenServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(OpenFail), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(OpenFail), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(NAMEDReopenServer), TRANS(ReopenFail), #endif #ifdef TRANS_SERVER TRANS(NAMEDResetListener), TRANS(NAMEDAccept) #endif /* TRANS_SERVER */ }, {"local", #ifdef TRANS_CLIENT TRANS(NAMEDOpenClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(NAMEDOpenServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(OpenFail), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(OpenFail), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(NAMEDReopenServer), TRANS(ReopenFail), #endif #ifdef TRANS_SERVER TRANS(NAMEDResetListener), TRANS(NAMEDAccept) #endif /* TRANS_SERVER */ }, #endif /* !LOCAL_TRANS_PTS */ #ifdef LOCAL_TRANS_NAMED {"named", #ifdef TRANS_CLIENT TRANS(NAMEDOpenClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(NAMEDOpenServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(OpenFail), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(OpenFail), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(NAMEDReopenServer), TRANS(ReopenFail), #endif #ifdef TRANS_SERVER TRANS(NAMEDResetListener), TRANS(NAMEDAccept) #endif /* TRANS_SERVER */ }, #ifdef sun /* Alias "pipe" to named, since that's what Solaris called it */ {"pipe", #ifdef TRANS_CLIENT TRANS(NAMEDOpenClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(NAMEDOpenServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(OpenFail), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(OpenFail), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(NAMEDReopenServer), TRANS(ReopenFail), #endif #ifdef TRANS_SERVER TRANS(NAMEDResetListener), TRANS(NAMEDAccept) #endif /* TRANS_SERVER */ }, #endif /* sun */ #endif /* LOCAL_TRANS_NAMED */ #ifdef LOCAL_TRANS_SCO {"sco", #ifdef TRANS_CLIENT TRANS(SCOOpenClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(SCOOpenServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(OpenFail), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(OpenFail), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(SCOReopenServer), TRANS(ReopenFail), #endif #ifdef TRANS_SERVER NULL, /* ResetListener */ TRANS(SCOAccept) #endif /* TRANS_SERVER */ }, #endif /* LOCAL_TRANS_SCO */ }; #define NUMTRANSPORTS (sizeof(LOCALtrans2devtab)/sizeof(LOCALtrans2dev)) static const char *XLOCAL=NULL; static char *workingXLOCAL=NULL; static char *freeXLOCAL=NULL; #if defined(__SCO__) #define DEF_XLOCAL "SCO:UNIX:PTS" #elif defined(__UNIXWARE__) #define DEF_XLOCAL "UNIX:PTS:NAMED:SCO" #elif defined(sun) #define DEF_XLOCAL "UNIX:NAMED" #else #define DEF_XLOCAL "UNIX:PTS:NAMED:SCO" #endif static void TRANS(LocalInitTransports)(const char *protocol) { prmsg(3,"LocalInitTransports(%s)\n", protocol); if( strcmp(protocol,"local") && strcmp(protocol,"LOCAL") ) { workingXLOCAL = freeXLOCAL = strdup (protocol); } else { XLOCAL=(char *)getenv("XLOCAL"); if(XLOCAL==NULL) XLOCAL=DEF_XLOCAL; workingXLOCAL = freeXLOCAL = strdup (XLOCAL); } } static void TRANS(LocalEndTransports)(void) { prmsg(3,"LocalEndTransports()\n"); free(freeXLOCAL); } #define TYPEBUFSIZE 32 #ifdef TRANS_CLIENT static LOCALtrans2dev * TRANS(LocalGetNextTransport)(void) { int i,j; char *typetocheck; char typebuf[TYPEBUFSIZE]; prmsg(3,"LocalGetNextTransport()\n"); while(1) { if( workingXLOCAL == NULL || *workingXLOCAL == '\0' ) return NULL; typetocheck=workingXLOCAL; workingXLOCAL=strchr(workingXLOCAL,':'); if(workingXLOCAL && *workingXLOCAL) *workingXLOCAL++='\0'; for(i=0;i #endif /* * Make sure 'host' is really local. */ static int HostReallyLocal (const char *host) { /* * The 'host' passed to this function may have been generated * by either uname() or gethostname(). We try both if possible. */ #ifdef NEED_UTSNAME struct utsname name; #endif char buf[256]; #ifdef NEED_UTSNAME if (uname (&name) >= 0 && strcmp (host, name.nodename) == 0) return (1); #endif buf[0] = '\0'; (void) gethostname (buf, 256); buf[255] = '\0'; if (strcmp (host, buf) == 0) return (1); return (0); } static XtransConnInfo TRANS(LocalOpenClient)(int type, const char *protocol, const char *host, const char *port) { LOCALtrans2dev *transptr; XtransConnInfo ciptr; int index; prmsg(3,"LocalOpenClient()\n"); /* * Make sure 'host' is really local. If not, we return failure. * The reason we make this check is because a process may advertise * a "local" address for which it can accept connections, but if a * process on a remote machine tries to connect to this address, * we know for sure it will fail. */ if (strcmp (host, "unix") != 0 && !HostReallyLocal (host)) { prmsg (1, "LocalOpenClient: Cannot connect to non-local host %s\n", host); return NULL; } #if defined(X11_t) /* * X has a well known port, that is transport dependant. It is easier * to handle it here, than try and come up with a transport independent * representation that can be passed in and resolved the usual way. * * The port that is passed here is really a string containing the idisplay * from ConnectDisplay(). Since that is what we want for the local transports, * we don't have to do anything special. */ #endif /* X11_t */ if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { prmsg(1,"LocalOpenClient: calloc(1,%lu) failed\n", sizeof(struct _XtransConnInfo)); return NULL; } ciptr->fd = -1; TRANS(LocalInitTransports)(protocol); index = 0; for(transptr=TRANS(LocalGetNextTransport)(); transptr!=NULL;transptr=TRANS(LocalGetNextTransport)(), index++) { switch( type ) { case XTRANS_OPEN_COTS_CLIENT: ciptr->fd=transptr->devcotsopenclient(ciptr,port); break; case XTRANS_OPEN_CLTS_CLIENT: ciptr->fd=transptr->devcltsopenclient(ciptr,port); break; case XTRANS_OPEN_COTS_SERVER: case XTRANS_OPEN_CLTS_SERVER: prmsg(1, "LocalOpenClient: Should not be opening a server with this function\n"); break; default: prmsg(1, "LocalOpenClient: Unknown Open type %d\n", type); } if( ciptr->fd >= 0 ) break; } TRANS(LocalEndTransports)(); if( ciptr->fd < 0 ) { free(ciptr); return NULL; } ciptr->priv=(char *)transptr; ciptr->index = index; return ciptr; } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER static XtransConnInfo TRANS(LocalOpenServer)(int type, const char *protocol, const char *host _X_UNUSED, const char *port) { int i; XtransConnInfo ciptr; prmsg(2,"LocalOpenServer(%d,%s,%s)\n", type, protocol, port); #if defined(X11_t) /* * For X11, the port will be in the format xserverN where N is the * display number. All of the local connections just need to know * the display number because they don't do any name resolution on * the port. This just truncates port to the display portion. */ #endif /* X11_t */ if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { prmsg(1,"LocalOpenServer: calloc(1,%lu) failed\n", sizeof(struct _XtransConnInfo)); return NULL; } for(i=1;ifd=LOCALtrans2devtab[i].devcotsopenserver(ciptr,port); break; case XTRANS_OPEN_CLTS_SERVER: ciptr->fd=LOCALtrans2devtab[i].devcltsopenserver(ciptr,port); break; default: prmsg(1,"LocalOpenServer: Unknown Open type %d\n", type ); } if( ciptr->fd >= 0 ) { ciptr->priv=(char *)&LOCALtrans2devtab[i]; ciptr->index=i; ciptr->flags = 1 | (ciptr->flags & TRANS_KEEPFLAGS); return ciptr; } } free(ciptr); return NULL; } #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN static XtransConnInfo TRANS(LocalReopenServer)(int type, int index, int fd, const char *port) { XtransConnInfo ciptr; int stat = 0; prmsg(2,"LocalReopenServer(%d,%d,%d)\n", type, index, fd); if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { prmsg(1,"LocalReopenServer: calloc(1,%lu) failed\n", sizeof(struct _XtransConnInfo)); return NULL; } ciptr->fd = fd; switch( type ) { case XTRANS_OPEN_COTS_SERVER: stat = LOCALtrans2devtab[index].devcotsreopenserver(ciptr,fd,port); break; case XTRANS_OPEN_CLTS_SERVER: stat = LOCALtrans2devtab[index].devcltsreopenserver(ciptr,fd,port); break; default: prmsg(1,"LocalReopenServer: Unknown Open type %d\n", type ); } if( stat > 0 ) { ciptr->priv=(char *)&LOCALtrans2devtab[index]; ciptr->index=index; ciptr->flags = 1 | (ciptr->flags & TRANS_KEEPFLAGS); return ciptr; } free(ciptr); return NULL; } #endif /* TRANS_REOPEN */ /* * This is the Local implementation of the X Transport service layer */ #ifdef TRANS_CLIENT static XtransConnInfo TRANS(LocalOpenCOTSClient)(Xtransport *thistrans _X_UNUSED, const char *protocol, const char *host, const char *port) { prmsg(2,"LocalOpenCOTSClient(%s,%s,%s)\n",protocol,host,port); return TRANS(LocalOpenClient)(XTRANS_OPEN_COTS_CLIENT, protocol, host, port); } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER static XtransConnInfo TRANS(LocalOpenCOTSServer)(Xtransport *thistrans, const char *protocol, const char *host, const char *port) { char *typetocheck = NULL; int found = 0; char typebuf[TYPEBUFSIZE]; prmsg(2,"LocalOpenCOTSServer(%s,%s,%s)\n",protocol,host,port); /* Check if this local type is in the XLOCAL list */ TRANS(LocalInitTransports)("local"); typetocheck = workingXLOCAL; while (typetocheck && !found) { int j; workingXLOCAL = strchr(workingXLOCAL, ':'); if (workingXLOCAL && *workingXLOCAL) *workingXLOCAL++ = '\0'; strncpy(typebuf, typetocheck, TYPEBUFSIZE); for (j = 0; j < TYPEBUFSIZE; j++) if (isupper(typebuf[j])) typebuf[j] = tolower(typebuf[j]); if (!strcmp(thistrans->TransName, typebuf)) found = 1; typetocheck = workingXLOCAL; } TRANS(LocalEndTransports)(); if (!found) { prmsg(3,"LocalOpenCOTSServer: disabling %s\n",thistrans->TransName); thistrans->flags |= TRANS_DISABLED; return NULL; } return TRANS(LocalOpenServer)(XTRANS_OPEN_COTS_SERVER, protocol, host, port); } #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT static XtransConnInfo TRANS(LocalOpenCLTSClient)(Xtransport *thistrans _X_UNUSED, const char *protocol, const char *host, const char *port) { prmsg(2,"LocalOpenCLTSClient(%s,%s,%s)\n",protocol,host,port); return TRANS(LocalOpenClient)(XTRANS_OPEN_CLTS_CLIENT, protocol, host, port); } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER static XtransConnInfo TRANS(LocalOpenCLTSServer)(Xtransport *thistrans _X_UNUSED, const char *protocol, const char *host, const char *port) { prmsg(2,"LocalOpenCLTSServer(%s,%s,%s)\n",protocol,host,port); return TRANS(LocalOpenServer)(XTRANS_OPEN_CLTS_SERVER, protocol, host, port); } #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN static XtransConnInfo TRANS(LocalReopenCOTSServer)(Xtransport *thistrans, int fd, const char *port) { int index; prmsg(2,"LocalReopenCOTSServer(%d,%s)\n", fd, port); for(index=1;indexTransName, LOCALtrans2devtab[index].transname) == 0 ) break; } if (index >= NUMTRANSPORTS) { return (NULL); } return TRANS(LocalReopenServer)(XTRANS_OPEN_COTS_SERVER, index, fd, port); } static XtransConnInfo TRANS(LocalReopenCLTSServer)(Xtransport *thistrans, int fd, const char *port) { int index; prmsg(2,"LocalReopenCLTSServer(%d,%s)\n", fd, port); for(index=1;indexTransName, LOCALtrans2devtab[index].transname) == 0 ) break; } if (index >= NUMTRANSPORTS) { return (NULL); } return TRANS(LocalReopenServer)(XTRANS_OPEN_CLTS_SERVER, index, fd, port); } #endif /* TRANS_REOPEN */ static int TRANS(LocalSetOption)(XtransConnInfo ciptr, int option, int arg) { prmsg(2,"LocalSetOption(%d,%d,%d)\n",ciptr->fd,option,arg); return -1; } #ifdef TRANS_SERVER static int TRANS(LocalCreateListener)(XtransConnInfo ciptr, const char *port, unsigned int flags _X_UNUSED) { prmsg(2,"LocalCreateListener(%p->%d,%s)\n",ciptr,ciptr->fd,port); return 0; } static int TRANS(LocalResetListener)(XtransConnInfo ciptr) { LOCALtrans2dev *transptr; prmsg(2,"LocalResetListener(%p)\n",ciptr); transptr=(LOCALtrans2dev *)ciptr->priv; if (transptr->devreset != NULL) { return transptr->devreset(ciptr); } return TRANS_RESET_NOOP; } static XtransConnInfo TRANS(LocalAccept)(XtransConnInfo ciptr, int *status) { XtransConnInfo newciptr; LOCALtrans2dev *transptr; prmsg(2,"LocalAccept(%p->%d)\n", ciptr, ciptr->fd); transptr=(LOCALtrans2dev *)ciptr->priv; if( (newciptr = calloc(1,sizeof(struct _XtransConnInfo)))==NULL ) { prmsg(1,"LocalAccept: calloc(1,%lu) failed\n", sizeof(struct _XtransConnInfo)); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; } newciptr->fd=transptr->devaccept(ciptr,newciptr,status); if( newciptr->fd < 0 ) { free(newciptr); return NULL; } newciptr->priv=(char *)transptr; newciptr->index = ciptr->index; *status = 0; return newciptr; } #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT static int TRANS(LocalConnect)(XtransConnInfo ciptr, const char *host _X_UNUSED, const char *port) { prmsg(2,"LocalConnect(%p->%d,%s)\n", ciptr, ciptr->fd, port); return 0; } #endif /* TRANS_CLIENT */ static int TRANS(LocalBytesReadable)(XtransConnInfo ciptr, BytesReadable_t *pend ) { prmsg(2,"LocalBytesReadable(%p->%d,%p)\n", ciptr, ciptr->fd, pend); #if defined(SCO325) return ioctl(ciptr->fd, I_NREAD, (char *)pend); #else return ioctl(ciptr->fd, FIONREAD, (char *)pend); #endif } static int TRANS(LocalRead)(XtransConnInfo ciptr, char *buf, int size) { prmsg(2,"LocalRead(%d,%p,%d)\n", ciptr->fd, buf, size ); return read(ciptr->fd,buf,size); } static int TRANS(LocalWrite)(XtransConnInfo ciptr, char *buf, int size) { prmsg(2,"LocalWrite(%d,%p,%d)\n", ciptr->fd, buf, size ); return write(ciptr->fd,buf,size); } static int TRANS(LocalReadv)(XtransConnInfo ciptr, struct iovec *buf, int size) { prmsg(2,"LocalReadv(%d,%p,%d)\n", ciptr->fd, buf, size ); return READV(ciptr,buf,size); } static int TRANS(LocalWritev)(XtransConnInfo ciptr, struct iovec *buf, int size) { prmsg(2,"LocalWritev(%d,%p,%d)\n", ciptr->fd, buf, size ); return WRITEV(ciptr,buf,size); } static int TRANS(LocalDisconnect)(XtransConnInfo ciptr) { prmsg(2,"LocalDisconnect(%p->%d)\n", ciptr, ciptr->fd); return 0; } static int TRANS(LocalClose)(XtransConnInfo ciptr) { struct sockaddr_un *sockname=(struct sockaddr_un *) ciptr->addr; int ret; prmsg(2,"LocalClose(%p->%d)\n", ciptr, ciptr->fd ); ret=close(ciptr->fd); if(ciptr->flags && sockname && sockname->sun_family == AF_UNIX && sockname->sun_path[0] ) { if (!(ciptr->flags & TRANS_NOUNLINK)) unlink(sockname->sun_path); } return ret; } static int TRANS(LocalCloseForCloning)(XtransConnInfo ciptr) { int ret; prmsg(2,"LocalCloseForCloning(%p->%d)\n", ciptr, ciptr->fd ); /* Don't unlink path */ ret=close(ciptr->fd); return ret; } /* * MakeAllCOTSServerListeners() will go through the entire Xtransports[] * array defined in Xtrans.c and try to OpenCOTSServer() for each entry. * We will add duplicate entries to that table so that the OpenCOTSServer() * function will get called once for each type of local transport. * * The TransName is in lowercase, so it will never match during a normal * call to SelectTransport() in Xtrans.c. */ #ifdef TRANS_SERVER static const char * local_aliases[] = { # ifdef LOCAL_TRANS_PTS "pts", # endif "named", # ifdef sun "pipe", /* compatibility with Solaris Xlib */ # endif # ifdef LOCAL_TRANS_SCO "sco", # endif NULL }; #endif Xtransport TRANS(LocalFuncs) = { /* Local Interface */ "local", TRANS_ALIAS | TRANS_LOCAL, #ifdef TRANS_CLIENT TRANS(LocalOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER local_aliases, TRANS(LocalOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(LocalOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(LocalReopenCOTSServer), TRANS(LocalReopenCLTSServer), #endif TRANS(LocalSetOption), #ifdef TRANS_SERVER TRANS(LocalCreateListener), TRANS(LocalResetListener), TRANS(LocalAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalConnect), #endif /* TRANS_CLIENT */ TRANS(LocalBytesReadable), TRANS(LocalRead), TRANS(LocalWrite), TRANS(LocalReadv), TRANS(LocalWritev), #if XTRANS_SEND_FDS TRANS(LocalSendFdInvalid), TRANS(LocalRecvFdInvalid), #endif TRANS(LocalDisconnect), TRANS(LocalClose), TRANS(LocalCloseForCloning), }; #ifdef LOCAL_TRANS_PTS Xtransport TRANS(PTSFuncs) = { /* Local Interface */ "pts", TRANS_LOCAL, #ifdef TRANS_CLIENT TRANS(LocalOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER NULL, TRANS(LocalOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(LocalOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(LocalReopenCOTSServer), TRANS(LocalReopenCLTSServer), #endif TRANS(LocalSetOption), #ifdef TRANS_SERVER TRANS(LocalCreateListener), TRANS(LocalResetListener), TRANS(LocalAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalConnect), #endif /* TRANS_CLIENT */ TRANS(LocalBytesReadable), TRANS(LocalRead), TRANS(LocalWrite), TRANS(LocalReadv), TRANS(LocalWritev), #if XTRANS_SEND_FDS TRANS(LocalSendFdInvalid), TRANS(LocalRecvFdInvalid), #endif TRANS(LocalDisconnect), TRANS(LocalClose), TRANS(LocalCloseForCloning), }; #endif /* LOCAL_TRANS_PTS */ #ifdef LOCAL_TRANS_NAMED Xtransport TRANS(NAMEDFuncs) = { /* Local Interface */ "named", TRANS_LOCAL, #ifdef TRANS_CLIENT TRANS(LocalOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER NULL, TRANS(LocalOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(LocalOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(LocalReopenCOTSServer), TRANS(LocalReopenCLTSServer), #endif TRANS(LocalSetOption), #ifdef TRANS_SERVER TRANS(LocalCreateListener), TRANS(LocalResetListener), TRANS(LocalAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalConnect), #endif /* TRANS_CLIENT */ TRANS(LocalBytesReadable), TRANS(LocalRead), TRANS(LocalWrite), TRANS(LocalReadv), TRANS(LocalWritev), #if XTRANS_SEND_FDS TRANS(LocalSendFdInvalid), TRANS(LocalRecvFdInvalid), #endif TRANS(LocalDisconnect), TRANS(LocalClose), TRANS(LocalCloseForCloning), }; #ifdef sun Xtransport TRANS(PIPEFuncs) = { /* Local Interface */ "pipe", TRANS_ALIAS | TRANS_LOCAL, #ifdef TRANS_CLIENT TRANS(LocalOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER NULL, TRANS(LocalOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(LocalOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(LocalReopenCOTSServer), TRANS(LocalReopenCLTSServer), #endif TRANS(LocalSetOption), #ifdef TRANS_SERVER TRANS(LocalCreateListener), TRANS(LocalResetListener), TRANS(LocalAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalConnect), #endif /* TRANS_CLIENT */ TRANS(LocalBytesReadable), TRANS(LocalRead), TRANS(LocalWrite), TRANS(LocalReadv), TRANS(LocalWritev), #if XTRANS_SEND_FDS TRANS(LocalSendFdInvalid), TRANS(LocalRecvFdInvalid), #endif TRANS(LocalDisconnect), TRANS(LocalClose), TRANS(LocalCloseForCloning), }; #endif /* sun */ #endif /* LOCAL_TRANS_NAMED */ #ifdef LOCAL_TRANS_SCO Xtransport TRANS(SCOFuncs) = { /* Local Interface */ "sco", TRANS_LOCAL, #ifdef TRANS_CLIENT TRANS(LocalOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER NULL, TRANS(LocalOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(LocalOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(LocalReopenCOTSServer), TRANS(LocalReopenCLTSServer), #endif TRANS(LocalSetOption), #ifdef TRANS_SERVER TRANS(LocalCreateListener), TRANS(LocalResetListener), TRANS(LocalAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(LocalConnect), #endif /* TRANS_CLIENT */ TRANS(LocalBytesReadable), TRANS(LocalRead), TRANS(LocalWrite), TRANS(LocalReadv), TRANS(LocalWritev), #if XTRANS_SEND_FDS TRANS(LocalSendFdInvalid), TRANS(LocalRecvFdInvalid), #endif TRANS(LocalDisconnect), TRANS(LocalClose), TRANS(LocalCloseForCloning), }; #endif /* LOCAL_TRANS_SCO */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xtrans/Xtranssock.c ================================================ /* * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /* Copyright 1993, 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of the copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the copyright holders. * Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name NCR not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. NCR makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #ifdef XTHREADS #include #endif #ifndef WIN32 #if defined(TCPCONN) || defined(UNIXCONN) #include #include #include #endif #if defined(TCPCONN) || defined(UNIXCONN) #define X_INCLUDE_NETDB_H #define XOS_USE_NO_LOCKING #include #endif #ifdef UNIXCONN #ifndef X_NO_SYS_UN #include #endif #include #endif #ifndef NO_TCP_H #if defined(linux) || defined(__GLIBC__) #include #endif /* osf */ #if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) #include #include #endif /* __NetBSD__ || __OpenBSD__ || __FreeBSD__ || __DragonFly__ */ #include #endif /* !NO_TCP_H */ #include #if defined(SVR4) || defined(__SVR4) #include #endif #if (defined(__i386__) && defined(SYSV)) && !defined(SCO325) && !defined(sun) #include #endif #if defined(__i386__) && defined(SYSV) #include #endif #include #else /* !WIN32 */ #include #include #include #undef close #define close closesocket #define ECONNREFUSED WSAECONNREFUSED #define EADDRINUSE WSAEADDRINUSE #define EPROTOTYPE WSAEPROTOTYPE #undef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK #define EINPROGRESS WSAEINPROGRESS #undef EINTR #define EINTR WSAEINTR #define X_INCLUDE_NETDB_H #define XOS_USE_MTSAFE_NETDBAPI #include #endif /* WIN32 */ #if defined(SO_DONTLINGER) && defined(SO_LINGER) #undef SO_DONTLINGER #endif /* others don't need this */ #define SocketInitOnce() /**/ #ifdef linux #define HAVE_ABSTRACT_SOCKETS #endif #define MIN_BACKLOG 128 #ifdef SOMAXCONN #if SOMAXCONN > MIN_BACKLOG #define BACKLOG SOMAXCONN #endif #endif #ifndef BACKLOG #define BACKLOG MIN_BACKLOG #endif /* * This is the Socket implementation of the X Transport service layer * * This file contains the implementation for both the UNIX and INET domains, * and can be built for either one, or both. * */ typedef struct _Sockettrans2dev { const char *transname; int family; int devcotsname; int devcltsname; int protocol; } Sockettrans2dev; static Sockettrans2dev Sockettrans2devtab[] = { #ifdef TCPCONN {"inet",AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, #if !defined(IPv6) || !defined(AF_INET6) {"tcp",AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, #else /* IPv6 */ {"tcp",AF_INET6,SOCK_STREAM,SOCK_DGRAM,0}, {"tcp",AF_INET,SOCK_STREAM,SOCK_DGRAM,0}, /* fallback */ {"inet6",AF_INET6,SOCK_STREAM,SOCK_DGRAM,0}, #endif #endif /* TCPCONN */ #ifdef UNIXCONN {"unix",AF_UNIX,SOCK_STREAM,SOCK_DGRAM,0}, #if !defined(LOCALCONN) {"local",AF_UNIX,SOCK_STREAM,SOCK_DGRAM,0}, #endif /* !LOCALCONN */ #endif /* UNIXCONN */ }; #define NUMSOCKETFAMILIES (sizeof(Sockettrans2devtab)/sizeof(Sockettrans2dev)) #ifdef TCPCONN static int TRANS(SocketINETClose) (XtransConnInfo ciptr); #endif #ifdef UNIXCONN #if defined(X11_t) #define UNIX_PATH "/tmp/.X11-unix/X" #define UNIX_DIR "/tmp/.X11-unix" #endif /* X11_t */ #if defined(XIM_t) #define UNIX_PATH "/tmp/.XIM-unix/XIM" #define UNIX_DIR "/tmp/.XIM-unix" #endif /* XIM_t */ #if defined(FS_t) || defined(FONT_t) #define UNIX_PATH "/tmp/.font-unix/fs" #define UNIX_DIR "/tmp/.font-unix" #endif /* FS_t || FONT_t */ #if defined(ICE_t) #define UNIX_PATH "/tmp/.ICE-unix/" #define UNIX_DIR "/tmp/.ICE-unix" #endif /* ICE_t */ #if defined(TEST_t) #define UNIX_PATH "/tmp/.Test-unix/test" #define UNIX_DIR "/tmp/.Test-unix" #endif #if defined(LBXPROXY_t) #define UNIX_PATH "/tmp/.X11-unix/X" #define UNIX_DIR "/tmp/.X11-unix" #endif #endif /* UNIXCONN */ #define PORTBUFSIZE 32 #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 255 #endif #if defined HAVE_SOCKLEN_T || (defined(IPv6) && defined(AF_INET6)) # define SOCKLEN_T socklen_t #elif defined(SVR4) || defined(__SVR4) || defined(__SCO__) # define SOCKLEN_T size_t #else # define SOCKLEN_T int #endif /* * These are some utility function used by the real interface function below. */ static int TRANS(SocketSelectFamily) (int first, const char *family) { int i; prmsg (3,"SocketSelectFamily(%s)\n", family); for (i = first + 1; i < NUMSOCKETFAMILIES;i++) { if (!strcmp (family, Sockettrans2devtab[i].transname)) return i; } return (first == -1 ? -2 : -1); } /* * This function gets the local address of the socket and stores it in the * XtransConnInfo structure for the connection. */ static int TRANS(SocketINETGetAddr) (XtransConnInfo ciptr) { #if defined(IPv6) && defined(AF_INET6) struct sockaddr_storage socknamev6; #else struct sockaddr_in socknamev4; #endif void *socknamePtr; SOCKLEN_T namelen; prmsg (3,"SocketINETGetAddr(%p)\n", ciptr); #if defined(IPv6) && defined(AF_INET6) namelen = sizeof(socknamev6); socknamePtr = &socknamev6; #else namelen = sizeof(socknamev4); socknamePtr = &socknamev4; #endif bzero(socknamePtr, namelen); if (getsockname (ciptr->fd,(struct sockaddr *) socknamePtr, (void *)&namelen) < 0) { #ifdef WIN32 errno = WSAGetLastError(); #endif prmsg (1,"SocketINETGetAddr: getsockname() failed: %d\n", EGET()); return -1; } /* * Everything looks good: fill in the XtransConnInfo structure. */ if ((ciptr->addr = malloc (namelen)) == NULL) { prmsg (1, "SocketINETGetAddr: Can't allocate space for the addr\n"); return -1; } #if defined(IPv6) && defined(AF_INET6) ciptr->family = ((struct sockaddr *)socknamePtr)->sa_family; #else ciptr->family = socknamev4.sin_family; #endif ciptr->addrlen = namelen; memcpy (ciptr->addr, socknamePtr, ciptr->addrlen); return 0; } /* * This function gets the remote address of the socket and stores it in the * XtransConnInfo structure for the connection. */ static int TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr) { #if defined(IPv6) && defined(AF_INET6) struct sockaddr_storage socknamev6; #endif struct sockaddr_in socknamev4; void *socknamePtr; SOCKLEN_T namelen; #if defined(IPv6) && defined(AF_INET6) if (ciptr->family == AF_INET6) { namelen = sizeof(socknamev6); socknamePtr = &socknamev6; } else #endif { namelen = sizeof(socknamev4); socknamePtr = &socknamev4; } bzero(socknamePtr, namelen); prmsg (3,"SocketINETGetPeerAddr(%p)\n", ciptr); if (getpeername (ciptr->fd, (struct sockaddr *) socknamePtr, (void *)&namelen) < 0) { #ifdef WIN32 errno = WSAGetLastError(); #endif prmsg (1,"SocketINETGetPeerAddr: getpeername() failed: %d\n", EGET()); return -1; } /* * Everything looks good: fill in the XtransConnInfo structure. */ if ((ciptr->peeraddr = malloc (namelen)) == NULL) { prmsg (1, "SocketINETGetPeerAddr: Can't allocate space for the addr\n"); return -1; } ciptr->peeraddrlen = namelen; memcpy (ciptr->peeraddr, socknamePtr, ciptr->peeraddrlen); return 0; } static XtransConnInfo TRANS(SocketOpen) (int i, int type) { XtransConnInfo ciptr; prmsg (3,"SocketOpen(%d,%d)\n", i, type); if ((ciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL) { prmsg (1, "SocketOpen: malloc failed\n"); return NULL; } if ((ciptr->fd = socket(Sockettrans2devtab[i].family, type, Sockettrans2devtab[i].protocol)) < 0 #ifndef WIN32 #if (defined(X11_t) && !defined(USE_POLL)) || defined(FS_t) || defined(FONT_t) || ciptr->fd >= sysconf(_SC_OPEN_MAX) #endif #endif ) { #ifdef WIN32 errno = WSAGetLastError(); #endif prmsg (2, "SocketOpen: socket() failed for %s\n", Sockettrans2devtab[i].transname); free (ciptr); return NULL; } #ifdef TCP_NODELAY if (Sockettrans2devtab[i].family == AF_INET #if defined(IPv6) && defined(AF_INET6) || Sockettrans2devtab[i].family == AF_INET6 #endif ) { /* * turn off TCP coalescence for INET sockets */ int tmp = 1; setsockopt (ciptr->fd, IPPROTO_TCP, TCP_NODELAY, (char *) &tmp, sizeof (int)); } #endif /* * Some systems provide a really small default buffer size for * UNIX sockets. Bump it up a bit such that large transfers don't * proceed at glacial speed. */ #ifdef SO_SNDBUF if (Sockettrans2devtab[i].family == AF_UNIX) { SOCKLEN_T len = sizeof (int); int val; if (getsockopt (ciptr->fd, SOL_SOCKET, SO_SNDBUF, (char *) &val, &len) == 0 && val < 64 * 1024) { val = 64 * 1024; setsockopt (ciptr->fd, SOL_SOCKET, SO_SNDBUF, (char *) &val, sizeof (int)); } } #endif return ciptr; } #ifdef TRANS_REOPEN static XtransConnInfo TRANS(SocketReopen) (int i _X_UNUSED, int type, int fd, const char *port) { XtransConnInfo ciptr; int portlen; struct sockaddr *addr; size_t addrlen; prmsg (3,"SocketReopen(%d,%d,%s)\n", type, fd, port); if (port == NULL) { prmsg (1, "SocketReopen: port was null!\n"); return NULL; } portlen = strlen(port) + 1; // include space for trailing null #ifdef SOCK_MAXADDRLEN if (portlen < 0 || portlen > (SOCK_MAXADDRLEN + 2)) { prmsg (1, "SocketReopen: invalid portlen %d\n", portlen); return NULL; } if (portlen < 14) portlen = 14; #else if (portlen < 0 || portlen > 14) { prmsg (1, "SocketReopen: invalid portlen %d\n", portlen); return NULL; } #endif /*SOCK_MAXADDRLEN*/ if ((ciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL) { prmsg (1, "SocketReopen: malloc(ciptr) failed\n"); return NULL; } ciptr->fd = fd; addrlen = portlen + offsetof(struct sockaddr, sa_data); if ((addr = calloc (1, addrlen)) == NULL) { prmsg (1, "SocketReopen: malloc(addr) failed\n"); free (ciptr); return NULL; } ciptr->addr = (char *) addr; ciptr->addrlen = addrlen; if ((ciptr->peeraddr = calloc (1, addrlen)) == NULL) { prmsg (1, "SocketReopen: malloc(portaddr) failed\n"); free (addr); free (ciptr); return NULL; } ciptr->peeraddrlen = addrlen; /* Initialize ciptr structure as if it were a normally-opened unix socket */ ciptr->flags = TRANS_LOCAL | TRANS_NOUNLINK; #ifdef BSD44SOCKETS addr->sa_len = addrlen; #endif addr->sa_family = AF_UNIX; #ifdef HAS_STRLCPY strlcpy(addr->sa_data, port, portlen); #else strncpy(addr->sa_data, port, portlen); #endif ciptr->family = AF_UNIX; memcpy(ciptr->peeraddr, ciptr->addr, addrlen); ciptr->port = rindex(addr->sa_data, ':'); if (ciptr->port == NULL) { if (is_numeric(addr->sa_data)) { ciptr->port = addr->sa_data; } } else if (ciptr->port[0] == ':') { ciptr->port++; } /* port should now point to portnum or NULL */ return ciptr; } #endif /* TRANS_REOPEN */ /* * These functions are the interface supplied in the Xtransport structure */ #ifdef TRANS_CLIENT static XtransConnInfo TRANS(SocketOpenCOTSClientBase) (const char *transname, const char *protocol, const char *host, const char *port, int previndex) { XtransConnInfo ciptr; int i = previndex; prmsg (2, "SocketOpenCOTSClient(%s,%s,%s)\n", protocol, host, port); SocketInitOnce(); while ((i = TRANS(SocketSelectFamily) (i, transname)) >= 0) { if ((ciptr = TRANS(SocketOpen) ( i, Sockettrans2devtab[i].devcotsname)) != NULL) { /* Save the index for later use */ ciptr->index = i; break; } } if (i < 0) { if (i == -1) prmsg (1,"SocketOpenCOTSClient: Unable to open socket for %s\n", transname); else prmsg (1,"SocketOpenCOTSClient: Unable to determine socket type for %s\n", transname); return NULL; } return ciptr; } static XtransConnInfo TRANS(SocketOpenCOTSClient) (Xtransport *thistrans, const char *protocol, const char *host, const char *port) { return TRANS(SocketOpenCOTSClientBase)( thistrans->TransName, protocol, host, port, -1); } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER static XtransConnInfo TRANS(SocketOpenCOTSServer) (Xtransport *thistrans, const char *protocol, const char *host, const char *port) { XtransConnInfo ciptr; int i = -1; prmsg (2,"SocketOpenCOTSServer(%s,%s,%s)\n", protocol, host, port); SocketInitOnce(); while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { if ((ciptr = TRANS(SocketOpen) ( i, Sockettrans2devtab[i].devcotsname)) != NULL) break; } if (i < 0) { if (i == -1) prmsg (1,"SocketOpenCOTSServer: Unable to open socket for %s\n", thistrans->TransName); else prmsg (1,"SocketOpenCOTSServer: Unable to determine socket type for %s\n", thistrans->TransName); return NULL; } /* * Using this prevents the bind() check for an existing server listening * on the same port, but it is required for other reasons. */ #ifdef SO_REUSEADDR /* * SO_REUSEADDR only applied to AF_INET && AF_INET6 */ if (Sockettrans2devtab[i].family == AF_INET #if defined(IPv6) && defined(AF_INET6) || Sockettrans2devtab[i].family == AF_INET6 #endif ) { int one = 1; setsockopt (ciptr->fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof (int)); } #endif #ifdef IPV6_V6ONLY if (Sockettrans2devtab[i].family == AF_INET6) { int one = 1; setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(int)); } #endif /* Save the index for later use */ ciptr->index = i; return ciptr; } #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT static XtransConnInfo TRANS(SocketOpenCLTSClient) (Xtransport *thistrans, const char *protocol, const char *host, const char *port) { XtransConnInfo ciptr; int i = -1; prmsg (2,"SocketOpenCLTSClient(%s,%s,%s)\n", protocol, host, port); SocketInitOnce(); while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { if ((ciptr = TRANS(SocketOpen) ( i, Sockettrans2devtab[i].devcotsname)) != NULL) break; } if (i < 0) { if (i == -1) prmsg (1,"SocketOpenCLTSClient: Unable to open socket for %s\n", thistrans->TransName); else prmsg (1,"SocketOpenCLTSClient: Unable to determine socket type for %s\n", thistrans->TransName); return NULL; } /* Save the index for later use */ ciptr->index = i; return ciptr; } #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER static XtransConnInfo TRANS(SocketOpenCLTSServer) (Xtransport *thistrans, const char *protocol, const char *host, const char *port) { XtransConnInfo ciptr; int i = -1; prmsg (2,"SocketOpenCLTSServer(%s,%s,%s)\n", protocol, host, port); SocketInitOnce(); while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { if ((ciptr = TRANS(SocketOpen) ( i, Sockettrans2devtab[i].devcotsname)) != NULL) break; } if (i < 0) { if (i == -1) prmsg (1,"SocketOpenCLTSServer: Unable to open socket for %s\n", thistrans->TransName); else prmsg (1,"SocketOpenCLTSServer: Unable to determine socket type for %s\n", thistrans->TransName); return NULL; } #ifdef IPV6_V6ONLY if (Sockettrans2devtab[i].family == AF_INET6) { int one = 1; setsockopt(ciptr->fd, IPPROTO_IPV6, IPV6_V6ONLY, &one, sizeof(int)); } #endif /* Save the index for later use */ ciptr->index = i; return ciptr; } #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN static XtransConnInfo TRANS(SocketReopenCOTSServer) (Xtransport *thistrans, int fd, const char *port) { XtransConnInfo ciptr; int i = -1; prmsg (2, "SocketReopenCOTSServer(%d, %s)\n", fd, port); SocketInitOnce(); while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { if ((ciptr = TRANS(SocketReopen) ( i, Sockettrans2devtab[i].devcotsname, fd, port)) != NULL) break; } if (i < 0) { if (i == -1) prmsg (1,"SocketReopenCOTSServer: Unable to open socket for %s\n", thistrans->TransName); else prmsg (1,"SocketReopenCOTSServer: Unable to determine socket type for %s\n", thistrans->TransName); return NULL; } /* Save the index for later use */ ciptr->index = i; return ciptr; } static XtransConnInfo TRANS(SocketReopenCLTSServer) (Xtransport *thistrans, int fd, const char *port) { XtransConnInfo ciptr; int i = -1; prmsg (2, "SocketReopenCLTSServer(%d, %s)\n", fd, port); SocketInitOnce(); while ((i = TRANS(SocketSelectFamily) (i, thistrans->TransName)) >= 0) { if ((ciptr = TRANS(SocketReopen) ( i, Sockettrans2devtab[i].devcotsname, fd, port)) != NULL) break; } if (i < 0) { if (i == -1) prmsg (1,"SocketReopenCLTSServer: Unable to open socket for %s\n", thistrans->TransName); else prmsg (1,"SocketReopenCLTSServer: Unable to determine socket type for %s\n", thistrans->TransName); return NULL; } /* Save the index for later use */ ciptr->index = i; return ciptr; } #endif /* TRANS_REOPEN */ static int TRANS(SocketSetOption) (XtransConnInfo ciptr, int option, int arg) { prmsg (2,"SocketSetOption(%d,%d,%d)\n", ciptr->fd, option, arg); return -1; } #ifdef UNIXCONN static int set_sun_path(const char *port, const char *upath, char *path, int abstract) { struct sockaddr_un s; int maxlen = sizeof(s.sun_path) - 1; const char *at = ""; if (!port || !*port || !path) return -1; #ifdef HAVE_ABSTRACT_SOCKETS if (port[0] == '@') upath = ""; else if (abstract) at = "@"; #endif if (*port == '/') /* a full pathname */ upath = ""; if (strlen(port) + strlen(upath) > maxlen) return -1; snprintf(path, sizeof(s.sun_path), "%s%s%s", at, upath, port); return 0; } #endif #ifdef TRANS_SERVER static int TRANS(SocketCreateListener) (XtransConnInfo ciptr, struct sockaddr *sockname, int socknamelen, unsigned int flags) { SOCKLEN_T namelen = socknamelen; int fd = ciptr->fd; int retry; prmsg (3, "SocketCreateListener(%p,%d)\n", ciptr, fd); if (Sockettrans2devtab[ciptr->index].family == AF_INET #if defined(IPv6) && defined(AF_INET6) || Sockettrans2devtab[ciptr->index].family == AF_INET6 #endif ) retry = 20; else retry = 0; while (bind (fd, (struct sockaddr *) sockname, namelen) < 0) { if (errno == EADDRINUSE) { if (flags & ADDR_IN_USE_ALLOWED) break; else return TRANS_ADDR_IN_USE; } if (retry-- == 0) { prmsg (1, "SocketCreateListener: failed to bind listener\n"); close (fd); return TRANS_CREATE_LISTENER_FAILED; } #ifdef SO_REUSEADDR sleep (1); #else sleep (10); #endif /* SO_REUSEDADDR */ } if (Sockettrans2devtab[ciptr->index].family == AF_INET #if defined(IPv6) && defined(AF_INET6) || Sockettrans2devtab[ciptr->index].family == AF_INET6 #endif ) { #ifdef SO_DONTLINGER setsockopt (fd, SOL_SOCKET, SO_DONTLINGER, (char *) NULL, 0); #else #ifdef SO_LINGER { static int linger[2] = { 0, 0 }; setsockopt (fd, SOL_SOCKET, SO_LINGER, (char *) linger, sizeof (linger)); } #endif #endif } if (listen (fd, BACKLOG) < 0) { prmsg (1, "SocketCreateListener: listen() failed\n"); close (fd); return TRANS_CREATE_LISTENER_FAILED; } /* Set a flag to indicate that this connection is a listener */ ciptr->flags = 1 | (ciptr->flags & TRANS_KEEPFLAGS); return 0; } #ifdef TCPCONN static int TRANS(SocketINETCreateListener) (XtransConnInfo ciptr, const char *port, unsigned int flags) { #if defined(IPv6) && defined(AF_INET6) struct sockaddr_storage sockname; #else struct sockaddr_in sockname; #endif unsigned short sport; SOCKLEN_T namelen = sizeof(sockname); int status; long tmpport; #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgetservbynameparams sparams; #endif struct servent *servp; #ifdef X11_t char portbuf[PORTBUFSIZE]; #endif prmsg (2, "SocketINETCreateListener(%s)\n", port); #ifdef X11_t /* * X has a well known port, that is transport dependent. It is easier * to handle it here, than try and come up with a transport independent * representation that can be passed in and resolved the usual way. * * The port that is passed here is really a string containing the idisplay * from ConnectDisplay(). */ if (is_numeric (port)) { /* fixup the server port address */ tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); snprintf (portbuf, sizeof(portbuf), "%lu", tmpport); port = portbuf; } #endif if (port && *port) { /* Check to see if the port string is just a number (handles X11) */ if (!is_numeric (port)) { if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL) { prmsg (1, "SocketINETCreateListener: Unable to get service for %s\n", port); return TRANS_CREATE_LISTENER_FAILED; } /* we trust getservbyname to return a valid number */ sport = servp->s_port; } else { tmpport = strtol (port, (char**)NULL, 10); /* * check that somehow the port address isn't negative or in * the range of reserved port addresses. This can happen and * be very bad if the server is suid-root and the user does * something (dumb) like `X :60049`. */ if (tmpport < 1024 || tmpport > USHRT_MAX) return TRANS_CREATE_LISTENER_FAILED; sport = (unsigned short) tmpport; } } else sport = 0; bzero(&sockname, sizeof(sockname)); #if defined(IPv6) && defined(AF_INET6) if (Sockettrans2devtab[ciptr->index].family == AF_INET) { namelen = sizeof (struct sockaddr_in); #ifdef BSD44SOCKETS ((struct sockaddr_in *)&sockname)->sin_len = namelen; #endif ((struct sockaddr_in *)&sockname)->sin_family = AF_INET; ((struct sockaddr_in *)&sockname)->sin_port = htons(sport); ((struct sockaddr_in *)&sockname)->sin_addr.s_addr = htonl(INADDR_ANY); } else { namelen = sizeof (struct sockaddr_in6); #ifdef SIN6_LEN ((struct sockaddr_in6 *)&sockname)->sin6_len = sizeof(sockname); #endif ((struct sockaddr_in6 *)&sockname)->sin6_family = AF_INET6; ((struct sockaddr_in6 *)&sockname)->sin6_port = htons(sport); ((struct sockaddr_in6 *)&sockname)->sin6_addr = in6addr_any; } #else #ifdef BSD44SOCKETS sockname.sin_len = sizeof (sockname); #endif sockname.sin_family = AF_INET; sockname.sin_port = htons (sport); sockname.sin_addr.s_addr = htonl (INADDR_ANY); #endif if ((status = TRANS(SocketCreateListener) (ciptr, (struct sockaddr *) &sockname, namelen, flags)) < 0) { prmsg (1, "SocketINETCreateListener: ...SocketCreateListener() failed\n"); return status; } if (TRANS(SocketINETGetAddr) (ciptr) < 0) { prmsg (1, "SocketINETCreateListener: ...SocketINETGetAddr() failed\n"); return TRANS_CREATE_LISTENER_FAILED; } return 0; } #endif /* TCPCONN */ #ifdef UNIXCONN static int TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, const char *port, unsigned int flags) { struct sockaddr_un sockname; int namelen; int oldUmask; int status; unsigned int mode; char tmpport[108]; int abstract = 0; #ifdef HAVE_ABSTRACT_SOCKETS abstract = ciptr->transptr->flags & TRANS_ABSTRACT; #endif prmsg (2, "SocketUNIXCreateListener(%s)\n", port ? port : "NULL"); /* Make sure the directory is created */ oldUmask = umask (0); #ifdef UNIX_DIR #ifdef HAS_STICKY_DIR_BIT mode = 01777; #else mode = 0777; #endif if (!abstract && trans_mkdir(UNIX_DIR, mode) == -1) { prmsg (1, "SocketUNIXCreateListener: mkdir(%s) failed, errno = %d\n", UNIX_DIR, errno); (void) umask (oldUmask); return TRANS_CREATE_LISTENER_FAILED; } #endif memset(&sockname, 0, sizeof(sockname)); sockname.sun_family = AF_UNIX; if (!(port && *port)) { snprintf (tmpport, sizeof(tmpport), "%s%ld", UNIX_PATH, (long)getpid()); port = tmpport; } if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) { prmsg (1, "SocketUNIXCreateListener: path too long\n"); return TRANS_CREATE_LISTENER_FAILED; } #if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) sockname.sun_len = strlen(sockname.sun_path); #endif #if defined(BSD44SOCKETS) || defined(SUN_LEN) namelen = SUN_LEN(&sockname); #else namelen = strlen(sockname.sun_path) + offsetof(struct sockaddr_un, sun_path); #endif if (abstract) { sockname.sun_path[0] = '\0'; namelen = offsetof(struct sockaddr_un, sun_path) + 1 + strlen(&sockname.sun_path[1]); } else unlink (sockname.sun_path); if ((status = TRANS(SocketCreateListener) (ciptr, (struct sockaddr *) &sockname, namelen, flags)) < 0) { prmsg (1, "SocketUNIXCreateListener: ...SocketCreateListener() failed\n"); (void) umask (oldUmask); return status; } /* * Now that the listener is esablished, create the addr info for * this connection. getpeername() doesn't work for UNIX Domain Sockets * on some systems (hpux at least), so we will just do it manually, instead * of calling something like TRANS(SocketUNIXGetAddr). */ namelen = sizeof (sockname); /* this will always make it the same size */ if ((ciptr->addr = malloc (namelen)) == NULL) { prmsg (1, "SocketUNIXCreateListener: Can't allocate space for the addr\n"); (void) umask (oldUmask); return TRANS_CREATE_LISTENER_FAILED; } if (abstract) sockname.sun_path[0] = '@'; ciptr->family = sockname.sun_family; ciptr->addrlen = namelen; memcpy (ciptr->addr, &sockname, ciptr->addrlen); (void) umask (oldUmask); return 0; } static int TRANS(SocketUNIXResetListener) (XtransConnInfo ciptr) { /* * See if the unix domain socket has disappeared. If it has, recreate it. */ struct sockaddr_un *unsock = (struct sockaddr_un *) ciptr->addr; struct stat statb; int status = TRANS_RESET_NOOP; unsigned int mode; int abstract = 0; #ifdef HAVE_ABSTRACT_SOCKETS abstract = ciptr->transptr->flags & TRANS_ABSTRACT; #endif prmsg (3, "SocketUNIXResetListener(%p,%d)\n", ciptr, ciptr->fd); if (!abstract && ( stat (unsock->sun_path, &statb) == -1 || ((statb.st_mode & S_IFMT) != #if defined(NCR) || defined(SCO325) || !defined(S_IFSOCK) S_IFIFO #else S_IFSOCK #endif ))) { int oldUmask = umask (0); #ifdef UNIX_DIR #ifdef HAS_STICKY_DIR_BIT mode = 01777; #else mode = 0777; #endif if (trans_mkdir(UNIX_DIR, mode) == -1) { prmsg (1, "SocketUNIXResetListener: mkdir(%s) failed, errno = %d\n", UNIX_DIR, errno); (void) umask (oldUmask); return TRANS_RESET_FAILURE; } #endif close (ciptr->fd); unlink (unsock->sun_path); if ((ciptr->fd = socket (AF_UNIX, SOCK_STREAM, 0)) < 0) { TRANS(FreeConnInfo) (ciptr); (void) umask (oldUmask); return TRANS_RESET_FAILURE; } if (bind (ciptr->fd, (struct sockaddr *) unsock, ciptr->addrlen) < 0) { close (ciptr->fd); TRANS(FreeConnInfo) (ciptr); return TRANS_RESET_FAILURE; } if (listen (ciptr->fd, BACKLOG) < 0) { close (ciptr->fd); TRANS(FreeConnInfo) (ciptr); (void) umask (oldUmask); return TRANS_RESET_FAILURE; } umask (oldUmask); status = TRANS_RESET_NEW_FD; } return status; } #endif /* UNIXCONN */ #ifdef TCPCONN static XtransConnInfo TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) { XtransConnInfo newciptr; struct sockaddr_in sockname; SOCKLEN_T namelen = sizeof(sockname); prmsg (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd); if ((newciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL) { prmsg (1, "SocketINETAccept: malloc failed\n"); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; } if ((newciptr->fd = accept (ciptr->fd, (struct sockaddr *) &sockname, (void *)&namelen)) < 0) { #ifdef WIN32 errno = WSAGetLastError(); #endif prmsg (1, "SocketINETAccept: accept() failed\n"); free (newciptr); *status = TRANS_ACCEPT_FAILED; return NULL; } #ifdef TCP_NODELAY { /* * turn off TCP coalescence for INET sockets */ int tmp = 1; setsockopt (newciptr->fd, IPPROTO_TCP, TCP_NODELAY, (char *) &tmp, sizeof (int)); } #endif /* * Get this address again because the transport may give a more * specific address now that a connection is established. */ if (TRANS(SocketINETGetAddr) (newciptr) < 0) { prmsg (1, "SocketINETAccept: ...SocketINETGetAddr() failed:\n"); close (newciptr->fd); free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } if (TRANS(SocketINETGetPeerAddr) (newciptr) < 0) { prmsg (1, "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n"); close (newciptr->fd); if (newciptr->addr) free (newciptr->addr); free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } *status = 0; return newciptr; } #endif /* TCPCONN */ #ifdef UNIXCONN static XtransConnInfo TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) { XtransConnInfo newciptr; struct sockaddr_un sockname; SOCKLEN_T namelen = sizeof sockname; prmsg (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd); if ((newciptr = calloc (1, sizeof(struct _XtransConnInfo))) == NULL) { prmsg (1, "SocketUNIXAccept: malloc() failed\n"); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; } if ((newciptr->fd = accept (ciptr->fd, (struct sockaddr *) &sockname, (void *)&namelen)) < 0) { prmsg (1, "SocketUNIXAccept: accept() failed\n"); free (newciptr); *status = TRANS_ACCEPT_FAILED; return NULL; } ciptr->addrlen = namelen; /* * Get the socket name and the peer name from the listener socket, * since this is unix domain. */ if ((newciptr->addr = malloc (ciptr->addrlen)) == NULL) { prmsg (1, "SocketUNIXAccept: Can't allocate space for the addr\n"); close (newciptr->fd); free (newciptr); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; } /* * if the socket is abstract, we already modified the address to have a * @ instead of the initial NUL, so no need to do that again here. */ newciptr->addrlen = ciptr->addrlen; memcpy (newciptr->addr, ciptr->addr, newciptr->addrlen); if ((newciptr->peeraddr = malloc (ciptr->addrlen)) == NULL) { prmsg (1, "SocketUNIXAccept: Can't allocate space for the addr\n"); close (newciptr->fd); if (newciptr->addr) free (newciptr->addr); free (newciptr); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; } newciptr->peeraddrlen = ciptr->addrlen; memcpy (newciptr->peeraddr, ciptr->addr, newciptr->addrlen); newciptr->family = AF_UNIX; *status = 0; return newciptr; } #endif /* UNIXCONN */ #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT #ifdef TCPCONN #if defined(IPv6) && defined(AF_INET6) struct addrlist { struct addrinfo * addr; struct addrinfo * firstaddr; char port[PORTBUFSIZE]; char host[MAXHOSTNAMELEN]; }; static struct addrlist *addrlist = NULL; #endif static int TRANS(SocketINETConnect) (XtransConnInfo ciptr, const char *host, const char *port) { struct sockaddr * socketaddr = NULL; int socketaddrlen = 0; int res; #if defined(IPv6) && defined(AF_INET6) struct addrinfo hints; char ntopbuf[INET6_ADDRSTRLEN]; int resetonce = 0; #else struct sockaddr_in sockname; struct hostent *hostp; struct servent *servp; unsigned long tmpaddr; #endif #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; _Xgetservbynameparams sparams; #endif #ifdef X11_t char portbuf[PORTBUFSIZE]; #endif char hostnamebuf[256]; /* tmp space */ prmsg (2,"SocketINETConnect(%d,%s,%s)\n", ciptr->fd, host, port); if (!host) { hostnamebuf[0] = '\0'; (void) TRANS(GetHostname) (hostnamebuf, sizeof hostnamebuf); host = hostnamebuf; } #ifdef X11_t /* * X has a well known port, that is transport dependent. It is easier * to handle it here, than try and come up with a transport independent * representation that can be passed in and resolved the usual way. * * The port that is passed here is really a string containing the idisplay * from ConnectDisplay(). */ if (is_numeric (port)) { long tmpport = X_TCP_PORT + strtol (port, (char**)NULL, 10); snprintf (portbuf, sizeof(portbuf), "%lu", tmpport); port = portbuf; } #endif #if defined(IPv6) && defined(AF_INET6) { if (addrlist != NULL) { if (strcmp(host,addrlist->host) || strcmp(port,addrlist->port)) { if (addrlist->firstaddr) freeaddrinfo(addrlist->firstaddr); addrlist->firstaddr = NULL; } } else { addrlist = malloc(sizeof(struct addrlist)); addrlist->firstaddr = NULL; } if (addrlist->firstaddr == NULL) { strncpy(addrlist->port, port, sizeof(addrlist->port)); addrlist->port[sizeof(addrlist->port) - 1] = '\0'; strncpy(addrlist->host, host, sizeof(addrlist->host)); addrlist->host[sizeof(addrlist->host) - 1] = '\0'; bzero(&hints,sizeof(hints)); hints.ai_socktype = Sockettrans2devtab[ciptr->index].devcotsname; res = getaddrinfo(host,port,&hints,&addrlist->firstaddr); if (res != 0) { prmsg (1, "SocketINETConnect() can't get address " "for %s:%s: %s\n", host, port, gai_strerror(res)); ESET(EINVAL); return TRANS_CONNECT_FAILED; } for (res = 0, addrlist->addr = addrlist->firstaddr; addrlist->addr ; res++) { addrlist->addr = addrlist->addr->ai_next; } prmsg(4,"Got New Address list with %d addresses\n", res); res = 0; addrlist->addr = NULL; } while (socketaddr == NULL) { if (addrlist->addr == NULL) { if (resetonce) { /* Already checked entire list - no usable addresses */ prmsg (1, "SocketINETConnect() no usable address " "for %s:%s\n", host, port); return TRANS_CONNECT_FAILED; } else { /* Go back to beginning of list */ resetonce = 1; addrlist->addr = addrlist->firstaddr; } } socketaddr = addrlist->addr->ai_addr; socketaddrlen = addrlist->addr->ai_addrlen; if (addrlist->addr->ai_family == AF_INET) { struct sockaddr_in *sin = (struct sockaddr_in *) socketaddr; prmsg (4,"SocketINETConnect() sockname.sin_addr = %s\n", inet_ntop(addrlist->addr->ai_family,&sin->sin_addr, ntopbuf,sizeof(ntopbuf))); prmsg (4,"SocketINETConnect() sockname.sin_port = %d\n", ntohs(sin->sin_port)); if (Sockettrans2devtab[ciptr->index].family == AF_INET6) { if (strcmp(Sockettrans2devtab[ciptr->index].transname, "tcp") == 0) { XtransConnInfo newciptr; /* * Our socket is an IPv6 socket, but the address is * IPv4. Close it and get an IPv4 socket. This is * needed for IPv4 connections to work on platforms * that don't allow IPv4 over IPv6 sockets. */ TRANS(SocketINETClose)(ciptr); newciptr = TRANS(SocketOpenCOTSClientBase)( "tcp", "tcp", host, port, ciptr->index); if (newciptr) ciptr->fd = newciptr->fd; if (!newciptr || Sockettrans2devtab[newciptr->index].family != AF_INET) { socketaddr = NULL; prmsg (4,"SocketINETConnect() Cannot get IPv4 " " socketfor IPv4 address\n"); } if (newciptr) free(newciptr); } else { socketaddr = NULL; prmsg (4,"SocketINETConnect Skipping IPv4 address\n"); } } } else if (addrlist->addr->ai_family == AF_INET6) { struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) socketaddr; prmsg (4,"SocketINETConnect() sockname.sin6_addr = %s\n", inet_ntop(addrlist->addr->ai_family, &sin6->sin6_addr,ntopbuf,sizeof(ntopbuf))); prmsg (4,"SocketINETConnect() sockname.sin6_port = %d\n", ntohs(sin6->sin6_port)); if (Sockettrans2devtab[ciptr->index].family == AF_INET) { if (strcmp(Sockettrans2devtab[ciptr->index].transname, "tcp") == 0) { XtransConnInfo newciptr; /* * Close the IPv4 socket and try to open an IPv6 socket. */ TRANS(SocketINETClose)(ciptr); newciptr = TRANS(SocketOpenCOTSClientBase)( "tcp", "tcp", host, port, -1); if (newciptr) ciptr->fd = newciptr->fd; if (!newciptr || Sockettrans2devtab[newciptr->index].family != AF_INET6) { socketaddr = NULL; prmsg (4,"SocketINETConnect() Cannot get IPv6 " "socket for IPv6 address\n"); } if (newciptr) free(newciptr); } else { socketaddr = NULL; prmsg (4,"SocketINETConnect() Skipping IPv6 address\n"); } } } else { socketaddr = NULL; /* Unsupported address type */ } if (socketaddr == NULL) { addrlist->addr = addrlist->addr->ai_next; } } } #else { /* * Build the socket name. */ #ifdef BSD44SOCKETS sockname.sin_len = sizeof (struct sockaddr_in); #endif sockname.sin_family = AF_INET; /* * fill in sin_addr */ #ifndef INADDR_NONE #define INADDR_NONE ((in_addr_t) 0xffffffff) #endif /* check for ww.xx.yy.zz host string */ if (isascii (host[0]) && isdigit (host[0])) { tmpaddr = inet_addr (host); /* returns network byte order */ } else { tmpaddr = INADDR_NONE; } prmsg (4,"SocketINETConnect() inet_addr(%s) = %x\n", host, tmpaddr); if (tmpaddr == INADDR_NONE) { if ((hostp = _XGethostbyname(host,hparams)) == NULL) { prmsg (1,"SocketINETConnect: Can't get address for %s\n", host); ESET(EINVAL); return TRANS_CONNECT_FAILED; } if (hostp->h_addrtype != AF_INET) { /* is IP host? */ prmsg (1,"SocketINETConnect: not INET host%s\n", host); ESET(EPROTOTYPE); return TRANS_CONNECT_FAILED; } memcpy ((char *) &sockname.sin_addr, (char *) hostp->h_addr, sizeof (sockname.sin_addr)); } else { sockname.sin_addr.s_addr = tmpaddr; } /* * fill in sin_port */ /* Check for number in the port string */ if (!is_numeric (port)) { if ((servp = _XGetservbyname (port,"tcp",sparams)) == NULL) { prmsg (1,"SocketINETConnect: can't get service for %s\n", port); return TRANS_CONNECT_FAILED; } sockname.sin_port = htons (servp->s_port); } else { long tmpport = strtol (port, (char**)NULL, 10); if (tmpport < 1024 || tmpport > USHRT_MAX) return TRANS_CONNECT_FAILED; sockname.sin_port = htons (((unsigned short) tmpport)); } prmsg (4,"SocketINETConnect: sockname.sin_port = %d\n", ntohs(sockname.sin_port)); socketaddr = (struct sockaddr *) &sockname; socketaddrlen = sizeof(sockname); } #endif /* * Turn on socket keepalive so the client process will eventually * be notified with a SIGPIPE signal if the display server fails * to respond to a periodic transmission of messages * on the connected socket. * This is useful to avoid hung application processes when the * processes are not spawned from the xdm session and * the display server terminates abnormally. * (Someone turned off the power switch.) */ { int tmp = 1; setsockopt (ciptr->fd, SOL_SOCKET, SO_KEEPALIVE, (char *) &tmp, sizeof (int)); } /* * Do the connect() */ if (connect (ciptr->fd, socketaddr, socketaddrlen ) < 0) { #ifdef WIN32 int olderrno = WSAGetLastError(); #else int olderrno = errno; #endif /* * If the error was ECONNREFUSED, the server may be overloaded * and we should try again. * * If the error was EWOULDBLOCK or EINPROGRESS then the socket * was non-blocking and we should poll using select * * If the error was EINTR, the connect was interrupted and we * should try again. * * If multiple addresses are found for a host then we should * try to connect again with a different address for a larger * number of errors that made us quit before, since those * could be caused by trying to use an IPv6 address to contact * a machine with an IPv4-only server or other reasons that * only affect one of a set of addresses. */ if (olderrno == ECONNREFUSED || olderrno == EINTR #if defined(IPv6) && defined(AF_INET6) || (((addrlist->addr->ai_next != NULL) || (addrlist->addr != addrlist->firstaddr)) && (olderrno == ENETUNREACH || olderrno == EAFNOSUPPORT || olderrno == EADDRNOTAVAIL || olderrno == ETIMEDOUT #if defined(EHOSTDOWN) || olderrno == EHOSTDOWN #endif )) #endif ) res = TRANS_TRY_CONNECT_AGAIN; else if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) res = TRANS_IN_PROGRESS; else { prmsg (2,"SocketINETConnect: Can't connect: errno = %d\n", olderrno); res = TRANS_CONNECT_FAILED; } } else { res = 0; /* * Sync up the address fields of ciptr. */ if (TRANS(SocketINETGetAddr) (ciptr) < 0) { prmsg (1, "SocketINETConnect: ...SocketINETGetAddr() failed:\n"); res = TRANS_CONNECT_FAILED; } else if (TRANS(SocketINETGetPeerAddr) (ciptr) < 0) { prmsg (1, "SocketINETConnect: ...SocketINETGetPeerAddr() failed:\n"); res = TRANS_CONNECT_FAILED; } } #if defined(IPv6) && defined(AF_INET6) if (res != 0) { addrlist->addr = addrlist->addr->ai_next; } #endif return res; } #endif /* TCPCONN */ #ifdef UNIXCONN /* * Make sure 'host' is really local. */ static int UnixHostReallyLocal (const char *host) { char hostnamebuf[256]; TRANS(GetHostname) (hostnamebuf, sizeof (hostnamebuf)); if (strcmp (hostnamebuf, host) == 0) { return (1); } else { #if defined(IPv6) && defined(AF_INET6) struct addrinfo *localhostaddr; struct addrinfo *otherhostaddr; struct addrinfo *i, *j; int equiv = 0; if (getaddrinfo(hostnamebuf, NULL, NULL, &localhostaddr) != 0) return 0; if (getaddrinfo(host, NULL, NULL, &otherhostaddr) != 0) { freeaddrinfo(localhostaddr); return 0; } for (i = localhostaddr; i != NULL && equiv == 0; i = i->ai_next) { for (j = otherhostaddr; j != NULL && equiv == 0; j = j->ai_next) { if (i->ai_family == j->ai_family) { if (i->ai_family == AF_INET) { struct sockaddr_in *sinA = (struct sockaddr_in *) i->ai_addr; struct sockaddr_in *sinB = (struct sockaddr_in *) j->ai_addr; struct in_addr *A = &sinA->sin_addr; struct in_addr *B = &sinB->sin_addr; if (memcmp(A,B,sizeof(struct in_addr)) == 0) { equiv = 1; } } else if (i->ai_family == AF_INET6) { struct sockaddr_in6 *sinA = (struct sockaddr_in6 *) i->ai_addr; struct sockaddr_in6 *sinB = (struct sockaddr_in6 *) j->ai_addr; struct in6_addr *A = &sinA->sin6_addr; struct in6_addr *B = &sinB->sin6_addr; if (memcmp(A,B,sizeof(struct in6_addr)) == 0) { equiv = 1; } } } } } freeaddrinfo(localhostaddr); freeaddrinfo(otherhostaddr); return equiv; #else /* * A host may have more than one network address. If any of the * network addresses of 'host' (specified to the connect call) * match any of the network addresses of 'hostname' (determined * by TRANS(GetHostname)), then the two hostnames are equivalent, * and we know that 'host' is really a local host. */ char specified_local_addr_list[10][4]; int scount, equiv, i, j; #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; #endif struct hostent *hostp; if ((hostp = _XGethostbyname (host,hparams)) == NULL) return (0); scount = 0; while (hostp->h_addr_list[scount] && scount <= 8) { /* * The 2nd call to gethostname() overrides the data * from the 1st call, so we must save the address list. */ specified_local_addr_list[scount][0] = hostp->h_addr_list[scount][0]; specified_local_addr_list[scount][1] = hostp->h_addr_list[scount][1]; specified_local_addr_list[scount][2] = hostp->h_addr_list[scount][2]; specified_local_addr_list[scount][3] = hostp->h_addr_list[scount][3]; scount++; } if ((hostp = _XGethostbyname (hostnamebuf,hparams)) == NULL) return (0); equiv = 0; i = 0; while (i < scount && !equiv) { j = 0; while (hostp->h_addr_list[j]) { if ((specified_local_addr_list[i][0] == hostp->h_addr_list[j][0]) && (specified_local_addr_list[i][1] == hostp->h_addr_list[j][1]) && (specified_local_addr_list[i][2] == hostp->h_addr_list[j][2]) && (specified_local_addr_list[i][3] == hostp->h_addr_list[j][3])) { /* They're equal, so we're done */ equiv = 1; break; } j++; } i++; } return (equiv); #endif } } static int TRANS(SocketUNIXConnect) (XtransConnInfo ciptr, const char *host, const char *port) { struct sockaddr_un sockname; SOCKLEN_T namelen; int abstract = 0; #ifdef HAVE_ABSTRACT_SOCKETS abstract = ciptr->transptr->flags & TRANS_ABSTRACT; #endif prmsg (2,"SocketUNIXConnect(%d,%s,%s)\n", ciptr->fd, host, port); /* * Make sure 'host' is really local. If not, we return failure. * The reason we make this check is because a process may advertise * a "local" network ID for which it can accept connections, but if * a process on a remote machine tries to connect to this network ID, * we know for sure it will fail. */ if (host && *host && host[0]!='/' && strcmp (host, "unix") != 0 && !UnixHostReallyLocal (host)) { prmsg (1, "SocketUNIXConnect: Cannot connect to non-local host %s\n", host); return TRANS_CONNECT_FAILED; } /* * Check the port. */ if (!port || !*port) { prmsg (1,"SocketUNIXConnect: Missing port specification\n"); return TRANS_CONNECT_FAILED; } /* * Build the socket name. */ sockname.sun_family = AF_UNIX; if (set_sun_path(port, UNIX_PATH, sockname.sun_path, abstract) != 0) { prmsg (1, "SocketUNIXConnect: path too long\n"); return TRANS_CONNECT_FAILED; } #if (defined(BSD44SOCKETS) || defined(__UNIXWARE__)) sockname.sun_len = strlen (sockname.sun_path); #endif #if defined(BSD44SOCKETS) || defined(SUN_LEN) namelen = SUN_LEN (&sockname); #else namelen = strlen (sockname.sun_path) + offsetof(struct sockaddr_un, sun_path); #endif /* * Adjust the socket path if using abstract sockets. * Done here because otherwise all the strlen() calls above would fail. */ if (abstract) { sockname.sun_path[0] = '\0'; } /* * Do the connect() */ if (connect (ciptr->fd, (struct sockaddr *) &sockname, namelen) < 0) { int olderrno = errno; int connected = 0; if (!connected) { errno = olderrno; /* * If the error was ENOENT, the server may be starting up; we used * to suggest to try again in this case with * TRANS_TRY_CONNECT_AGAIN, but this introduced problems for * processes still referencing stale sockets in their environment. * Hence, we now return a hard error, TRANS_CONNECT_FAILED, and it * is suggested that higher level stacks handle retries on their * level when they face a slow starting server. * * If the error was EWOULDBLOCK or EINPROGRESS then the socket * was non-blocking and we should poll using select * * If the error was EINTR, the connect was interrupted and we * should try again. */ if (olderrno == EWOULDBLOCK || olderrno == EINPROGRESS) return TRANS_IN_PROGRESS; else if (olderrno == EINTR) return TRANS_TRY_CONNECT_AGAIN; else if (olderrno == ENOENT || olderrno == ECONNREFUSED) { /* If opening as abstract socket failed, try again normally */ if (abstract) { ciptr->transptr->flags &= ~(TRANS_ABSTRACT); return TRANS_TRY_CONNECT_AGAIN; } else { return TRANS_CONNECT_FAILED; } } else { prmsg (2,"SocketUNIXConnect: Can't connect: errno = %d\n", EGET()); return TRANS_CONNECT_FAILED; } } } /* * Get the socket name and the peer name from the connect socket, * since this is unix domain. */ if ((ciptr->addr = malloc(namelen)) == NULL || (ciptr->peeraddr = malloc(namelen)) == NULL) { prmsg (1, "SocketUNIXCreateListener: Can't allocate space for the addr\n"); return TRANS_CONNECT_FAILED; } if (abstract) sockname.sun_path[0] = '@'; ciptr->family = AF_UNIX; ciptr->addrlen = namelen; ciptr->peeraddrlen = namelen; memcpy (ciptr->addr, &sockname, ciptr->addrlen); memcpy (ciptr->peeraddr, &sockname, ciptr->peeraddrlen); return 0; } #endif /* UNIXCONN */ #endif /* TRANS_CLIENT */ static int TRANS(SocketBytesReadable) (XtransConnInfo ciptr, BytesReadable_t *pend) { prmsg (2,"SocketBytesReadable(%p,%d,%p)\n", ciptr, ciptr->fd, pend); #ifdef WIN32 { int ret = ioctlsocket ((SOCKET) ciptr->fd, FIONREAD, (u_long *) pend); if (ret == SOCKET_ERROR) errno = WSAGetLastError(); return ret; } #else #if defined(__i386__) && defined(SYSV) && !defined(SCO325) return ioctl (ciptr->fd, I_NREAD, (char *) pend); #else return ioctl (ciptr->fd, FIONREAD, (char *) pend); #endif /* __i386__ && SYSV || _SEQUENT_ && _SOCKET_VERSION == 1 */ #endif /* WIN32 */ } #if XTRANS_SEND_FDS static void appendFd(struct _XtransConnFd **prev, int fd, int do_close) { struct _XtransConnFd *cf, *new; new = malloc (sizeof (struct _XtransConnFd)); if (!new) { /* XXX mark connection as broken */ close(fd); return; } new->next = 0; new->fd = fd; new->do_close = do_close; /* search to end of list */ for (; (cf = *prev); prev = &(cf->next)); *prev = new; } static int removeFd(struct _XtransConnFd **prev) { struct _XtransConnFd *cf; int fd; if ((cf = *prev)) { *prev = cf->next; fd = cf->fd; free(cf); } else fd = -1; return fd; } static void discardFd(struct _XtransConnFd **prev, struct _XtransConnFd *upto, int do_close) { struct _XtransConnFd *cf, *next; for (cf = *prev; cf != upto; cf = next) { next = cf->next; if (do_close || cf->do_close) close(cf->fd); free(cf); } *prev = upto; } static void cleanupFds(XtransConnInfo ciptr) { /* Clean up the send list but don't close the fds */ discardFd(&ciptr->send_fds, NULL, 0); /* Clean up the recv list and *do* close the fds */ discardFd(&ciptr->recv_fds, NULL, 1); } static int nFd(struct _XtransConnFd **prev) { struct _XtransConnFd *cf; int n = 0; for (cf = *prev; cf; cf = cf->next) n++; return n; } static int TRANS(SocketRecvFd) (XtransConnInfo ciptr) { prmsg (2, "SocketRecvFd(%d)\n", ciptr->fd); return removeFd(&ciptr->recv_fds); } static int TRANS(SocketSendFd) (XtransConnInfo ciptr, int fd, int do_close) { appendFd(&ciptr->send_fds, fd, do_close); return 0; } static int TRANS(SocketRecvFdInvalid)(XtransConnInfo ciptr) { errno = EINVAL; return -1; } static int TRANS(SocketSendFdInvalid)(XtransConnInfo ciptr, int fd, int do_close) { errno = EINVAL; return -1; } #define MAX_FDS 128 union fd_pass { struct cmsghdr cmsghdr; char buf[CMSG_SPACE(MAX_FDS * sizeof(int))]; }; #endif /* XTRANS_SEND_FDS */ static int TRANS(SocketRead) (XtransConnInfo ciptr, char *buf, int size) { prmsg (2,"SocketRead(%d,%p,%d)\n", ciptr->fd, buf, size); #if defined(WIN32) { int ret = recv ((SOCKET)ciptr->fd, buf, size, 0); #ifdef WIN32 if (ret == SOCKET_ERROR) errno = WSAGetLastError(); #endif return ret; } #else #if XTRANS_SEND_FDS { struct iovec iov = { .iov_base = buf, .iov_len = size }; union fd_pass cmsgbuf; struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, .msg_iov = &iov, .msg_iovlen = 1, .msg_control = cmsgbuf.buf, .msg_controllen = CMSG_LEN(MAX_FDS * sizeof(int)) }; size = recvmsg(ciptr->fd, &msg, 0); if (size >= 0) { struct cmsghdr *hdr; for (hdr = CMSG_FIRSTHDR(&msg); hdr; hdr = CMSG_NXTHDR(&msg, hdr)) { if (hdr->cmsg_level == SOL_SOCKET && hdr->cmsg_type == SCM_RIGHTS) { int nfd = (hdr->cmsg_len - CMSG_LEN(0)) / sizeof (int); int i; int *fd = (int *) CMSG_DATA(hdr); for (i = 0; i < nfd; i++) appendFd(&ciptr->recv_fds, fd[i], 0); } } } return size; } #else return read(ciptr->fd, buf, size); #endif /* XTRANS_SEND_FDS */ #endif /* WIN32 */ } static int TRANS(SocketReadv) (XtransConnInfo ciptr, struct iovec *buf, int size) { prmsg (2,"SocketReadv(%d,%p,%d)\n", ciptr->fd, buf, size); #if XTRANS_SEND_FDS { union fd_pass cmsgbuf; struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, .msg_iov = buf, .msg_iovlen = size, .msg_control = cmsgbuf.buf, .msg_controllen = CMSG_LEN(MAX_FDS * sizeof(int)) }; size = recvmsg(ciptr->fd, &msg, 0); if (size >= 0) { struct cmsghdr *hdr; for (hdr = CMSG_FIRSTHDR(&msg); hdr; hdr = CMSG_NXTHDR(&msg, hdr)) { if (hdr->cmsg_level == SOL_SOCKET && hdr->cmsg_type == SCM_RIGHTS) { int nfd = (hdr->cmsg_len - CMSG_LEN(0)) / sizeof (int); int i; int *fd = (int *) CMSG_DATA(hdr); for (i = 0; i < nfd; i++) appendFd(&ciptr->recv_fds, fd[i], 0); } } } return size; } #else return READV (ciptr, buf, size); #endif } static int TRANS(SocketWritev) (XtransConnInfo ciptr, struct iovec *buf, int size) { prmsg (2,"SocketWritev(%d,%p,%d)\n", ciptr->fd, buf, size); #if XTRANS_SEND_FDS if (ciptr->send_fds) { union fd_pass cmsgbuf; int nfd = nFd(&ciptr->send_fds); struct _XtransConnFd *cf = ciptr->send_fds; struct msghdr msg = { .msg_name = NULL, .msg_namelen = 0, .msg_iov = buf, .msg_iovlen = size, .msg_control = cmsgbuf.buf, .msg_controllen = CMSG_LEN(nfd * sizeof(int)) }; struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); int i; int *fds; hdr->cmsg_len = msg.msg_controllen; hdr->cmsg_level = SOL_SOCKET; hdr->cmsg_type = SCM_RIGHTS; fds = (int *) CMSG_DATA(hdr); /* Set up fds */ for (i = 0; i < nfd; i++) { fds[i] = cf->fd; cf = cf->next; } i = sendmsg(ciptr->fd, &msg, 0); if (i > 0) discardFd(&ciptr->send_fds, cf, 0); return i; } #endif return WRITEV (ciptr, buf, size); } static int TRANS(SocketWrite) (XtransConnInfo ciptr, char *buf, int size) { prmsg (2,"SocketWrite(%d,%p,%d)\n", ciptr->fd, buf, size); #if defined(WIN32) { int ret = send ((SOCKET)ciptr->fd, buf, size, 0); #ifdef WIN32 if (ret == SOCKET_ERROR) errno = WSAGetLastError(); #endif return ret; } #else #if XTRANS_SEND_FDS if (ciptr->send_fds) { struct iovec iov; iov.iov_base = buf; iov.iov_len = size; return TRANS(SocketWritev)(ciptr, &iov, 1); } #endif /* XTRANS_SEND_FDS */ return write (ciptr->fd, buf, size); #endif /* WIN32 */ } static int TRANS(SocketDisconnect) (XtransConnInfo ciptr) { prmsg (2,"SocketDisconnect(%p,%d)\n", ciptr, ciptr->fd); #ifdef WIN32 { int ret = shutdown (ciptr->fd, 2); if (ret == SOCKET_ERROR) errno = WSAGetLastError(); return ret; } #else return shutdown (ciptr->fd, 2); /* disallow further sends and receives */ #endif } #ifdef TCPCONN static int TRANS(SocketINETClose) (XtransConnInfo ciptr) { prmsg (2,"SocketINETClose(%p,%d)\n", ciptr, ciptr->fd); #ifdef WIN32 { int ret = close (ciptr->fd); if (ret == SOCKET_ERROR) errno = WSAGetLastError(); return ret; } #else return close (ciptr->fd); #endif } #endif /* TCPCONN */ #ifdef UNIXCONN static int TRANS(SocketUNIXClose) (XtransConnInfo ciptr) { /* * If this is the server side, then once the socket is closed, * it must be unlinked to completely close it */ struct sockaddr_un *sockname = (struct sockaddr_un *) ciptr->addr; int ret; prmsg (2,"SocketUNIXClose(%p,%d)\n", ciptr, ciptr->fd); #if XTRANS_SEND_FDS cleanupFds(ciptr); #endif ret = close(ciptr->fd); if (ciptr->flags && sockname && sockname->sun_family == AF_UNIX && sockname->sun_path[0]) { if (!(ciptr->flags & TRANS_NOUNLINK || ciptr->transptr->flags & TRANS_ABSTRACT)) unlink (sockname->sun_path); } return ret; } static int TRANS(SocketUNIXCloseForCloning) (XtransConnInfo ciptr) { /* * Don't unlink path. */ int ret; prmsg (2,"SocketUNIXCloseForCloning(%p,%d)\n", ciptr, ciptr->fd); #if XTRANS_SEND_FDS cleanupFds(ciptr); #endif ret = close(ciptr->fd); return ret; } #endif /* UNIXCONN */ #ifdef TCPCONN # ifdef TRANS_SERVER static const char* tcp_nolisten[] = { "inet", #if defined(IPv6) && defined(AF_INET6) "inet6", #endif NULL }; # endif Xtransport TRANS(SocketTCPFuncs) = { /* Socket Interface */ "tcp", TRANS_ALIAS, #ifdef TRANS_CLIENT TRANS(SocketOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER tcp_nolisten, TRANS(SocketOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(SocketOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(SocketReopenCOTSServer), TRANS(SocketReopenCLTSServer), #endif TRANS(SocketSetOption), #ifdef TRANS_SERVER TRANS(SocketINETCreateListener), NULL, /* ResetListener */ TRANS(SocketINETAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketINETConnect), #endif /* TRANS_CLIENT */ TRANS(SocketBytesReadable), TRANS(SocketRead), TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), #if XTRANS_SEND_FDS TRANS(SocketSendFdInvalid), TRANS(SocketRecvFdInvalid), #endif TRANS(SocketDisconnect), TRANS(SocketINETClose), TRANS(SocketINETClose), }; Xtransport TRANS(SocketINETFuncs) = { /* Socket Interface */ "inet", 0, #ifdef TRANS_CLIENT TRANS(SocketOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER NULL, TRANS(SocketOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(SocketOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(SocketReopenCOTSServer), TRANS(SocketReopenCLTSServer), #endif TRANS(SocketSetOption), #ifdef TRANS_SERVER TRANS(SocketINETCreateListener), NULL, /* ResetListener */ TRANS(SocketINETAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketINETConnect), #endif /* TRANS_CLIENT */ TRANS(SocketBytesReadable), TRANS(SocketRead), TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), #if XTRANS_SEND_FDS TRANS(SocketSendFdInvalid), TRANS(SocketRecvFdInvalid), #endif TRANS(SocketDisconnect), TRANS(SocketINETClose), TRANS(SocketINETClose), }; #if defined(IPv6) && defined(AF_INET6) Xtransport TRANS(SocketINET6Funcs) = { /* Socket Interface */ "inet6", 0, #ifdef TRANS_CLIENT TRANS(SocketOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER NULL, TRANS(SocketOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(SocketOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(SocketReopenCOTSServer), TRANS(SocketReopenCLTSServer), #endif TRANS(SocketSetOption), #ifdef TRANS_SERVER TRANS(SocketINETCreateListener), NULL, /* ResetListener */ TRANS(SocketINETAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketINETConnect), #endif /* TRANS_CLIENT */ TRANS(SocketBytesReadable), TRANS(SocketRead), TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), #if XTRANS_SEND_FDS TRANS(SocketSendFdInvalid), TRANS(SocketRecvFdInvalid), #endif TRANS(SocketDisconnect), TRANS(SocketINETClose), TRANS(SocketINETClose), }; #endif /* IPv6 */ #endif /* TCPCONN */ #ifdef UNIXCONN #if !defined(LOCALCONN) Xtransport TRANS(SocketLocalFuncs) = { /* Socket Interface */ "local", #ifdef HAVE_ABSTRACT_SOCKETS TRANS_ABSTRACT, #else 0, #endif #ifdef TRANS_CLIENT TRANS(SocketOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER NULL, TRANS(SocketOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(SocketOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(SocketReopenCOTSServer), TRANS(SocketReopenCLTSServer), #endif TRANS(SocketSetOption), #ifdef TRANS_SERVER TRANS(SocketUNIXCreateListener), TRANS(SocketUNIXResetListener), TRANS(SocketUNIXAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketUNIXConnect), #endif /* TRANS_CLIENT */ TRANS(SocketBytesReadable), TRANS(SocketRead), TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), #if XTRANS_SEND_FDS TRANS(SocketSendFd), TRANS(SocketRecvFd), #endif TRANS(SocketDisconnect), TRANS(SocketUNIXClose), TRANS(SocketUNIXCloseForCloning), }; #endif /* !LOCALCONN */ # ifdef TRANS_SERVER # if !defined(LOCALCONN) static const char* unix_nolisten[] = { "local" , NULL }; # endif # endif Xtransport TRANS(SocketUNIXFuncs) = { /* Socket Interface */ "unix", #if !defined(LOCALCONN) && !defined(HAVE_ABSTRACT_SOCKETS) TRANS_ALIAS, #else 0, #endif #ifdef TRANS_CLIENT TRANS(SocketOpenCOTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER #if !defined(LOCALCONN) unix_nolisten, #else NULL, #endif TRANS(SocketOpenCOTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketOpenCLTSClient), #endif /* TRANS_CLIENT */ #ifdef TRANS_SERVER TRANS(SocketOpenCLTSServer), #endif /* TRANS_SERVER */ #ifdef TRANS_REOPEN TRANS(SocketReopenCOTSServer), TRANS(SocketReopenCLTSServer), #endif TRANS(SocketSetOption), #ifdef TRANS_SERVER TRANS(SocketUNIXCreateListener), TRANS(SocketUNIXResetListener), TRANS(SocketUNIXAccept), #endif /* TRANS_SERVER */ #ifdef TRANS_CLIENT TRANS(SocketUNIXConnect), #endif /* TRANS_CLIENT */ TRANS(SocketBytesReadable), TRANS(SocketRead), TRANS(SocketWrite), TRANS(SocketReadv), TRANS(SocketWritev), #if XTRANS_SEND_FDS TRANS(SocketSendFd), TRANS(SocketRecvFd), #endif TRANS(SocketDisconnect), TRANS(SocketUNIXClose), TRANS(SocketUNIXCloseForCloning), }; #endif /* UNIXCONN */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xtrans/Xtransutil.c ================================================ /* Copyright 1993, 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name NCR not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. NCR makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * NCRS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* * These are some utility functions created for convenience or to provide * an interface that is similar to an existing interface. These are built * only using the Transport Independant API, and have no knowledge of * the internal implementation. */ #ifdef XTHREADS #include #endif #ifdef WIN32 #include #include #endif #ifdef X11_t /* * These values come from X.h and Xauth.h, and MUST match them. Some * of these values are also defined by the ChangeHost protocol message. */ #define FamilyInternet 0 /* IPv4 */ #define FamilyDECnet 1 #define FamilyChaos 2 #define FamilyInternet6 6 #define FamilyAmoeba 33 #define FamilyLocalHost 252 #define FamilyKrb5Principal 253 #define FamilyNetname 254 #define FamilyLocal 256 #define FamilyWild 65535 /* * TRANS(ConvertAddress) converts a sockaddr based address to an * X authorization based address. Some of this is defined as part of * the ChangeHost protocol. The rest is just done in a consistent manner. */ int TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) { prmsg(2,"ConvertAddress(%d,%d,%p)\n",*familyp,*addrlenp,*addrp); switch( *familyp ) { #if defined(TCPCONN) case AF_INET: { /* * Check for the BSD hack localhost address 127.0.0.1. * In this case, we are really FamilyLocal. */ struct sockaddr_in saddr; int len = sizeof(saddr.sin_addr.s_addr); char *cp = (char *) &saddr.sin_addr.s_addr; memcpy (&saddr, *addrp, sizeof (struct sockaddr_in)); if ((len == 4) && (cp[0] == 127) && (cp[1] == 0) && (cp[2] == 0) && (cp[3] == 1)) { *familyp=FamilyLocal; } else { *familyp=FamilyInternet; *addrlenp=len; memcpy(*addrp,&saddr.sin_addr,len); } break; } #if defined(IPv6) && defined(AF_INET6) case AF_INET6: { struct sockaddr_in6 saddr6; memcpy (&saddr6, *addrp, sizeof (struct sockaddr_in6)); if (IN6_IS_ADDR_LOOPBACK(&saddr6.sin6_addr)) { *familyp=FamilyLocal; } else if (IN6_IS_ADDR_V4MAPPED(&(saddr6.sin6_addr))) { char *cp = (char *) &saddr6.sin6_addr.s6_addr[12]; if ((cp[0] == 127) && (cp[1] == 0) && (cp[2] == 0) && (cp[3] == 1)) { *familyp=FamilyLocal; } else { *familyp=FamilyInternet; *addrlenp = sizeof (struct in_addr); memcpy(*addrp,cp,*addrlenp); } } else { *familyp=FamilyInternet6; *addrlenp=sizeof(saddr6.sin6_addr); memcpy(*addrp,&saddr6.sin6_addr,sizeof(saddr6.sin6_addr)); } break; } #endif /* IPv6 */ #endif /* defined(TCPCONN) */ #if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: { *familyp=FamilyLocal; break; } #endif /* defined(UNIXCONN) || defined(LOCALCONN) */ #if (defined(__SCO__) || defined(__UNIXWARE__)) && defined(LOCALCONN) case 0: { *familyp=FamilyLocal; break; } #endif default: prmsg(1,"ConvertAddress: Unknown family type %d\n", *familyp); return -1; } if (*familyp == FamilyLocal) { /* * In the case of a local connection, we need to get the * host name for authentication. */ char hostnamebuf[256]; int len = TRANS(GetHostname) (hostnamebuf, sizeof hostnamebuf); if (len > 0) { if (*addrp && *addrlenp < (len + 1)) { free (*addrp); *addrp = NULL; } if (!*addrp) *addrp = malloc (len + 1); if (*addrp) { strcpy ((char *) *addrp, hostnamebuf); *addrlenp = len; } else { *addrlenp = 0; } } else { if (*addrp) free (*addrp); *addrp = NULL; *addrlenp = 0; } } return 0; } #endif /* X11_t */ #ifdef ICE_t /* Needed for _XGethostbyaddr usage in TRANS(GetPeerNetworkId) */ # if defined(TCPCONN) || defined(UNIXCONN) # define X_INCLUDE_NETDB_H # define XOS_USE_NO_LOCKING # include # endif #include char * TRANS(GetMyNetworkId) (XtransConnInfo ciptr) { int family = ciptr->family; char *addr = ciptr->addr; char hostnamebuf[256]; char *networkId = NULL; const char *transName = ciptr->transptr->TransName; if (gethostname (hostnamebuf, sizeof (hostnamebuf)) < 0) { return (NULL); } switch (family) { #if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: { struct sockaddr_un *saddr = (struct sockaddr_un *) addr; networkId = malloc (3 + strlen (transName) + strlen (hostnamebuf) + strlen (saddr->sun_path)); sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, saddr->sun_path); break; } #endif /* defined(UNIXCONN) || defined(LOCALCONN) */ #if defined(TCPCONN) case AF_INET: #if defined(IPv6) && defined(AF_INET6) case AF_INET6: #endif { struct sockaddr_in *saddr = (struct sockaddr_in *) addr; #if defined(IPv6) && defined(AF_INET6) struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *) addr; #endif int portnum; char portnumbuf[10]; #if defined(IPv6) && defined(AF_INET6) if (family == AF_INET6) portnum = ntohs (saddr6->sin6_port); else #endif portnum = ntohs (saddr->sin_port); snprintf (portnumbuf, sizeof(portnumbuf), "%d", portnum); networkId = malloc (3 + strlen (transName) + strlen (hostnamebuf) + strlen (portnumbuf)); sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, portnumbuf); break; } #endif /* defined(TCPCONN) */ default: break; } return (networkId); } #include static jmp_buf env; #ifdef SIGALRM static volatile int nameserver_timedout = 0; static void nameserver_lost(int sig _X_UNUSED) { nameserver_timedout = 1; longjmp (env, -1); /* NOTREACHED */ } #endif /* SIGALARM */ char * TRANS(GetPeerNetworkId) (XtransConnInfo ciptr) { int family = ciptr->family; char *peer_addr = ciptr->peeraddr; char *hostname; char addrbuf[256]; const char *addr = NULL; switch (family) { case AF_UNSPEC: #if defined(UNIXCONN) || defined(LOCALCONN) case AF_UNIX: { if (gethostname (addrbuf, sizeof (addrbuf)) == 0) addr = addrbuf; break; } #endif /* defined(UNIXCONN) || defined(LOCALCONN) */ #if defined(TCPCONN) case AF_INET: #if defined(IPv6) && defined(AF_INET6) case AF_INET6: #endif { struct sockaddr_in *saddr = (struct sockaddr_in *) peer_addr; #if defined(IPv6) && defined(AF_INET6) struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *) peer_addr; #endif char *address; int addresslen; #ifdef XTHREADS_NEEDS_BYNAMEPARAMS _Xgethostbynameparams hparams; #endif struct hostent * volatile hostp = NULL; #if defined(IPv6) && defined(AF_INET6) if (family == AF_INET6) { address = (char *) &saddr6->sin6_addr; addresslen = sizeof (saddr6->sin6_addr); } else #endif { address = (char *) &saddr->sin_addr; addresslen = sizeof (saddr->sin_addr); } #ifdef SIGALRM /* * gethostbyaddr can take a LONG time if the host does not exist. * Assume that if it does not respond in NAMESERVER_TIMEOUT seconds * that something is wrong and do not make the user wait. * gethostbyaddr will continue after a signal, so we have to * jump out of it. */ nameserver_timedout = 0; signal (SIGALRM, nameserver_lost); alarm (4); if (setjmp(env) == 0) { #endif hostp = _XGethostbyaddr (address, addresslen, family, hparams); #ifdef SIGALRM } alarm (0); #endif if (hostp != NULL) addr = hostp->h_name; else #if defined(IPv6) && defined(AF_INET6) addr = inet_ntop (family, address, addrbuf, sizeof (addrbuf)); #else addr = inet_ntoa (saddr->sin_addr); #endif break; } #endif /* defined(TCPCONN) */ default: return (NULL); } hostname = malloc (strlen (ciptr->transptr->TransName) + strlen (addr) + 2); strcpy (hostname, ciptr->transptr->TransName); strcat (hostname, "/"); if (addr) strcat (hostname, addr); return (hostname); } #endif /* ICE_t */ #if defined(WIN32) && defined(TCPCONN) int TRANS(WSAStartup) (void) { static WSADATA wsadata; prmsg (2,"WSAStartup()\n"); if (!wsadata.wVersion && WSAStartup(MAKEWORD(2,2), &wsadata)) return 1; return 0; } #endif #include static int is_numeric (const char *str) { int i; for (i = 0; i < (int) strlen (str); i++) if (!isdigit (str[i])) return (0); return (1); } #ifdef TRANS_SERVER #include #include #include #if !defined(S_IFLNK) && !defined(S_ISLNK) #undef lstat #define lstat(a,b) stat(a,b) #endif #define FAIL_IF_NOMODE 1 #define FAIL_IF_NOT_ROOT 2 #define WARN_NO_ACCESS 4 /* * We make the assumption that when the 'sticky' (t) bit is requested * it's not save if the directory has non-root ownership or the sticky * bit cannot be set and fail. */ static int trans_mkdir(const char *path, int mode) { struct stat buf; if (lstat(path, &buf) != 0) { if (errno != ENOENT) { prmsg(1, "mkdir: ERROR: (l)stat failed for %s (%d)\n", path, errno); return -1; } /* Dir doesn't exist. Try to create it */ #if !defined(WIN32) && !defined(__CYGWIN__) /* * 'sticky' bit requested: assume application makes * certain security implications. If effective user ID * is != 0: fail as we may not be able to meet them. */ if (geteuid() != 0) { if (mode & 01000) { prmsg(1, "mkdir: ERROR: euid != 0," "directory %s will not be created.\n", path); #ifdef FAIL_HARD return -1; #endif } else { prmsg(1, "mkdir: Cannot create %s with root ownership\n", path); } } #endif #ifndef WIN32 if (mkdir(path, mode) == 0) { if (chmod(path, mode)) { prmsg(1, "mkdir: ERROR: Mode of %s should be set to %04o\n", path, mode); #ifdef FAIL_HARD return -1; #endif } #else if (mkdir(path) == 0) { #endif } else { prmsg(1, "mkdir: ERROR: Cannot create %s\n", path); return -1; } return 0; } else { if (S_ISDIR(buf.st_mode)) { int updateOwner = 0; int updateMode = 0; int updatedOwner = 0; int updatedMode = 0; int status = 0; /* Check if the directory's ownership is OK. */ if (buf.st_uid != 0) updateOwner = 1; /* * Check if the directory's mode is OK. An exact match isn't * required, just a mode that isn't more permissive than the * one requested. */ if ((~mode) & 0077 & buf.st_mode) updateMode = 1; /* * If the directory is not writeable not everybody may * be able to create sockets. Therefore warn if mode * cannot be fixed. */ if ((~buf.st_mode) & 0022 & mode) { updateMode = 1; status |= WARN_NO_ACCESS; } /* * If 'sticky' bit is requested fail if owner isn't root * as we assume the caller makes certain security implications */ if (mode & 01000) { status |= FAIL_IF_NOT_ROOT; if (!(buf.st_mode & 01000)) { status |= FAIL_IF_NOMODE; updateMode = 1; } } #ifdef HAS_FCHOWN /* * If fchown(2) and fchmod(2) are available, try to correct the * directory's owner and mode. Otherwise it isn't safe to attempt * to do this. */ if (updateMode || updateOwner) { int fd = -1; struct stat fbuf; if ((fd = open(path, O_RDONLY)) != -1) { if (fstat(fd, &fbuf) == -1) { prmsg(1, "mkdir: ERROR: fstat failed for %s (%d)\n", path, errno); close(fd); return -1; } /* * Verify that we've opened the same directory as was * checked above. */ if (!S_ISDIR(fbuf.st_mode) || buf.st_dev != fbuf.st_dev || buf.st_ino != fbuf.st_ino) { prmsg(1, "mkdir: ERROR: inode for %s changed\n", path); close(fd); return -1; } if (updateOwner && fchown(fd, 0, 0) == 0) updatedOwner = 1; if (updateMode && fchmod(fd, mode) == 0) updatedMode = 1; close(fd); } } #endif if (updateOwner && !updatedOwner) { #ifdef FAIL_HARD if (status & FAIL_IF_NOT_ROOT) { prmsg(1, "mkdir: ERROR: Owner of %s must be set to root\n", path); return -1; } #endif #if !defined(__APPLE_CC__) && !defined(__CYGWIN__) prmsg(1, "mkdir: Owner of %s should be set to root\n", path); #endif } if (updateMode && !updatedMode) { #ifdef FAIL_HARD if (status & FAIL_IF_NOMODE) { prmsg(1, "mkdir: ERROR: Mode of %s must be set to %04o\n", path, mode); return -1; } #endif prmsg(1, "mkdir: Mode of %s should be set to %04o\n", path, mode); if (status & WARN_NO_ACCESS) { prmsg(1, "mkdir: this may cause subsequent errors\n"); } } return 0; } return -1; } /* In all other cases, fail */ return -1; } #endif /* TRANS_SERVER */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xtrans/transport.c ================================================ /* Copyright 1993, 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. * Copyright 1993, 1994 NCR Corporation - Dayton, Ohio, USA * * All Rights Reserved * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose and without fee is hereby granted, provided * that the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting * documentation, and that the name NCR not be used in advertising * or publicity pertaining to distribution of the software without specific, * written prior permission. NCR makes no representations about the * suitability of this software for any purpose. It is provided "as is" * without express or implied warranty. * * NCR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN * NO EVENT SHALL NCR BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #define XTRANS_TRANSPORT_C /* used to flag Xtransint.h that it's being used here, not just #included in another file */ #include "Xtransint.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wformat-nonliteral" #pragma clang diagnostic ignored "-Wdeprecated-declarations" #endif #ifdef LOCALCONN #include "Xtranslcl.c" #endif #if defined(TCPCONN) || defined(UNIXCONN) #include "Xtranssock.c" #endif #include "Xtrans.c" #include "Xtransutil.c" #ifdef __clang__ #pragma clang diagnostic pop #endif ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xutil.h ================================================ /*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ #ifndef _X11_XUTIL_H_ #define _X11_XUTIL_H_ /* You must include before including this file */ #include #include /* The Xlib structs are full of implicit padding to properly align members. We can't clean that up without breaking ABI, so tell clang not to bother complaining about it. */ #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" #endif /* * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding * value (x, y, width, height) was found in the parsed string. */ #define NoValue 0x0000 #define XValue 0x0001 #define YValue 0x0002 #define WidthValue 0x0004 #define HeightValue 0x0008 #define AllValues 0x000F #define XNegative 0x0010 #define YNegative 0x0020 /* * new version containing base_width, base_height, and win_gravity fields; * used with WM_NORMAL_HINTS. */ typedef struct { long flags; /* marks which fields in this structure are defined */ int x, y; /* obsolete for new window mgrs, but clients */ int width, height; /* should set so old wm's don't mess up */ int min_width, min_height; int max_width, max_height; int width_inc, height_inc; struct { int x; /* numerator */ int y; /* denominator */ } min_aspect, max_aspect; int base_width, base_height; /* added by ICCCM version 1 */ int win_gravity; /* added by ICCCM version 1 */ } XSizeHints; /* * The next block of definitions are for window manager properties that * clients and applications use for communication. */ /* flags argument in size hints */ #define USPosition (1L << 0) /* user specified x, y */ #define USSize (1L << 1) /* user specified width, height */ #define PPosition (1L << 2) /* program specified position */ #define PSize (1L << 3) /* program specified size */ #define PMinSize (1L << 4) /* program specified minimum size */ #define PMaxSize (1L << 5) /* program specified maximum size */ #define PResizeInc (1L << 6) /* program specified resize increments */ #define PAspect (1L << 7) /* program specified min and max aspect ratios */ #define PBaseSize (1L << 8) /* program specified base for incrementing */ #define PWinGravity (1L << 9) /* program specified window gravity */ /* obsolete */ #define PAllHints (PPosition|PSize|PMinSize|PMaxSize|PResizeInc|PAspect) typedef struct { long flags; /* marks which fields in this structure are defined */ Bool input; /* does this application rely on the window manager to get keyboard input? */ int initial_state; /* see below */ Pixmap icon_pixmap; /* pixmap to be used as icon */ Window icon_window; /* window to be used as icon */ int icon_x, icon_y; /* initial position of icon */ Pixmap icon_mask; /* icon mask bitmap */ XID window_group; /* id of related window group */ /* this structure may be extended in the future */ } XWMHints; /* definition for flags of XWMHints */ #define InputHint (1L << 0) #define StateHint (1L << 1) #define IconPixmapHint (1L << 2) #define IconWindowHint (1L << 3) #define IconPositionHint (1L << 4) #define IconMaskHint (1L << 5) #define WindowGroupHint (1L << 6) #define AllHints (InputHint|StateHint|IconPixmapHint|IconWindowHint| \ IconPositionHint|IconMaskHint|WindowGroupHint) #define XUrgencyHint (1L << 8) /* definitions for initial window state */ #define WithdrawnState 0 /* for windows that are not mapped */ #define NormalState 1 /* most applications want to start this way */ #define IconicState 3 /* application wants to start as an icon */ /* * Obsolete states no longer defined by ICCCM */ #define DontCareState 0 /* don't know or care */ #define ZoomState 2 /* application wants to start zoomed */ #define InactiveState 4 /* application believes it is seldom used; */ /* some wm's may put it on inactive menu */ /* * new structure for manipulating TEXT properties; used with WM_NAME, * WM_ICON_NAME, WM_CLIENT_MACHINE, and WM_COMMAND. */ typedef struct { unsigned char *value; /* same as Property routines */ Atom encoding; /* prop type */ int format; /* prop data format: 8, 16, or 32 */ unsigned long nitems; /* number of data items in value */ } XTextProperty; #define XNoMemory -1 #define XLocaleNotSupported -2 #define XConverterNotFound -3 typedef enum { XStringStyle, /* STRING */ XCompoundTextStyle, /* COMPOUND_TEXT */ XTextStyle, /* text in owner's encoding (current locale)*/ XStdICCTextStyle, /* STRING, else COMPOUND_TEXT */ /* The following is an XFree86 extension, introduced in November 2000 */ XUTF8StringStyle /* UTF8_STRING */ } XICCEncodingStyle; typedef struct { int min_width, min_height; int max_width, max_height; int width_inc, height_inc; } XIconSize; typedef struct { char *res_name; char *res_class; } XClassHint; #ifdef XUTIL_DEFINE_FUNCTIONS extern int XDestroyImage( XImage *ximage); extern unsigned long XGetPixel( XImage *ximage, int x, int y); extern int XPutPixel( XImage *ximage, int x, int y, unsigned long pixel); extern XImage *XSubImage( XImage *ximage, int x, int y, unsigned int width, unsigned int height); extern int XAddPixel( XImage *ximage, long value); #else /* * These macros are used to give some sugar to the image routines so that * naive people are more comfortable with them. */ #define XDestroyImage(ximage) \ ((*((ximage)->f.destroy_image))((ximage))) #define XGetPixel(ximage, x, y) \ ((*((ximage)->f.get_pixel))((ximage), (x), (y))) #define XPutPixel(ximage, x, y, pixel) \ ((*((ximage)->f.put_pixel))((ximage), (x), (y), (pixel))) #define XSubImage(ximage, x, y, width, height) \ ((*((ximage)->f.sub_image))((ximage), (x), (y), (width), (height))) #define XAddPixel(ximage, value) \ ((*((ximage)->f.add_pixel))((ximage), (value))) #endif /* * Compose sequence status structure, used in calling XLookupString. */ typedef struct _XComposeStatus { XPointer compose_ptr; /* state table pointer */ int chars_matched; /* match state */ } XComposeStatus; /* * Keysym macros, used on Keysyms to test for classes of symbols */ #define IsKeypadKey(keysym) \ (((KeySym)(keysym) >= XK_KP_Space) && ((KeySym)(keysym) <= XK_KP_Equal)) #define IsPrivateKeypadKey(keysym) \ (((KeySym)(keysym) >= 0x11000000) && ((KeySym)(keysym) <= 0x1100FFFF)) #define IsCursorKey(keysym) \ (((KeySym)(keysym) >= XK_Home) && ((KeySym)(keysym) < XK_Select)) #define IsPFKey(keysym) \ (((KeySym)(keysym) >= XK_KP_F1) && ((KeySym)(keysym) <= XK_KP_F4)) #define IsFunctionKey(keysym) \ (((KeySym)(keysym) >= XK_F1) && ((KeySym)(keysym) <= XK_F35)) #define IsMiscFunctionKey(keysym) \ (((KeySym)(keysym) >= XK_Select) && ((KeySym)(keysym) <= XK_Break)) #ifdef XK_XKB_KEYS #define IsModifierKey(keysym) \ ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \ || (((KeySym)(keysym) >= XK_ISO_Lock) && \ ((KeySym)(keysym) <= XK_ISO_Level5_Lock)) \ || ((KeySym)(keysym) == XK_Mode_switch) \ || ((KeySym)(keysym) == XK_Num_Lock)) #else #define IsModifierKey(keysym) \ ((((KeySym)(keysym) >= XK_Shift_L) && ((KeySym)(keysym) <= XK_Hyper_R)) \ || ((KeySym)(keysym) == XK_Mode_switch) \ || ((KeySym)(keysym) == XK_Num_Lock)) #endif /* * opaque reference to Region data type */ typedef struct _XRegion *Region; /* Return values from XRectInRegion() */ #define RectangleOut 0 #define RectangleIn 1 #define RectanglePart 2 /* * Information used by the visual utility routines to find desired visual * type from the many visuals a display may support. */ typedef struct { Visual *visual; VisualID visualid; int screen; int depth; #if defined(__cplusplus) || defined(c_plusplus) int c_class; /* C++ */ #else int class; #endif unsigned long red_mask; unsigned long green_mask; unsigned long blue_mask; int colormap_size; int bits_per_rgb; } XVisualInfo; #define VisualNoMask 0x0 #define VisualIDMask 0x1 #define VisualScreenMask 0x2 #define VisualDepthMask 0x4 #define VisualClassMask 0x8 #define VisualRedMaskMask 0x10 #define VisualGreenMaskMask 0x20 #define VisualBlueMaskMask 0x40 #define VisualColormapSizeMask 0x80 #define VisualBitsPerRGBMask 0x100 #define VisualAllMask 0x1FF /* * This defines a window manager property that clients may use to * share standard color maps of type RGB_COLOR_MAP: */ typedef struct { Colormap colormap; unsigned long red_max; unsigned long red_mult; unsigned long green_max; unsigned long green_mult; unsigned long blue_max; unsigned long blue_mult; unsigned long base_pixel; VisualID visualid; /* added by ICCCM version 1 */ XID killid; /* added by ICCCM version 1 */ } XStandardColormap; #define ReleaseByFreeingColormap ((XID) 1L) /* for killid field above */ /* * return codes for XReadBitmapFile and XWriteBitmapFile */ #define BitmapSuccess 0 #define BitmapOpenFailed 1 #define BitmapFileInvalid 2 #define BitmapNoMemory 3 /**************************************************************** * * Context Management * ****************************************************************/ /* Associative lookup table return codes */ #define XCSUCCESS 0 /* No error. */ #define XCNOMEM 1 /* Out of memory */ #define XCNOENT 2 /* No entry in table */ typedef int XContext; #define XUniqueContext() ((XContext) XrmUniqueQuark()) #define XStringToContext(string) ((XContext) XrmStringToQuark(string)) _XFUNCPROTOBEGIN /* The following declarations are alphabetized. */ extern XClassHint *XAllocClassHint ( void ); extern XIconSize *XAllocIconSize ( void ); extern XSizeHints *XAllocSizeHints ( void ); extern XStandardColormap *XAllocStandardColormap ( void ); extern XWMHints *XAllocWMHints ( void ); extern int XClipBox( Region /* r */, XRectangle* /* rect_return */ ); extern Region XCreateRegion( void ); extern const char *XDefaultString (void); extern int XDeleteContext( Display* /* display */, XID /* rid */, XContext /* context */ ); extern int XDestroyRegion( Region /* r */ ); extern int XEmptyRegion( Region /* r */ ); extern int XEqualRegion( Region /* r1 */, Region /* r2 */ ); extern int XFindContext( Display* /* display */, XID /* rid */, XContext /* context */, XPointer* /* data_return */ ); extern Status XGetClassHint( Display* /* display */, Window /* w */, XClassHint* /* class_hints_return */ ); extern Status XGetIconSizes( Display* /* display */, Window /* w */, XIconSize** /* size_list_return */, int* /* count_return */ ); extern Status XGetNormalHints( Display* /* display */, Window /* w */, XSizeHints* /* hints_return */ ); extern Status XGetRGBColormaps( Display* /* display */, Window /* w */, XStandardColormap** /* stdcmap_return */, int* /* count_return */, Atom /* property */ ); extern Status XGetSizeHints( Display* /* display */, Window /* w */, XSizeHints* /* hints_return */, Atom /* property */ ); extern Status XGetStandardColormap( Display* /* display */, Window /* w */, XStandardColormap* /* colormap_return */, Atom /* property */ ); extern Status XGetTextProperty( Display* /* display */, Window /* window */, XTextProperty* /* text_prop_return */, Atom /* property */ ); extern XVisualInfo *XGetVisualInfo( Display* /* display */, long /* vinfo_mask */, XVisualInfo* /* vinfo_template */, int* /* nitems_return */ ); extern Status XGetWMClientMachine( Display* /* display */, Window /* w */, XTextProperty* /* text_prop_return */ ); extern XWMHints *XGetWMHints( Display* /* display */, Window /* w */ ); extern Status XGetWMIconName( Display* /* display */, Window /* w */, XTextProperty* /* text_prop_return */ ); extern Status XGetWMName( Display* /* display */, Window /* w */, XTextProperty* /* text_prop_return */ ); extern Status XGetWMNormalHints( Display* /* display */, Window /* w */, XSizeHints* /* hints_return */, long* /* supplied_return */ ); extern Status XGetWMSizeHints( Display* /* display */, Window /* w */, XSizeHints* /* hints_return */, long* /* supplied_return */, Atom /* property */ ); extern Status XGetZoomHints( Display* /* display */, Window /* w */, XSizeHints* /* zhints_return */ ); extern int XIntersectRegion( Region /* sra */, Region /* srb */, Region /* dr_return */ ); extern void XConvertCase( KeySym /* sym */, KeySym* /* lower */, KeySym* /* upper */ ); extern int XLookupString( XKeyEvent* /* event_struct */, char* /* buffer_return */, int /* bytes_buffer */, KeySym* /* keysym_return */, XComposeStatus* /* status_in_out */ ); extern Status XMatchVisualInfo( Display* /* display */, int /* screen */, int /* depth */, int /* class */, XVisualInfo* /* vinfo_return */ ); extern int XOffsetRegion( Region /* r */, int /* dx */, int /* dy */ ); extern Bool XPointInRegion( Region /* r */, int /* x */, int /* y */ ); extern Region XPolygonRegion( XPoint* /* points */, int /* n */, int /* fill_rule */ ); extern int XRectInRegion( Region /* r */, int /* x */, int /* y */, unsigned int /* width */, unsigned int /* height */ ); extern int XSaveContext( Display* /* display */, XID /* rid */, XContext /* context */, _Xconst char* /* data */ ); extern int XSetClassHint( Display* /* display */, Window /* w */, XClassHint* /* class_hints */ ); extern int XSetIconSizes( Display* /* display */, Window /* w */, XIconSize* /* size_list */, int /* count */ ); extern int XSetNormalHints( Display* /* display */, Window /* w */, XSizeHints* /* hints */ ); extern void XSetRGBColormaps( Display* /* display */, Window /* w */, XStandardColormap* /* stdcmaps */, int /* count */, Atom /* property */ ); extern int XSetSizeHints( Display* /* display */, Window /* w */, XSizeHints* /* hints */, Atom /* property */ ); extern int XSetStandardProperties( Display* /* display */, Window /* w */, _Xconst char* /* window_name */, _Xconst char* /* icon_name */, Pixmap /* icon_pixmap */, char** /* argv */, int /* argc */, XSizeHints* /* hints */ ); extern void XSetTextProperty( Display* /* display */, Window /* w */, XTextProperty* /* text_prop */, Atom /* property */ ); extern void XSetWMClientMachine( Display* /* display */, Window /* w */, XTextProperty* /* text_prop */ ); extern int XSetWMHints( Display* /* display */, Window /* w */, XWMHints* /* wm_hints */ ); extern void XSetWMIconName( Display* /* display */, Window /* w */, XTextProperty* /* text_prop */ ); extern void XSetWMName( Display* /* display */, Window /* w */, XTextProperty* /* text_prop */ ); extern void XSetWMNormalHints( Display* /* display */, Window /* w */, XSizeHints* /* hints */ ); extern void XSetWMProperties( Display* /* display */, Window /* w */, XTextProperty* /* window_name */, XTextProperty* /* icon_name */, char** /* argv */, int /* argc */, XSizeHints* /* normal_hints */, XWMHints* /* wm_hints */, XClassHint* /* class_hints */ ); extern void XmbSetWMProperties( Display* /* display */, Window /* w */, _Xconst char* /* window_name */, _Xconst char* /* icon_name */, char** /* argv */, int /* argc */, XSizeHints* /* normal_hints */, XWMHints* /* wm_hints */, XClassHint* /* class_hints */ ); extern void Xutf8SetWMProperties( Display* /* display */, Window /* w */, _Xconst char* /* window_name */, _Xconst char* /* icon_name */, char** /* argv */, int /* argc */, XSizeHints* /* normal_hints */, XWMHints* /* wm_hints */, XClassHint* /* class_hints */ ); extern void XSetWMSizeHints( Display* /* display */, Window /* w */, XSizeHints* /* hints */, Atom /* property */ ); extern int XSetRegion( Display* /* display */, GC /* gc */, Region /* r */ ); extern void XSetStandardColormap( Display* /* display */, Window /* w */, XStandardColormap* /* colormap */, Atom /* property */ ); extern int XSetZoomHints( Display* /* display */, Window /* w */, XSizeHints* /* zhints */ ); extern int XShrinkRegion( Region /* r */, int /* dx */, int /* dy */ ); extern Status XStringListToTextProperty( char** /* list */, int /* count */, XTextProperty* /* text_prop_return */ ); extern int XSubtractRegion( Region /* sra */, Region /* srb */, Region /* dr_return */ ); extern int XmbTextListToTextProperty( Display* display, char** list, int count, XICCEncodingStyle style, XTextProperty* text_prop_return ); extern int XwcTextListToTextProperty( Display* display, wchar_t** list, int count, XICCEncodingStyle style, XTextProperty* text_prop_return ); extern int Xutf8TextListToTextProperty( Display* display, char** list, int count, XICCEncodingStyle style, XTextProperty* text_prop_return ); extern void XwcFreeStringList( wchar_t** list ); extern Status XTextPropertyToStringList( XTextProperty* /* text_prop */, char*** /* list_return */, int* /* count_return */ ); extern int XmbTextPropertyToTextList( Display* display, const XTextProperty* text_prop, char*** list_return, int* count_return ); extern int XwcTextPropertyToTextList( Display* display, const XTextProperty* text_prop, wchar_t*** list_return, int* count_return ); extern int Xutf8TextPropertyToTextList( Display* display, const XTextProperty* text_prop, char*** list_return, int* count_return ); extern int XUnionRectWithRegion( XRectangle* /* rectangle */, Region /* src_region */, Region /* dest_region_return */ ); extern int XUnionRegion( Region /* sra */, Region /* srb */, Region /* dr_return */ ); extern int XWMGeometry( Display* /* display */, int /* screen_number */, _Xconst char* /* user_geometry */, _Xconst char* /* default_geometry */, unsigned int /* border_width */, XSizeHints* /* hints */, int* /* x_return */, int* /* y_return */, int* /* width_return */, int* /* height_return */, int* /* gravity_return */ ); extern int XXorRegion( Region /* sra */, Region /* srb */, Region /* dr_return */ ); #ifdef __clang__ #pragma clang diagnostic pop #endif _XFUNCPROTOEND #endif /* _X11_XUTIL_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xw32defs.h ================================================ #ifndef _XW32DEFS_H # define _XW32DEFS_H # ifdef __GNUC__ /* mingw is more close to unix than msvc */ # if !defined(__daddr_t_defined) typedef char *caddr_t; # endif # define lstat stat # else typedef char *caddr_t; # define access _access # define alloca _alloca # define chdir _chdir # define chmod _chmod # define close _close # define creat _creat # define dup _dup # define dup2 _dup2 # define environ _environ # define execl _execl # define execle _execle # define execlp _execlp # define execlpe _execlpe # define execv _execv # define execve _execve # define execvp _execvp # define execvpe _execvpe # define fdopen _fdopen # define fileno _fileno # define fstat _fstat # define getcwd _getcwd # define getpid _getpid # define hypot _hypot # define isascii __isascii # define isatty _isatty # define lseek _lseek # define mkdir _mkdir # define mktemp _mktemp # define open _open # define putenv _putenv # define read _read # define rmdir _rmdir # define sleep(x) Sleep((x) * 1000) # define stat _stat # define sys_errlist _sys_errlist # define sys_nerr _sys_nerr # define umask _umask # define unlink _unlink # define write _write # define random rand # define srandom srand # define O_RDONLY _O_RDONLY # define O_WRONLY _O_WRONLY # define O_RDWR _O_RDWR # define O_APPEND _O_APPEND # define O_CREAT _O_CREAT # define O_TRUNC _O_TRUNC # define O_EXCL _O_EXCL # define O_TEXT _O_TEXT # define O_BINARY _O_BINARY # define O_RAW _O_BINARY # define S_IFMT _S_IFMT # define S_IFDIR _S_IFDIR # define S_IFCHR _S_IFCHR # define S_IFREG _S_IFREG # define S_IREAD _S_IREAD # define S_IWRITE _S_IWRITE # define S_IEXEC _S_IEXEC # define F_OK 0 # define X_OK 1 # define W_OK 2 # define R_OK 4 # endif /* __GNUC__ */ #endif ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xwindows.h ================================================ /* Copyright 1996, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL- ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * This header file has the sole purpose of allowing the inclusion of * windows.h without getting any name conflicts with X headers code, by * renaming or disabling the conflicting definitions from windows.h */ /* * Mingw.org versions of the Windows API headers actually avoid * making the conflicting definitions if XFree86Server is defined, so we * need to remember if that was defined and undefine it during including * windows.h (so the conflicting definitions get wrapped correctly), and * then redefine it afterwards. (This was never the correct thing to * do as it's no help at all to X11 clients which also need to use the * Win32 API) */ #undef _XFree86Server #ifdef XFree86Server # define _XFree86Server # undef XFree86Server #endif /* * There doesn't seem to be a good way to wrap the min/max macros from * windows.h, so we simply avoid defining them completely, allowing any * pre-existing definition to stand. * */ #define NOMINMAX /* * mingw-w64 headers define BOOL as a typedef, protecting against macros * mingw.org headers define BOOL in terms of WINBOOL * ... so try to come up with something which works with both :-) */ #define _NO_BOOL_TYPEDEF #define BOOL WINBOOL #define INT32 wINT32 #ifdef __x86_64__ #define INT64 wINT64 #define LONG64 wLONG64 #endif #undef Status #define Status wStatus #define ATOM wATOM #define BYTE wBYTE #define FreeResource wFreeResource #include #undef NOMINMAX #undef Status #define Status int #undef BYTE #undef BOOL #undef INT32 #undef INT64 #undef LONG64 #undef ATOM #undef FreeResource #undef CreateWindowA /* * Older version of this header used to name the windows API bool type wBOOL, * rather than more standard name WINBOOL */ #define wBOOL WINBOOL #ifdef RESOURCE_H # undef RT_FONT # undef RT_CURSOR # define RT_FONT ((RESTYPE)4) # define RT_CURSOR ((RESTYPE)5) #endif #ifndef __CYGWIN__ #define sleep(x) Sleep((x) * 1000) #endif #if defined(WIN32) && (!defined(PATH_MAX) || PATH_MAX < 1024) # undef PATH_MAX # define PATH_MAX 1024 #endif #ifdef _XFree86Server # define XFree86Server # undef _XFree86Server #endif ================================================ FILE: Libraries/Core/RPi/Headers/X11/Xwinsock.h ================================================ /* Copyright 1996, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL- ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL- ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ /* * This header file has for sole purpose to allow to include winsock.h * without getting any name conflicts with our code. * Conflicts come from the fact that including winsock.h actually pulls * in the whole Windows API... */ #undef _XFree86Server #ifdef XFree86Server # define _XFree86Server # undef XFree86Server #endif /* * mingw-w64 headers define BOOL as a typedef, protecting against macros * mingw.org headers define BOOL in terms of WINBOOL * ... so try to come up with something which works with both :-) */ #define _NO_BOOL_TYPEDEF #define BOOL WINBOOL #define INT32 wINT32 #undef Status #define Status wStatus #define ATOM wATOM #define BYTE wBYTE #define FreeResource wFreeResource #include #undef Status #define Status int #undef BYTE #undef BOOL #undef INT32 #undef ATOM #undef FreeResource #undef CreateWindowA #undef RT_FONT #undef RT_CURSOR /* * Older version of this header used to name the windows API bool type wBOOL, * rather than more standard name WINBOOL */ #define wBOOL WINBOOL #ifdef _XFree86Server # define XFree86Server # undef _XFree86Server #endif ================================================ FILE: Libraries/Core/RPi/Headers/X11/ap_keysym.h ================================================ /****************************************************************** Copyright 1987 by Apollo Computer Inc., Chelmsford, Massachusetts. Copyright 1989 by Hewlett-Packard Company. All Rights Reserved Permission to use, duplicate, change, and distribute this software and its documentation for any purpose and without fee is granted, provided that the above copyright notice appear in such copy and that this copyright notice appear in all supporting documentation, and that the names of Apollo Computer Inc., the Hewlett-Packard Company, or the X Consortium not be used in advertising or publicity pertaining to distribution of the software without written prior permission. HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Hewlett-Packard shall not be liable for errors contained herein or direct, indirect, special, incidental or consequential damages in connection with the furnishing, performance, or use of this material. This software is not subject to any license of the American Telephone and Telegraph Company or of the Regents of the University of California. ******************************************************************/ #define apXK_LineDel 0x1000FF00 #define apXK_CharDel 0x1000FF01 #define apXK_Copy 0x1000FF02 #define apXK_Cut 0x1000FF03 #define apXK_Paste 0x1000FF04 #define apXK_Move 0x1000FF05 #define apXK_Grow 0x1000FF06 #define apXK_Cmd 0x1000FF07 #define apXK_Shell 0x1000FF08 #define apXK_LeftBar 0x1000FF09 #define apXK_RightBar 0x1000FF0A #define apXK_LeftBox 0x1000FF0B #define apXK_RightBox 0x1000FF0C #define apXK_UpBox 0x1000FF0D #define apXK_DownBox 0x1000FF0E #define apXK_Pop 0x1000FF0F #define apXK_Read 0x1000FF10 #define apXK_Edit 0x1000FF11 #define apXK_Save 0x1000FF12 #define apXK_Exit 0x1000FF13 #define apXK_Repeat 0x1000FF14 #define apXK_KP_parenleft 0x1000FFA8 #define apXK_KP_parenright 0x1000FFA9 ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_error ================================================ /* $XConsortium: xm_error /main/5 1995/07/17 10:31:41 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_error_width 20 #define xm_error_height 20 static char xm_error_bits[] = { 0x00, 0x00, 0x00, 0xc0, 0x0f, 0x00, 0xf0, 0x3a, 0x00, 0x58, 0x55, 0x00, 0x2c, 0xa0, 0x00, 0x56, 0x40, 0x01, 0xaa, 0x80, 0x02, 0x46, 0x81, 0x01, 0x8a, 0x82, 0x02, 0x06, 0x85, 0x01, 0x0a, 0x8a, 0x02, 0x06, 0x94, 0x01, 0x0a, 0xe8, 0x02, 0x14, 0x50, 0x01, 0x28, 0xb0, 0x00, 0xd0, 0x5f, 0x00, 0xa0, 0x2a, 0x00, 0x40, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_hour16 ================================================ /* $XConsortium: xm_hour16 /main/5 1995/07/17 10:31:48 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define hour16_x_hot 7 #define hour16_y_hot 7 #define hour16_width 16 #define hour16_height 16 static char hour16_bits[] = { 0x00, 0x00, 0xfe, 0x7f, 0x14, 0x28, 0x14, 0x28, 0x14, 0x28, 0x24, 0x24, 0x44, 0x22, 0x84, 0x21, 0x84, 0x21, 0x44, 0x22, 0x24, 0x24, 0x14, 0x28, 0x94, 0x29, 0xd4, 0x2b, 0xfe, 0x7f, 0x00, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_hour16m ================================================ /* $XConsortium: xm_hour16m /main/5 1995/07/17 10:31:55 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define hour16m_width 16 #define hour16m_height 16 static char hour16m_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_hour32 ================================================ /* $XConsortium: xm_hour32 /main/5 1995/07/17 10:32:03 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define hour32_width 32 #define hour32_height 32 #define hour32_x_hot 15 #define hour32_y_hot 15 static char hour32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0x8c, 0x00, 0x00, 0x31, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x4c, 0x00, 0x00, 0x32, 0x8c, 0x00, 0x00, 0x31, 0x0c, 0x7f, 0xfe, 0x30, 0x0c, 0xfe, 0x7f, 0x30, 0x0c, 0xfc, 0x3f, 0x30, 0x0c, 0xf8, 0x1f, 0x30, 0x0c, 0xe0, 0x07, 0x30, 0x0c, 0x80, 0x01, 0x30, 0x0c, 0x80, 0x01, 0x30, 0x0c, 0x60, 0x06, 0x30, 0x0c, 0x18, 0x18, 0x30, 0x0c, 0x04, 0x20, 0x30, 0x0c, 0x02, 0x40, 0x30, 0x0c, 0x01, 0x80, 0x30, 0x8c, 0x00, 0x00, 0x31, 0x4c, 0x80, 0x01, 0x32, 0x4c, 0xc0, 0x03, 0x32, 0x4c, 0xf0, 0x1f, 0x32, 0x4c, 0xff, 0xff, 0x32, 0xcc, 0xff, 0xff, 0x33, 0x8c, 0xff, 0xff, 0x31, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_hour32m ================================================ /* $XConsortium: xm_hour32m /main/5 1995/07/17 10:32:11 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define hour32m_width 32 #define hour32m_height 32 static char hour32m_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcf, 0x00, 0x00, 0xf3, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0x6e, 0x00, 0x00, 0x76, 0xce, 0x00, 0x00, 0x73, 0x8e, 0x7f, 0xfe, 0x71, 0x0e, 0xff, 0xff, 0x70, 0x0e, 0xfe, 0x7f, 0x70, 0x0e, 0xfc, 0x3f, 0x70, 0x0e, 0xf8, 0x1f, 0x70, 0x0e, 0xe0, 0x07, 0x70, 0x0e, 0xe0, 0x07, 0x70, 0x0e, 0x78, 0x1e, 0x70, 0x0e, 0x1c, 0x38, 0x70, 0x0e, 0x06, 0x60, 0x70, 0x0e, 0x03, 0xc0, 0x70, 0x8e, 0x01, 0x80, 0x71, 0xce, 0x00, 0x00, 0x73, 0x6e, 0x80, 0x01, 0x76, 0x6e, 0xc0, 0x03, 0x76, 0x6e, 0xf0, 0x1f, 0x76, 0x6e, 0xff, 0xff, 0x76, 0xee, 0xff, 0xff, 0x77, 0xcf, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_information ================================================ /* $XConsortium: xm_information /main/5 1995/07/17 10:32:20 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_information_width 11 #define xm_information_height 24 static char xm_information_bits[] = { 0x00, 0x00, 0x78, 0x00, 0x54, 0x00, 0x2c, 0x00, 0x54, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x2a, 0x00, 0x5c, 0x00, 0x28, 0x00, 0x58, 0x00, 0x28, 0x00, 0x58, 0x00, 0x28, 0x00, 0x58, 0x00, 0x28, 0x00, 0x58, 0x00, 0xae, 0x01, 0x56, 0x01, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_noenter16 ================================================ /* $XConsortium: xm_noenter16 /main/5 1995/07/17 10:32:28 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define noenter16_width 16 #define noenter16_height 16 #define noenter16_x_hot 7 #define noenter16_y_hot 7 static char noenter16_bits[] = { 0x00, 0x00, 0xc0, 0x03, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfe, 0x7f, 0x02, 0x40, 0x02, 0x40, 0xfe, 0x7f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf0, 0x0f, 0xc0, 0x03, 0x00, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_noenter16m ================================================ /* $XConsortium: xm_noenter16m /main/5 1995/07/17 10:32:37 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define noenter16m_width 16 #define noenter16m_height 16 static char noenter16m_bits[] = { 0xc0, 0x03, 0xf0, 0x0f, 0xf8, 0x1f, 0xfc, 0x3f, 0xfe, 0x7f, 0xfe, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0xfe, 0x7f, 0xfc, 0x3f, 0xf8, 0x1f, 0xf0, 0x0f, 0xc0, 0x03}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_noenter32 ================================================ /* $XConsortium: xm_noenter32 /main/5 1995/07/17 10:32:46 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define noenter32_width 32 #define noenter32_height 32 #define noenter32_x_hot 15 #define noenter32_y_hot 15 static char noenter32_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0x06, 0x00, 0x00, 0x60, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_noenter32m ================================================ /* $XConsortium: xm_noenter32m /main/5 1995/07/17 10:32:56 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define noenter32m_width 32 #define noenter32m_height 32 static char noenter32m_bits[] = { 0x00, 0xe0, 0x07, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf8, 0xff, 0xff, 0x1f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfe, 0xff, 0xff, 0x7f, 0xfc, 0xff, 0xff, 0x3f, 0xfc, 0xff, 0xff, 0x3f, 0xf8, 0xff, 0xff, 0x1f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xff, 0x07, 0xc0, 0xff, 0xff, 0x03, 0x80, 0xff, 0xff, 0x01, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xe0, 0x07, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_question ================================================ /* $XConsortium: xm_question /main/5 1995/07/17 10:33:09 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_question_width 22 #define xm_question_height 22 static char xm_question_bits[] = { 0xf0, 0x3f, 0x00, 0x58, 0x55, 0x00, 0xac, 0xaa, 0x00, 0xd6, 0x5f, 0x01, 0xea, 0xbf, 0x02, 0xf6, 0x7f, 0x01, 0xea, 0xba, 0x02, 0xf6, 0x7d, 0x05, 0xea, 0xba, 0x0a, 0x56, 0x7d, 0x15, 0xaa, 0xbe, 0x1e, 0x56, 0x5f, 0x01, 0xac, 0xaf, 0x02, 0x58, 0x57, 0x01, 0xb0, 0xaf, 0x00, 0x60, 0x55, 0x01, 0xa0, 0xaa, 0x00, 0x60, 0x17, 0x00, 0xa0, 0x2f, 0x00, 0x60, 0x17, 0x00, 0xb0, 0x2a, 0x00, 0x50, 0x55, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_warning ================================================ /* $XConsortium: xm_warning /main/5 1995/07/17 10:33:17 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_warning_width 9 #define xm_warning_height 22 static char xm_warning_bits[] = { 0x00, 0x00, 0x18, 0x00, 0x2c, 0x00, 0x56, 0x00, 0x2a, 0x00, 0x56, 0x00, 0x2a, 0x00, 0x56, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x14, 0x00, 0x2c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/bitmaps/xm_working ================================================ /* $XConsortium: xm_working /main/5 1995/07/17 10:33:26 drk $ */ /* * Motif * * Copyright (c) 1987-2012, The Open Group. All rights reserved. * * These libraries and programs are free software; you can * redistribute them and/or modify them under the terms of the GNU * Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) * any later version. * * These libraries and programs are distributed in the hope that * they will be useful, but WITHOUT ANY WARRANTY; without even the * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public * License along with these librararies and programs; if not, write * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301 USA */ /* * HISTORY */ #define xm_working_width 21 #define xm_working_height 23 static char xm_working_bits[] = { 0x00, 0x00, 0x00, 0xfe, 0xff, 0x0f, 0xaa, 0xaa, 0x0a, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x84, 0x15, 0x06, 0x8c, 0x2a, 0x02, 0x04, 0x15, 0x06, 0x0c, 0x0a, 0x02, 0x04, 0x06, 0x06, 0x0c, 0x0b, 0x02, 0x84, 0x15, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xcc, 0x2a, 0x02, 0x44, 0x55, 0x06, 0xfe, 0xff, 0x0f, 0x56, 0x55, 0x05, 0x00, 0x00, 0x00}; ================================================ FILE: Libraries/Core/RPi/Headers/X11/cursorfont.h ================================================ /* Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ #ifndef _X11_CURSORFONT_H_ #define _X11_CURSORFONT_H_ #define XC_num_glyphs 154 #define XC_X_cursor 0 #define XC_arrow 2 #define XC_based_arrow_down 4 #define XC_based_arrow_up 6 #define XC_boat 8 #define XC_bogosity 10 #define XC_bottom_left_corner 12 #define XC_bottom_right_corner 14 #define XC_bottom_side 16 #define XC_bottom_tee 18 #define XC_box_spiral 20 #define XC_center_ptr 22 #define XC_circle 24 #define XC_clock 26 #define XC_coffee_mug 28 #define XC_cross 30 #define XC_cross_reverse 32 #define XC_crosshair 34 #define XC_diamond_cross 36 #define XC_dot 38 #define XC_dotbox 40 #define XC_double_arrow 42 #define XC_draft_large 44 #define XC_draft_small 46 #define XC_draped_box 48 #define XC_exchange 50 #define XC_fleur 52 #define XC_gobbler 54 #define XC_gumby 56 #define XC_hand1 58 #define XC_hand2 60 #define XC_heart 62 #define XC_icon 64 #define XC_iron_cross 66 #define XC_left_ptr 68 #define XC_left_side 70 #define XC_left_tee 72 #define XC_leftbutton 74 #define XC_ll_angle 76 #define XC_lr_angle 78 #define XC_man 80 #define XC_middlebutton 82 #define XC_mouse 84 #define XC_pencil 86 #define XC_pirate 88 #define XC_plus 90 #define XC_question_arrow 92 #define XC_right_ptr 94 #define XC_right_side 96 #define XC_right_tee 98 #define XC_rightbutton 100 #define XC_rtl_logo 102 #define XC_sailboat 104 #define XC_sb_down_arrow 106 #define XC_sb_h_double_arrow 108 #define XC_sb_left_arrow 110 #define XC_sb_right_arrow 112 #define XC_sb_up_arrow 114 #define XC_sb_v_double_arrow 116 #define XC_shuttle 118 #define XC_sizing 120 #define XC_spider 122 #define XC_spraycan 124 #define XC_star 126 #define XC_target 128 #define XC_tcross 130 #define XC_top_left_arrow 132 #define XC_top_left_corner 134 #define XC_top_right_corner 136 #define XC_top_side 138 #define XC_top_tee 140 #define XC_trek 142 #define XC_ul_angle 144 #define XC_umbrella 146 #define XC_ur_angle 148 #define XC_watch 150 #define XC_xterm 152 #endif /* _X11_CURSORFONT_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/extensions/XI.h ================================================ /************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ /* Definitions used by the server, library and client */ #ifndef _XI_H_ #define _XI_H_ #define sz_xGetExtensionVersionReq 8 #define sz_xGetExtensionVersionReply 32 #define sz_xListInputDevicesReq 4 #define sz_xListInputDevicesReply 32 #define sz_xOpenDeviceReq 8 #define sz_xOpenDeviceReply 32 #define sz_xCloseDeviceReq 8 #define sz_xSetDeviceModeReq 8 #define sz_xSetDeviceModeReply 32 #define sz_xSelectExtensionEventReq 12 #define sz_xGetSelectedExtensionEventsReq 8 #define sz_xGetSelectedExtensionEventsReply 32 #define sz_xChangeDeviceDontPropagateListReq 12 #define sz_xGetDeviceDontPropagateListReq 8 #define sz_xGetDeviceDontPropagateListReply 32 #define sz_xGetDeviceMotionEventsReq 16 #define sz_xGetDeviceMotionEventsReply 32 #define sz_xChangeKeyboardDeviceReq 8 #define sz_xChangeKeyboardDeviceReply 32 #define sz_xChangePointerDeviceReq 8 #define sz_xChangePointerDeviceReply 32 #define sz_xGrabDeviceReq 20 #define sz_xGrabDeviceReply 32 #define sz_xUngrabDeviceReq 12 #define sz_xGrabDeviceKeyReq 20 #define sz_xGrabDeviceKeyReply 32 #define sz_xUngrabDeviceKeyReq 16 #define sz_xGrabDeviceButtonReq 20 #define sz_xGrabDeviceButtonReply 32 #define sz_xUngrabDeviceButtonReq 16 #define sz_xAllowDeviceEventsReq 12 #define sz_xGetDeviceFocusReq 8 #define sz_xGetDeviceFocusReply 32 #define sz_xSetDeviceFocusReq 16 #define sz_xGetFeedbackControlReq 8 #define sz_xGetFeedbackControlReply 32 #define sz_xChangeFeedbackControlReq 12 #define sz_xGetDeviceKeyMappingReq 8 #define sz_xGetDeviceKeyMappingReply 32 #define sz_xChangeDeviceKeyMappingReq 8 #define sz_xGetDeviceModifierMappingReq 8 #define sz_xSetDeviceModifierMappingReq 8 #define sz_xSetDeviceModifierMappingReply 32 #define sz_xGetDeviceButtonMappingReq 8 #define sz_xGetDeviceButtonMappingReply 32 #define sz_xSetDeviceButtonMappingReq 8 #define sz_xSetDeviceButtonMappingReply 32 #define sz_xQueryDeviceStateReq 8 #define sz_xQueryDeviceStateReply 32 #define sz_xSendExtensionEventReq 16 #define sz_xDeviceBellReq 8 #define sz_xSetDeviceValuatorsReq 8 #define sz_xSetDeviceValuatorsReply 32 #define sz_xGetDeviceControlReq 8 #define sz_xGetDeviceControlReply 32 #define sz_xChangeDeviceControlReq 8 #define sz_xChangeDeviceControlReply 32 #define sz_xListDevicePropertiesReq 8 #define sz_xListDevicePropertiesReply 32 #define sz_xChangeDevicePropertyReq 20 #define sz_xDeleteDevicePropertyReq 12 #define sz_xGetDevicePropertyReq 24 #define sz_xGetDevicePropertyReply 32 #define INAME "XInputExtension" #define XI_KEYBOARD "KEYBOARD" #define XI_MOUSE "MOUSE" #define XI_TABLET "TABLET" #define XI_TOUCHSCREEN "TOUCHSCREEN" #define XI_TOUCHPAD "TOUCHPAD" #define XI_BARCODE "BARCODE" #define XI_BUTTONBOX "BUTTONBOX" #define XI_KNOB_BOX "KNOB_BOX" #define XI_ONE_KNOB "ONE_KNOB" #define XI_NINE_KNOB "NINE_KNOB" #define XI_TRACKBALL "TRACKBALL" #define XI_QUADRATURE "QUADRATURE" #define XI_ID_MODULE "ID_MODULE" #define XI_SPACEBALL "SPACEBALL" #define XI_DATAGLOVE "DATAGLOVE" #define XI_EYETRACKER "EYETRACKER" #define XI_CURSORKEYS "CURSORKEYS" #define XI_FOOTMOUSE "FOOTMOUSE" #define XI_JOYSTICK "JOYSTICK" /* Indices into the versions[] array (XExtInt.c). Used as a index to * retrieve the minimum version of XI from _XiCheckExtInit */ #define Dont_Check 0 #define XInput_Initial_Release 1 #define XInput_Add_XDeviceBell 2 #define XInput_Add_XSetDeviceValuators 3 #define XInput_Add_XChangeDeviceControl 4 #define XInput_Add_DevicePresenceNotify 5 #define XInput_Add_DeviceProperties 6 /* DO NOT ADD TO HERE -> XI2 */ #define XI_Absent 0 #define XI_Present 1 #define XI_Initial_Release_Major 1 #define XI_Initial_Release_Minor 0 #define XI_Add_XDeviceBell_Major 1 #define XI_Add_XDeviceBell_Minor 1 #define XI_Add_XSetDeviceValuators_Major 1 #define XI_Add_XSetDeviceValuators_Minor 2 #define XI_Add_XChangeDeviceControl_Major 1 #define XI_Add_XChangeDeviceControl_Minor 3 #define XI_Add_DevicePresenceNotify_Major 1 #define XI_Add_DevicePresenceNotify_Minor 4 #define XI_Add_DeviceProperties_Major 1 #define XI_Add_DeviceProperties_Minor 5 #define DEVICE_RESOLUTION 1 #define DEVICE_ABS_CALIB 2 #define DEVICE_CORE 3 #define DEVICE_ENABLE 4 #define DEVICE_ABS_AREA 5 #define NoSuchExtension 1 #define COUNT 0 #define CREATE 1 #define NewPointer 0 #define NewKeyboard 1 #define XPOINTER 0 #define XKEYBOARD 1 #define UseXKeyboard 0xFF #define IsXPointer 0 #define IsXKeyboard 1 #define IsXExtensionDevice 2 #define IsXExtensionKeyboard 3 #define IsXExtensionPointer 4 #define AsyncThisDevice 0 #define SyncThisDevice 1 #define ReplayThisDevice 2 #define AsyncOtherDevices 3 #define AsyncAll 4 #define SyncAll 5 #define FollowKeyboard 3 #ifndef RevertToFollowKeyboard #define RevertToFollowKeyboard 3 #endif #define DvAccelNum (1L << 0) #define DvAccelDenom (1L << 1) #define DvThreshold (1L << 2) #define DvKeyClickPercent (1L<<0) #define DvPercent (1L<<1) #define DvPitch (1L<<2) #define DvDuration (1L<<3) #define DvLed (1L<<4) #define DvLedMode (1L<<5) #define DvKey (1L<<6) #define DvAutoRepeatMode (1L<<7) #define DvString (1L << 0) #define DvInteger (1L << 0) #define DeviceMode (1L << 0) #define Relative 0 #define Absolute 1 #define ProximityState (1L << 1) #define InProximity (0L << 1) #define OutOfProximity (1L << 1) #define AddToList 0 #define DeleteFromList 1 #define KeyClass 0 #define ButtonClass 1 #define ValuatorClass 2 #define FeedbackClass 3 #define ProximityClass 4 #define FocusClass 5 #define OtherClass 6 #define AttachClass 7 #define KbdFeedbackClass 0 #define PtrFeedbackClass 1 #define StringFeedbackClass 2 #define IntegerFeedbackClass 3 #define LedFeedbackClass 4 #define BellFeedbackClass 5 #define _devicePointerMotionHint 0 #define _deviceButton1Motion 1 #define _deviceButton2Motion 2 #define _deviceButton3Motion 3 #define _deviceButton4Motion 4 #define _deviceButton5Motion 5 #define _deviceButtonMotion 6 #define _deviceButtonGrab 7 #define _deviceOwnerGrabButton 8 #define _noExtensionEvent 9 #define _devicePresence 0 #define _deviceEnter 0 #define _deviceLeave 1 /* Device presence notify states */ #define DeviceAdded 0 #define DeviceRemoved 1 #define DeviceEnabled 2 #define DeviceDisabled 3 #define DeviceUnrecoverable 4 #define DeviceControlChanged 5 /* XI Errors */ #define XI_BadDevice 0 #define XI_BadEvent 1 #define XI_BadMode 2 #define XI_DeviceBusy 3 #define XI_BadClass 4 /* * Make XEventClass be a CARD32 for 64 bit servers. Don't affect client * definition of XEventClass since that would be a library interface change. * See the top of X.h for more _XSERVER64 magic. * * But, don't actually use the CARD32 type. We can't get it defined here * without polluting the namespace. */ #ifdef _XSERVER64 typedef unsigned int XEventClass; #else typedef unsigned long XEventClass; #endif /******************************************************************* * * Extension version structure. * */ typedef struct { int present; short major_version; short minor_version; } XExtensionVersion; #endif /* _XI_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/extensions/XI2.h ================================================ /* * Copyright © 2009 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ #ifndef _XI2_H_ #define _XI2_H_ #define XInput_2_0 7 /* DO NOT ADD TO THIS LIST. These are libXi-specific defines. See commit libXi-1.4.2-21-ge8531dd */ #define XI_2_Major 2 #define XI_2_Minor 3 /* Property event flags */ #define XIPropertyDeleted 0 #define XIPropertyCreated 1 #define XIPropertyModified 2 /* Property modes */ #define XIPropModeReplace 0 #define XIPropModePrepend 1 #define XIPropModeAppend 2 /* Special property type used for XIGetProperty */ #define XIAnyPropertyType 0L /* Enter/Leave and Focus In/Out modes */ #define XINotifyNormal 0 #define XINotifyGrab 1 #define XINotifyUngrab 2 #define XINotifyWhileGrabbed 3 #define XINotifyPassiveGrab 4 #define XINotifyPassiveUngrab 5 /* Enter/Leave and focus In/out detail */ #define XINotifyAncestor 0 #define XINotifyVirtual 1 #define XINotifyInferior 2 #define XINotifyNonlinear 3 #define XINotifyNonlinearVirtual 4 #define XINotifyPointer 5 #define XINotifyPointerRoot 6 #define XINotifyDetailNone 7 /* Grab modes */ #define XIGrabModeSync 0 #define XIGrabModeAsync 1 #define XIGrabModeTouch 2 /* Grab reply status codes */ #define XIGrabSuccess 0 #define XIAlreadyGrabbed 1 #define XIGrabInvalidTime 2 #define XIGrabNotViewable 3 #define XIGrabFrozen 4 /* Grab owner events values */ #define XIOwnerEvents True #define XINoOwnerEvents False /* Passive grab types */ #define XIGrabtypeButton 0 #define XIGrabtypeKeycode 1 #define XIGrabtypeEnter 2 #define XIGrabtypeFocusIn 3 #define XIGrabtypeTouchBegin 4 /* Passive grab modifier */ #define XIAnyModifier (1U << 31) #define XIAnyButton 0 #define XIAnyKeycode 0 /* XIAllowEvents event-modes */ #define XIAsyncDevice 0 #define XISyncDevice 1 #define XIReplayDevice 2 #define XIAsyncPairedDevice 3 #define XIAsyncPair 4 #define XISyncPair 5 #define XIAcceptTouch 6 #define XIRejectTouch 7 /* DeviceChangedEvent change reasons */ #define XISlaveSwitch 1 #define XIDeviceChange 2 /* Hierarchy flags */ #define XIMasterAdded (1 << 0) #define XIMasterRemoved (1 << 1) #define XISlaveAdded (1 << 2) #define XISlaveRemoved (1 << 3) #define XISlaveAttached (1 << 4) #define XISlaveDetached (1 << 5) #define XIDeviceEnabled (1 << 6) #define XIDeviceDisabled (1 << 7) /* ChangeHierarchy constants */ #define XIAddMaster 1 #define XIRemoveMaster 2 #define XIAttachSlave 3 #define XIDetachSlave 4 #define XIAttachToMaster 1 #define XIFloating 2 /* Valuator modes */ #define XIModeRelative 0 #define XIModeAbsolute 1 /* Device types */ #define XIMasterPointer 1 #define XIMasterKeyboard 2 #define XISlavePointer 3 #define XISlaveKeyboard 4 #define XIFloatingSlave 5 /* Device classes: classes that are not identical to Xi 1.x classes must be * numbered starting from 8. */ #define XIKeyClass 0 #define XIButtonClass 1 #define XIValuatorClass 2 #define XIScrollClass 3 #define XITouchClass 8 /* Scroll class types */ #define XIScrollTypeVertical 1 #define XIScrollTypeHorizontal 2 /* Scroll class flags */ #define XIScrollFlagNoEmulation (1 << 0) #define XIScrollFlagPreferred (1 << 1) /* Device event flags (common) */ /* Device event flags (key events only) */ #define XIKeyRepeat (1 << 16) /* Device event flags (pointer events only) */ #define XIPointerEmulated (1 << 16) /* Device event flags (touch events only) */ #define XITouchPendingEnd (1 << 16) #define XITouchEmulatingPointer (1 << 17) /* Barrier event flags */ #define XIBarrierPointerReleased (1 << 0) #define XIBarrierDeviceIsGrabbed (1 << 1) /* Touch modes */ #define XIDirectTouch 1 #define XIDependentTouch 2 /* XI2 event mask macros */ #define XISetMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] |= (1 << ((event) & 7))) #define XIClearMask(ptr, event) (((unsigned char*)(ptr))[(event)>>3] &= ~(1 << ((event) & 7))) #define XIMaskIsSet(ptr, event) (((unsigned char*)(ptr))[(event)>>3] & (1 << ((event) & 7))) #define XIMaskLen(event) (((event) >> 3) + 1) /* Fake device ID's for event selection */ #define XIAllDevices 0 #define XIAllMasterDevices 1 /* Event types */ #define XI_DeviceChanged 1 #define XI_KeyPress 2 #define XI_KeyRelease 3 #define XI_ButtonPress 4 #define XI_ButtonRelease 5 #define XI_Motion 6 #define XI_Enter 7 #define XI_Leave 8 #define XI_FocusIn 9 #define XI_FocusOut 10 #define XI_HierarchyChanged 11 #define XI_PropertyEvent 12 #define XI_RawKeyPress 13 #define XI_RawKeyRelease 14 #define XI_RawButtonPress 15 #define XI_RawButtonRelease 16 #define XI_RawMotion 17 #define XI_TouchBegin 18 /* XI 2.2 */ #define XI_TouchUpdate 19 #define XI_TouchEnd 20 #define XI_TouchOwnership 21 #define XI_RawTouchBegin 22 #define XI_RawTouchUpdate 23 #define XI_RawTouchEnd 24 #define XI_BarrierHit 25 /* XI 2.3 */ #define XI_BarrierLeave 26 #define XI_LASTEVENT XI_BarrierLeave /* NOTE: XI2LASTEVENT in xserver/include/inputstr.h must be the same value * as XI_LASTEVENT if the server is supposed to handle masks etc. for this * type of event. */ /* Event masks. * Note: the protocol spec defines a mask to be of (1 << type). Clients are * free to create masks by bitshifting instead of using these defines. */ #define XI_DeviceChangedMask (1 << XI_DeviceChanged) #define XI_KeyPressMask (1 << XI_KeyPress) #define XI_KeyReleaseMask (1 << XI_KeyRelease) #define XI_ButtonPressMask (1 << XI_ButtonPress) #define XI_ButtonReleaseMask (1 << XI_ButtonRelease) #define XI_MotionMask (1 << XI_Motion) #define XI_EnterMask (1 << XI_Enter) #define XI_LeaveMask (1 << XI_Leave) #define XI_FocusInMask (1 << XI_FocusIn) #define XI_FocusOutMask (1 << XI_FocusOut) #define XI_HierarchyChangedMask (1 << XI_HierarchyChanged) #define XI_PropertyEventMask (1 << XI_PropertyEvent) #define XI_RawKeyPressMask (1 << XI_RawKeyPress) #define XI_RawKeyReleaseMask (1 << XI_RawKeyRelease) #define XI_RawButtonPressMask (1 << XI_RawButtonPress) #define XI_RawButtonReleaseMask (1 << XI_RawButtonRelease) #define XI_RawMotionMask (1 << XI_RawMotion) #define XI_TouchBeginMask (1 << XI_TouchBegin) #define XI_TouchEndMask (1 << XI_TouchEnd) #define XI_TouchOwnershipChangedMask (1 << XI_TouchOwnership) #define XI_TouchUpdateMask (1 << XI_TouchUpdate) #define XI_RawTouchBeginMask (1 << XI_RawTouchBegin) #define XI_RawTouchEndMask (1 << XI_RawTouchEnd) #define XI_RawTouchUpdateMask (1 << XI_RawTouchUpdate) #define XI_BarrierHitMask (1 << XI_BarrierHit) #define XI_BarrierLeaveMask (1 << XI_BarrierLeave) #endif /* _XI2_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/extensions/XI2proto.h ================================================ /* * Copyright © 2009 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ /* Conventions for this file: * Names: * structs: always typedef'd, prefixed with xXI, CamelCase * struct members: lower_case_with_underscores * Exceptions: reqType, ReqType, repType, RepType, sequenceNumber are * named as such for historical reasons. * request opcodes: X_XIRequestName as CamelCase * defines: defines used in client applications must go in XI2.h * defines used only in protocol handling: XISOMENAME * * Data types: unless there is a historical name for a datatype (e.g. * Window), use stdint types specifying the size of the datatype. * historical data type names must be defined and undefined at the top and * end of the file. * * General: * spaces, not tabs. * structs specific to a request or reply added before the request * definition. structs used in more than one request, reply or event * appended to the common structs section before the definition of the * first request. * members of structs vertically aligned on column 16 if datatypes permit. * otherwise alingned on next available 8n column. */ /** * Protocol definitions for the XI2 protocol. * This file should not be included by clients that merely use XI2, but do not * need the wire protocol. Such clients should include XI2.h, or the matching * header from the library. * */ #ifndef _XI2PROTO_H_ #define _XI2PROTO_H_ #include #include #include #include /* make sure types have right sizes for protocol structures. */ #define Window uint32_t #define Time uint32_t #define Atom uint32_t #define Cursor uint32_t #define Barrier uint32_t /** * XI2 Request opcodes */ #define X_XIQueryPointer 40 #define X_XIWarpPointer 41 #define X_XIChangeCursor 42 #define X_XIChangeHierarchy 43 #define X_XISetClientPointer 44 #define X_XIGetClientPointer 45 #define X_XISelectEvents 46 #define X_XIQueryVersion 47 #define X_XIQueryDevice 48 #define X_XISetFocus 49 #define X_XIGetFocus 50 #define X_XIGrabDevice 51 #define X_XIUngrabDevice 52 #define X_XIAllowEvents 53 #define X_XIPassiveGrabDevice 54 #define X_XIPassiveUngrabDevice 55 #define X_XIListProperties 56 #define X_XIChangeProperty 57 #define X_XIDeleteProperty 58 #define X_XIGetProperty 59 #define X_XIGetSelectedEvents 60 #define X_XIBarrierReleasePointer 61 /** Number of XI requests */ #define XI2REQUESTS (X_XIBarrierReleasePointer - X_XIQueryPointer + 1) /** Number of XI2 events */ #define XI2EVENTS (XI_LASTEVENT + 1) /************************************************************************************* * * * COMMON STRUCTS * * * *************************************************************************************/ /** Fixed point 16.16 */ typedef int32_t FP1616; /** Fixed point 32.32 */ typedef struct { int32_t integral; uint32_t frac; } FP3232; /** * Struct to describe a device. * * For a MasterPointer or a MasterKeyboard, 'attachment' specifies the * paired master device. * For a SlaveKeyboard or SlavePointer, 'attachment' specifies the master * device this device is attached to. * For a FloatingSlave, 'attachment' is undefined. */ typedef struct { uint16_t deviceid; uint16_t use; /**< ::XIMasterPointer, ::XIMasterKeyboard, ::XISlavePointer, ::XISlaveKeyboard, ::XIFloatingSlave */ uint16_t attachment; /**< Current attachment or pairing.*/ uint16_t num_classes; /**< Number of classes following this struct. */ uint16_t name_len; /**< Length of name in bytes. */ uint8_t enabled; /**< TRUE if device is enabled. */ uint8_t pad; } xXIDeviceInfo; /** * Default template for a device class. * A device class is equivalent to a device's capabilities. Multiple classes * are supported per device. */ typedef struct { uint16_t type; /**< One of *class */ uint16_t length; /**< Length in 4 byte units */ uint16_t sourceid; /**< source device for this class */ uint16_t pad; } xXIAnyInfo; /** * Denotes button capability on a device. * Struct is followed by num_buttons * Atom that names the buttons in the * device-native setup (i.e. ignoring button mappings). */ typedef struct { uint16_t type; /**< Always ButtonClass */ uint16_t length; /**< Length in 4 byte units */ uint16_t sourceid; /**< source device for this class */ uint16_t num_buttons; /**< Number of buttons provided */ } xXIButtonInfo; /** * Denotes key capability on a device. * Struct is followed by num_keys * CARD32 that lists the keycodes available * on the device. */ typedef struct { uint16_t type; /**< Always KeyClass */ uint16_t length; /**< Length in 4 byte units */ uint16_t sourceid; /**< source device for this class */ uint16_t num_keycodes; /**< Number of keys provided */ } xXIKeyInfo; /** * Denotes an valuator capability on a device. * One XIValuatorInfo describes exactly one valuator (axis) on the device. */ typedef struct { uint16_t type; /**< Always ValuatorClass */ uint16_t length; /**< Length in 4 byte units */ uint16_t sourceid; /**< source device for this class */ uint16_t number; /**< Valuator number */ Atom label; /**< Axis label */ FP3232 min; /**< Min value */ FP3232 max; /**< Max value */ FP3232 value; /**< Last published value */ uint32_t resolution; /**< Resolutions in units/m */ uint8_t mode; /**< ModeRelative or ModeAbsolute */ uint8_t pad1; uint16_t pad2; } xXIValuatorInfo; /*** * Denotes a scroll valuator on a device. * One XIScrollInfo describes exactly one scroll valuator that must have a * XIValuatorInfo struct. */ typedef struct { uint16_t type; /**< Always ValuatorClass */ uint16_t length; /**< Length in 4 byte units */ uint16_t sourceid; /**< source device for this class */ uint16_t number; /**< Valuator number */ uint16_t scroll_type; /**< ::XIScrollTypeVertical, ::XIScrollTypeHorizontal */ uint16_t pad0; uint32_t flags; /**< ::XIScrollFlagEmulate, ::XIScrollFlagPreferred */ FP3232 increment; /**< Increment for one unit of scrolling */ } xXIScrollInfo; /** * Denotes multitouch capability on a device. */ typedef struct { uint16_t type; /**< Always TouchClass */ uint16_t length; /**< Length in 4 byte units */ uint16_t sourceid; /**< source device for this class */ uint8_t mode; /**< DirectTouch or DependentTouch */ uint8_t num_touches; /**< Maximum number of touches (0==unlimited) */ } xXITouchInfo; /** * Used to select for events on a given window. * Struct is followed by (mask_len * CARD8), with each bit set representing * the event mask for the given type. A mask bit represents an event type if * (mask == (1 << type)). */ typedef struct { uint16_t deviceid; /**< Device id to select for */ uint16_t mask_len; /**< Length of mask in 4 byte units */ } xXIEventMask; /** * XKB modifier information. * The effective modifier is a binary mask of base, latched, and locked * modifiers. */ typedef struct { uint32_t base_mods; /**< Logically pressed modifiers */ uint32_t latched_mods; /**< Logically latched modifiers */ uint32_t locked_mods; /**< Logically locked modifiers */ uint32_t effective_mods; /**< Effective modifiers */ } xXIModifierInfo; /** * XKB group information. * The effective group is the mathematical sum of base, latched, and locked * group after group wrapping is taken into account. */ typedef struct { uint8_t base_group; /**< Logically "pressed" group */ uint8_t latched_group; /**< Logically latched group */ uint8_t locked_group; /**< Logically locked group */ uint8_t effective_group; /**< Effective group */ } xXIGroupInfo; /************************************************************************************* * * * REQUESTS * * * *************************************************************************************/ /** * Query the server for the supported X Input extension version. */ typedef struct { uint8_t reqType; /**< Input extension major code */ uint8_t ReqType; /**< Always ::X_XIQueryVersion */ uint16_t length; /**< Length in 4 byte units */ uint16_t major_version; uint16_t minor_version; } xXIQueryVersionReq; #define sz_xXIQueryVersionReq 8 typedef struct { uint8_t repType; /**< ::X_Reply */ uint8_t RepType; /**< Always ::X_XIQueryVersion */ uint16_t sequenceNumber; uint32_t length; uint16_t major_version; uint16_t minor_version; uint32_t pad1; uint32_t pad2; uint32_t pad3; uint32_t pad4; uint32_t pad5; } xXIQueryVersionReply; #define sz_xXIQueryVersionReply 32 /** * Query the server for information about a specific device or all input * devices. */ typedef struct { uint8_t reqType; /**< Input extension major code */ uint8_t ReqType; /**< Always ::X_XIQueryDevice */ uint16_t length; /**< Length in 4 byte units */ uint16_t deviceid; uint16_t pad; } xXIQueryDeviceReq; #define sz_xXIQueryDeviceReq 8 typedef struct { uint8_t repType; /**< ::X_Reply */ uint8_t RepType; /**< Always ::X_XIQueryDevice */ uint16_t sequenceNumber; uint32_t length; uint16_t num_devices; uint16_t pad0; uint32_t pad1; uint32_t pad2; uint32_t pad3; uint32_t pad4; uint32_t pad5; } xXIQueryDeviceReply; #define sz_xXIQueryDeviceReply 32 /** * Select for events on a given window. */ typedef struct { uint8_t reqType; /**< Input extension major code */ uint8_t ReqType; /**< Always ::X_XISelectEvents */ uint16_t length; /**< Length in 4 byte units */ Window win; uint16_t num_masks; uint16_t pad; } xXISelectEventsReq; #define sz_xXISelectEventsReq 12 /** * Query for selected events on a given window. */ typedef struct { uint8_t reqType; /**< Input extension major code */ uint8_t ReqType; /**< Always ::X_XIGetSelectedEvents */ uint16_t length; /**< Length in 4 byte units */ Window win; } xXIGetSelectedEventsReq; #define sz_xXIGetSelectedEventsReq 8 typedef struct { uint8_t repType; /**< Input extension major opcode */ uint8_t RepType; /**< Always ::X_XIGetSelectedEvents */ uint16_t sequenceNumber; uint32_t length; uint16_t num_masks; /**< Number of xXIEventMask structs trailing the reply */ uint16_t pad0; uint32_t pad1; uint32_t pad2; uint32_t pad3; uint32_t pad4; uint32_t pad5; } xXIGetSelectedEventsReply; #define sz_xXIGetSelectedEventsReply 32 /** * Query the given device's screen/window coordinates. */ typedef struct { uint8_t reqType; /**< Input extension major code */ uint8_t ReqType; /**< Always ::X_XIQueryPointer */ uint16_t length; /**< Length in 4 byte units */ Window win; uint16_t deviceid; uint16_t pad1; } xXIQueryPointerReq; #define sz_xXIQueryPointerReq 12 typedef struct { uint8_t repType; /**< Input extension major opcode */ uint8_t RepType; /**< Always ::X_XIQueryPointer */ uint16_t sequenceNumber; uint32_t length; Window root; Window child; FP1616 root_x; FP1616 root_y; FP1616 win_x; FP1616 win_y; uint8_t same_screen; uint8_t pad0; uint16_t buttons_len; xXIModifierInfo mods; xXIGroupInfo group; } xXIQueryPointerReply; #define sz_xXIQueryPointerReply 56 /** * Warp the given device's pointer to the specified position. */ typedef struct { uint8_t reqType; /**< Input extension major code */ uint8_t ReqType; /**< Always ::X_XIWarpPointer */ uint16_t length; /**< Length in 4 byte units */ Window src_win; Window dst_win; FP1616 src_x; FP1616 src_y; uint16_t src_width; uint16_t src_height; FP1616 dst_x; FP1616 dst_y; uint16_t deviceid; uint16_t pad1; } xXIWarpPointerReq; #define sz_xXIWarpPointerReq 36 /** * Change the given device's sprite to the given cursor. */ typedef struct { uint8_t reqType; /**< Input extension major code */ uint8_t ReqType; /**< Always ::X_XIChangeCursor */ uint16_t length; /**< Length in 4 byte units */ Window win; Cursor cursor; uint16_t deviceid; uint16_t pad1; } xXIChangeCursorReq; #define sz_xXIChangeCursorReq 16 /** * Modify the device hierarchy. */ typedef struct { uint8_t reqType; /**< Input extension major code */ uint8_t ReqType; /**< Always ::X_XIChangeHierarchy */ uint16_t length; /**< Length in 4 byte units */ uint8_t num_changes; uint8_t pad0; uint16_t pad1; } xXIChangeHierarchyReq; #define sz_xXIChangeHierarchyReq 8 /** * Generic header for any hierarchy change. */ typedef struct { uint16_t type; uint16_t length; /**< Length in 4 byte units */ } xXIAnyHierarchyChangeInfo; /** * Create a new master device. * Name of new master follows struct (4-byte padded) */ typedef struct { uint16_t type; /**< Always ::XIAddMaster */ uint16_t length; /**< 2 + (namelen + padding)/4 */ uint16_t name_len; uint8_t send_core; uint8_t enable; } xXIAddMasterInfo; /** * Delete a master device. Will automatically delete the master device paired * with the given master device. */ typedef struct { uint16_t type; /**< Always ::XIRemoveMaster */ uint16_t length; /**< 3 */ uint16_t deviceid; uint8_t return_mode; /**< ::XIAttachToMaster, ::XIFloating */ uint8_t pad; uint16_t return_pointer; /**< Pointer to attach slave ptr devices to */ uint16_t return_keyboard; /**< keyboard to attach slave keybd devices to*/ } xXIRemoveMasterInfo; /** * Attach an SD to a new device. * NewMaster has to be of same type (pointer->pointer, keyboard->keyboard); */ typedef struct { uint16_t type; /**< Always ::XIAttachSlave */ uint16_t length; /**< 2 */ uint16_t deviceid; uint16_t new_master; /**< id of new master device */ } xXIAttachSlaveInfo; /** * Detach an SD from its current master device. */ typedef struct { uint16_t type; /**< Always ::XIDetachSlave */ uint16_t length; /**< 2 */ uint16_t deviceid; uint16_t pad; } xXIDetachSlaveInfo; /** * Set the window/client's ClientPointer. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XISetClientPointer */ uint16_t length; /**< Length in 4 byte units */ Window win; uint16_t deviceid; uint16_t pad1; } xXISetClientPointerReq; #define sz_xXISetClientPointerReq 12 /** * Query the given window/client's ClientPointer setting. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_GetClientPointer */ uint16_t length; /**< Length in 4 byte units */ Window win; } xXIGetClientPointerReq; #define sz_xXIGetClientPointerReq 8 typedef struct { uint8_t repType; /**< Input extension major opcode */ uint8_t RepType; /**< Always ::X_GetClientPointer */ uint16_t sequenceNumber; uint32_t length; BOOL set; /**< client pointer is set? */ uint8_t pad0; uint16_t deviceid; uint32_t pad1; uint32_t pad2; uint32_t pad3; uint32_t pad4; uint32_t pad5; } xXIGetClientPointerReply; #define sz_xXIGetClientPointerReply 32 /** * Set the input focus to the specified window. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XISetFocus */ uint16_t length; /**< Length in 4 byte units */ Window focus; Time time; uint16_t deviceid; uint16_t pad0; } xXISetFocusReq; #define sz_xXISetFocusReq 16 /** * Query the current input focus. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XIGetDeviceFocus */ uint16_t length; /**< Length in 4 byte units */ uint16_t deviceid; uint16_t pad0; } xXIGetFocusReq; #define sz_xXIGetFocusReq 8 typedef struct { uint8_t repType; /**< Input extension major opcode */ uint8_t RepType; /**< Always ::X_XIGetFocus */ uint16_t sequenceNumber; uint32_t length; Window focus; uint32_t pad1; uint32_t pad2; uint32_t pad3; uint32_t pad4; uint32_t pad5; } xXIGetFocusReply; #define sz_xXIGetFocusReply 32 /** * Grab the given device. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XIGrabDevice */ uint16_t length; /**< Length in 4 byte units */ Window grab_window; Time time; Cursor cursor; uint16_t deviceid; uint8_t grab_mode; uint8_t paired_device_mode; uint8_t owner_events; uint8_t pad; uint16_t mask_len; } xXIGrabDeviceReq; #define sz_xXIGrabDeviceReq 24 /** * Return codes from a XIPassiveGrabDevice request. */ typedef struct { uint32_t modifiers; /**< Modifier state */ uint8_t status; /**< Grab status code */ uint8_t pad0; uint16_t pad1; } xXIGrabModifierInfo; typedef struct { uint8_t repType; /**< Input extension major opcode */ uint8_t RepType; /**< Always ::X_XIGrabDevice */ uint16_t sequenceNumber; uint32_t length; uint8_t status; uint8_t pad0; uint16_t pad1; uint32_t pad2; uint32_t pad3; uint32_t pad4; uint32_t pad5; uint32_t pad6; } xXIGrabDeviceReply; #define sz_xXIGrabDeviceReply 32 /** * Ungrab the specified device. * */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XIUngrabDevice */ uint16_t length; /**< Length in 4 byte units */ Time time; uint16_t deviceid; uint16_t pad; } xXIUngrabDeviceReq; #define sz_xXIUngrabDeviceReq 12 /** * Allow or replay events on the specified grabbed device. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XIAllowEvents */ uint16_t length; /**< Length in 4 byte units */ Time time; uint16_t deviceid; uint8_t mode; uint8_t pad; } xXIAllowEventsReq; #define sz_xXIAllowEventsReq 12 /** * Allow or replay events on the specified grabbed device. * Since XI 2.2 */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XIAllowEvents */ uint16_t length; /**< Length in 4 byte units */ Time time; uint16_t deviceid; uint8_t mode; uint8_t pad; uint32_t touchid; /**< Since XI 2.2 */ Window grab_window; /**< Since XI 2.2 */ } xXI2_2AllowEventsReq; #define sz_xXI2_2AllowEventsReq 20 /** * Passively grab the device. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XIPassiveGrabDevice */ uint16_t length; /**< Length in 4 byte units */ Time time; Window grab_window; Cursor cursor; uint32_t detail; uint16_t deviceid; uint16_t num_modifiers; uint16_t mask_len; uint8_t grab_type; uint8_t grab_mode; uint8_t paired_device_mode; uint8_t owner_events; uint16_t pad1; } xXIPassiveGrabDeviceReq; #define sz_xXIPassiveGrabDeviceReq 32 typedef struct { uint8_t repType; /**< Input extension major opcode */ uint8_t RepType; /**< Always ::X_XIPassiveGrabDevice */ uint16_t sequenceNumber; uint32_t length; uint16_t num_modifiers; uint16_t pad1; uint32_t pad2; uint32_t pad3; uint32_t pad4; uint32_t pad5; uint32_t pad6; } xXIPassiveGrabDeviceReply; #define sz_xXIPassiveGrabDeviceReply 32 /** * Delete a passive grab for the given device. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XIPassiveUngrabDevice */ uint16_t length; /**< Length in 4 byte units */ Window grab_window; uint32_t detail; uint16_t deviceid; uint16_t num_modifiers; uint8_t grab_type; uint8_t pad0; uint16_t pad1; } xXIPassiveUngrabDeviceReq; #define sz_xXIPassiveUngrabDeviceReq 20 /** * List all device properties on the specified device. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XIListProperties */ uint16_t length; /**< Length in 4 byte units */ uint16_t deviceid; uint16_t pad; } xXIListPropertiesReq; #define sz_xXIListPropertiesReq 8 typedef struct { uint8_t repType; /**< Input extension major opcode */ uint8_t RepType; /**< Always ::X_XIListProperties */ uint16_t sequenceNumber; uint32_t length; uint16_t num_properties; uint16_t pad0; uint32_t pad1; uint32_t pad2; uint32_t pad3; uint32_t pad4; uint32_t pad5; } xXIListPropertiesReply; #define sz_xXIListPropertiesReply 32 /** * Change a property on the specified device. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always ::X_XIChangeProperty */ uint16_t length; /**< Length in 4 byte units */ uint16_t deviceid; uint8_t mode; uint8_t format; Atom property; Atom type; uint32_t num_items; } xXIChangePropertyReq; #define sz_xXIChangePropertyReq 20 /** * Delete the specified property. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always X_XIDeleteProperty */ uint16_t length; /**< Length in 4 byte units */ uint16_t deviceid; uint16_t pad0; Atom property; } xXIDeletePropertyReq; #define sz_xXIDeletePropertyReq 12 /** * Query the specified property's values. */ typedef struct { uint8_t reqType; uint8_t ReqType; /**< Always X_XIGetProperty */ uint16_t length; /**< Length in 4 byte units */ uint16_t deviceid; #if defined(__cplusplus) || defined(c_plusplus) uint8_t c_delete; #else uint8_t delete; #endif uint8_t pad0; Atom property; Atom type; uint32_t offset; uint32_t len; } xXIGetPropertyReq; #define sz_xXIGetPropertyReq 24 typedef struct { uint8_t repType; /**< Input extension major opcode */ uint8_t RepType; /**< Always X_XIGetProperty */ uint16_t sequenceNumber; uint32_t length; Atom type; uint32_t bytes_after; uint32_t num_items; uint8_t format; uint8_t pad0; uint16_t pad1; uint32_t pad2; uint32_t pad3; } xXIGetPropertyReply; #define sz_xXIGetPropertyReply 32 typedef struct { uint16_t deviceid; uint16_t pad; Barrier barrier; uint32_t eventid; } xXIBarrierReleasePointerInfo; typedef struct { uint8_t reqType; /**< Input extension major opcode */ uint8_t ReqType; /**< Always X_XIBarrierReleasePointer */ uint16_t length; uint32_t num_barriers; /* array of xXIBarrierReleasePointerInfo */ } xXIBarrierReleasePointerReq; #define sz_xXIBarrierReleasePointerReq 8 /************************************************************************************* * * * EVENTS * * * *************************************************************************************/ /** * Generic XI2 event header. All XI2 events use the same header. */ typedef struct { uint8_t type; uint8_t extension; /**< XI extension offset */ uint16_t sequenceNumber; uint32_t length; uint16_t evtype; uint16_t deviceid; Time time; } xXIGenericDeviceEvent; /** * Device hierarchy information. */ typedef struct { uint16_t deviceid; uint16_t attachment; /**< ID of master or paired device */ uint8_t use; /**< ::XIMasterKeyboard, ::XIMasterPointer, ::XISlaveKeyboard, ::XISlavePointer, ::XIFloatingSlave */ BOOL enabled; /**< TRUE if the device is enabled */ uint16_t pad; uint32_t flags; /**< ::XIMasterAdded, ::XIMasterRemoved, ::XISlaveAttached, ::XISlaveDetached, ::XISlaveAdded, ::XISlaveRemoved, ::XIDeviceEnabled, ::XIDeviceDisabled */ } xXIHierarchyInfo; /** * The device hierarchy has been modified. This event includes the device * hierarchy after the modification has been applied. */ typedef struct { uint8_t type; /**< Always GenericEvent */ uint8_t extension; /**< XI extension offset */ uint16_t sequenceNumber; uint32_t length; /**< Length in 4 byte units */ uint16_t evtype; /**< ::XI_Hierarchy */ uint16_t deviceid; Time time; uint32_t flags; /**< ::XIMasterAdded, ::XIMasterDeleted, ::XISlaveAttached, ::XISlaveDetached, ::XISlaveAdded, ::XISlaveRemoved, ::XIDeviceEnabled, ::XIDeviceDisabled */ uint16_t num_info; uint16_t pad0; uint32_t pad1; uint32_t pad2; } xXIHierarchyEvent; /** * A device has changed capabilities. */ typedef struct { uint8_t type; /**< Always GenericEvent */ uint8_t extension; /**< XI extension offset */ uint16_t sequenceNumber; uint32_t length; /**< Length in 4 byte units */ uint16_t evtype; /**< XI_DeviceChanged */ uint16_t deviceid; /**< Device that has changed */ Time time; uint16_t num_classes; /**< Number of classes that have changed */ uint16_t sourceid; /**< Source of the new classes */ uint8_t reason; /**< ::XISlaveSwitch, ::XIDeviceChange */ uint8_t pad0; uint16_t pad1; uint32_t pad2; uint32_t pad3; } xXIDeviceChangedEvent; /** * The owner of a touch stream has passed on ownership to another client. */ typedef struct { uint8_t type; /**< Always GenericEvent */ uint8_t extension; /**< XI extension offset */ uint16_t sequenceNumber; uint32_t length; /**< Length in 4 byte units */ uint16_t evtype; /**< XI_TouchOwnership */ uint16_t deviceid; /**< Device that has changed */ Time time; uint32_t touchid; Window root; Window event; Window child; /* └──────── 32 byte boundary ────────┘ */ uint16_t sourceid; uint16_t pad0; uint32_t flags; uint32_t pad1; uint32_t pad2; } xXITouchOwnershipEvent; /** * Default input event for pointer, keyboard or touch input. */ typedef struct { uint8_t type; /**< Always GenericEvent */ uint8_t extension; /**< XI extension offset */ uint16_t sequenceNumber; uint32_t length; /**< Length in 4 byte uints */ uint16_t evtype; uint16_t deviceid; Time time; uint32_t detail; /**< Keycode or button */ Window root; Window event; Window child; /* └──────── 32 byte boundary ────────┘ */ FP1616 root_x; /**< Always screen coords, 16.16 fixed point */ FP1616 root_y; FP1616 event_x; /**< Always screen coords, 16.16 fixed point */ FP1616 event_y; uint16_t buttons_len; /**< Len of button flags in 4 b units */ uint16_t valuators_len; /**< Len of val. flags in 4 b units */ uint16_t sourceid; /**< The source device */ uint16_t pad0; uint32_t flags; /**< ::XIKeyRepeat */ xXIModifierInfo mods; xXIGroupInfo group; } xXIDeviceEvent; /** * Sent when an input event is generated. RawEvents include valuator * information in both device-specific data (i.e. unaccelerated) and * processed data (i.e. accelerated, if applicable). */ typedef struct { uint8_t type; /**< Always GenericEvent */ uint8_t extension; /**< XI extension offset */ uint16_t sequenceNumber; uint32_t length; /**< Length in 4 byte uints */ uint16_t evtype; /**< ::XI_RawEvent */ uint16_t deviceid; Time time; uint32_t detail; uint16_t sourceid; /**< The source device (XI 2.1) */ uint16_t valuators_len; /**< Length of trailing valuator mask in 4 byte units */ uint32_t flags; /**< ::XIKeyRepeat */ uint32_t pad2; } xXIRawEvent; /** * Note that the layout of root, event, child, root_x, root_y, event_x, * event_y must be identical to the xXIDeviceEvent. */ typedef struct { uint8_t type; /**< Always GenericEvent */ uint8_t extension; /**< XI extension offset */ uint16_t sequenceNumber; uint32_t length; /**< Length in 4 byte uints */ uint16_t evtype; /**< ::XI_Enter */ uint16_t deviceid; Time time; uint16_t sourceid; uint8_t mode; uint8_t detail; Window root; Window event; Window child; /* └──────── 32 byte boundary ────────┘ */ FP1616 root_x; FP1616 root_y; FP1616 event_x; FP1616 event_y; BOOL same_screen; BOOL focus; uint16_t buttons_len; /**< Length of trailing button mask in 4 byte units */ xXIModifierInfo mods; xXIGroupInfo group; } xXIEnterEvent; typedef xXIEnterEvent xXILeaveEvent; typedef xXIEnterEvent xXIFocusInEvent; typedef xXIEnterEvent xXIFocusOutEvent; /** * Sent when a device property is created, modified or deleted. Does not * include property data, the client is required to query the data. */ typedef struct { uint8_t type; /**< Always GenericEvent */ uint8_t extension; /**< XI extension offset */ uint16_t sequenceNumber; uint32_t length; /**< Length in 4 byte units */ uint16_t evtype; /**< ::XI_PropertyEvent */ uint16_t deviceid; Time time; Atom property; uint8_t what; /**< ::XIPropertyDeleted, ::XIPropertyCreated, ::XIPropertyMotified */ uint8_t pad0; uint16_t pad1; uint32_t pad2; uint32_t pad3; } xXIPropertyEvent; typedef struct { uint8_t type; /**< Always GenericEvent */ uint8_t extension; /**< XI extension offset */ uint16_t sequenceNumber; uint32_t length; /**< Length in 4 byte units */ uint16_t evtype; /**< ::XI_BarrierHit or ::XI_BarrierLeave */ uint16_t deviceid; Time time; uint32_t eventid; Window root; Window event; Barrier barrier; /* └──────── 32 byte boundary ────────┘ */ uint32_t dtime; uint32_t flags; /**< ::XIBarrierPointerReleased ::XIBarrierDeviceIsGrabbed */ uint16_t sourceid; int16_t pad; FP1616 root_x; FP1616 root_y; FP3232 dx; FP3232 dy; } xXIBarrierEvent; typedef xXIBarrierEvent xXIBarrierHitEvent; typedef xXIBarrierEvent xXIBarrierPointerReleasedEvent; typedef xXIBarrierEvent xXIBarrierLeaveEvent; #undef Window #undef Time #undef Atom #undef Cursor #undef Barrier #endif /* _XI2PROTO_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/extensions/XIproto.h ================================================ /************************************************************ Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Hewlett-Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifndef _XIPROTO_H #define _XIPROTO_H #include #include /* make sure types have right sizes for protocol structures. */ #define Window CARD32 #define Time CARD32 #define KeyCode CARD8 #define Mask CARD32 #define Atom CARD32 #define Cursor CARD32 /********************************************************* * * number of events, errors, and extension name. * */ #define MORE_EVENTS 0x80 #define DEVICE_BITS 0x7F #define InputClassBits 0x3F /* bits in mode field for input classes */ #define ModeBitsShift 6 /* amount to shift the remaining bits */ #define numInputClasses 7 #define IEVENTS 17 /* does NOT include generic events */ #define IERRORS 5 #define IREQUESTS 39 #define CLIENT_REQ 1 typedef struct _XExtEventInfo { Mask mask; BYTE type; BYTE word; } XExtEventInfo; #ifndef _XITYPEDEF_POINTER typedef void *Pointer; #endif struct tmask { Mask mask; void *dev; }; /********************************************************* * * Event constants used by library. * */ #define XI_DeviceValuator 0 #define XI_DeviceKeyPress 1 #define XI_DeviceKeyRelease 2 #define XI_DeviceButtonPress 3 #define XI_DeviceButtonRelease 4 #define XI_DeviceMotionNotify 5 #define XI_DeviceFocusIn 6 #define XI_DeviceFocusOut 7 #define XI_ProximityIn 8 #define XI_ProximityOut 9 #define XI_DeviceStateNotify 10 #define XI_DeviceMappingNotify 11 #define XI_ChangeDeviceNotify 12 #define XI_DeviceKeystateNotify 13 #define XI_DeviceButtonstateNotify 14 #define XI_DevicePresenceNotify 15 #define XI_DevicePropertyNotify 16 /********************************************************* * * Protocol request constants * */ #define X_GetExtensionVersion 1 #define X_ListInputDevices 2 #define X_OpenDevice 3 #define X_CloseDevice 4 #define X_SetDeviceMode 5 #define X_SelectExtensionEvent 6 #define X_GetSelectedExtensionEvents 7 #define X_ChangeDeviceDontPropagateList 8 #define X_GetDeviceDontPropagateList 9 #define X_GetDeviceMotionEvents 10 #define X_ChangeKeyboardDevice 11 #define X_ChangePointerDevice 12 #define X_GrabDevice 13 #define X_UngrabDevice 14 #define X_GrabDeviceKey 15 #define X_UngrabDeviceKey 16 #define X_GrabDeviceButton 17 #define X_UngrabDeviceButton 18 #define X_AllowDeviceEvents 19 #define X_GetDeviceFocus 20 #define X_SetDeviceFocus 21 #define X_GetFeedbackControl 22 #define X_ChangeFeedbackControl 23 #define X_GetDeviceKeyMapping 24 #define X_ChangeDeviceKeyMapping 25 #define X_GetDeviceModifierMapping 26 #define X_SetDeviceModifierMapping 27 #define X_GetDeviceButtonMapping 28 #define X_SetDeviceButtonMapping 29 #define X_QueryDeviceState 30 #define X_SendExtensionEvent 31 #define X_DeviceBell 32 #define X_SetDeviceValuators 33 #define X_GetDeviceControl 34 #define X_ChangeDeviceControl 35 /* XI 1.5 */ #define X_ListDeviceProperties 36 #define X_ChangeDeviceProperty 37 #define X_DeleteDeviceProperty 38 #define X_GetDeviceProperty 39 /********************************************************* * * Protocol request and reply structures. * * GetExtensionVersion. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_GetExtensionVersion */ CARD16 length B16; CARD16 nbytes B16; CARD8 pad1, pad2; } xGetExtensionVersionReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GetExtensionVersion */ CARD16 sequenceNumber B16; CARD32 length B32; CARD16 major_version B16; CARD16 minor_version B16; BOOL present; CARD8 pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; } xGetExtensionVersionReply; /********************************************************* * * ListInputDevices. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_ListInputDevices */ CARD16 length B16; } xListInputDevicesReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_ListInputDevices */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 ndevices; CARD8 pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xListInputDevicesReply; typedef struct _xDeviceInfo *xDeviceInfoPtr; typedef struct _xAnyClassinfo *xAnyClassPtr; typedef struct _xAnyClassinfo { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 length; } xAnyClassInfo; typedef struct _xDeviceInfo { CARD32 type B32; CARD8 id; CARD8 num_classes; CARD8 use; /* IsXPointer | IsXKeyboard | IsXExtension... */ CARD8 attached; /* id of master dev (if IsXExtension..) */ } xDeviceInfo; typedef struct _xKeyInfo *xKeyInfoPtr; typedef struct _xKeyInfo { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 length; KeyCode min_keycode; KeyCode max_keycode; CARD16 num_keys B16; CARD8 pad1,pad2; } xKeyInfo; typedef struct _xButtonInfo *xButtonInfoPtr; typedef struct _xButtonInfo { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 length; CARD16 num_buttons B16; } xButtonInfo; typedef struct _xValuatorInfo *xValuatorInfoPtr; typedef struct _xValuatorInfo { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 length; CARD8 num_axes; CARD8 mode; CARD32 motion_buffer_size B32; } xValuatorInfo; typedef struct _xAxisInfo *xAxisInfoPtr; typedef struct _xAxisInfo { CARD32 resolution B32; CARD32 min_value B32; CARD32 max_value B32; } xAxisInfo; /********************************************************* * * OpenDevice. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_OpenDevice */ CARD16 length B16; CARD8 deviceid; BYTE pad1, pad2, pad3; } xOpenDeviceReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_OpenDevice */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 num_classes; BYTE pad1, pad2, pad3; CARD32 pad00 B32; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; } xOpenDeviceReply; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 event_type_base; } xInputClassInfo; /********************************************************* * * CloseDevice. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_CloseDevice */ CARD16 length B16; CARD8 deviceid; BYTE pad1, pad2, pad3; } xCloseDeviceReq; /********************************************************* * * SetDeviceMode. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_SetDeviceMode */ CARD16 length B16; CARD8 deviceid; CARD8 mode; BYTE pad1, pad2; } xSetDeviceModeReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_SetDeviceMode */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 status; BYTE pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xSetDeviceModeReply; /********************************************************* * * SelectExtensionEvent. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_SelectExtensionEvent */ CARD16 length B16; Window window B32; CARD16 count B16; CARD16 pad00 B16; } xSelectExtensionEventReq; /********************************************************* * * GetSelectedExtensionEvent. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* X_GetSelectedExtensionEvents */ CARD16 length B16; Window window B32; } xGetSelectedExtensionEventsReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* GetSelectedExtensionEvents */ CARD16 sequenceNumber B16; CARD32 length B32; CARD16 this_client_count B16; CARD16 all_clients_count B16; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xGetSelectedExtensionEventsReply; /********************************************************* * * ChangeDeviceDontPropagateList. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* X_ChangeDeviceDontPropagateList */ CARD16 length B16; Window window B32; CARD16 count B16; CARD8 mode; BYTE pad; } xChangeDeviceDontPropagateListReq; /********************************************************* * * GetDeviceDontPropagateList. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* X_GetDeviceDontPropagateList */ CARD16 length B16; Window window B32; } xGetDeviceDontPropagateListReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* GetDeviceDontPropagateList */ CARD16 sequenceNumber B16; CARD32 length B32; CARD16 count B16; CARD16 pad00 B16; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xGetDeviceDontPropagateListReply; /********************************************************* * * GetDeviceMotionEvents. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_GetDeviceMotionEvents*/ CARD16 length B16; Time start B32; Time stop B32; CARD8 deviceid; BYTE pad1, pad2, pad3; } xGetDeviceMotionEventsReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GetDeviceMotionEvents */ CARD16 sequenceNumber B16; CARD32 length B32; CARD32 nEvents B32; CARD8 axes; CARD8 mode; BYTE pad1, pad2; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; } xGetDeviceMotionEventsReply; /********************************************************* * * ChangeKeyboardDevice. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* X_ChangeKeyboardDevice */ CARD16 length B16; CARD8 deviceid; BYTE pad1, pad2, pad3; } xChangeKeyboardDeviceReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_ChangeKeyboardDevice*/ CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD8 status; BYTE pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xChangeKeyboardDeviceReply; /********************************************************* * * ChangePointerDevice. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* X_ChangePointerDevice */ CARD16 length B16; CARD8 xaxis; CARD8 yaxis; CARD8 deviceid; BYTE pad1; } xChangePointerDeviceReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_ChangePointerDevice */ CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD8 status; BYTE pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xChangePointerDeviceReply; /********************************************************* * * GrabDevice. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_GrabDevice */ CARD16 length B16; Window grabWindow B32; Time time B32; CARD16 event_count B16; CARD8 this_device_mode; CARD8 other_devices_mode; BOOL ownerEvents; CARD8 deviceid; CARD16 pad01 B16; } xGrabDeviceReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GrabDevice */ CARD16 sequenceNumber B16; CARD32 length B32; /* 0 */ CARD8 status; BYTE pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xGrabDeviceReply; /********************************************************* * * UngrabDevice. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_UnGrabDevice */ CARD16 length B16; Time time B32; CARD8 deviceid; BYTE pad1, pad2, pad3; } xUngrabDeviceReq; /********************************************************* * * GrabDeviceKey. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_GrabDeviceKey */ CARD16 length B16; Window grabWindow B32; CARD16 event_count B16; CARD16 modifiers B16; CARD8 modifier_device; CARD8 grabbed_device; CARD8 key; BYTE this_device_mode; BYTE other_devices_mode; BOOL ownerEvents; BYTE pad1, pad2; } xGrabDeviceKeyReq; /********************************************************* * * UngrabDeviceKey. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_UngrabDeviceKey */ CARD16 length B16; Window grabWindow B32; CARD16 modifiers B16; CARD8 modifier_device; CARD8 key; CARD8 grabbed_device; BYTE pad1, pad2, pad3; } xUngrabDeviceKeyReq; /********************************************************* * * GrabDeviceButton. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_GrabDeviceButton */ CARD16 length B16; Window grabWindow B32; CARD8 grabbed_device; CARD8 modifier_device; CARD16 event_count B16; CARD16 modifiers B16; BYTE this_device_mode; BYTE other_devices_mode; CARD8 button; BOOL ownerEvents; BYTE pad1, pad2; } xGrabDeviceButtonReq; /********************************************************* * * UngrabDeviceButton. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_UngrabDeviceButton */ CARD16 length B16; Window grabWindow B32; CARD16 modifiers B16; CARD8 modifier_device; CARD8 button; CARD8 grabbed_device; BYTE pad1, pad2, pad3; } xUngrabDeviceButtonReq; /********************************************************* * * AllowDeviceEvents. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_AllowDeviceEvents */ CARD16 length B16; Time time B32; CARD8 mode; CARD8 deviceid; BYTE pad1, pad2; } xAllowDeviceEventsReq; /********************************************************* * * GetDeviceFocus. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_GetDeviceFocus */ CARD16 length B16; CARD8 deviceid; BYTE pad1, pad2, pad3; } xGetDeviceFocusReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GetDeviceFocus */ CARD16 sequenceNumber B16; CARD32 length B32; CARD32 focus B32; Time time B32; CARD8 revertTo; BYTE pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; } xGetDeviceFocusReply; /********************************************************* * * SetDeviceFocus. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_SetDeviceFocus */ CARD16 length B16; Window focus B32; Time time B32; CARD8 revertTo; CARD8 device; CARD16 pad01 B16; } xSetDeviceFocusReq; /********************************************************* * * GetFeedbackControl. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* X_GetFeedbackControl */ CARD16 length B16; CARD8 deviceid; BYTE pad1, pad2, pad3; } xGetFeedbackControlReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GetFeedbackControl */ CARD16 sequenceNumber B16; CARD32 length B32; CARD16 num_feedbacks B16; CARD16 pad01 B16; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; CARD32 pad06 B32; } xGetFeedbackControlReply; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class */ #else CARD8 class; /* feedback class */ #endif CARD8 id; /* feedback id */ CARD16 length B16; /* feedback length */ } xFeedbackState; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 id; CARD16 length B16; CARD16 pitch B16; CARD16 duration B16; CARD32 led_mask B32; CARD32 led_values B32; BOOL global_auto_repeat; CARD8 click; CARD8 percent; BYTE pad; BYTE auto_repeats[32]; } xKbdFeedbackState; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 id; CARD16 length B16; CARD8 pad1,pad2; CARD16 accelNum B16; CARD16 accelDenom B16; CARD16 threshold B16; } xPtrFeedbackState; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; CARD16 length B16; /* feedback length */ CARD32 resolution B32; INT32 min_value B32; INT32 max_value B32; } xIntegerFeedbackState; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; CARD16 length B16; /* feedback length */ CARD16 max_symbols B16; CARD16 num_syms_supported B16; } xStringFeedbackState; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; CARD16 length B16; /* feedback length */ CARD8 percent; BYTE pad1, pad2, pad3; CARD16 pitch B16; CARD16 duration B16; } xBellFeedbackState; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; CARD16 length B16; /* feedback length */ CARD32 led_mask B32; CARD32 led_values B32; } xLedFeedbackState; /********************************************************* * * ChangeFeedbackControl. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* X_ChangeFeedbackControl */ CARD16 length B16; CARD32 mask B32; CARD8 deviceid; CARD8 feedbackid; BYTE pad1, pad2; } xChangeFeedbackControlReq; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; /* feedback id */ CARD16 length B16; /* feedback length */ } xFeedbackCtl; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; /* feedback length */ CARD16 length B16; /* feedback length */ KeyCode key; CARD8 auto_repeat_mode; INT8 click; INT8 percent; INT16 pitch B16; INT16 duration B16; CARD32 led_mask B32; CARD32 led_values B32; } xKbdFeedbackCtl; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; /* feedback id */ CARD16 length B16; /* feedback length */ CARD8 pad1,pad2; INT16 num B16; INT16 denom B16; INT16 thresh B16; } xPtrFeedbackCtl; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; /* feedback id */ CARD16 length B16; /* feedback length */ INT32 int_to_display B32; } xIntegerFeedbackCtl; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; /* feedback id */ CARD16 length B16; /* feedback length */ CARD8 pad1,pad2; CARD16 num_keysyms B16; } xStringFeedbackCtl; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; /* feedback id */ CARD16 length B16; /* feedback length */ INT8 percent; BYTE pad1, pad2, pad3; INT16 pitch B16; INT16 duration B16; } xBellFeedbackCtl; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; /* feedback class id */ #else CARD8 class; /* feedback class id */ #endif CARD8 id; /* feedback id */ CARD16 length B16; /* feedback length */ CARD32 led_mask B32; CARD32 led_values B32; } xLedFeedbackCtl; /********************************************************* * * GetDeviceKeyMapping. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_GetDeviceKeyMapping */ CARD16 length B16; CARD8 deviceid; KeyCode firstKeyCode; CARD8 count; BYTE pad1; } xGetDeviceKeyMappingReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GetDeviceKeyMapping */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 keySymsPerKeyCode; CARD8 pad0; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xGetDeviceKeyMappingReply; /********************************************************* * * ChangeDeviceKeyMapping. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_ChangeDeviceKeyMapping */ CARD16 length B16; CARD8 deviceid; KeyCode firstKeyCode; CARD8 keySymsPerKeyCode; CARD8 keyCodes; } xChangeDeviceKeyMappingReq; /********************************************************* * * GetDeviceModifierMapping. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_GetDeviceModifierMapping */ CARD16 length B16; CARD8 deviceid; BYTE pad1, pad2, pad3; } xGetDeviceModifierMappingReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GetDeviceModifierMapping */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 numKeyPerModifier; CARD8 pad0; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xGetDeviceModifierMappingReply; /********************************************************* * * SetDeviceModifierMapping. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_SetDeviceModifierMapping */ CARD16 length B16; CARD8 deviceid; CARD8 numKeyPerModifier; CARD16 pad1 B16; } xSetDeviceModifierMappingReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_SetDeviceModifierMapping */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 success; CARD8 pad0; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xSetDeviceModifierMappingReply; /********************************************************* * * GetDeviceButtonMapping. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* X_GetDeviceButtonMapping */ CARD16 length B16; CARD8 deviceid; BYTE pad1, pad2, pad3; } xGetDeviceButtonMappingReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GetDeviceButtonMapping */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 nElts; BYTE pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xGetDeviceButtonMappingReply; /********************************************************* * * SetDeviceButtonMapping. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* X_SetDeviceButtonMapping */ CARD16 length B16; CARD8 deviceid; CARD8 map_length; BYTE pad1, pad2; } xSetDeviceButtonMappingReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_SetDeviceButtonMapping */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 status; BYTE pad0; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xSetDeviceButtonMappingReply; /********************************************************* * * QueryDeviceState. * */ typedef struct { CARD8 reqType; CARD8 ReqType; /* always X_QueryDeviceState */ CARD16 length B16; CARD8 deviceid; BYTE pad1, pad2, pad3; } xQueryDeviceStateReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_QueryDeviceState */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 num_classes; BYTE pad0; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xQueryDeviceStateReply; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 length; CARD8 num_keys; BYTE pad1; CARD8 keys[32]; } xKeyState; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 length; CARD8 num_buttons; BYTE pad1; CARD8 buttons[32]; } xButtonState; typedef struct { #if defined(__cplusplus) || defined(c_plusplus) CARD8 c_class; #else CARD8 class; #endif CARD8 length; CARD8 num_valuators; CARD8 mode; } xValuatorState; /********************************************************* * * SendExtensionEvent. * THIS REQUEST MUST BE KEPT A MULTIPLE OF 8 BYTES IN LENGTH! * MORE EVENTS MAY FOLLOW AND THEY MUST BE QUAD-ALIGNED! * */ typedef struct { CARD8 reqType; CARD8 ReqType; /* always X_SendExtensionEvent */ CARD16 length B16; Window destination B32; CARD8 deviceid; BOOL propagate; CARD16 count B16; CARD8 num_events; BYTE pad1,pad2,pad3; } xSendExtensionEventReq; /********************************************************* * * DeviceBell. * */ typedef struct { CARD8 reqType; CARD8 ReqType; /* always X_DeviceBell */ CARD16 length B16; CARD8 deviceid; CARD8 feedbackid; CARD8 feedbackclass; INT8 percent; } xDeviceBellReq; /********************************************************* * * SetDeviceValuators. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_SetDeviceValuators */ CARD16 length B16; CARD8 deviceid; CARD8 first_valuator; CARD8 num_valuators; BYTE pad1; } xSetDeviceValuatorsReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_SetDeviceValuators */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 status; BYTE pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xSetDeviceValuatorsReply; /********************************************************* * * GetDeviceControl. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_GetDeviceControl */ CARD16 length B16; CARD16 control B16; CARD8 deviceid; BYTE pad2; } xGetDeviceControlReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GetDeviceControl */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 status; BYTE pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xGetDeviceControlReply; typedef struct { CARD16 control B16; /* control type */ CARD16 length B16; /* control length */ } xDeviceState; typedef struct { CARD16 control B16; /* control type */ CARD16 length B16; /* control length */ CARD32 num_valuators B32; /* number of valuators */ } xDeviceResolutionState; typedef struct { CARD16 control B16; CARD16 length B16; INT32 min_x B32; INT32 max_x B32; INT32 min_y B32; INT32 max_y B32; CARD32 flip_x B32; CARD32 flip_y B32; CARD32 rotation B32; CARD32 button_threshold B32; } xDeviceAbsCalibState; typedef struct { CARD16 control B16; CARD16 length B16; CARD32 offset_x B32; CARD32 offset_y B32; CARD32 width B32; CARD32 height B32; CARD32 screen B32; CARD32 following B32; } xDeviceAbsAreaState; typedef struct { CARD16 control B16; /* control type */ CARD16 length B16; /* control length */ CARD8 status; CARD8 iscore; CARD16 pad1 B16; } xDeviceCoreState; typedef struct { CARD16 control B16; /* control type */ CARD16 length B16; /* control length */ CARD8 enable; CARD8 pad0; CARD16 pad1 B16; } xDeviceEnableState; /********************************************************* * * ChangeDeviceControl. * */ typedef struct { CARD8 reqType; /* input extension major code */ CARD8 ReqType; /* always X_ChangeDeviceControl */ CARD16 length B16; CARD16 control B16; CARD8 deviceid; BYTE pad0; } xChangeDeviceControlReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_ChangeDeviceControl */ CARD16 sequenceNumber B16; CARD32 length B32; CARD8 status; BYTE pad1, pad2, pad3; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; } xChangeDeviceControlReply; typedef struct { CARD16 control B16; /* control type */ CARD16 length B16; /* control length */ } xDeviceCtl; typedef struct { CARD16 control B16; /* control type */ CARD16 length B16; /* control length */ CARD8 first_valuator; /* first valuator to change */ CARD8 num_valuators; /* number of valuators to change*/ CARD8 pad1,pad2; } xDeviceResolutionCtl; typedef struct { CARD16 control B16; CARD16 length B16; INT32 min_x; INT32 max_x; INT32 min_y; INT32 max_y; CARD32 flip_x; CARD32 flip_y; CARD32 rotation; CARD32 button_threshold; } xDeviceAbsCalibCtl; typedef struct { CARD16 control B16; CARD16 length B16; CARD32 offset_x; CARD32 offset_y; INT32 width; INT32 height; INT32 screen; CARD32 following; } xDeviceAbsAreaCtl; typedef struct { CARD16 control B16; CARD16 length B16; CARD8 status; CARD8 pad0; CARD16 pad1 B16; } xDeviceCoreCtl; typedef struct { CARD16 control B16; CARD16 length B16; CARD8 enable; CARD8 pad0; CARD16 pad1 B16; } xDeviceEnableCtl; /* XI 1.5 */ /********************************************************* * * ListDeviceProperties. * */ typedef struct { CARD8 reqType; /* input extension major opcode */ CARD8 ReqType; /* always X_ListDeviceProperties */ CARD16 length B16; CARD8 deviceid; CARD8 pad0; CARD16 pad1 B16; } xListDevicePropertiesReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_ListDeviceProperties */ CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nAtoms B16; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; } xListDevicePropertiesReply; /********************************************************* * * ChangeDeviceProperty. * */ typedef struct { CARD8 reqType; /* input extension major opcode */ CARD8 ReqType; /* always X_ChangeDeviceProperty */ CARD16 length B16; Atom property B32; Atom type B32; CARD8 deviceid; CARD8 format; CARD8 mode; CARD8 pad; CARD32 nUnits B32; } xChangeDevicePropertyReq; /********************************************************* * * DeleteDeviceProperty. * */ typedef struct { CARD8 reqType; /* input extension major opcode */ CARD8 ReqType; /* always X_DeleteDeviceProperty */ CARD16 length B16; Atom property B32; CARD8 deviceid; CARD8 pad0; CARD16 pad1 B16; } xDeleteDevicePropertyReq; /********************************************************* * * GetDeviceProperty. * */ typedef struct { CARD8 reqType; /* input extension major opcode */ CARD8 ReqType; /* always X_GetDeviceProperty */ CARD16 length B16; Atom property B32; Atom type B32; CARD32 longOffset B32; CARD32 longLength B32; CARD8 deviceid; #if defined(__cplusplus) || defined(c_plusplus) BOOL c_delete; #else BOOL delete; #endif CARD16 pad; } xGetDevicePropertyReq; typedef struct { CARD8 repType; /* X_Reply */ CARD8 RepType; /* always X_GetDeviceProperty */ CARD16 sequenceNumber B16; CARD32 length B32; Atom propertyType B32; CARD32 bytesAfter B32; CARD32 nItems B32; CARD8 format; CARD8 deviceid; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; } xGetDevicePropertyReply; /********************************************************** * * Input extension events. * * DeviceValuator * */ typedef struct { BYTE type; CARD8 deviceid; CARD16 sequenceNumber B16; KeyButMask device_state B16; CARD8 num_valuators; CARD8 first_valuator; INT32 valuator0 B32; INT32 valuator1 B32; INT32 valuator2 B32; INT32 valuator3 B32; INT32 valuator4 B32; INT32 valuator5 B32; } deviceValuator; /********************************************************** * * DeviceKeyButtonPointer. * * Used for: DeviceKeyPress, DeviceKeyRelease, * DeviceButtonPress, DeviceButtonRelease, * ProximityIn, ProximityOut * DeviceMotionNotify, * */ typedef struct { BYTE type; BYTE detail; CARD16 sequenceNumber B16; Time time B32; Window root B32; Window event B32; Window child B32; INT16 root_x B16; INT16 root_y B16; INT16 event_x B16; INT16 event_y B16; KeyButMask state B16; BOOL same_screen; CARD8 deviceid; } deviceKeyButtonPointer; /********************************************************** * * DeviceFocus. * */ typedef struct { BYTE type; BYTE detail; CARD16 sequenceNumber B16; Time time B32; Window window B32; BYTE mode; CARD8 deviceid; BYTE pad1, pad2; CARD32 pad00 B32; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; } deviceFocus; /********************************************************** * * DeviceStateNotify. * * Note that the two high-order bits in the classes_reported * field are the proximity state (InProximity or OutOfProximity), * and the device mode (Absolute or Relative), respectively. * */ typedef struct { BYTE type; BYTE deviceid; CARD16 sequenceNumber B16; Time time B32; CARD8 num_keys; CARD8 num_buttons; CARD8 num_valuators; CARD8 classes_reported; CARD8 buttons[4]; CARD8 keys[4]; INT32 valuator0 B32; INT32 valuator1 B32; INT32 valuator2 B32; } deviceStateNotify; /********************************************************** * * DeviceKeyStateNotify. * */ typedef struct { BYTE type; BYTE deviceid; CARD16 sequenceNumber B16; CARD8 keys[28]; } deviceKeyStateNotify; /********************************************************** * * DeviceButtonStateNotify. * */ typedef struct { BYTE type; BYTE deviceid; CARD16 sequenceNumber B16; CARD8 buttons[28]; } deviceButtonStateNotify; /********************************************************** * * DeviceMappingNotify. * Fields must be kept in sync with core mappingnotify event. * */ typedef struct { BYTE type; BYTE deviceid; CARD16 sequenceNumber B16; CARD8 request; KeyCode firstKeyCode; CARD8 count; BYTE pad1; Time time B32; CARD32 pad00 B32; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; } deviceMappingNotify; /********************************************************** * * ChangeDeviceNotify. * */ typedef struct { BYTE type; BYTE deviceid; CARD16 sequenceNumber B16; Time time B32; CARD8 request; BYTE pad1, pad2, pad3; CARD32 pad00 B32; CARD32 pad01 B32; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; } changeDeviceNotify; /********************************************************** * * devicePresenceNotify. * */ typedef struct { BYTE type; BYTE pad00; CARD16 sequenceNumber B16; Time time B32; BYTE devchange; /* Device{Added|Removed|Enabled|Disabled|ControlChanged} */ BYTE deviceid; CARD16 control B16; CARD32 pad02 B32; CARD32 pad03 B32; CARD32 pad04 B32; CARD32 pad05 B32; CARD32 pad06 B32; } devicePresenceNotify; /********************************************************* * DevicePropertyNotifyEvent * * Sent whenever a device's property changes. * */ typedef struct { BYTE type; BYTE state; /* NewValue or Deleted */ CARD16 sequenceNumber B16; CARD32 time B32; Atom atom B32; /* affected property */ CARD32 pad0 B32; CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD16 pad5 B16; CARD8 pad4; CARD8 deviceid; /* id of device */ } devicePropertyNotify; #undef Window #undef Time #undef KeyCode #undef Mask #undef Atom #undef Cursor #endif ================================================ FILE: Libraries/Core/RPi/Headers/X11/extensions/XKB.h ================================================ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Silicon Graphics not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifndef _XKB_H_ #define _XKB_H_ /* * XKB request codes, used in: * - xkbReqType field of all requests * - requestMinor field of some events */ #define X_kbUseExtension 0 #define X_kbSelectEvents 1 #define X_kbBell 3 #define X_kbGetState 4 #define X_kbLatchLockState 5 #define X_kbGetControls 6 #define X_kbSetControls 7 #define X_kbGetMap 8 #define X_kbSetMap 9 #define X_kbGetCompatMap 10 #define X_kbSetCompatMap 11 #define X_kbGetIndicatorState 12 #define X_kbGetIndicatorMap 13 #define X_kbSetIndicatorMap 14 #define X_kbGetNamedIndicator 15 #define X_kbSetNamedIndicator 16 #define X_kbGetNames 17 #define X_kbSetNames 18 #define X_kbGetGeometry 19 #define X_kbSetGeometry 20 #define X_kbPerClientFlags 21 #define X_kbListComponents 22 #define X_kbGetKbdByName 23 #define X_kbGetDeviceInfo 24 #define X_kbSetDeviceInfo 25 #define X_kbSetDebuggingFlags 101 /* * In the X sense, XKB reports only one event. * The type field of all XKB events is XkbEventCode */ #define XkbEventCode 0 #define XkbNumberEvents (XkbEventCode+1) /* * XKB has a minor event code so it can use one X event code for * multiple purposes. * - reported in the xkbType field of all XKB events. * - XkbSelectEventDetails: Indicates the event for which event details * are being changed */ #define XkbNewKeyboardNotify 0 #define XkbMapNotify 1 #define XkbStateNotify 2 #define XkbControlsNotify 3 #define XkbIndicatorStateNotify 4 #define XkbIndicatorMapNotify 5 #define XkbNamesNotify 6 #define XkbCompatMapNotify 7 #define XkbBellNotify 8 #define XkbActionMessage 9 #define XkbAccessXNotify 10 #define XkbExtensionDeviceNotify 11 /* * Event Mask: * - XkbSelectEvents: Specifies event interest. */ #define XkbNewKeyboardNotifyMask (1L << 0) #define XkbMapNotifyMask (1L << 1) #define XkbStateNotifyMask (1L << 2) #define XkbControlsNotifyMask (1L << 3) #define XkbIndicatorStateNotifyMask (1L << 4) #define XkbIndicatorMapNotifyMask (1L << 5) #define XkbNamesNotifyMask (1L << 6) #define XkbCompatMapNotifyMask (1L << 7) #define XkbBellNotifyMask (1L << 8) #define XkbActionMessageMask (1L << 9) #define XkbAccessXNotifyMask (1L << 10) #define XkbExtensionDeviceNotifyMask (1L << 11) #define XkbAllEventsMask (0xFFF) /* * NewKeyboardNotify event details: */ #define XkbNKN_KeycodesMask (1L << 0) #define XkbNKN_GeometryMask (1L << 1) #define XkbNKN_DeviceIDMask (1L << 2) #define XkbAllNewKeyboardEventsMask (0x7) /* * AccessXNotify event types: * - The 'what' field of AccessXNotify events reports the * reason that the event was generated. */ #define XkbAXN_SKPress 0 #define XkbAXN_SKAccept 1 #define XkbAXN_SKReject 2 #define XkbAXN_SKRelease 3 #define XkbAXN_BKAccept 4 #define XkbAXN_BKReject 5 #define XkbAXN_AXKWarning 6 /* * AccessXNotify details: * - Used as an event detail mask to limit the conditions under which * AccessXNotify events are reported */ #define XkbAXN_SKPressMask (1L << 0) #define XkbAXN_SKAcceptMask (1L << 1) #define XkbAXN_SKRejectMask (1L << 2) #define XkbAXN_SKReleaseMask (1L << 3) #define XkbAXN_BKAcceptMask (1L << 4) #define XkbAXN_BKRejectMask (1L << 5) #define XkbAXN_AXKWarningMask (1L << 6) #define XkbAllAccessXEventsMask (0x7f) /* * Miscellaneous event details: * - event detail masks for assorted events that don't reall * have any details. */ #define XkbAllStateEventsMask XkbAllStateComponentsMask #define XkbAllMapEventsMask XkbAllMapComponentsMask #define XkbAllControlEventsMask XkbAllControlsMask #define XkbAllIndicatorEventsMask XkbAllIndicatorsMask #define XkbAllNameEventsMask XkbAllNamesMask #define XkbAllCompatMapEventsMask XkbAllCompatMask #define XkbAllBellEventsMask (1L << 0) #define XkbAllActionMessagesMask (1L << 0) /* * XKB reports one error: BadKeyboard * A further reason for the error is encoded into to most significant * byte of the resourceID for the error: * XkbErr_BadDevice - the device in question was not found * XkbErr_BadClass - the device was found but it doesn't belong to * the appropriate class. * XkbErr_BadId - the device was found and belongs to the right * class, but not feedback with a matching id was * found. * The low byte of the resourceID for this error contains the device * id, class specifier or feedback id that failed. */ #define XkbKeyboard 0 #define XkbNumberErrors 1 #define XkbErr_BadDevice 0xff #define XkbErr_BadClass 0xfe #define XkbErr_BadId 0xfd /* * Keyboard Components Mask: * - Specifies the components that follow a GetKeyboardByNameReply */ #define XkbClientMapMask (1L << 0) #define XkbServerMapMask (1L << 1) #define XkbCompatMapMask (1L << 2) #define XkbIndicatorMapMask (1L << 3) #define XkbNamesMask (1L << 4) #define XkbGeometryMask (1L << 5) #define XkbControlsMask (1L << 6) #define XkbAllComponentsMask (0x7f) /* * State detail mask: * - The 'changed' field of StateNotify events reports which of * the keyboard state components have changed. * - Used as an event detail mask to limit the conditions under * which StateNotify events are reported. */ #define XkbModifierStateMask (1L << 0) #define XkbModifierBaseMask (1L << 1) #define XkbModifierLatchMask (1L << 2) #define XkbModifierLockMask (1L << 3) #define XkbGroupStateMask (1L << 4) #define XkbGroupBaseMask (1L << 5) #define XkbGroupLatchMask (1L << 6) #define XkbGroupLockMask (1L << 7) #define XkbCompatStateMask (1L << 8) #define XkbGrabModsMask (1L << 9) #define XkbCompatGrabModsMask (1L << 10) #define XkbLookupModsMask (1L << 11) #define XkbCompatLookupModsMask (1L << 12) #define XkbPointerButtonMask (1L << 13) #define XkbAllStateComponentsMask (0x3fff) /* * Controls detail masks: * The controls specified in XkbAllControlsMask: * - The 'changed' field of ControlsNotify events reports which of * the keyboard controls have changed. * - The 'changeControls' field of the SetControls request specifies * the controls for which values are to be changed. * - Used as an event detail mask to limit the conditions under * which ControlsNotify events are reported. * * The controls specified in the XkbAllBooleanCtrlsMask: * - The 'enabledControls' field of ControlsNotify events reports the * current status of the boolean controls. * - The 'enabledControlsChanges' field of ControlsNotify events reports * any boolean controls that have been turned on or off. * - The 'affectEnabledControls' and 'enabledControls' fields of the * kbSetControls request change the set of enabled controls. * - The 'accessXTimeoutMask' and 'accessXTimeoutValues' fields of * an XkbControlsRec specify the controls to be changed if the keyboard * times out and the values to which they should be changed. * - The 'autoCtrls' and 'autoCtrlsValues' fields of the PerClientFlags * request specifies the specify the controls to be reset when the * client exits and the values to which they should be reset. * - The 'ctrls' field of an indicator map specifies the controls * that drive the indicator. * - Specifies the boolean controls affected by the SetControls and * LockControls key actions. */ #define XkbRepeatKeysMask (1L << 0) #define XkbSlowKeysMask (1L << 1) #define XkbBounceKeysMask (1L << 2) #define XkbStickyKeysMask (1L << 3) #define XkbMouseKeysMask (1L << 4) #define XkbMouseKeysAccelMask (1L << 5) #define XkbAccessXKeysMask (1L << 6) #define XkbAccessXTimeoutMask (1L << 7) #define XkbAccessXFeedbackMask (1L << 8) #define XkbAudibleBellMask (1L << 9) #define XkbOverlay1Mask (1L << 10) #define XkbOverlay2Mask (1L << 11) #define XkbIgnoreGroupLockMask (1L << 12) #define XkbGroupsWrapMask (1L << 27) #define XkbInternalModsMask (1L << 28) #define XkbIgnoreLockModsMask (1L << 29) #define XkbPerKeyRepeatMask (1L << 30) #define XkbControlsEnabledMask (1L << 31) #define XkbAccessXOptionsMask (XkbStickyKeysMask|XkbAccessXFeedbackMask) #define XkbAllBooleanCtrlsMask (0x00001FFF) #define XkbAllControlsMask (0xF8001FFF) #define XkbAllControlEventsMask XkbAllControlsMask /* * AccessX Options Mask * - The 'accessXOptions' field of an XkbControlsRec specifies the * AccessX options that are currently in effect. * - The 'accessXTimeoutOptionsMask' and 'accessXTimeoutOptionsValues' * fields of an XkbControlsRec specify the Access X options to be * changed if the keyboard times out and the values to which they * should be changed. */ #define XkbAX_SKPressFBMask (1L << 0) #define XkbAX_SKAcceptFBMask (1L << 1) #define XkbAX_FeatureFBMask (1L << 2) #define XkbAX_SlowWarnFBMask (1L << 3) #define XkbAX_IndicatorFBMask (1L << 4) #define XkbAX_StickyKeysFBMask (1L << 5) #define XkbAX_TwoKeysMask (1L << 6) #define XkbAX_LatchToLockMask (1L << 7) #define XkbAX_SKReleaseFBMask (1L << 8) #define XkbAX_SKRejectFBMask (1L << 9) #define XkbAX_BKRejectFBMask (1L << 10) #define XkbAX_DumbBellFBMask (1L << 11) #define XkbAX_FBOptionsMask (0xF3F) #define XkbAX_SKOptionsMask (0x0C0) #define XkbAX_AllOptionsMask (0xFFF) /* * XkbUseCoreKbd is used to specify the core keyboard without having * to look up its X input extension identifier. * XkbUseCorePtr is used to specify the core pointer without having * to look up its X input extension identifier. * XkbDfltXIClass is used to specify "don't care" any place that the * XKB protocol is looking for an X Input Extension * device class. * XkbDfltXIId is used to specify "don't care" any place that the * XKB protocol is looking for an X Input Extension * feedback identifier. * XkbAllXIClasses is used to get information about all device indicators, * whether they're part of the indicator feedback class * or the keyboard feedback class. * XkbAllXIIds is used to get information about all device indicator * feedbacks without having to list them. * XkbXINone is used to indicate that no class or id has been specified. * XkbLegalXILedClass(c) True if 'c' specifies a legal class with LEDs * XkbLegalXIBellClass(c) True if 'c' specifies a legal class with bells * XkbExplicitXIDevice(d) True if 'd' explicitly specifies a device * XkbExplicitXIClass(c) True if 'c' explicitly specifies a device class * XkbExplicitXIId(c) True if 'i' explicitly specifies a device id * XkbSingleXIClass(c) True if 'c' specifies exactly one device class, * including the default. * XkbSingleXIId(i) True if 'i' specifies exactly one device * identifier, including the default. */ #define XkbUseCoreKbd 0x0100 #define XkbUseCorePtr 0x0200 #define XkbDfltXIClass 0x0300 #define XkbDfltXIId 0x0400 #define XkbAllXIClasses 0x0500 #define XkbAllXIIds 0x0600 #define XkbXINone 0xff00 #define XkbLegalXILedClass(c) (((c)==KbdFeedbackClass)||\ ((c)==LedFeedbackClass)||\ ((c)==XkbDfltXIClass)||\ ((c)==XkbAllXIClasses)) #define XkbLegalXIBellClass(c) (((c)==KbdFeedbackClass)||\ ((c)==BellFeedbackClass)||\ ((c)==XkbDfltXIClass)||\ ((c)==XkbAllXIClasses)) #define XkbExplicitXIDevice(c) (((c)&(~0xff))==0) #define XkbExplicitXIClass(c) (((c)&(~0xff))==0) #define XkbExplicitXIId(c) (((c)&(~0xff))==0) #define XkbSingleXIClass(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIClass)) #define XkbSingleXIId(c) ((((c)&(~0xff))==0)||((c)==XkbDfltXIId)) #define XkbNoModifier 0xff #define XkbNoShiftLevel 0xff #define XkbNoShape 0xff #define XkbNoIndicator 0xff #define XkbNoModifierMask 0 #define XkbAllModifiersMask 0xff #define XkbAllVirtualModsMask 0xffff #define XkbNumKbdGroups 4 #define XkbMaxKbdGroup (XkbNumKbdGroups-1) #define XkbMaxMouseKeysBtn 4 /* * Group Index and Mask: * - Indices into the kt_index array of a key type. * - Mask specifies types to be changed for XkbChangeTypesOfKey */ #define XkbGroup1Index 0 #define XkbGroup2Index 1 #define XkbGroup3Index 2 #define XkbGroup4Index 3 #define XkbAnyGroup 254 #define XkbAllGroups 255 #define XkbGroup1Mask (1<<0) #define XkbGroup2Mask (1<<1) #define XkbGroup3Mask (1<<2) #define XkbGroup4Mask (1<<3) #define XkbAnyGroupMask (1<<7) #define XkbAllGroupsMask (0xf) /* * BuildCoreState: Given a keyboard group and a modifier state, * construct the value to be reported an event. * GroupForCoreState: Given the state reported in an event, * determine the keyboard group. * IsLegalGroup: Returns TRUE if 'g' is a valid group index. */ #define XkbBuildCoreState(m,g) ((((g)&0x3)<<13)|((m)&0xff)) #define XkbGroupForCoreState(s) (((s)>>13)&0x3) #define XkbIsLegalGroup(g) (((g)>=0)&&((g)type>=Xkb_SASetMods)&&((a)->type<=XkbSA_LockMods)) #define XkbIsGroupAction(a) (((a)->type>=XkbSA_SetGroup)&&((a)->type<=XkbSA_LockGroup)) #define XkbIsPtrAction(a) (((a)->type>=XkbSA_MovePtr)&&((a)->type<=XkbSA_SetPtrDflt)) /* * Key Behavior Qualifier: * KB_Permanent indicates that the behavior describes an unalterable * characteristic of the keyboard, not an XKB software-simulation of * the listed behavior. * Key Behavior Types: * Specifies the behavior of the underlying key. */ #define XkbKB_Permanent 0x80 #define XkbKB_OpMask 0x7f #define XkbKB_Default 0x00 #define XkbKB_Lock 0x01 #define XkbKB_RadioGroup 0x02 #define XkbKB_Overlay1 0x03 #define XkbKB_Overlay2 0x04 #define XkbKB_RGAllowNone 0x80 /* * Various macros which describe the range of legal keycodes. */ #define XkbMinLegalKeyCode 8 #define XkbMaxLegalKeyCode 255 #define XkbMaxKeyCount (XkbMaxLegalKeyCode-XkbMinLegalKeyCode+1) #define XkbPerKeyBitArraySize ((XkbMaxLegalKeyCode+1)/8) /* Seems kinda silly to check that an unsigned char is <= 255... */ #define XkbIsLegalKeycode(k) ((k)>=XkbMinLegalKeyCode) /* * Assorted constants and limits. */ #define XkbNumModifiers 8 #define XkbNumVirtualMods 16 #define XkbNumIndicators 32 #define XkbAllIndicatorsMask (0xffffffff) #define XkbMaxRadioGroups 32 #define XkbAllRadioGroupsMask (0xffffffff) #define XkbMaxShiftLevel 63 #define XkbMaxSymsPerKey (XkbMaxShiftLevel*XkbNumKbdGroups) #define XkbRGMaxMembers 12 #define XkbActionMessageLength 6 #define XkbKeyNameLength 4 #define XkbMaxRedirectCount 8 #define XkbGeomPtsPerMM 10 #define XkbGeomMaxColors 32 #define XkbGeomMaxLabelColors 3 #define XkbGeomMaxPriority 255 /* * Key Type index and mask for the four standard key types. */ #define XkbOneLevelIndex 0 #define XkbTwoLevelIndex 1 #define XkbAlphabeticIndex 2 #define XkbKeypadIndex 3 #define XkbLastRequiredType XkbKeypadIndex #define XkbNumRequiredTypes (XkbLastRequiredType+1) #define XkbMaxKeyTypes 255 #define XkbOneLevelMask (1<<0) #define XkbTwoLevelMask (1<<1) #define XkbAlphabeticMask (1<<2) #define XkbKeypadMask (1<<3) #define XkbAllRequiredTypes (0xf) #define XkbShiftLevel(n) ((n)-1) #define XkbShiftLevelMask(n) (1<<((n)-1)) /* * Extension name and version information */ #define XkbName "XKEYBOARD" #define XkbMajorVersion 1 #define XkbMinorVersion 0 /* * Explicit map components: * - Used in the 'explicit' field of an XkbServerMap. Specifies * the keyboard components that should _not_ be updated automatically * in response to core protocol keyboard mapping requests. */ #define XkbExplicitKeyTypesMask (0x0f) #define XkbExplicitKeyType1Mask (1<<0) #define XkbExplicitKeyType2Mask (1<<1) #define XkbExplicitKeyType3Mask (1<<2) #define XkbExplicitKeyType4Mask (1<<3) #define XkbExplicitInterpretMask (1<<4) #define XkbExplicitAutoRepeatMask (1<<5) #define XkbExplicitBehaviorMask (1<<6) #define XkbExplicitVModMapMask (1<<7) #define XkbAllExplicitMask (0xff) /* * Map components masks: * Those in AllMapComponentsMask: * - Specifies the individual fields to be loaded or changed for the * GetMap and SetMap requests. * Those in ClientInfoMask: * - Specifies the components to be allocated by XkbAllocClientMap. * Those in ServerInfoMask: * - Specifies the components to be allocated by XkbAllocServerMap. */ #define XkbKeyTypesMask (1<<0) #define XkbKeySymsMask (1<<1) #define XkbModifierMapMask (1<<2) #define XkbExplicitComponentsMask (1<<3) #define XkbKeyActionsMask (1<<4) #define XkbKeyBehaviorsMask (1<<5) #define XkbVirtualModsMask (1<<6) #define XkbVirtualModMapMask (1<<7) #define XkbAllClientInfoMask (XkbKeyTypesMask|XkbKeySymsMask|XkbModifierMapMask) #define XkbAllServerInfoMask (XkbExplicitComponentsMask|XkbKeyActionsMask|XkbKeyBehaviorsMask|XkbVirtualModsMask|XkbVirtualModMapMask) #define XkbAllMapComponentsMask (XkbAllClientInfoMask|XkbAllServerInfoMask) /* * Symbol interpretations flags: * - Used in the flags field of a symbol interpretation */ #define XkbSI_AutoRepeat (1<<0) #define XkbSI_LockingKey (1<<1) /* * Symbol interpretations match specification: * - Used in the match field of a symbol interpretation to specify * the conditions under which an interpretation is used. */ #define XkbSI_LevelOneOnly (0x80) #define XkbSI_OpMask (0x7f) #define XkbSI_NoneOf (0) #define XkbSI_AnyOfOrNone (1) #define XkbSI_AnyOf (2) #define XkbSI_AllOf (3) #define XkbSI_Exactly (4) /* * Indicator map flags: * - Used in the flags field of an indicator map to indicate the * conditions under which and indicator can be changed and the * effects of changing the indicator. */ #define XkbIM_NoExplicit (1L << 7) #define XkbIM_NoAutomatic (1L << 6) #define XkbIM_LEDDrivesKB (1L << 5) /* * Indicator map component specifications: * - Used by the 'which_groups' and 'which_mods' fields of an indicator * map to specify which keyboard components should be used to drive * the indicator. */ #define XkbIM_UseBase (1L << 0) #define XkbIM_UseLatched (1L << 1) #define XkbIM_UseLocked (1L << 2) #define XkbIM_UseEffective (1L << 3) #define XkbIM_UseCompat (1L << 4) #define XkbIM_UseNone 0 #define XkbIM_UseAnyGroup (XkbIM_UseBase|XkbIM_UseLatched|XkbIM_UseLocked\ |XkbIM_UseEffective) #define XkbIM_UseAnyMods (XkbIM_UseAnyGroup|XkbIM_UseCompat) /* * Compatibility Map Compontents: * - Specifies the components to be allocated in XkbAllocCompatMap. */ #define XkbSymInterpMask (1<<0) #define XkbGroupCompatMask (1<<1) #define XkbAllCompatMask (0x3) /* * Names component mask: * - Specifies the names to be loaded or changed for the GetNames and * SetNames requests. * - Specifies the names that have changed in a NamesNotify event. * - Specifies the names components to be allocated by XkbAllocNames. */ #define XkbKeycodesNameMask (1<<0) #define XkbGeometryNameMask (1<<1) #define XkbSymbolsNameMask (1<<2) #define XkbPhysSymbolsNameMask (1<<3) #define XkbTypesNameMask (1<<4) #define XkbCompatNameMask (1<<5) #define XkbKeyTypeNamesMask (1<<6) #define XkbKTLevelNamesMask (1<<7) #define XkbIndicatorNamesMask (1<<8) #define XkbKeyNamesMask (1<<9) #define XkbKeyAliasesMask (1<<10) #define XkbVirtualModNamesMask (1<<11) #define XkbGroupNamesMask (1<<12) #define XkbRGNamesMask (1<<13) #define XkbComponentNamesMask (0x3f) #define XkbAllNamesMask (0x3fff) /* * GetByName components: * - Specifies desired or necessary components to GetKbdByName request. * - Reports the components that were found in a GetKbdByNameReply */ #define XkbGBN_TypesMask (1L << 0) #define XkbGBN_CompatMapMask (1L << 1) #define XkbGBN_ClientSymbolsMask (1L << 2) #define XkbGBN_ServerSymbolsMask (1L << 3) #define XkbGBN_SymbolsMask (XkbGBN_ClientSymbolsMask|XkbGBN_ServerSymbolsMask) #define XkbGBN_IndicatorMapMask (1L << 4) #define XkbGBN_KeyNamesMask (1L << 5) #define XkbGBN_GeometryMask (1L << 6) #define XkbGBN_OtherNamesMask (1L << 7) #define XkbGBN_AllComponentsMask (0xff) /* * ListComponents flags */ #define XkbLC_Hidden (1L << 0) #define XkbLC_Default (1L << 1) #define XkbLC_Partial (1L << 2) #define XkbLC_AlphanumericKeys (1L << 8) #define XkbLC_ModifierKeys (1L << 9) #define XkbLC_KeypadKeys (1L << 10) #define XkbLC_FunctionKeys (1L << 11) #define XkbLC_AlternateGroup (1L << 12) /* * X Input Extension Interactions * - Specifies the possible interactions between XKB and the X input * extension * - Used to request (XkbGetDeviceInfo) or change (XKbSetDeviceInfo) * XKB information about an extension device. * - Reports the list of supported optional features in the reply to * XkbGetDeviceInfo or in an XkbExtensionDeviceNotify event. * XkbXI_UnsupportedFeature is reported in XkbExtensionDeviceNotify * events to indicate an attempt to use an unsupported feature. */ #define XkbXI_KeyboardsMask (1L << 0) #define XkbXI_ButtonActionsMask (1L << 1) #define XkbXI_IndicatorNamesMask (1L << 2) #define XkbXI_IndicatorMapsMask (1L << 3) #define XkbXI_IndicatorStateMask (1L << 4) #define XkbXI_UnsupportedFeatureMask (1L << 15) #define XkbXI_AllFeaturesMask (0x001f) #define XkbXI_AllDeviceFeaturesMask (0x001e) #define XkbXI_IndicatorsMask (0x001c) #define XkbAllExtensionDeviceEventsMask (0x801f) /* * Per-Client Flags: * - Specifies flags to be changed by the PerClientFlags request. */ #define XkbPCF_DetectableAutoRepeatMask (1L << 0) #define XkbPCF_GrabsUseXKBStateMask (1L << 1) #define XkbPCF_AutoResetControlsMask (1L << 2) #define XkbPCF_LookupStateWhenGrabbed (1L << 3) #define XkbPCF_SendEventUsesXKBState (1L << 4) #define XkbPCF_AllFlagsMask (0x1F) /* * Debugging flags and controls */ #define XkbDF_DisableLocks (1<<0) #endif /* _XKB_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/extensions/XKBgeom.h ================================================ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Silicon Graphics not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifndef _XKBGEOM_H_ #define _XKBGEOM_H_ #include #ifdef XKB_IN_SERVER #define XkbAddGeomKeyAlias SrvXkbAddGeomKeyAlias #define XkbAddGeomColor SrvXkbAddGeomColor #define XkbAddGeomDoodad SrvXkbAddGeomDoodad #define XkbAddGeomKey SrvXkbAddGeomKey #define XkbAddGeomOutline SrvXkbAddGeomOutline #define XkbAddGeomOverlay SrvXkbAddGeomOverlay #define XkbAddGeomOverlayRow SrvXkbAddGeomOverlayRow #define XkbAddGeomOverlayKey SrvXkbAddGeomOverlayKey #define XkbAddGeomProperty SrvXkbAddGeomProperty #define XkbAddGeomRow SrvXkbAddGeomRow #define XkbAddGeomSection SrvXkbAddGeomSection #define XkbAddGeomShape SrvXkbAddGeomShape #define XkbAllocGeomKeyAliases SrvXkbAllocGeomKeyAliases #define XkbAllocGeomColors SrvXkbAllocGeomColors #define XkbAllocGeomDoodads SrvXkbAllocGeomDoodads #define XkbAllocGeomKeys SrvXkbAllocGeomKeys #define XkbAllocGeomOutlines SrvXkbAllocGeomOutlines #define XkbAllocGeomPoints SrvXkbAllocGeomPoints #define XkbAllocGeomProps SrvXkbAllocGeomProps #define XkbAllocGeomRows SrvXkbAllocGeomRows #define XkbAllocGeomSectionDoodads SrvXkbAllocGeomSectionDoodads #define XkbAllocGeomSections SrvXkbAllocGeomSections #define XkbAllocGeomOverlays SrvXkbAllocGeomOverlays #define XkbAllocGeomOverlayRows SrvXkbAllocGeomOverlayRows #define XkbAllocGeomOverlayKeys SrvXkbAllocGeomOverlayKeys #define XkbAllocGeomShapes SrvXkbAllocGeomShapes #define XkbAllocGeometry SrvXkbAllocGeometry #define XkbFreeGeomKeyAliases SrvXkbFreeGeomKeyAliases #define XkbFreeGeomColors SrvXkbFreeGeomColors #define XkbFreeGeomDoodads SrvXkbFreeGeomDoodads #define XkbFreeGeomProperties SrvXkbFreeGeomProperties #define XkbFreeGeomOverlayKeys SrvXkbFreeGeomOverlayKeys #define XkbFreeGeomOverlayRows SrvXkbFreeGeomOverlayRows #define XkbFreeGeomOverlays SrvXkbFreeGeomOverlays #define XkbFreeGeomKeys SrvXkbFreeGeomKeys #define XkbFreeGeomRows SrvXkbFreeGeomRows #define XkbFreeGeomSections SrvXkbFreeGeomSections #define XkbFreeGeomPoints SrvXkbFreeGeomPoints #define XkbFreeGeomOutlines SrvXkbFreeGeomOutlines #define XkbFreeGeomShapes SrvXkbFreeGeomShapes #define XkbFreeGeometry SrvXkbFreeGeometry #endif typedef struct _XkbProperty { char *name; char *value; } XkbPropertyRec,*XkbPropertyPtr; typedef struct _XkbColor { unsigned int pixel; char * spec; } XkbColorRec,*XkbColorPtr; typedef struct _XkbPoint { short x; short y; } XkbPointRec, *XkbPointPtr; typedef struct _XkbBounds { short x1,y1; short x2,y2; } XkbBoundsRec, *XkbBoundsPtr; #define XkbBoundsWidth(b) (((b)->x2)-((b)->x1)) #define XkbBoundsHeight(b) (((b)->y2)-((b)->y1)) typedef struct _XkbOutline { unsigned short num_points; unsigned short sz_points; unsigned short corner_radius; XkbPointPtr points; } XkbOutlineRec, *XkbOutlinePtr; typedef struct _XkbShape { Atom name; unsigned short num_outlines; unsigned short sz_outlines; XkbOutlinePtr outlines; XkbOutlinePtr approx; XkbOutlinePtr primary; XkbBoundsRec bounds; } XkbShapeRec, *XkbShapePtr; #define XkbOutlineIndex(s,o) ((int)((o)-&(s)->outlines[0])) typedef struct _XkbShapeDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; unsigned short color_ndx; unsigned short shape_ndx; } XkbShapeDoodadRec, *XkbShapeDoodadPtr; #define XkbShapeDoodadColor(g,d) (&(g)->colors[(d)->color_ndx]) #define XkbShapeDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx]) #define XkbSetShapeDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0]) #define XkbSetShapeDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0]) typedef struct _XkbTextDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; short width; short height; unsigned short color_ndx; char * text; char * font; } XkbTextDoodadRec, *XkbTextDoodadPtr; #define XkbTextDoodadColor(g,d) (&(g)->colors[(d)->color_ndx]) #define XkbSetTextDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0]) typedef struct _XkbIndicatorDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; unsigned short shape_ndx; unsigned short on_color_ndx; unsigned short off_color_ndx; } XkbIndicatorDoodadRec, *XkbIndicatorDoodadPtr; #define XkbIndicatorDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx]) #define XkbIndicatorDoodadOnColor(g,d) (&(g)->colors[(d)->on_color_ndx]) #define XkbIndicatorDoodadOffColor(g,d) (&(g)->colors[(d)->off_color_ndx]) #define XkbSetIndicatorDoodadOnColor(g,d,c) \ ((d)->on_color_ndx= (c)-&(g)->colors[0]) #define XkbSetIndicatorDoodadOffColor(g,d,c) \ ((d)->off_color_ndx= (c)-&(g)->colors[0]) #define XkbSetIndicatorDoodadShape(g,d,s) \ ((d)->shape_ndx= (s)-&(g)->shapes[0]) typedef struct _XkbLogoDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; unsigned short color_ndx; unsigned short shape_ndx; char * logo_name; } XkbLogoDoodadRec, *XkbLogoDoodadPtr; #define XkbLogoDoodadColor(g,d) (&(g)->colors[(d)->color_ndx]) #define XkbLogoDoodadShape(g,d) (&(g)->shapes[(d)->shape_ndx]) #define XkbSetLogoDoodadColor(g,d,c) ((d)->color_ndx= (c)-&(g)->colors[0]) #define XkbSetLogoDoodadShape(g,d,s) ((d)->shape_ndx= (s)-&(g)->shapes[0]) typedef struct _XkbAnyDoodad { Atom name; unsigned char type; unsigned char priority; short top; short left; short angle; } XkbAnyDoodadRec, *XkbAnyDoodadPtr; typedef union _XkbDoodad { XkbAnyDoodadRec any; XkbShapeDoodadRec shape; XkbTextDoodadRec text; XkbIndicatorDoodadRec indicator; XkbLogoDoodadRec logo; } XkbDoodadRec, *XkbDoodadPtr; #define XkbUnknownDoodad 0 #define XkbOutlineDoodad 1 #define XkbSolidDoodad 2 #define XkbTextDoodad 3 #define XkbIndicatorDoodad 4 #define XkbLogoDoodad 5 typedef struct _XkbKey { XkbKeyNameRec name; short gap; unsigned char shape_ndx; unsigned char color_ndx; } XkbKeyRec, *XkbKeyPtr; #define XkbKeyShape(g,k) (&(g)->shapes[(k)->shape_ndx]) #define XkbKeyColor(g,k) (&(g)->colors[(k)->color_ndx]) #define XkbSetKeyShape(g,k,s) ((k)->shape_ndx= (s)-&(g)->shapes[0]) #define XkbSetKeyColor(g,k,c) ((k)->color_ndx= (c)-&(g)->colors[0]) typedef struct _XkbRow { short top; short left; unsigned short num_keys; unsigned short sz_keys; int vertical; XkbKeyPtr keys; XkbBoundsRec bounds; } XkbRowRec, *XkbRowPtr; typedef struct _XkbSection { Atom name; unsigned char priority; short top; short left; unsigned short width; unsigned short height; short angle; unsigned short num_rows; unsigned short num_doodads; unsigned short num_overlays; unsigned short sz_rows; unsigned short sz_doodads; unsigned short sz_overlays; XkbRowPtr rows; XkbDoodadPtr doodads; XkbBoundsRec bounds; struct _XkbOverlay *overlays; } XkbSectionRec, *XkbSectionPtr; typedef struct _XkbOverlayKey { XkbKeyNameRec over; XkbKeyNameRec under; } XkbOverlayKeyRec,*XkbOverlayKeyPtr; typedef struct _XkbOverlayRow { unsigned short row_under; unsigned short num_keys; unsigned short sz_keys; XkbOverlayKeyPtr keys; } XkbOverlayRowRec,*XkbOverlayRowPtr; typedef struct _XkbOverlay { Atom name; XkbSectionPtr section_under; unsigned short num_rows; unsigned short sz_rows; XkbOverlayRowPtr rows; XkbBoundsPtr bounds; } XkbOverlayRec,*XkbOverlayPtr; typedef struct _XkbGeometry { Atom name; unsigned short width_mm; unsigned short height_mm; char * label_font; XkbColorPtr label_color; XkbColorPtr base_color; unsigned short sz_properties; unsigned short sz_colors; unsigned short sz_shapes; unsigned short sz_sections; unsigned short sz_doodads; unsigned short sz_key_aliases; unsigned short num_properties; unsigned short num_colors; unsigned short num_shapes; unsigned short num_sections; unsigned short num_doodads; unsigned short num_key_aliases; XkbPropertyPtr properties; XkbColorPtr colors; XkbShapePtr shapes; XkbSectionPtr sections; XkbDoodadPtr doodads; XkbKeyAliasPtr key_aliases; } XkbGeometryRec; #define XkbGeomColorIndex(g,c) ((int)((c)-&(g)->colors[0])) #define XkbGeomPropertiesMask (1<<0) #define XkbGeomColorsMask (1<<1) #define XkbGeomShapesMask (1<<2) #define XkbGeomSectionsMask (1<<3) #define XkbGeomDoodadsMask (1<<4) #define XkbGeomKeyAliasesMask (1<<5) #define XkbGeomAllMask (0x3f) typedef struct _XkbGeometrySizes { unsigned int which; unsigned short num_properties; unsigned short num_colors; unsigned short num_shapes; unsigned short num_sections; unsigned short num_doodads; unsigned short num_key_aliases; } XkbGeometrySizesRec,*XkbGeometrySizesPtr; _XFUNCPROTOBEGIN extern XkbPropertyPtr XkbAddGeomProperty( XkbGeometryPtr /* geom */, char * /* name */, char * /* value */ ); extern XkbKeyAliasPtr XkbAddGeomKeyAlias( XkbGeometryPtr /* geom */, char * /* alias */, char * /* real */ ); extern XkbColorPtr XkbAddGeomColor( XkbGeometryPtr /* geom */, char * /* spec */, unsigned int /* pixel */ ); extern XkbOutlinePtr XkbAddGeomOutline( XkbShapePtr /* shape */, int /* sz_points */ ); extern XkbShapePtr XkbAddGeomShape( XkbGeometryPtr /* geom */, Atom /* name */, int /* sz_outlines */ ); extern XkbKeyPtr XkbAddGeomKey( XkbRowPtr /* row */ ); extern XkbRowPtr XkbAddGeomRow( XkbSectionPtr /* section */, int /* sz_keys */ ); extern XkbSectionPtr XkbAddGeomSection( XkbGeometryPtr /* geom */, Atom /* name */, int /* sz_rows */, int /* sz_doodads */, int /* sz_overlays */ ); extern XkbOverlayPtr XkbAddGeomOverlay( XkbSectionPtr /* section */, Atom /* name */, int /* sz_rows */ ); extern XkbOverlayRowPtr XkbAddGeomOverlayRow( XkbOverlayPtr /* overlay */, int /* row_under */, int /* sz_keys */ ); extern XkbOverlayKeyPtr XkbAddGeomOverlayKey( XkbOverlayPtr /* overlay */, XkbOverlayRowPtr /* row */, char * /* over */, char * /* under */ ); extern XkbDoodadPtr XkbAddGeomDoodad( XkbGeometryPtr /* geom */, XkbSectionPtr /* section */, Atom /* name */ ); extern void XkbFreeGeomKeyAliases( XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomColors( XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomDoodads( XkbDoodadPtr /* doodads */, int /* nDoodads */, Bool /* freeAll */ ); extern void XkbFreeGeomProperties( XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomOverlayKeys( XkbOverlayRowPtr /* row */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomOverlayRows( XkbOverlayPtr /* overlay */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomOverlays( XkbSectionPtr /* section */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomKeys( XkbRowPtr /* row */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomRows( XkbSectionPtr /* section */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomSections( XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomPoints( XkbOutlinePtr /* outline */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomOutlines( XkbShapePtr /* shape */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeomShapes( XkbGeometryPtr /* geom */, int /* first */, int /* count */, Bool /* freeAll */ ); extern void XkbFreeGeometry( XkbGeometryPtr /* geom */, unsigned int /* which */, Bool /* freeMap */ ); extern Status XkbAllocGeomProps( XkbGeometryPtr /* geom */, int /* nProps */ ); extern Status XkbAllocGeomKeyAliases( XkbGeometryPtr /* geom */, int /* nAliases */ ); extern Status XkbAllocGeomColors( XkbGeometryPtr /* geom */, int /* nColors */ ); extern Status XkbAllocGeomShapes( XkbGeometryPtr /* geom */, int /* nShapes */ ); extern Status XkbAllocGeomSections( XkbGeometryPtr /* geom */, int /* nSections */ ); extern Status XkbAllocGeomOverlays( XkbSectionPtr /* section */, int /* num_needed */ ); extern Status XkbAllocGeomOverlayRows( XkbOverlayPtr /* overlay */, int /* num_needed */ ); extern Status XkbAllocGeomOverlayKeys( XkbOverlayRowPtr /* row */, int /* num_needed */ ); extern Status XkbAllocGeomDoodads( XkbGeometryPtr /* geom */, int /* nDoodads */ ); extern Status XkbAllocGeomSectionDoodads( XkbSectionPtr /* section */, int /* nDoodads */ ); extern Status XkbAllocGeomOutlines( XkbShapePtr /* shape */, int /* nOL */ ); extern Status XkbAllocGeomRows( XkbSectionPtr /* section */, int /* nRows */ ); extern Status XkbAllocGeomPoints( XkbOutlinePtr /* ol */, int /* nPts */ ); extern Status XkbAllocGeomKeys( XkbRowPtr /* row */, int /* nKeys */ ); extern Status XkbAllocGeometry( XkbDescPtr /* xkb */, XkbGeometrySizesPtr /* sizes */ ); extern Status XkbSetGeometry( Display * /* dpy */, unsigned /* deviceSpec */, XkbGeometryPtr /* geom */ ); extern Bool XkbComputeShapeTop( XkbShapePtr /* shape */, XkbBoundsPtr /* bounds */ ); extern Bool XkbComputeShapeBounds( XkbShapePtr /* shape */ ); extern Bool XkbComputeRowBounds( XkbGeometryPtr /* geom */, XkbSectionPtr /* section */, XkbRowPtr /* row */ ); extern Bool XkbComputeSectionBounds( XkbGeometryPtr /* geom */, XkbSectionPtr /* section */ ); extern char * XkbFindOverlayForKey( XkbGeometryPtr /* geom */, XkbSectionPtr /* wanted */, char * /* under */ ); extern Status XkbGetGeometry( Display * /* dpy */, XkbDescPtr /* xkb */ ); extern Status XkbGetNamedGeometry( Display * /* dpy */, XkbDescPtr /* xkb */, Atom /* name */ ); _XFUNCPROTOEND #endif /* _XKBSTR_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/extensions/XKBproto.h ================================================ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Silicon Graphics not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifndef _XKBPROTO_H_ #define _XKBPROTO_H_ #include #include #define Window CARD32 #define Atom CARD32 #define Time CARD32 #define KeyCode CARD8 #define KeySym CARD32 #define XkbPaddedSize(n) ((((unsigned int)(n)+3) >> 2) << 2) typedef struct _xkbUseExtension { CARD8 reqType; CARD8 xkbReqType; /* always X_KBUseExtension */ CARD16 length B16; CARD16 wantedMajor B16; CARD16 wantedMinor B16; } xkbUseExtensionReq; #define sz_xkbUseExtensionReq 8 typedef struct _xkbUseExtensionReply { BYTE type; /* X_Reply */ BOOL supported; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 serverMajor B16; CARD16 serverMinor B16; CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xkbUseExtensionReply; #define sz_xkbUseExtensionReply 32 typedef struct _xkbSelectEvents { CARD8 reqType; CARD8 xkbReqType; /* X_KBSelectEvents */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 affectWhich B16; CARD16 clear B16; CARD16 selectAll B16; CARD16 affectMap B16; CARD16 map B16; } xkbSelectEventsReq; #define sz_xkbSelectEventsReq 16 typedef struct _xkbBell { CARD8 reqType; CARD8 xkbReqType; /* X_KBBell */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 bellClass B16; CARD16 bellID B16; INT8 percent; BOOL forceSound; BOOL eventOnly; CARD8 pad1; INT16 pitch B16; INT16 duration B16; CARD16 pad2 B16; Atom name B32; Window window B32; } xkbBellReq; #define sz_xkbBellReq 28 typedef struct _xkbGetState { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetState */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 pad B16; } xkbGetStateReq; #define sz_xkbGetStateReq 8 typedef struct _xkbGetStateReply { BYTE type; BYTE deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD8 mods; CARD8 baseMods; CARD8 latchedMods; CARD8 lockedMods; CARD8 group; CARD8 lockedGroup; INT16 baseGroup B16; INT16 latchedGroup B16; CARD8 compatState; CARD8 grabMods; CARD8 compatGrabMods; CARD8 lookupMods; CARD8 compatLookupMods; CARD8 pad1; CARD16 ptrBtnState B16; CARD16 pad2 B16; CARD32 pad3 B32; } xkbGetStateReply; #define sz_xkbGetStateReply 32 typedef struct _xkbLatchLockState { CARD8 reqType; CARD8 xkbReqType; /* always X_KBLatchLockState */ CARD16 length B16; CARD16 deviceSpec B16; CARD8 affectModLocks; CARD8 modLocks; BOOL lockGroup; CARD8 groupLock; CARD8 affectModLatches; CARD8 modLatches; CARD8 pad; BOOL latchGroup; INT16 groupLatch B16; } xkbLatchLockStateReq; #define sz_xkbLatchLockStateReq 16 typedef struct _xkbGetControls { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetControls */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 pad B16; } xkbGetControlsReq; #define sz_xkbGetControlsReq 8 typedef struct _xkbGetControlsReply { BYTE type; /* X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD8 mkDfltBtn; CARD8 numGroups; CARD8 groupsWrap; CARD8 internalMods; CARD8 ignoreLockMods; CARD8 internalRealMods; CARD8 ignoreLockRealMods; CARD8 pad1; CARD16 internalVMods B16; CARD16 ignoreLockVMods B16; CARD16 repeatDelay B16; CARD16 repeatInterval B16; CARD16 slowKeysDelay B16; CARD16 debounceDelay B16; CARD16 mkDelay B16; CARD16 mkInterval B16; CARD16 mkTimeToMax B16; CARD16 mkMaxSpeed B16; INT16 mkCurve B16; CARD16 axOptions B16; CARD16 axTimeout B16; CARD16 axtOptsMask B16; CARD16 axtOptsValues B16; CARD16 pad2 B16; CARD32 axtCtrlsMask B32; CARD32 axtCtrlsValues B32; CARD32 enabledCtrls B32; BYTE perKeyRepeat[XkbPerKeyBitArraySize]; } xkbGetControlsReply; #define sz_xkbGetControlsReply 92 typedef struct _xkbSetControls { CARD8 reqType; CARD8 xkbReqType; /* always X_KBSetControls */ CARD16 length B16; CARD16 deviceSpec B16; CARD8 affectInternalMods; CARD8 internalMods; CARD8 affectIgnoreLockMods; CARD8 ignoreLockMods; CARD16 affectInternalVMods B16; CARD16 internalVMods B16; CARD16 affectIgnoreLockVMods B16; CARD16 ignoreLockVMods B16; CARD8 mkDfltBtn; CARD8 groupsWrap; CARD16 axOptions B16; CARD16 pad1 B16; CARD32 affectEnabledCtrls B32; CARD32 enabledCtrls B32; CARD32 changeCtrls B32; CARD16 repeatDelay B16; CARD16 repeatInterval B16; CARD16 slowKeysDelay B16; CARD16 debounceDelay B16; CARD16 mkDelay B16; CARD16 mkInterval B16; CARD16 mkTimeToMax B16; CARD16 mkMaxSpeed B16; INT16 mkCurve B16; CARD16 axTimeout B16; CARD32 axtCtrlsMask B32; CARD32 axtCtrlsValues B32; CARD16 axtOptsMask B16; CARD16 axtOptsValues B16; BYTE perKeyRepeat[XkbPerKeyBitArraySize]; } xkbSetControlsReq; #define sz_xkbSetControlsReq 100 typedef struct _xkbKTMapEntryWireDesc { BOOL active; CARD8 mask; CARD8 level; CARD8 realMods; CARD16 virtualMods B16; CARD16 pad B16; } xkbKTMapEntryWireDesc; #define sz_xkbKTMapEntryWireDesc 8 typedef struct _xkbKTSetMapEntryWireDesc { CARD8 level; CARD8 realMods; CARD16 virtualMods B16; } xkbKTSetMapEntryWireDesc; #define sz_xkbKTSetMapEntryWireDesc 4 typedef struct _xkbModsWireDesc { CARD8 mask; /* GetMap only */ CARD8 realMods; CARD16 virtualMods B16; } xkbModsWireDesc; #define sz_xkbModsWireDesc 4 typedef struct _xkbKeyTypeWireDesc { CARD8 mask; CARD8 realMods; CARD16 virtualMods B16; CARD8 numLevels; CARD8 nMapEntries; BOOL preserve; CARD8 pad; } xkbKeyTypeWireDesc; #define sz_xkbKeyTypeWireDesc 8 typedef struct _xkbSymMapWireDesc { CARD8 ktIndex[XkbNumKbdGroups]; CARD8 groupInfo; CARD8 width; CARD16 nSyms B16; } xkbSymMapWireDesc; #define sz_xkbSymMapWireDesc 8 typedef struct _xkbVModMapWireDesc { KeyCode key; CARD8 pad; CARD16 vmods B16; } xkbVModMapWireDesc; #define sz_xkbVModMapWireDesc 4 typedef struct _xkbBehaviorWireDesc { CARD8 key; CARD8 type; CARD8 data; CARD8 pad; } xkbBehaviorWireDesc; #define sz_xkbBehaviorWireDesc 4 typedef struct _xkbActionWireDesc { CARD8 type; CARD8 data[7]; } xkbActionWireDesc; #define sz_xkbActionWireDesc 8 typedef struct _xkbGetMap { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetMap */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 full B16; CARD16 partial B16; CARD8 firstType; CARD8 nTypes; KeyCode firstKeySym; CARD8 nKeySyms; KeyCode firstKeyAct; CARD8 nKeyActs; KeyCode firstKeyBehavior; CARD8 nKeyBehaviors; CARD16 virtualMods B16; KeyCode firstKeyExplicit; CARD8 nKeyExplicit; KeyCode firstModMapKey; CARD8 nModMapKeys; KeyCode firstVModMapKey; CARD8 nVModMapKeys; CARD16 pad1 B16; } xkbGetMapReq; #define sz_xkbGetMapReq 28 typedef struct _xkbGetMapReply { CARD8 type; /* always X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 pad1 B16; KeyCode minKeyCode; KeyCode maxKeyCode; CARD16 present B16; CARD8 firstType; CARD8 nTypes; CARD8 totalTypes; KeyCode firstKeySym; CARD16 totalSyms B16; CARD8 nKeySyms; KeyCode firstKeyAct; CARD16 totalActs B16; CARD8 nKeyActs; KeyCode firstKeyBehavior; CARD8 nKeyBehaviors; CARD8 totalKeyBehaviors; KeyCode firstKeyExplicit; CARD8 nKeyExplicit; CARD8 totalKeyExplicit; KeyCode firstModMapKey; CARD8 nModMapKeys; CARD8 totalModMapKeys; KeyCode firstVModMapKey; CARD8 nVModMapKeys; CARD8 totalVModMapKeys; CARD8 pad2; CARD16 virtualMods B16; } xkbGetMapReply; #define sz_xkbGetMapReply 40 #define XkbSetMapResizeTypes (1L<<0) #define XkbSetMapRecomputeActions (1L<<1) #define XkbSetMapAllFlags (0x3) typedef struct _xkbSetMap { CARD8 reqType; CARD8 xkbReqType; /* always X_KBSetMap */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 present B16; CARD16 flags B16; KeyCode minKeyCode; KeyCode maxKeyCode; CARD8 firstType; CARD8 nTypes; KeyCode firstKeySym; CARD8 nKeySyms; CARD16 totalSyms B16; KeyCode firstKeyAct; CARD8 nKeyActs; CARD16 totalActs B16; KeyCode firstKeyBehavior; CARD8 nKeyBehaviors; CARD8 totalKeyBehaviors; KeyCode firstKeyExplicit; CARD8 nKeyExplicit; CARD8 totalKeyExplicit; KeyCode firstModMapKey; CARD8 nModMapKeys; CARD8 totalModMapKeys; KeyCode firstVModMapKey; CARD8 nVModMapKeys; CARD8 totalVModMapKeys; CARD16 virtualMods B16; } xkbSetMapReq; #define sz_xkbSetMapReq 36 typedef struct _xkbSymInterpretWireDesc { CARD32 sym B32; CARD8 mods; CARD8 match; CARD8 virtualMod; CARD8 flags; xkbActionWireDesc act; } xkbSymInterpretWireDesc; #define sz_xkbSymInterpretWireDesc 16 typedef struct _xkbGetCompatMap { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetCompatMap */ CARD16 length B16; CARD16 deviceSpec B16; CARD8 groups; BOOL getAllSI; CARD16 firstSI B16; CARD16 nSI B16; } xkbGetCompatMapReq; #define sz_xkbGetCompatMapReq 12 typedef struct _xkbGetCompatMapReply { CARD8 type; /* always X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD8 groups; CARD8 pad1; CARD16 firstSI B16; CARD16 nSI B16; CARD16 nTotalSI B16; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xkbGetCompatMapReply; #define sz_xkbGetCompatMapReply 32 typedef struct _xkbSetCompatMap { CARD8 reqType; CARD8 xkbReqType; /* always X_KBSetCompatMap */ CARD16 length B16; CARD16 deviceSpec B16; CARD8 pad1; BOOL recomputeActions; BOOL truncateSI; CARD8 groups; CARD16 firstSI B16; CARD16 nSI B16; CARD16 pad2 B16; } xkbSetCompatMapReq; #define sz_xkbSetCompatMapReq 16 typedef struct _xkbGetIndicatorState { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetIndicatorState */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 pad1 B16; } xkbGetIndicatorStateReq; #define sz_xkbGetIndicatorStateReq 8 typedef struct _xkbGetIndicatorStateReply { CARD8 type; /* always X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 state B32; CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xkbGetIndicatorStateReply; #define sz_xkbGetIndicatorStateReply 32 typedef struct _xkbGetIndicatorMap { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetIndicatorMap */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 pad B16; CARD32 which B32; } xkbGetIndicatorMapReq; #define sz_xkbGetIndicatorMapReq 12 typedef struct _xkbGetIndicatorMapReply { CARD8 type; /* always X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 which B32; CARD32 realIndicators B32; CARD8 nIndicators; CARD8 pad1; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xkbGetIndicatorMapReply; #define sz_xkbGetIndicatorMapReply 32 typedef struct _xkbIndicatorMapWireDesc { CARD8 flags; CARD8 whichGroups; CARD8 groups; CARD8 whichMods; CARD8 mods; CARD8 realMods; CARD16 virtualMods B16; CARD32 ctrls B32; } xkbIndicatorMapWireDesc; #define sz_xkbIndicatorMapWireDesc 12 typedef struct _xkbSetIndicatorMap { CARD8 reqType; CARD8 xkbReqType; /* always X_KBSetIndicatorMap */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 pad1 B16; CARD32 which B32; } xkbSetIndicatorMapReq; #define sz_xkbSetIndicatorMapReq 12 typedef struct _xkbGetNamedIndicator { CARD8 reqType; CARD8 xkbReqType; /* X_KBGetNamedIndicator */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 ledClass B16; CARD16 ledID B16; CARD16 pad1 B16; Atom indicator B32; } xkbGetNamedIndicatorReq; #define sz_xkbGetNamedIndicatorReq 16 typedef struct _xkbGetNamedIndicatorReply { BYTE type; BYTE deviceID; CARD16 sequenceNumber B16; CARD32 length B32; Atom indicator B32; BOOL found; BOOL on; BOOL realIndicator; CARD8 ndx; CARD8 flags; CARD8 whichGroups; CARD8 groups; CARD8 whichMods; CARD8 mods; CARD8 realMods; CARD16 virtualMods B16; CARD32 ctrls B32; BOOL supported; CARD8 pad1; CARD16 pad2 B16; } xkbGetNamedIndicatorReply; #define sz_xkbGetNamedIndicatorReply 32 typedef struct _xkbSetNamedIndicator { CARD8 reqType; CARD8 xkbReqType; /* X_KBSetNamedIndicator */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 ledClass B16; CARD16 ledID B16; CARD16 pad1 B16; Atom indicator B32; BOOL setState; BOOL on; BOOL setMap; BOOL createMap; CARD8 pad2; CARD8 flags; CARD8 whichGroups; CARD8 groups; CARD8 whichMods; CARD8 realMods; CARD16 virtualMods B16; CARD32 ctrls B32; } xkbSetNamedIndicatorReq; #define sz_xkbSetNamedIndicatorReq 32 typedef struct _xkbGetNames { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetNames */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 pad B16; CARD32 which B32; } xkbGetNamesReq; #define sz_xkbGetNamesReq 12 typedef struct _xkbGetNamesReply { BYTE type; BYTE deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 which B32; KeyCode minKeyCode; KeyCode maxKeyCode; CARD8 nTypes; CARD8 groupNames; CARD16 virtualMods B16; KeyCode firstKey; CARD8 nKeys; CARD32 indicators B32; CARD8 nRadioGroups; CARD8 nKeyAliases; CARD16 nKTLevels B16; CARD32 pad3 B32; } xkbGetNamesReply; #define sz_xkbGetNamesReply 32 typedef struct _xkbSetNames { CARD8 reqType; CARD8 xkbReqType; /* always X_KBSetNames */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 virtualMods B16; CARD32 which B32; CARD8 firstType; CARD8 nTypes; CARD8 firstKTLevel; CARD8 nKTLevels; CARD32 indicators B32; CARD8 groupNames; CARD8 nRadioGroups; KeyCode firstKey; CARD8 nKeys; CARD8 nKeyAliases; CARD8 pad1; CARD16 totalKTLevelNames B16; } xkbSetNamesReq; #define sz_xkbSetNamesReq 28 typedef struct _xkbPointWireDesc { INT16 x B16; INT16 y B16; } xkbPointWireDesc; #define sz_xkbPointWireDesc 4 typedef struct _xkbOutlineWireDesc { CARD8 nPoints; CARD8 cornerRadius; CARD16 pad B16; } xkbOutlineWireDesc; #define sz_xkbOutlineWireDesc 4 typedef struct _xkbShapeWireDesc { Atom name B32; CARD8 nOutlines; CARD8 primaryNdx; CARD8 approxNdx; CARD8 pad; } xkbShapeWireDesc; #define sz_xkbShapeWireDesc 8 typedef struct _xkbSectionWireDesc { Atom name B32; INT16 top B16; INT16 left B16; CARD16 width B16; CARD16 height B16; INT16 angle B16; CARD8 priority; CARD8 nRows; CARD8 nDoodads; CARD8 nOverlays; CARD16 pad B16; } xkbSectionWireDesc; #define sz_xkbSectionWireDesc 20 typedef struct _xkbRowWireDesc { INT16 top B16; INT16 left B16; CARD8 nKeys; BOOL vertical; CARD16 pad B16; } xkbRowWireDesc; #define sz_xkbRowWireDesc 8 typedef struct _xkbKeyWireDesc { CARD8 name[XkbKeyNameLength]; INT16 gap B16; CARD8 shapeNdx; CARD8 colorNdx; } xkbKeyWireDesc; #define sz_xkbKeyWireDesc 8 typedef struct _xkbOverlayWireDesc { Atom name B32; CARD8 nRows; CARD8 pad1; CARD16 pad2 B16; } xkbOverlayWireDesc; #define sz_xkbOverlayWireDesc 8 typedef struct _xkbOverlayRowWireDesc { CARD8 rowUnder; CARD8 nKeys; CARD16 pad1 B16; } xkbOverlayRowWireDesc; #define sz_xkbOverlayRowWireDesc 4 typedef struct _xkbOverlayKeyWireDesc { CARD8 over[XkbKeyNameLength]; CARD8 under[XkbKeyNameLength]; } xkbOverlayKeyWireDesc; #define sz_xkbOverlayKeyWireDesc 8 typedef struct _xkbShapeDoodadWireDesc { Atom name B32; CARD8 type; CARD8 priority; INT16 top B16; INT16 left B16; INT16 angle B16; CARD8 colorNdx; CARD8 shapeNdx; CARD16 pad1 B16; CARD32 pad2 B32; } xkbShapeDoodadWireDesc; #define sz_xkbShapeDoodadWireDesc 20 typedef struct _xkbTextDoodadWireDesc { Atom name B32; CARD8 type; CARD8 priority; INT16 top B16; INT16 left B16; INT16 angle B16; CARD16 width B16; CARD16 height B16; CARD8 colorNdx; CARD8 pad1; CARD16 pad2 B16; } xkbTextDoodadWireDesc; #define sz_xkbTextDoodadWireDesc 20 typedef struct _xkbIndicatorDoodadWireDesc { Atom name B32; CARD8 type; CARD8 priority; INT16 top B16; INT16 left B16; INT16 angle B16; CARD8 shapeNdx; CARD8 onColorNdx; CARD8 offColorNdx; CARD8 pad1; CARD32 pad2 B32; } xkbIndicatorDoodadWireDesc; #define sz_xkbIndicatorDoodadWireDesc 20 typedef struct _xkbLogoDoodadWireDesc { Atom name B32; CARD8 type; CARD8 priority; INT16 top B16; INT16 left B16; INT16 angle B16; CARD8 colorNdx; CARD8 shapeNdx; CARD16 pad1 B16; CARD32 pad2 B32; } xkbLogoDoodadWireDesc; #define sz_xkbLogoDoodadWireDesc 20 typedef struct _xkbAnyDoodadWireDesc { Atom name B32; CARD8 type; CARD8 priority; INT16 top B16; INT16 left B16; INT16 angle B16; CARD32 pad2 B32; CARD32 pad3 B32; } xkbAnyDoodadWireDesc; #define sz_xkbAnyDoodadWireDesc 20 typedef union _xkbDoodadWireDesc { xkbAnyDoodadWireDesc any; xkbShapeDoodadWireDesc shape; xkbTextDoodadWireDesc text; xkbIndicatorDoodadWireDesc indicator; xkbLogoDoodadWireDesc logo; } xkbDoodadWireDesc; #define sz_xkbDoodadWireDesc 20 typedef struct _xkbGetGeometry { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetGeometry */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 pad B16; Atom name B32; } xkbGetGeometryReq; #define sz_xkbGetGeometryReq 12 typedef struct _xkbGetGeometryReply { CARD8 type; /* always X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; Atom name B32; BOOL found; CARD8 pad; CARD16 widthMM B16; CARD16 heightMM B16; CARD16 nProperties B16; CARD16 nColors B16; CARD16 nShapes B16; CARD16 nSections B16; CARD16 nDoodads B16; CARD16 nKeyAliases B16; CARD8 baseColorNdx; CARD8 labelColorNdx; } xkbGetGeometryReply; #define sz_xkbGetGeometryReply 32 typedef struct _xkbSetGeometry { CARD8 reqType; CARD8 xkbReqType; /* always X_KBSetGeometry */ CARD16 length B16; CARD16 deviceSpec B16; CARD8 nShapes; CARD8 nSections; Atom name B32; CARD16 widthMM B16; CARD16 heightMM B16; CARD16 nProperties B16; CARD16 nColors B16; CARD16 nDoodads B16; CARD16 nKeyAliases B16; CARD8 baseColorNdx; CARD8 labelColorNdx; CARD16 pad B16; } xkbSetGeometryReq; #define sz_xkbSetGeometryReq 28 typedef struct _xkbPerClientFlags { CARD8 reqType; CARD8 xkbReqType;/* always X_KBPerClientFlags */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 pad1 B16; CARD32 change B32; CARD32 value B32; CARD32 ctrlsToChange B32; CARD32 autoCtrls B32; CARD32 autoCtrlValues B32; } xkbPerClientFlagsReq; #define sz_xkbPerClientFlagsReq 28 typedef struct _xkbPerClientFlagsReply { CARD8 type; /* always X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 supported B32; CARD32 value B32; CARD32 autoCtrls B32; CARD32 autoCtrlValues B32; CARD32 pad1 B32; CARD32 pad2 B32; } xkbPerClientFlagsReply; #define sz_xkbPerClientFlagsReply 32 typedef struct _xkbListComponents { CARD8 reqType; CARD8 xkbReqType; /* always X_KBListComponents */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 maxNames B16; } xkbListComponentsReq; #define sz_xkbListComponentsReq 8 typedef struct _xkbListComponentsReply { CARD8 type; /* always X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 nKeymaps B16; CARD16 nKeycodes B16; CARD16 nTypes B16; CARD16 nCompatMaps B16; CARD16 nSymbols B16; CARD16 nGeometries B16; CARD16 extra B16; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; } xkbListComponentsReply; #define sz_xkbListComponentsReply 32 typedef struct _xkbGetKbdByName { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetKbdByName */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 need B16; /* combination of XkbGBN_* */ CARD16 want B16; /* combination of XkbGBN_* */ BOOL load; CARD8 pad; } xkbGetKbdByNameReq; #define sz_xkbGetKbdByNameReq 12 typedef struct _xkbGetKbdByNameReply { CARD8 type; /* always X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; KeyCode minKeyCode; KeyCode maxKeyCode; BOOL loaded; BOOL newKeyboard; CARD16 found B16; /* combination of XkbGBN_* */ CARD16 reported B16; /* combination of XkbAllComponents */ CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; } xkbGetKbdByNameReply; #define sz_xkbGetKbdByNameReply 32 typedef struct _xkbDeviceLedsWireDesc { CARD16 ledClass B16; CARD16 ledID B16; CARD32 namesPresent B32; CARD32 mapsPresent B32; CARD32 physIndicators B32; CARD32 state B32; } xkbDeviceLedsWireDesc; #define sz_xkbDeviceLedsWireDesc 20 typedef struct _xkbGetDeviceInfo { CARD8 reqType; CARD8 xkbReqType; /* always X_KBGetDeviceInfo */ CARD16 length B16; CARD16 deviceSpec B16; CARD16 wanted B16; BOOL allBtns; CARD8 firstBtn; CARD8 nBtns; CARD8 pad; CARD16 ledClass B16; CARD16 ledID B16; } xkbGetDeviceInfoReq; #define sz_xkbGetDeviceInfoReq 16 typedef struct _xkbGetDeviceInfoReply { CARD8 type; /* always X_Reply */ CARD8 deviceID; CARD16 sequenceNumber B16; CARD32 length B32; CARD16 present B16; CARD16 supported B16; CARD16 unsupported B16; CARD16 nDeviceLedFBs B16; CARD8 firstBtnWanted; CARD8 nBtnsWanted; CARD8 firstBtnRtrn; CARD8 nBtnsRtrn; CARD8 totalBtns; BOOL hasOwnState; CARD16 dfltKbdFB B16; CARD16 dfltLedFB B16; CARD16 pad B16; Atom devType B32; } xkbGetDeviceInfoReply; #define sz_xkbGetDeviceInfoReply 32 typedef struct _xkbSetDeviceInfo { CARD8 reqType; CARD8 xkbReqType; /* always X_KBSetDeviceInfo */ CARD16 length B16; CARD16 deviceSpec B16; CARD8 firstBtn; CARD8 nBtns; CARD16 change B16; CARD16 nDeviceLedFBs B16; } xkbSetDeviceInfoReq; #define sz_xkbSetDeviceInfoReq 12 typedef struct _xkbSetDebuggingFlags { CARD8 reqType; CARD8 xkbReqType; /* always X_KBSetDebuggingFlags */ CARD16 length B16; CARD16 msgLength B16; CARD16 pad B16; CARD32 affectFlags B32; CARD32 flags B32; CARD32 affectCtrls B32; CARD32 ctrls B32; } xkbSetDebuggingFlagsReq; #define sz_xkbSetDebuggingFlagsReq 24 typedef struct _xkbSetDebuggingFlagsReply { BYTE type; /* X_Reply */ CARD8 pad0; CARD16 sequenceNumber B16; CARD32 length B32; CARD32 currentFlags B32; CARD32 currentCtrls B32; CARD32 supportedFlags B32; CARD32 supportedCtrls B32; CARD32 pad1 B32; CARD32 pad2 B32; } xkbSetDebuggingFlagsReply; #define sz_xkbSetDebuggingFlagsReply 32 /* * X KEYBOARD EXTENSION EVENT STRUCTURES */ typedef struct _xkbAnyEvent { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 pad1; CARD16 pad2 B16; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; CARD32 pad6 B32; CARD32 pad7 B32; } xkbAnyEvent; #define sz_xkbAnyEvent 32 typedef struct _xkbNewKeyboardNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 oldDeviceID; KeyCode minKeyCode; KeyCode maxKeyCode; KeyCode oldMinKeyCode; KeyCode oldMaxKeyCode; CARD8 requestMajor; CARD8 requestMinor; CARD16 changed B16; CARD8 detail; CARD8 pad1; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; } xkbNewKeyboardNotify; #define sz_xkbNewKeyboardNotify 32 typedef struct _xkbMapNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 ptrBtnActions; CARD16 changed B16; KeyCode minKeyCode; KeyCode maxKeyCode; CARD8 firstType; CARD8 nTypes; KeyCode firstKeySym; CARD8 nKeySyms; KeyCode firstKeyAct; CARD8 nKeyActs; KeyCode firstKeyBehavior; CARD8 nKeyBehaviors; KeyCode firstKeyExplicit; CARD8 nKeyExplicit; KeyCode firstModMapKey; CARD8 nModMapKeys; KeyCode firstVModMapKey; CARD8 nVModMapKeys; CARD16 virtualMods B16; CARD16 pad1 B16; } xkbMapNotify; #define sz_xkbMapNotify 32 typedef struct _xkbStateNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 mods; CARD8 baseMods; CARD8 latchedMods; CARD8 lockedMods; CARD8 group; INT16 baseGroup B16; INT16 latchedGroup B16; CARD8 lockedGroup; CARD8 compatState; CARD8 grabMods; CARD8 compatGrabMods; CARD8 lookupMods; CARD8 compatLookupMods; CARD16 ptrBtnState B16; CARD16 changed B16; KeyCode keycode; CARD8 eventType; CARD8 requestMajor; CARD8 requestMinor; } xkbStateNotify; #define sz_xkbStateNotify 32 typedef struct _xkbControlsNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 numGroups; CARD16 pad1 B16; CARD32 changedControls B32; CARD32 enabledControls B32; CARD32 enabledControlChanges B32; KeyCode keycode; CARD8 eventType; CARD8 requestMajor; CARD8 requestMinor; CARD32 pad2 B32; } xkbControlsNotify; #define sz_xkbControlsNotify 32 typedef struct _xkbIndicatorNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 pad1; CARD16 pad2 B16; CARD32 state B32; CARD32 changed B32; CARD32 pad3 B32; CARD32 pad4 B32; CARD32 pad5 B32; } xkbIndicatorNotify; #define sz_xkbIndicatorNotify 32 typedef struct _xkbNamesNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 pad1; CARD16 changed B16; CARD8 firstType; CARD8 nTypes; CARD8 firstLevelName; CARD8 nLevelNames; CARD8 pad2; CARD8 nRadioGroups; CARD8 nAliases; CARD8 changedGroupNames; CARD16 changedVirtualMods B16; CARD8 firstKey; CARD8 nKeys; CARD32 changedIndicators B32; CARD32 pad3 B32; } xkbNamesNotify; #define sz_xkbNamesNotify 32 typedef struct _xkbCompatMapNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 changedGroups; CARD16 firstSI B16; CARD16 nSI B16; CARD16 nTotalSI B16; CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; } xkbCompatMapNotify; #define sz_xkbCompatMapNotify 32 typedef struct _xkbBellNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 bellClass; CARD8 bellID; CARD8 percent; CARD16 pitch B16; CARD16 duration B16; Atom name B32; Window window B32; BOOL eventOnly; CARD8 pad1; CARD16 pad2 B16; CARD32 pad3 B32; } xkbBellNotify; #define sz_xkbBellNotify 32 typedef struct _xkbActionMessage { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; KeyCode keycode; BOOL press; BOOL keyEventFollows; CARD8 mods; CARD8 group; CARD8 message[8]; CARD16 pad1 B16; CARD32 pad2 B32; CARD32 pad3 B32; } xkbActionMessage; #define sz_xkbActionMessage 32 typedef struct _xkbAccessXNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; KeyCode keycode; CARD16 detail B16; CARD16 slowKeysDelay B16; CARD16 debounceDelay B16; CARD32 pad1 B32; CARD32 pad2 B32; CARD32 pad3 B32; CARD32 pad4 B32; } xkbAccessXNotify; #define sz_xkbAccessXNotify 32 typedef struct _xkbExtensionDeviceNotify { BYTE type; BYTE xkbType; CARD16 sequenceNumber B16; Time time B32; CARD8 deviceID; CARD8 pad1; CARD16 reason B16; CARD16 ledClass B16; CARD16 ledID B16; CARD32 ledsDefined B32; CARD32 ledState B32; CARD8 firstBtn; CARD8 nBtns; CARD16 supported B16; CARD16 unsupported B16; CARD16 pad3 B16; } xkbExtensionDeviceNotify; #define sz_xkbExtensionDeviceNotify 32 typedef struct _xkbEvent { union { xkbAnyEvent any; xkbNewKeyboardNotify new_kbd; xkbMapNotify map; xkbStateNotify state; xkbControlsNotify ctrls; xkbIndicatorNotify indicators; xkbNamesNotify names; xkbCompatMapNotify compat; xkbBellNotify bell; xkbActionMessage message; xkbAccessXNotify accessx; xkbExtensionDeviceNotify device; } u; } xkbEvent; #define sz_xkbEvent 32 #undef Window #undef Atom #undef Time #undef KeyCode #undef KeySym #endif /* _XKBPROTO_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/extensions/XKBsrv.h ================================================ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Silicon Graphics not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifndef _XKBSRV_H_ #define _XKBSRV_H_ #ifdef XKB_IN_SERVER #define XkbAllocClientMap SrvXkbAllocClientMap #define XkbAllocServerMap SrvXkbAllocServerMap #define XkbChangeTypesOfKey SrvXkbChangeTypesOfKey #define XkbAddKeyType SrvXkbAddKeyType #define XkbCopyKeyType SrvXkbCopyKeyType #define XkbCopyKeyTypes SrvXkbCopyKeyTypes #define XkbFreeClientMap SrvXkbFreeClientMap #define XkbFreeServerMap SrvXkbFreeServerMap #define XkbInitCanonicalKeyTypes SrvXkbInitCanonicalKeyTypes #define XkbKeyTypesForCoreSymbols SrvXkbKeyTypesForCoreSymbols #define XkbApplyCompatMapToKey SrvXkbApplyCompatMapToKey #define XkbUpdateMapFromCore SrvXkbUpdateMapFromCore #define XkbResizeKeyActions SrvXkbResizeKeyActions #define XkbResizeKeySyms SrvXkbResizeKeySyms #define XkbResizeKeyType SrvXkbResizeKeyType #define XkbAllocCompatMap SrvXkbAllocCompatMap #define XkbAllocControls SrvXkbAllocControls #define XkbAllocIndicatorMaps SrvXkbAllocIndicatorMaps #define XkbAllocKeyboard SrvXkbAllocKeyboard #define XkbAllocNames SrvXkbAllocNames #define XkbFreeCompatMap SrvXkbFreeCompatMap #define XkbFreeControls SrvXkbFreeControls #define XkbFreeIndicatorMaps SrvXkbFreeIndicatorMaps #define XkbFreeKeyboard SrvXkbFreeKeyboard #define XkbFreeNames SrvXkbFreeNames #define XkbAddDeviceLedInfo SrvXkbAddDeviceLedInfo #define XkbAllocDeviceInfo SrvXkbAllocDeviceInfo #define XkbFreeDeviceInfo SrvXkbFreeDeviceInfo #define XkbResizeDeviceButtonActions SrvXkbResizeDeviceButtonActions #define XkbLatchModifiers SrvXkbLatchModifiers #define XkbLatchGroup SrvXkbLatchGroup #define XkbVirtualModsToReal SrvXkbVirtualModsToReal #define XkbChangeKeycodeRange SrvXkbChangeKeycodeRange #define XkbApplyVirtualModChanges SrvXkbApplyVirtualModChanges #define XkbUpdateActionVirtualMods SrvXkbUpdateActionVirtualMods #define XkbUpdateKeyTypeVirtualMods SrvXkbUpdateKeyTypeVirtualMods #endif #include #include #include "inputstr.h" typedef struct _XkbInterest { DeviceIntPtr dev; ClientPtr client; XID resource; struct _XkbInterest * next; CARD16 extDevNotifyMask; CARD16 stateNotifyMask; CARD16 namesNotifyMask; CARD32 ctrlsNotifyMask; CARD8 compatNotifyMask; BOOL bellNotifyMask; BOOL actionMessageMask; CARD16 accessXNotifyMask; CARD32 iStateNotifyMask; CARD32 iMapNotifyMask; CARD16 altSymsNotifyMask; CARD32 autoCtrls; CARD32 autoCtrlValues; } XkbInterestRec,*XkbInterestPtr; typedef struct _XkbRadioGroup { CARD8 flags; CARD8 nMembers; CARD8 dfltDown; CARD8 currentDown; CARD8 members[XkbRGMaxMembers]; } XkbRadioGroupRec, *XkbRadioGroupPtr; typedef struct _XkbEventCause { CARD8 kc; CARD8 event; CARD8 mjr; CARD8 mnr; ClientPtr client; } XkbEventCauseRec,*XkbEventCausePtr; #define XkbSetCauseKey(c,k,e) { (c)->kc= (k),(c)->event= (e),\ (c)->mjr= (c)->mnr= 0; \ (c)->client= NULL; } #define XkbSetCauseReq(c,j,n,cl) { (c)->kc= (c)->event= 0,\ (c)->mjr= (j),(c)->mnr= (n);\ (c)->client= (cl); } #define XkbSetCauseCoreReq(c,e,cl) XkbSetCauseReq(c,e,0,cl) #define XkbSetCauseXkbReq(c,e,cl) XkbSetCauseReq(c,XkbReqCode,e,cl) #define XkbSetCauseUnknown(c) XkbSetCauseKey(c,0,0) #define _OFF_TIMER 0 #define _KRG_WARN_TIMER 1 #define _KRG_TIMER 2 #define _SK_TIMEOUT_TIMER 3 #define _ALL_TIMEOUT_TIMER 4 #define _BEEP_NONE 0 #define _BEEP_FEATURE_ON 1 #define _BEEP_FEATURE_OFF 2 #define _BEEP_FEATURE_CHANGE 3 #define _BEEP_SLOW_WARN 4 #define _BEEP_SLOW_PRESS 5 #define _BEEP_SLOW_ACCEPT 6 #define _BEEP_SLOW_REJECT 7 #define _BEEP_SLOW_RELEASE 8 #define _BEEP_STICKY_LATCH 9 #define _BEEP_STICKY_LOCK 10 #define _BEEP_STICKY_UNLOCK 11 #define _BEEP_LED_ON 12 #define _BEEP_LED_OFF 13 #define _BEEP_LED_CHANGE 14 #define _BEEP_BOUNCE_REJECT 15 typedef struct _XkbSrvInfo { XkbStateRec prev_state; XkbStateRec state; XkbDescPtr desc; DeviceIntPtr device; KbdCtrlProcPtr kbdProc; XkbRadioGroupPtr radioGroups; CARD8 nRadioGroups; CARD8 clearMods; CARD8 setMods; INT16 groupChange; CARD16 dfltPtrDelta; double mouseKeysCurve; double mouseKeysCurveFactor; INT16 mouseKeysDX; INT16 mouseKeysDY; CARD8 mouseKeysFlags; Bool mouseKeysAccel; CARD8 mouseKeysCounter; CARD8 lockedPtrButtons; CARD8 shiftKeyCount; KeyCode mouseKey; KeyCode inactiveKey; KeyCode slowKey; KeyCode repeatKey; CARD8 krgTimerActive; CARD8 beepType; CARD8 beepCount; CARD32 flags; CARD32 lastPtrEventTime; CARD32 lastShiftEventTime; OsTimerPtr beepTimer; OsTimerPtr mouseKeyTimer; OsTimerPtr slowKeysTimer; OsTimerPtr bounceKeysTimer; OsTimerPtr repeatKeyTimer; OsTimerPtr krgTimer; } XkbSrvInfoRec, *XkbSrvInfoPtr; #define XkbSLI_IsDefault (1L<<0) #define XkbSLI_HasOwnState (1L<<1) typedef struct _XkbSrvLedInfo { CARD16 flags; CARD16 class; CARD16 id; union { KbdFeedbackPtr kf; LedFeedbackPtr lf; } fb; CARD32 physIndicators; CARD32 autoState; CARD32 explicitState; CARD32 effectiveState; CARD32 mapsPresent; CARD32 namesPresent; XkbIndicatorMapPtr maps; Atom * names; CARD32 usesBase; CARD32 usesLatched; CARD32 usesLocked; CARD32 usesEffective; CARD32 usesCompat; CARD32 usesControls; CARD32 usedComponents; } XkbSrvLedInfoRec, *XkbSrvLedInfoPtr; /* * Settings for xkbClientFlags field (used by DIX) * These flags _must_ not overlap with XkbPCF_* */ #define _XkbClientInitialized (1<<15) #define _XkbWantsDetectableAutoRepeat(c)\ ((c)->xkbClientFlags&XkbPCF_DetectableAutoRepeatMask) /* * Settings for flags field */ #define _XkbStateNotifyInProgress (1<<0) typedef struct { ProcessInputProc processInputProc; ProcessInputProc realInputProc; DeviceUnwrapProc unwrapProc; } xkbDeviceInfoRec, *xkbDeviceInfoPtr; #define WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \ device->public.processInputProc = proc; \ oldprocs->processInputProc = \ oldprocs->realInputProc = device->public.realInputProc; \ device->public.realInputProc = proc; \ oldprocs->unwrapProc = device->unwrapProc; \ device->unwrapProc = unwrapproc; #define COND_WRAP_PROCESS_INPUT_PROC(device, oldprocs, proc, unwrapproc) \ if (device->public.processInputProc == device->public.realInputProc)\ device->public.processInputProc = proc; \ oldprocs->processInputProc = \ oldprocs->realInputProc = device->public.realInputProc; \ device->public.realInputProc = proc; \ oldprocs->unwrapProc = device->unwrapProc; \ device->unwrapProc = unwrapproc; #define UNWRAP_PROCESS_INPUT_PROC(device, oldprocs) \ device->public.processInputProc = oldprocs->processInputProc; \ device->public.realInputProc = oldprocs->realInputProc; \ device->unwrapProc = oldprocs->unwrapProc; #define XKBDEVICEINFO(dev) ((xkbDeviceInfoPtr) (dev)->devPrivates[xkbDevicePrivateIndex].ptr) /***====================================================================***/ /***====================================================================***/ #define XkbAX_KRGMask (XkbSlowKeysMask|XkbBounceKeysMask) #define XkbAllFilteredEventsMask \ (XkbAccessXKeysMask|XkbRepeatKeysMask|XkbMouseKeysAccelMask|XkbAX_KRGMask) /***====================================================================***/ extern int XkbReqCode; extern int XkbEventBase; extern int XkbKeyboardErrorCode; extern int XkbDisableLockActions; extern char * XkbBaseDirectory; extern char * XkbBinDirectory; extern char * XkbInitialMap; extern int _XkbClientMajor; extern int _XkbClientMinor; extern unsigned int XkbXIUnsupported; extern char * XkbModelUsed,*XkbLayoutUsed,*XkbVariantUsed,*XkbOptionsUsed; extern Bool noXkbExtension; extern Bool XkbWantRulesProp; extern pointer XkbLastRepeatEvent; extern CARD32 xkbDebugFlags; extern CARD32 xkbDebugCtrls; #define _XkbAlloc(s) xalloc((s)) #define _XkbCalloc(n,s) Xcalloc((n)*(s)) #define _XkbRealloc(o,s) Xrealloc((o),(s)) #define _XkbTypedAlloc(t) ((t *)xalloc(sizeof(t))) #define _XkbTypedCalloc(n,t) ((t *)Xcalloc((n)*sizeof(t))) #define _XkbTypedRealloc(o,n,t) \ ((o)?(t *)Xrealloc((o),(n)*sizeof(t)):_XkbTypedCalloc(n,t)) #define _XkbClearElems(a,f,l,t) bzero(&(a)[f],((l)-(f)+1)*sizeof(t)) #define _XkbFree(p) Xfree(p) #define _XkbLibError(c,l,d) \ { _XkbErrCode= (c); _XkbErrLocation= (l); _XkbErrData= (d); } #define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff))) #define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c)) #define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d))) extern int DeviceKeyPress,DeviceKeyRelease; extern int DeviceButtonPress,DeviceButtonRelease; #ifdef XINPUT #define _XkbIsPressEvent(t) (((t)==KeyPress)||((t)==DeviceKeyPress)) #define _XkbIsReleaseEvent(t) (((t)==KeyRelease)||((t)==DeviceKeyRelease)) #else #define _XkbIsPressEvent(t) ((t)==KeyPress) #define _XkbIsReleaseEvent(t) ((t)==KeyRelease) #endif #define _XkbCoreKeycodeInRange(c,k) (((k)>=(c)->curKeySyms.minKeyCode)&&\ ((k)<=(c)->curKeySyms.maxKeyCode)) #define _XkbCoreNumKeys(c) ((c)->curKeySyms.maxKeyCode-\ (c)->curKeySyms.minKeyCode+1) #define XConvertCase(s,l,u) XkbConvertCase(s,l,u) #undef IsKeypadKey #define IsKeypadKey(s) XkbKSIsKeypad(s) typedef int Status; typedef pointer XPointer; typedef struct _XDisplay Display; #ifndef True #define True 1 #define False 0 #endif #ifndef PATH_MAX #ifdef MAXPATHLEN #define PATH_MAX MAXPATHLEN #else #define PATH_MAX 1024 #endif #endif _XFUNCPROTOBEGIN extern void XkbUseMsg( void ); extern int XkbProcessArguments( int /* argc */, char ** /* argv */, int /* i */ ); extern void XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc); extern void XkbFreeCompatMap( XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeMap */ ); extern void XkbFreeNames( XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeMap */ ); extern DeviceIntPtr _XkbLookupAnyDevice( int /* id */, int * /* why_rtrn */ ); extern DeviceIntPtr _XkbLookupKeyboard( int /* id */, int * /* why_rtrn */ ); extern DeviceIntPtr _XkbLookupBellDevice( int /* id */, int * /* why_rtrn */ ); extern DeviceIntPtr _XkbLookupLedDevice( int /* id */, int * /* why_rtrn */ ); extern DeviceIntPtr _XkbLookupButtonDevice( int /* id */, int * /* why_rtrn */ ); extern XkbDescPtr XkbAllocKeyboard( void ); extern Status XkbAllocClientMap( XkbDescPtr /* xkb */, unsigned int /* which */, unsigned int /* nTypes */ ); extern Status XkbAllocServerMap( XkbDescPtr /* xkb */, unsigned int /* which */, unsigned int /* nNewActions */ ); extern void XkbFreeClientMap( XkbDescPtr /* xkb */, unsigned int /* what */, Bool /* freeMap */ ); extern void XkbFreeServerMap( XkbDescPtr /* xkb */, unsigned int /* what */, Bool /* freeMap */ ); extern Status XkbAllocIndicatorMaps( XkbDescPtr /* xkb */ ); extern Status XkbAllocCompatMap( XkbDescPtr /* xkb */, unsigned int /* which */, unsigned int /* nInterpret */ ); extern Status XkbAllocNames( XkbDescPtr /* xkb */, unsigned int /* which */, int /* nTotalRG */, int /* nTotalAliases */ ); extern Status XkbAllocControls( XkbDescPtr /* xkb */, unsigned int /* which*/ ); extern Status XkbCopyKeyType( XkbKeyTypePtr /* from */, XkbKeyTypePtr /* into */ ); extern Status XkbCopyKeyTypes( XkbKeyTypePtr /* from */, XkbKeyTypePtr /* into */, int /* num_types */ ); extern Status XkbResizeKeyType( XkbDescPtr /* xkb */, int /* type_ndx */, int /* map_count */, Bool /* want_preserve */, int /* new_num_lvls */ ); extern void XkbFreeKeyboard( XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeDesc */ ); extern void XkbSetActionKeyMods( XkbDescPtr /* xkb */, XkbAction * /* act */, unsigned int /* mods */ ); extern Bool XkbCheckActionVMods( XkbDescPtr /* xkb */, XkbAction * /* act */, unsigned int /* changed */ ); extern Bool XkbApplyVModChanges( XkbSrvInfoPtr /* xkbi */, unsigned int /* changed */, XkbChangesPtr /* pChanges */, unsigned int * /* needChecksRtrn */, XkbEventCausePtr /* cause */ ); extern void XkbApplyVModChangesToAllDevices( DeviceIntPtr /* dev */, XkbDescPtr /* xkb */, unsigned int /* changed */, XkbEventCausePtr /* cause */ ); extern unsigned int XkbMaskForVMask( XkbDescPtr /* xkb */, unsigned int /* vmask */ ); extern Bool XkbVirtualModsToReal( XkbDescPtr /* xkb */, unsigned int /* virtua_mask */, unsigned int * /* mask_rtrn */ ); extern unsigned int XkbAdjustGroup( int /* group */, XkbControlsPtr /* ctrls */ ); extern KeySym *XkbResizeKeySyms( XkbDescPtr /* xkb */, int /* key */, int /* needed */ ); extern XkbAction *XkbResizeKeyActions( XkbDescPtr /* xkb */, int /* key */, int /* needed */ ); extern void XkbUpdateKeyTypesFromCore( DeviceIntPtr /* pXDev */, KeyCode /* first */, CARD8 /* num */, XkbChangesPtr /* pChanges */ ); extern void XkbUpdateDescActions( XkbDescPtr /* xkb */, KeyCode /* first */, CARD8 /* num */, XkbChangesPtr /* changes */ ); extern void XkbUpdateActions( DeviceIntPtr /* pXDev */, KeyCode /* first */, CARD8 /* num */, XkbChangesPtr /* pChanges */, unsigned int * /* needChecksRtrn */, XkbEventCausePtr /* cause */ ); extern void XkbUpdateCoreDescription( DeviceIntPtr /* keybd */, Bool /* resize */ ); extern void XkbApplyMappingChange( DeviceIntPtr /* pXDev */, CARD8 /* request */, KeyCode /* firstKey */, CARD8 /* num */, ClientPtr /* client */ ); extern void XkbSetIndicators( DeviceIntPtr /* pXDev */, CARD32 /* affect */, CARD32 /* values */, XkbEventCausePtr /* cause */ ); extern void XkbUpdateIndicators( DeviceIntPtr /* keybd */, CARD32 /* changed */, Bool /* check_edevs */, XkbChangesPtr /* pChanges */, XkbEventCausePtr /* cause */ ); extern XkbSrvLedInfoPtr XkbAllocSrvLedInfo( DeviceIntPtr /* dev */, KbdFeedbackPtr /* kf */, LedFeedbackPtr /* lf */, unsigned int /* needed_parts */ ); extern XkbSrvLedInfoPtr XkbFindSrvLedInfo( DeviceIntPtr /* dev */, unsigned int /* class */, unsigned int /* id */, unsigned int /* needed_parts */ ); extern void XkbApplyLedNameChanges( DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* changed_names */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ ); extern void XkbApplyLedMapChanges( DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* changed_maps */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ ); extern void XkbApplyLedStateChanges( DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* changed_leds */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ ); extern void XkbUpdateLedAutoState( DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* maps_to_check */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ ); extern void XkbFlushLedEvents( DeviceIntPtr /* dev */, DeviceIntPtr /* kbd */, XkbSrvLedInfoPtr /* sli */, xkbExtensionDeviceNotify * /* ed */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ ); extern void XkbUpdateAllDeviceIndicators( XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ ); extern unsigned int XkbIndicatorsToUpdate( DeviceIntPtr /* dev */, unsigned long /* state_changes */, Bool /* enabled_ctrl_changes */ ); extern void XkbComputeDerivedState( XkbSrvInfoPtr /* xkbi */ ); extern void XkbCheckSecondaryEffects( XkbSrvInfoPtr /* xkbi */, unsigned int /* which */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ ); extern void XkbCheckIndicatorMaps( DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, unsigned int /* which */ ); extern unsigned int XkbStateChangedFlags( XkbStatePtr /* old */, XkbStatePtr /* new */ ); extern void XkbSendStateNotify( DeviceIntPtr /* kbd */, xkbStateNotify * /* pSN */ ); extern void XkbSendMapNotify( DeviceIntPtr /* kbd */, xkbMapNotify * /* ev */ ); extern int XkbComputeControlsNotify( DeviceIntPtr /* kbd */, XkbControlsPtr /* old */, XkbControlsPtr /* new */, xkbControlsNotify * /* pCN */, Bool /* forceCtrlProc */ ); extern void XkbSendControlsNotify( DeviceIntPtr /* kbd */, xkbControlsNotify * /* ev */ ); extern void XkbSendCompatMapNotify( DeviceIntPtr /* kbd */, xkbCompatMapNotify * /* ev */ ); extern void XkbSendIndicatorNotify( DeviceIntPtr /* kbd */, int /* xkbType */, xkbIndicatorNotify * /* ev */ ); extern void XkbHandleBell( BOOL /* force */, BOOL /* eventOnly */, DeviceIntPtr /* kbd */, CARD8 /* percent */, pointer /* ctrl */, CARD8 /* class */, Atom /* name */, WindowPtr /* pWin */, ClientPtr /* pClient */ ); extern void XkbSendAccessXNotify( DeviceIntPtr /* kbd */, xkbAccessXNotify * /* pEv */ ); extern void XkbSendNamesNotify( DeviceIntPtr /* kbd */, xkbNamesNotify * /* ev */ ); extern void XkbSendCompatNotify( DeviceIntPtr /* kbd */, xkbCompatMapNotify * /* ev */ ); extern void XkbSendActionMessage( DeviceIntPtr /* kbd */, xkbActionMessage * /* ev */ ); extern void XkbSendExtensionDeviceNotify( DeviceIntPtr /* kbd */, ClientPtr /* client */, xkbExtensionDeviceNotify * /* ev */ ); extern void XkbSendNotification( DeviceIntPtr /* kbd */, XkbChangesPtr /* pChanges */, XkbEventCausePtr /* cause */ ); extern void XkbProcessKeyboardEvent( struct _xEvent * /* xE */, DeviceIntPtr /* keybd */, int /* count */ ); extern void XkbProcessOtherEvent( struct _xEvent * /* xE */, DeviceIntPtr /* keybd */, int /* count */ ); extern void XkbHandleActions( DeviceIntPtr /* dev */, DeviceIntPtr /* kbd */, struct _xEvent * /* xE */, int /* count */ ); extern Bool XkbEnableDisableControls( XkbSrvInfoPtr /* xkbi */, unsigned long /* change */, unsigned long /* newValues */, XkbChangesPtr /* changes */, XkbEventCausePtr /* cause */ ); extern void AccessXInit( DeviceIntPtr /* dev */ ); extern Bool AccessXFilterPressEvent( register struct _xEvent * /* xE */, register DeviceIntPtr /* keybd */, int /* count */ ); extern Bool AccessXFilterReleaseEvent( register struct _xEvent * /* xE */, register DeviceIntPtr /* keybd */, int /* count */ ); extern void AccessXCancelRepeatKey( XkbSrvInfoPtr /* xkbi */, KeyCode /* key */ ); extern void AccessXComputeCurveFactor( XkbSrvInfoPtr /* xkbi */, XkbControlsPtr /* ctrls */ ); extern XkbDeviceLedInfoPtr XkbAddDeviceLedInfo( XkbDeviceInfoPtr /* devi */, unsigned int /* ledClass */, unsigned int /* ledId */ ); extern XkbDeviceInfoPtr XkbAllocDeviceInfo( unsigned int /* deviceSpec */, unsigned int /* nButtons */, unsigned int /* szLeds */ ); extern void XkbFreeDeviceInfo( XkbDeviceInfoPtr /* devi */, unsigned int /* which */, Bool /* freeDevI */ ); extern Status XkbResizeDeviceButtonActions( XkbDeviceInfoPtr /* devi */, unsigned int /* newTotal */ ); extern XkbInterestPtr XkbFindClientResource( DevicePtr /* inDev */, ClientPtr /* client */ ); extern XkbInterestPtr XkbAddClientResource( DevicePtr /* inDev */, ClientPtr /* client */, XID /* id */ ); extern int XkbRemoveClient( DevicePtr /* inDev */, ClientPtr /* client */ ); extern int XkbRemoveResourceClient( DevicePtr /* inDev */, XID /* id */ ); extern int XkbDDXInitDevice( DeviceIntPtr /* dev */ ); extern int XkbDDXAccessXBeep( DeviceIntPtr /* dev */, unsigned int /* what */, unsigned int /* which */ ); extern void XkbDDXKeyClick( DeviceIntPtr /* dev */, int /* keycode */, int /* synthetic */ ); extern int XkbDDXUsesSoftRepeat( DeviceIntPtr /* dev */ ); extern void XkbDDXKeybdCtrlProc( DeviceIntPtr /* dev */, KeybdCtrl * /* ctrl */ ); extern void XkbDDXChangeControls( DeviceIntPtr /* dev */, XkbControlsPtr /* old */, XkbControlsPtr /* new */ ); extern void XkbDDXUpdateIndicators( DeviceIntPtr /* keybd */, CARD32 /* newState */ ); extern void XkbDDXUpdateDeviceIndicators( DeviceIntPtr /* dev */, XkbSrvLedInfoPtr /* sli */, CARD32 /* newState */ ); extern void XkbDDXFakePointerButton( int /* event */, int /* button */ ); extern void XkbDDXFakePointerMotion( unsigned int /* flags */, int /* x */, int /* y */ ); extern void XkbDDXFakeDeviceButton( DeviceIntPtr /* dev */, Bool /* press */, int /* button */ ); extern int XkbDDXTerminateServer( DeviceIntPtr /* dev */, KeyCode /* key */, XkbAction * /* act */ ); extern int XkbDDXSwitchScreen( DeviceIntPtr /* dev */, KeyCode /* key */, XkbAction * /* act */ ); extern int XkbDDXPrivate( DeviceIntPtr /* dev */, KeyCode /* key */, XkbAction * /* act */ ); extern void XkbDisableComputedAutoRepeats( DeviceIntPtr /* pXDev */, unsigned int /* key */ ); extern void XkbSetRepeatKeys( DeviceIntPtr /* pXDev */, int /* key */, int /* onoff */ ); extern int XkbLatchModifiers( DeviceIntPtr /* pXDev */, CARD8 /* mask */, CARD8 /* latches */ ); extern int XkbLatchGroup( DeviceIntPtr /* pXDev */, int /* group */ ); extern void XkbClearAllLatchesAndLocks( DeviceIntPtr /* dev */, XkbSrvInfoPtr /* xkbi */, Bool /* genEv */, XkbEventCausePtr /* cause */ ); extern void XkbSetRulesDflts( char * /* rulesFile */, char * /* model */, char * /* layout */, char * /* variant */, char * /* options */ ); extern void XkbInitDevice( DeviceIntPtr /* pXDev */ ); extern Bool XkbInitKeyboardDeviceStruct( DeviceIntPtr /* pXDev */, XkbComponentNamesPtr /* pNames */, KeySymsPtr /* pSyms */, CARD8 /* pMods */[], BellProcPtr /* bellProc */, KbdCtrlProcPtr /* ctrlProc */ ); extern int SProcXkbDispatch( ClientPtr /* client */ ); extern XkbGeometryPtr XkbLookupNamedGeometry( DeviceIntPtr /* dev */, Atom /* name */, Bool * /* shouldFree */ ); extern char * _XkbDupString( char * /* str */ ); extern void XkbConvertCase( KeySym /* sym */, KeySym * /* lower */, KeySym * /* upper */ ); extern Status XkbChangeKeycodeRange( XkbDescPtr /* xkb */, int /* minKC */, int /* maxKC */, XkbChangesPtr /* changes */ ); extern int XkbFinishDeviceInit( DeviceIntPtr /* pXDev */ ); extern void XkbFreeSrvLedInfo( XkbSrvLedInfoPtr /* sli */ ); extern void XkbFreeInfo( XkbSrvInfoPtr /* xkbi */ ); extern Status XkbChangeTypesOfKey( XkbDescPtr /* xkb */, int /* key */, int /* nGroups */, unsigned int /* groups */, int * /* newTypesIn */, XkbMapChangesPtr /* changes */ ); extern XkbKeyTypePtr XkbAddKeyType( XkbDescPtr /* xkb */, Atom /* name */, int /* map_count */, Bool /* want_preserve */, int /* num_lvls */ ); extern Status XkbInitCanonicalKeyTypes( XkbDescPtr /* xkb */, unsigned int /* which */, int /* keypadVMod */ ); extern int XkbKeyTypesForCoreSymbols( XkbDescPtr /* xkb */, int /* map_width */, KeySym * /* core_syms */, unsigned int /* protected */, int * /* types_inout */, KeySym * /* xkb_syms_rtrn */ ); extern Bool XkbApplyCompatMapToKey( XkbDescPtr /* xkb */, KeyCode /* key */, XkbChangesPtr /* changes */ ); extern Bool XkbUpdateMapFromCore( XkbDescPtr /* xkb */, KeyCode /* first_key */, int /* num_keys */, int /* map_width */, KeySym * /* core_keysyms */, XkbChangesPtr /* changes */ ); extern void XkbFreeControls( XkbDescPtr /* xkb */, unsigned int /* which */, Bool /* freeMap */ ); extern void XkbFreeIndicatorMaps( XkbDescPtr /* xkb */ ); extern Bool XkbApplyVirtualModChanges( XkbDescPtr /* xkb */, unsigned int /* changed */, XkbChangesPtr /* changes */ ); extern Bool XkbUpdateActionVirtualMods( XkbDescPtr /* xkb */, XkbAction * /* act */, unsigned int /* changed */ ); extern void XkbUpdateKeyTypeVirtualMods( XkbDescPtr /* xkb */, XkbKeyTypePtr /* type */, unsigned int /* changed */, XkbChangesPtr /* changes */ ); extern void XkbSendNewKeyboardNotify( DeviceIntPtr /* kbd */, xkbNewKeyboardNotify * /* pNKN */ ); #ifdef XKBSRV_NEED_FILE_FUNCS #include #include #include #define _XkbListKeymaps 0 #define _XkbListKeycodes 1 #define _XkbListTypes 2 #define _XkbListCompat 3 #define _XkbListSymbols 4 #define _XkbListGeometry 5 #define _XkbListNumComponents 6 typedef struct _XkbSrvListInfo { int szPool; int nPool; char * pool; int maxRtrn; int nTotal; char * pattern[_XkbListNumComponents]; int nFound[_XkbListNumComponents]; } XkbSrvListInfoRec,*XkbSrvListInfoPtr; char * XkbGetRulesDflts( XkbRF_VarDefsPtr /* defs */ ); extern void XkbSetRulesUsed( XkbRF_VarDefsPtr /* defs */ ); extern Status XkbDDXList( DeviceIntPtr /* dev */, XkbSrvListInfoPtr /* listing */, ClientPtr /* client */ ); extern unsigned int XkbDDXLoadKeymapByNames( DeviceIntPtr /* keybd */, XkbComponentNamesPtr /* names */, unsigned int /* want */, unsigned int /* need */, XkbFileInfoPtr /* finfoRtrn */, char * /* keymapNameRtrn */, int /* keymapNameRtrnLen */ ); extern Bool XkbDDXNamesFromRules( DeviceIntPtr /* keybd */, char * /* rules */, XkbRF_VarDefsPtr /* defs */, XkbComponentNamesPtr /* names */ ); extern FILE *XkbDDXOpenConfigFile( char * /* mapName */, char * /* fileNameRtrn */, int /* fileNameRtrnLen */ ); extern Bool XkbDDXApplyConfig( XPointer /* cfg_in */, XkbSrvInfoPtr /* xkbi */ ); extern XPointer XkbDDXPreloadConfig( char ** /* rulesFileRtrn */, XkbRF_VarDefsPtr /* defs */, XkbComponentNamesPtr /* names */, DeviceIntPtr /* dev */ ); extern int _XkbStrCaseCmp( char * /* str1 */, char * /* str2 */ ); #endif /* XKBSRV_NEED_FILE_FUNCS */ _XFUNCPROTOEND #define XkbAtomGetString(d,s) NameForAtom(s) #endif /* _XKBSRV_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/extensions/XKBstr.h ================================================ /************************************************************ Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Silicon Graphics not be used in advertising or publicity pertaining to distribution of the software without specific prior written permission. Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ #ifndef _XKBSTR_H_ #define _XKBSTR_H_ #include #define XkbCharToInt(v) ((v)&0x80?(int)((v)|(~0xff)):(int)((v)&0x7f)) #define XkbIntTo2Chars(i,h,l) (((h)=((i>>8)&0xff)),((l)=((i)&0xff))) #if defined(WORD64) && defined(UNSIGNEDBITFIELDS) #define Xkb2CharsToInt(h,l) ((h)&0x80?(int)(((h)<<8)|(l)|(~0xffff)):\ (int)(((h)<<8)|(l)&0x7fff)) #else #define Xkb2CharsToInt(h,l) ((short)(((h)<<8)|(l))) #endif /* * Common data structures and access macros */ typedef struct _XkbStateRec { unsigned char group; unsigned char locked_group; unsigned short base_group; unsigned short latched_group; unsigned char mods; unsigned char base_mods; unsigned char latched_mods; unsigned char locked_mods; unsigned char compat_state; unsigned char grab_mods; unsigned char compat_grab_mods; unsigned char lookup_mods; unsigned char compat_lookup_mods; unsigned short ptr_buttons; } XkbStateRec,*XkbStatePtr; #define XkbModLocks(s) ((s)->locked_mods) #define XkbStateMods(s) ((s)->base_mods|(s)->latched_mods|XkbModLocks(s)) #define XkbGroupLock(s) ((s)->locked_group) #define XkbStateGroup(s) ((s)->base_group+(s)->latched_group+XkbGroupLock(s)) #define XkbStateFieldFromRec(s) XkbBuildCoreState((s)->lookup_mods,(s)->group) #define XkbGrabStateFromRec(s) XkbBuildCoreState((s)->grab_mods,(s)->group) typedef struct _XkbMods { unsigned char mask; /* effective mods */ unsigned char real_mods; unsigned short vmods; } XkbModsRec,*XkbModsPtr; typedef struct _XkbKTMapEntry { Bool active; unsigned char level; XkbModsRec mods; } XkbKTMapEntryRec,*XkbKTMapEntryPtr; typedef struct _XkbKeyType { XkbModsRec mods; unsigned char num_levels; unsigned char map_count; XkbKTMapEntryPtr map; XkbModsPtr preserve; Atom name; Atom * level_names; } XkbKeyTypeRec, *XkbKeyTypePtr; #define XkbNumGroups(g) ((g)&0x0f) #define XkbOutOfRangeGroupInfo(g) ((g)&0xf0) #define XkbOutOfRangeGroupAction(g) ((g)&0xc0) #define XkbOutOfRangeGroupNumber(g) (((g)&0x30)>>4) #define XkbSetGroupInfo(g,w,n) (((w)&0xc0)|(((n)&3)<<4)|((g)&0x0f)) #define XkbSetNumGroups(g,n) (((g)&0xf0)|((n)&0x0f)) /* * Structures and access macros used primarily by the server */ typedef struct _XkbBehavior { unsigned char type; unsigned char data; } XkbBehavior; #define XkbAnyActionDataSize 7 typedef struct _XkbAnyAction { unsigned char type; unsigned char data[XkbAnyActionDataSize]; } XkbAnyAction; typedef struct _XkbModAction { unsigned char type; unsigned char flags; unsigned char mask; unsigned char real_mods; unsigned char vmods1; unsigned char vmods2; } XkbModAction; #define XkbModActionVMods(a) \ ((short)(((a)->vmods1<<8)|((a)->vmods2))) #define XkbSetModActionVMods(a,v) \ (((a)->vmods1=(((v)>>8)&0xff)),(a)->vmods2=((v)&0xff)) typedef struct _XkbGroupAction { unsigned char type; unsigned char flags; char group_XXX; } XkbGroupAction; #define XkbSAGroup(a) (XkbCharToInt((a)->group_XXX)) #define XkbSASetGroup(a,g) ((a)->group_XXX=(g)) typedef struct _XkbISOAction { unsigned char type; unsigned char flags; unsigned char mask; unsigned char real_mods; char group_XXX; unsigned char affect; unsigned char vmods1; unsigned char vmods2; } XkbISOAction; typedef struct _XkbPtrAction { unsigned char type; unsigned char flags; unsigned char high_XXX; unsigned char low_XXX; unsigned char high_YYY; unsigned char low_YYY; } XkbPtrAction; #define XkbPtrActionX(a) (Xkb2CharsToInt((a)->high_XXX,(a)->low_XXX)) #define XkbPtrActionY(a) (Xkb2CharsToInt((a)->high_YYY,(a)->low_YYY)) #define XkbSetPtrActionX(a,x) (XkbIntTo2Chars(x,(a)->high_XXX,(a)->low_XXX)) #define XkbSetPtrActionY(a,y) (XkbIntTo2Chars(y,(a)->high_YYY,(a)->low_YYY)) typedef struct _XkbPtrBtnAction { unsigned char type; unsigned char flags; unsigned char count; unsigned char button; } XkbPtrBtnAction; typedef struct _XkbPtrDfltAction { unsigned char type; unsigned char flags; unsigned char affect; char valueXXX; } XkbPtrDfltAction; #define XkbSAPtrDfltValue(a) (XkbCharToInt((a)->valueXXX)) #define XkbSASetPtrDfltValue(a,c) ((a)->valueXXX= ((c)&0xff)) typedef struct _XkbSwitchScreenAction { unsigned char type; unsigned char flags; char screenXXX; } XkbSwitchScreenAction; #define XkbSAScreen(a) (XkbCharToInt((a)->screenXXX)) #define XkbSASetScreen(a,s) ((a)->screenXXX= ((s)&0xff)) typedef struct _XkbCtrlsAction { unsigned char type; unsigned char flags; unsigned char ctrls3; unsigned char ctrls2; unsigned char ctrls1; unsigned char ctrls0; } XkbCtrlsAction; #define XkbActionSetCtrls(a,c) (((a)->ctrls3=(((c)>>24)&0xff)),\ ((a)->ctrls2=(((c)>>16)&0xff)),\ ((a)->ctrls1=(((c)>>8)&0xff)),\ ((a)->ctrls0=((c)&0xff))) #define XkbActionCtrls(a) ((((unsigned int)(a)->ctrls3)<<24)|\ (((unsigned int)(a)->ctrls2)<<16)|\ (((unsigned int)(a)->ctrls1)<<8)|\ ((unsigned int)((a)->ctrls0))) typedef struct _XkbMessageAction { unsigned char type; unsigned char flags; unsigned char message[6]; } XkbMessageAction; typedef struct _XkbRedirectKeyAction { unsigned char type; unsigned char new_key; unsigned char mods_mask; unsigned char mods; unsigned char vmods_mask0; unsigned char vmods_mask1; unsigned char vmods0; unsigned char vmods1; } XkbRedirectKeyAction; #define XkbSARedirectVMods(a) ((((unsigned int)(a)->vmods1)<<8)|\ ((unsigned int)(a)->vmods0)) #define XkbSARedirectSetVMods(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\ ((a)->vmods_mask0=((m)&0xff))) #define XkbSARedirectVModsMask(a) ((((unsigned int)(a)->vmods_mask1)<<8)|\ ((unsigned int)(a)->vmods_mask0)) #define XkbSARedirectSetVModsMask(a,m) (((a)->vmods_mask1=(((m)>>8)&0xff)),\ ((a)->vmods_mask0=((m)&0xff))) typedef struct _XkbDeviceBtnAction { unsigned char type; unsigned char flags; unsigned char count; unsigned char button; unsigned char device; } XkbDeviceBtnAction; typedef struct _XkbDeviceValuatorAction { unsigned char type; unsigned char device; unsigned char v1_what; unsigned char v1_ndx; unsigned char v1_value; unsigned char v2_what; unsigned char v2_ndx; unsigned char v2_value; } XkbDeviceValuatorAction; typedef union _XkbAction { XkbAnyAction any; XkbModAction mods; XkbGroupAction group; XkbISOAction iso; XkbPtrAction ptr; XkbPtrBtnAction btn; XkbPtrDfltAction dflt; XkbSwitchScreenAction screen; XkbCtrlsAction ctrls; XkbMessageAction msg; XkbRedirectKeyAction redirect; XkbDeviceBtnAction devbtn; XkbDeviceValuatorAction devval; unsigned char type; } XkbAction; typedef struct _XkbControls { unsigned char mk_dflt_btn; unsigned char num_groups; unsigned char groups_wrap; XkbModsRec internal; XkbModsRec ignore_lock; unsigned int enabled_ctrls; unsigned short repeat_delay; unsigned short repeat_interval; unsigned short slow_keys_delay; unsigned short debounce_delay; unsigned short mk_delay; unsigned short mk_interval; unsigned short mk_time_to_max; unsigned short mk_max_speed; short mk_curve; unsigned short ax_options; unsigned short ax_timeout; unsigned short axt_opts_mask; unsigned short axt_opts_values; unsigned int axt_ctrls_mask; unsigned int axt_ctrls_values; unsigned char per_key_repeat[XkbPerKeyBitArraySize]; } XkbControlsRec, *XkbControlsPtr; #define XkbAX_AnyFeedback(c) ((c)->enabled_ctrls&XkbAccessXFeedbackMask) #define XkbAX_NeedOption(c,w) ((c)->ax_options&(w)) #define XkbAX_NeedFeedback(c,w) (XkbAX_AnyFeedback(c)&&XkbAX_NeedOption(c,w)) typedef struct _XkbServerMapRec { unsigned short num_acts; unsigned short size_acts; XkbAction *acts; XkbBehavior *behaviors; unsigned short *key_acts; #if defined(__cplusplus) || defined(c_plusplus) /* explicit is a C++ reserved word */ unsigned char *c_explicit; #else unsigned char *explicit; #endif unsigned char vmods[XkbNumVirtualMods]; unsigned short *vmodmap; } XkbServerMapRec, *XkbServerMapPtr; #define XkbSMKeyActionsPtr(m,k) (&(m)->acts[(m)->key_acts[k]]) /* * Structures and access macros used primarily by clients */ typedef struct _XkbSymMapRec { unsigned char kt_index[XkbNumKbdGroups]; unsigned char group_info; unsigned char width; unsigned short offset; } XkbSymMapRec, *XkbSymMapPtr; typedef struct _XkbClientMapRec { unsigned char size_types; unsigned char num_types; XkbKeyTypePtr types; unsigned short size_syms; unsigned short num_syms; KeySym *syms; XkbSymMapPtr key_sym_map; unsigned char *modmap; } XkbClientMapRec, *XkbClientMapPtr; #define XkbCMKeyGroupInfo(m,k) ((m)->key_sym_map[k].group_info) #define XkbCMKeyNumGroups(m,k) (XkbNumGroups((m)->key_sym_map[k].group_info)) #define XkbCMKeyGroupWidth(m,k,g) (XkbCMKeyType(m,k,g)->num_levels) #define XkbCMKeyGroupsWidth(m,k) ((m)->key_sym_map[k].width) #define XkbCMKeyTypeIndex(m,k,g) ((m)->key_sym_map[k].kt_index[g&0x3]) #define XkbCMKeyType(m,k,g) (&(m)->types[XkbCMKeyTypeIndex(m,k,g)]) #define XkbCMKeyNumSyms(m,k) (XkbCMKeyGroupsWidth(m,k)*XkbCMKeyNumGroups(m,k)) #define XkbCMKeySymsOffset(m,k) ((m)->key_sym_map[k].offset) #define XkbCMKeySymsPtr(m,k) (&(m)->syms[XkbCMKeySymsOffset(m,k)]) /* * Compatibility structures and access macros */ typedef struct _XkbSymInterpretRec { KeySym sym; unsigned char flags; unsigned char match; unsigned char mods; unsigned char virtual_mod; XkbAnyAction act; } XkbSymInterpretRec,*XkbSymInterpretPtr; typedef struct _XkbCompatMapRec { XkbSymInterpretPtr sym_interpret; XkbModsRec groups[XkbNumKbdGroups]; unsigned short num_si; unsigned short size_si; } XkbCompatMapRec, *XkbCompatMapPtr; typedef struct _XkbIndicatorMapRec { unsigned char flags; unsigned char which_groups; unsigned char groups; unsigned char which_mods; XkbModsRec mods; unsigned int ctrls; } XkbIndicatorMapRec, *XkbIndicatorMapPtr; #define XkbIM_IsAuto(i) ((((i)->flags&XkbIM_NoAutomatic)==0)&&\ (((i)->which_groups&&(i)->groups)||\ ((i)->which_mods&&(i)->mods.mask)||\ ((i)->ctrls))) #define XkbIM_InUse(i) (((i)->flags)||((i)->which_groups)||\ ((i)->which_mods)||((i)->ctrls)) typedef struct _XkbIndicatorRec { unsigned long phys_indicators; XkbIndicatorMapRec maps[XkbNumIndicators]; } XkbIndicatorRec,*XkbIndicatorPtr; typedef struct _XkbKeyNameRec { char name[XkbKeyNameLength]; } XkbKeyNameRec,*XkbKeyNamePtr; typedef struct _XkbKeyAliasRec { char real[XkbKeyNameLength]; char alias[XkbKeyNameLength]; } XkbKeyAliasRec,*XkbKeyAliasPtr; /* * Names for everything */ typedef struct _XkbNamesRec { Atom keycodes; Atom geometry; Atom symbols; Atom types; Atom compat; Atom vmods[XkbNumVirtualMods]; Atom indicators[XkbNumIndicators]; Atom groups[XkbNumKbdGroups]; XkbKeyNamePtr keys; XkbKeyAliasPtr key_aliases; Atom *radio_groups; Atom phys_symbols; unsigned char num_keys; unsigned char num_key_aliases; unsigned short num_rg; } XkbNamesRec,*XkbNamesPtr; typedef struct _XkbGeometry *XkbGeometryPtr; /* * Tie it all together into one big keyboard description */ typedef struct _XkbDesc { struct _XDisplay * dpy; unsigned short flags; unsigned short device_spec; KeyCode min_key_code; KeyCode max_key_code; XkbControlsPtr ctrls; XkbServerMapPtr server; XkbClientMapPtr map; XkbIndicatorPtr indicators; XkbNamesPtr names; XkbCompatMapPtr compat; XkbGeometryPtr geom; } XkbDescRec, *XkbDescPtr; #define XkbKeyKeyTypeIndex(d,k,g) (XkbCMKeyTypeIndex((d)->map,k,g)) #define XkbKeyKeyType(d,k,g) (XkbCMKeyType((d)->map,k,g)) #define XkbKeyGroupWidth(d,k,g) (XkbCMKeyGroupWidth((d)->map,k,g)) #define XkbKeyGroupsWidth(d,k) (XkbCMKeyGroupsWidth((d)->map,k)) #define XkbKeyGroupInfo(d,k) (XkbCMKeyGroupInfo((d)->map,(k))) #define XkbKeyNumGroups(d,k) (XkbCMKeyNumGroups((d)->map,(k))) #define XkbKeyNumSyms(d,k) (XkbCMKeyNumSyms((d)->map,(k))) #define XkbKeySymsPtr(d,k) (XkbCMKeySymsPtr((d)->map,(k))) #define XkbKeySym(d,k,n) (XkbKeySymsPtr(d,k)[n]) #define XkbKeySymEntry(d,k,sl,g) \ (XkbKeySym(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl)))) #define XkbKeyAction(d,k,n) \ (XkbKeyHasActions(d,k)?&XkbKeyActionsPtr(d,k)[n]:NULL) #define XkbKeyActionEntry(d,k,sl,g) \ (XkbKeyHasActions(d,k)?\ XkbKeyAction(d,k,((XkbKeyGroupsWidth(d,k)*(g))+(sl))):NULL) #define XkbKeyHasActions(d,k) ((d)->server->key_acts[k]!=0) #define XkbKeyNumActions(d,k) (XkbKeyHasActions(d,k)?XkbKeyNumSyms(d,k):1) #define XkbKeyActionsPtr(d,k) (XkbSMKeyActionsPtr((d)->server,k)) #define XkbKeycodeInRange(d,k) (((k)>=(d)->min_key_code)&&\ ((k)<=(d)->max_key_code)) #define XkbNumKeys(d) ((d)->max_key_code-(d)->min_key_code+1) /* * The following structures can be used to track changes * to a keyboard device */ typedef struct _XkbMapChanges { unsigned short changed; KeyCode min_key_code; KeyCode max_key_code; unsigned char first_type; unsigned char num_types; KeyCode first_key_sym; unsigned char num_key_syms; KeyCode first_key_act; unsigned char num_key_acts; KeyCode first_key_behavior; unsigned char num_key_behaviors; KeyCode first_key_explicit; unsigned char num_key_explicit; KeyCode first_modmap_key; unsigned char num_modmap_keys; KeyCode first_vmodmap_key; unsigned char num_vmodmap_keys; unsigned char pad; unsigned short vmods; } XkbMapChangesRec,*XkbMapChangesPtr; typedef struct _XkbControlsChanges { unsigned int changed_ctrls; unsigned int enabled_ctrls_changes; Bool num_groups_changed; } XkbControlsChangesRec,*XkbControlsChangesPtr; typedef struct _XkbIndicatorChanges { unsigned int state_changes; unsigned int map_changes; } XkbIndicatorChangesRec,*XkbIndicatorChangesPtr; typedef struct _XkbNameChanges { unsigned int changed; unsigned char first_type; unsigned char num_types; unsigned char first_lvl; unsigned char num_lvls; unsigned char num_aliases; unsigned char num_rg; unsigned char first_key; unsigned char num_keys; unsigned short changed_vmods; unsigned long changed_indicators; unsigned char changed_groups; } XkbNameChangesRec,*XkbNameChangesPtr; typedef struct _XkbCompatChanges { unsigned char changed_groups; unsigned short first_si; unsigned short num_si; } XkbCompatChangesRec,*XkbCompatChangesPtr; typedef struct _XkbChanges { unsigned short device_spec; unsigned short state_changes; XkbMapChangesRec map; XkbControlsChangesRec ctrls; XkbIndicatorChangesRec indicators; XkbNameChangesRec names; XkbCompatChangesRec compat; } XkbChangesRec, *XkbChangesPtr; /* * These data structures are used to construct a keymap from * a set of components or to list components in the server * database. */ typedef struct _XkbComponentNames { char * keymap; char * keycodes; char * types; char * compat; char * symbols; char * geometry; } XkbComponentNamesRec, *XkbComponentNamesPtr; typedef struct _XkbComponentName { unsigned short flags; char * name; } XkbComponentNameRec,*XkbComponentNamePtr; typedef struct _XkbComponentList { int num_keymaps; int num_keycodes; int num_types; int num_compat; int num_symbols; int num_geometry; XkbComponentNamePtr keymaps; XkbComponentNamePtr keycodes; XkbComponentNamePtr types; XkbComponentNamePtr compat; XkbComponentNamePtr symbols; XkbComponentNamePtr geometry; } XkbComponentListRec, *XkbComponentListPtr; /* * The following data structures describe and track changes to a * non-keyboard extension device */ typedef struct _XkbDeviceLedInfo { unsigned short led_class; unsigned short led_id; unsigned int phys_indicators; unsigned int maps_present; unsigned int names_present; unsigned int state; Atom names[XkbNumIndicators]; XkbIndicatorMapRec maps[XkbNumIndicators]; } XkbDeviceLedInfoRec,*XkbDeviceLedInfoPtr; typedef struct _XkbDeviceInfo { char * name; Atom type; unsigned short device_spec; Bool has_own_state; unsigned short supported; unsigned short unsupported; unsigned short num_btns; XkbAction * btn_acts; unsigned short sz_leds; unsigned short num_leds; unsigned short dflt_kbd_fb; unsigned short dflt_led_fb; XkbDeviceLedInfoPtr leds; } XkbDeviceInfoRec,*XkbDeviceInfoPtr; #define XkbXI_DevHasBtnActs(d) (((d)->num_btns>0)&&((d)->btn_acts!=NULL)) #define XkbXI_LegalDevBtn(d,b) (XkbXI_DevHasBtnActs(d)&&((b)<(d)->num_btns)) #define XkbXI_DevHasLeds(d) (((d)->num_leds>0)&&((d)->leds!=NULL)) typedef struct _XkbDeviceLedChanges { unsigned short led_class; unsigned short led_id; unsigned int defined; /* names or maps changed */ struct _XkbDeviceLedChanges *next; } XkbDeviceLedChangesRec,*XkbDeviceLedChangesPtr; typedef struct _XkbDeviceChanges { unsigned int changed; unsigned short first_btn; unsigned short num_btns; XkbDeviceLedChangesRec leds; } XkbDeviceChangesRec,*XkbDeviceChangesPtr; #endif /* _XKBSTR_H_ */ ================================================ FILE: Libraries/Core/RPi/Headers/X11/keysym.h ================================================ /*********************************************************** Copyright 1987, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* default keysyms */ #define XK_MISCELLANY #define XK_XKB_KEYS #define XK_LATIN1 #define XK_LATIN2 #define XK_LATIN3 #define XK_LATIN4 #define XK_LATIN8 #define XK_LATIN9 #define XK_CAUCASUS #define XK_GREEK #define XK_KATAKANA #define XK_ARABIC #define XK_CYRILLIC #define XK_HEBREW #define XK_THAI #define XK_KOREAN #define XK_ARMENIAN #define XK_GEORGIAN #define XK_VIETNAMESE #define XK_CURRENCY #define XK_MATHEMATICAL #define XK_BRAILLE #define XK_SINHALA #include ================================================ FILE: Libraries/Core/RPi/Headers/X11/keysymdef.h ================================================ /*********************************************************** Copyright 1987, 1994, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Digital not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* * The "X11 Window System Protocol" standard defines in Appendix A the * keysym codes. These 29-bit integer values identify characters or * functions associated with each key (e.g., via the visible * engraving) of a keyboard layout. This file assigns mnemonic macro * names for these keysyms. * * This file is also compiled (by src/util/makekeys.c in libX11) into * hash tables that can be accessed with X11 library functions such as * XStringToKeysym() and XKeysymToString(). * * Where a keysym corresponds one-to-one to an ISO 10646 / Unicode * character, this is noted in a comment that provides both the U+xxxx * Unicode position, as well as the official Unicode name of the * character. * * Where the correspondence is either not one-to-one or semantically * unclear, the Unicode position and name are enclosed in * parentheses. Such legacy keysyms should be considered deprecated * and are not recommended for use in future keyboard mappings. * * For any future extension of the keysyms with characters already * found in ISO 10646 / Unicode, the following algorithm shall be * used. The new keysym code position will simply be the character's * Unicode number plus 0x01000000. The keysym values in the range * 0x01000100 to 0x0110ffff are reserved to represent Unicode * characters in the range U+0100 to U+10FFFF. * * While most newer Unicode-based X11 clients do already accept * Unicode-mapped keysyms in the range 0x01000100 to 0x0110ffff, it * will remain necessary for clients -- in the interest of * compatibility with existing servers -- to also understand the * existing legacy keysym values in the range 0x0100 to 0x20ff. * * Where several mnemonic names are defined for the same keysym in this * file, all but the first one listed should be considered deprecated. * * Mnemonic names for keysyms are defined in this file with lines * that match one of these Perl regular expressions: * * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\* U+([0-9A-F]{4,6}) (.*) \*\/\s*$/ * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*\/\*\(U+([0-9A-F]{4,6}) (.*)\)\*\/\s*$/ * /^\#define XK_([a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*(\/\*\s*(.*)\s*\*\/)?\s*$/ * * Before adding new keysyms, please do consider the following: In * addition to the keysym names defined in this file, the * XStringToKeysym() and XKeysymToString() functions will also handle * any keysym string of the form "U0020" to "U007E" and "U00A0" to * "U10FFFF" for all possible Unicode characters. In other words, * every possible Unicode character has already a keysym string * defined algorithmically, even if it is not listed here. Therefore, * defining an additional keysym macro is only necessary where a * non-hexadecimal mnemonic name is needed, or where the new keysym * does not represent any existing Unicode character. * * When adding new keysyms to this file, do not forget to also update the * following as needed: * * - the mappings in src/KeyBind.c in the repo * git://anongit.freedesktop.org/xorg/lib/libX11.git * * - the protocol specification in specs/keysyms.xml * in the repo git://anongit.freedesktop.org/xorg/proto/x11proto.git * */ #define XK_VoidSymbol 0xffffff /* Void symbol */ #ifdef XK_MISCELLANY /* * TTY function keys, cleverly chosen to map to ASCII, for convenience of * programming, but could have been arbitrary (at the cost of lookup * tables in client code). */ #define XK_BackSpace 0xff08 /* Back space, back char */ #define XK_Tab 0xff09 #define XK_Linefeed 0xff0a /* Linefeed, LF */ #define XK_Clear 0xff0b #define XK_Return 0xff0d /* Return, enter */ #define XK_Pause 0xff13 /* Pause, hold */ #define XK_Scroll_Lock 0xff14 #define XK_Sys_Req 0xff15 #define XK_Escape 0xff1b #define XK_Delete 0xffff /* Delete, rubout */ /* International & multi-key character composition */ #define XK_Multi_key 0xff20 /* Multi-key character compose */ #define XK_Codeinput 0xff37 #define XK_SingleCandidate 0xff3c #define XK_MultipleCandidate 0xff3d #define XK_PreviousCandidate 0xff3e /* Japanese keyboard support */ #define XK_Kanji 0xff21 /* Kanji, Kanji convert */ #define XK_Muhenkan 0xff22 /* Cancel Conversion */ #define XK_Henkan_Mode 0xff23 /* Start/Stop Conversion */ #define XK_Henkan 0xff23 /* Alias for Henkan_Mode */ #define XK_Romaji 0xff24 /* to Romaji */ #define XK_Hiragana 0xff25 /* to Hiragana */ #define XK_Katakana 0xff26 /* to Katakana */ #define XK_Hiragana_Katakana 0xff27 /* Hiragana/Katakana toggle */ #define XK_Zenkaku 0xff28 /* to Zenkaku */ #define XK_Hankaku 0xff29 /* to Hankaku */ #define XK_Zenkaku_Hankaku 0xff2a /* Zenkaku/Hankaku toggle */ #define XK_Touroku 0xff2b /* Add to Dictionary */ #define XK_Massyo 0xff2c /* Delete from Dictionary */ #define XK_Kana_Lock 0xff2d /* Kana Lock */ #define XK_Kana_Shift 0xff2e /* Kana Shift */ #define XK_Eisu_Shift 0xff2f /* Alphanumeric Shift */ #define XK_Eisu_toggle 0xff30 /* Alphanumeric toggle */ #define XK_Kanji_Bangou 0xff37 /* Codeinput */ #define XK_Zen_Koho 0xff3d /* Multiple/All Candidate(s) */ #define XK_Mae_Koho 0xff3e /* Previous Candidate */ /* 0xff31 thru 0xff3f are under XK_KOREAN */ /* Cursor control & motion */ #define XK_Home 0xff50 #define XK_Left 0xff51 /* Move left, left arrow */ #define XK_Up 0xff52 /* Move up, up arrow */ #define XK_Right 0xff53 /* Move right, right arrow */ #define XK_Down 0xff54 /* Move down, down arrow */ #define XK_Prior 0xff55 /* Prior, previous */ #define XK_Page_Up 0xff55 #define XK_Next 0xff56 /* Next */ #define XK_Page_Down 0xff56 #define XK_End 0xff57 /* EOL */ #define XK_Begin 0xff58 /* BOL */ /* Misc functions */ #define XK_Select 0xff60 /* Select, mark */ #define XK_Print 0xff61 #define XK_Execute 0xff62 /* Execute, run, do */ #define XK_Insert 0xff63 /* Insert, insert here */ #define XK_Undo 0xff65 #define XK_Redo 0xff66 /* Redo, again */ #define XK_Menu 0xff67 #define XK_Find 0xff68 /* Find, search */ #define XK_Cancel 0xff69 /* Cancel, stop, abort, exit */ #define XK_Help 0xff6a /* Help */ #define XK_Break 0xff6b #define XK_Mode_switch 0xff7e /* Character set switch */ #define XK_script_switch 0xff7e /* Alias for mode_switch */ #define XK_Num_Lock 0xff7f /* Keypad functions, keypad numbers cleverly chosen to map to ASCII */ #define XK_KP_Space 0xff80 /* Space */ #define XK_KP_Tab 0xff89 #define XK_KP_Enter 0xff8d /* Enter */ #define XK_KP_F1 0xff91 /* PF1, KP_A, ... */ #define XK_KP_F2 0xff92 #define XK_KP_F3 0xff93 #define XK_KP_F4 0xff94 #define XK_KP_Home 0xff95 #define XK_KP_Left 0xff96 #define XK_KP_Up 0xff97 #define XK_KP_Right 0xff98 #define XK_KP_Down 0xff99 #define XK_KP_Prior 0xff9a #define XK_KP_Page_Up 0xff9a #define XK_KP_Next 0xff9b #define XK_KP_Page_Down 0xff9b #define XK_KP_End 0xff9c #define XK_KP_Begin 0xff9d #define XK_KP_Insert 0xff9e #define XK_KP_Delete 0xff9f #define XK_KP_Equal 0xffbd /* Equals */ #define XK_KP_Multiply 0xffaa #define XK_KP_Add 0xffab #define XK_KP_Separator 0xffac /* Separator, often comma */ #define XK_KP_Subtract 0xffad #define XK_KP_Decimal 0xffae #define XK_KP_Divide 0xffaf #define XK_KP_0 0xffb0 #define XK_KP_1 0xffb1 #define XK_KP_2 0xffb2 #define XK_KP_3 0xffb3 #define XK_KP_4 0xffb4 #define XK_KP_5 0xffb5 #define XK_KP_6 0xffb6 #define XK_KP_7 0xffb7 #define XK_KP_8 0xffb8 #define XK_KP_9 0xffb9 /* * Auxiliary functions; note the duplicate definitions for left and right * function keys; Sun keyboards and a few other manufacturers have such * function key groups on the left and/or right sides of the keyboard. * We've not found a keyboard with more than 35 function keys total. */ #define XK_F1 0xffbe #define XK_F2 0xffbf #define XK_F3 0xffc0 #define XK_F4 0xffc1 #define XK_F5 0xffc2 #define XK_F6 0xffc3 #define XK_F7 0xffc4 #define XK_F8 0xffc5 #define XK_F9 0xffc6 #define XK_F10 0xffc7 #define XK_F11 0xffc8 #define XK_L1 0xffc8 #define XK_F12 0xffc9 #define XK_L2 0xffc9 #define XK_F13 0xffca #define XK_L3 0xffca #define XK_F14 0xffcb #define XK_L4 0xffcb #define XK_F15 0xffcc #define XK_L5 0xffcc #define XK_F16 0xffcd #define XK_L6 0xffcd #define XK_F17 0xffce #define XK_L7 0xffce #define XK_F18 0xffcf #define XK_L8 0xffcf #define XK_F19 0xffd0 #define XK_L9 0xffd0 #define XK_F20 0xffd1 #define XK_L10 0xffd1 #define XK_F21 0xffd2 #define XK_R1 0xffd2 #define XK_F22 0xffd3 #define XK_R2 0xffd3 #define XK_F23 0xffd4 #define XK_R3 0xffd4 #define XK_F24 0xffd5 #define XK_R4 0xffd5 #define XK_F25 0xffd6 #define XK_R5 0xffd6 #define XK_F26 0xffd7 #define XK_R6 0xffd7 #define XK_F27 0xffd8 #define XK_R7 0xffd8 #define XK_F28 0xffd9 #define XK_R8 0xffd9 #define XK_F29 0xffda #define XK_R9 0xffda #define XK_F30 0xffdb #define XK_R10 0xffdb #define XK_F31 0xffdc #define XK_R11 0xffdc #define XK_F32 0xffdd #define XK_R12 0xffdd #define XK_F33 0xffde #define XK_R13 0xffde #define XK_F34 0xffdf #define XK_R14 0xffdf #define XK_F35 0xffe0 #define XK_R15 0xffe0 /* Modifiers */ #define XK_Shift_L 0xffe1 /* Left shift */ #define XK_Shift_R 0xffe2 /* Right shift */ #define XK_Control_L 0xffe3 /* Left control */ #define XK_Control_R 0xffe4 /* Right control */ #define XK_Caps_Lock 0xffe5 /* Caps lock */ #define XK_Shift_Lock 0xffe6 /* Shift lock */ #define XK_Meta_L 0xffe7 /* Left meta */ #define XK_Meta_R 0xffe8 /* Right meta */ #define XK_Alt_L 0xffe9 /* Left alt */ #define XK_Alt_R 0xffea /* Right alt */ #define XK_Super_L 0xffeb /* Left super */ #define XK_Super_R 0xffec /* Right super */ #define XK_Hyper_L 0xffed /* Left hyper */ #define XK_Hyper_R 0xffee /* Right hyper */ #endif /* XK_MISCELLANY */ /* * Keyboard (XKB) Extension function and modifier keys * (from Appendix C of "The X Keyboard Extension: Protocol Specification") * Byte 3 = 0xfe */ #ifdef XK_XKB_KEYS #define XK_ISO_Lock 0xfe01 #define XK_ISO_Level2_Latch 0xfe02 #define XK_ISO_Level3_Shift 0xfe03 #define XK_ISO_Level3_Latch 0xfe04 #define XK_ISO_Level3_Lock 0xfe05 #define XK_ISO_Level5_Shift 0xfe11 #define XK_ISO_Level5_Latch 0xfe12 #define XK_ISO_Level5_Lock 0xfe13 #define XK_ISO_Group_Shift 0xff7e /* Alias for mode_switch */ #define XK_ISO_Group_Latch 0xfe06 #define XK_ISO_Group_Lock 0xfe07 #define XK_ISO_Next_Group 0xfe08 #define XK_ISO_Next_Group_Lock 0xfe09 #define XK_ISO_Prev_Group 0xfe0a #define XK_ISO_Prev_Group_Lock 0xfe0b #define XK_ISO_First_Group 0xfe0c #define XK_ISO_First_Group_Lock 0xfe0d #define XK_ISO_Last_Group 0xfe0e #define XK_ISO_Last_Group_Lock 0xfe0f #define XK_ISO_Left_Tab 0xfe20 #define XK_ISO_Move_Line_Up 0xfe21 #define XK_ISO_Move_Line_Down 0xfe22 #define XK_ISO_Partial_Line_Up 0xfe23 #define XK_ISO_Partial_Line_Down 0xfe24 #define XK_ISO_Partial_Space_Left 0xfe25 #define XK_ISO_Partial_Space_Right 0xfe26 #define XK_ISO_Set_Margin_Left 0xfe27 #define XK_ISO_Set_Margin_Right 0xfe28 #define XK_ISO_Release_Margin_Left 0xfe29 #define XK_ISO_Release_Margin_Right 0xfe2a #define XK_ISO_Release_Both_Margins 0xfe2b #define XK_ISO_Fast_Cursor_Left 0xfe2c #define XK_ISO_Fast_Cursor_Right 0xfe2d #define XK_ISO_Fast_Cursor_Up 0xfe2e #define XK_ISO_Fast_Cursor_Down 0xfe2f #define XK_ISO_Continuous_Underline 0xfe30 #define XK_ISO_Discontinuous_Underline 0xfe31 #define XK_ISO_Emphasize 0xfe32 #define XK_ISO_Center_Object 0xfe33 #define XK_ISO_Enter 0xfe34 #define XK_dead_grave 0xfe50 #define XK_dead_acute 0xfe51 #define XK_dead_circumflex 0xfe52 #define XK_dead_tilde 0xfe53 #define XK_dead_perispomeni 0xfe53 /* alias for dead_tilde */ #define XK_dead_macron 0xfe54 #define XK_dead_breve 0xfe55 #define XK_dead_abovedot 0xfe56 #define XK_dead_diaeresis 0xfe57 #define XK_dead_abovering 0xfe58 #define XK_dead_doubleacute 0xfe59 #define XK_dead_caron 0xfe5a #define XK_dead_cedilla 0xfe5b #define XK_dead_ogonek 0xfe5c #define XK_dead_iota 0xfe5d #define XK_dead_voiced_sound 0xfe5e #define XK_dead_semivoiced_sound 0xfe5f #define XK_dead_belowdot 0xfe60 #define XK_dead_hook 0xfe61 #define XK_dead_horn 0xfe62 #define XK_dead_stroke 0xfe63 #define XK_dead_abovecomma 0xfe64 #define XK_dead_psili 0xfe64 /* alias for dead_abovecomma */ #define XK_dead_abovereversedcomma 0xfe65 #define XK_dead_dasia 0xfe65 /* alias for dead_abovereversedcomma */ #define XK_dead_doublegrave 0xfe66 #define XK_dead_belowring 0xfe67 #define XK_dead_belowmacron 0xfe68 #define XK_dead_belowcircumflex 0xfe69 #define XK_dead_belowtilde 0xfe6a #define XK_dead_belowbreve 0xfe6b #define XK_dead_belowdiaeresis 0xfe6c #define XK_dead_invertedbreve 0xfe6d #define XK_dead_belowcomma 0xfe6e #define XK_dead_currency 0xfe6f /* extra dead elements for German T3 layout */ #define XK_dead_lowline 0xfe90 #define XK_dead_aboveverticalline 0xfe91 #define XK_dead_belowverticalline 0xfe92 #define XK_dead_longsolidusoverlay 0xfe93 /* dead vowels for universal syllable entry */ #define XK_dead_a 0xfe80 #define XK_dead_A 0xfe81 #define XK_dead_e 0xfe82 #define XK_dead_E 0xfe83 #define XK_dead_i 0xfe84 #define XK_dead_I 0xfe85 #define XK_dead_o 0xfe86 #define XK_dead_O 0xfe87 #define XK_dead_u 0xfe88 #define XK_dead_U 0xfe89 #define XK_dead_small_schwa 0xfe8a #define XK_dead_capital_schwa 0xfe8b #define XK_dead_greek 0xfe8c #define XK_First_Virtual_Screen 0xfed0 #define XK_Prev_Virtual_Screen 0xfed1 #define XK_Next_Virtual_Screen 0xfed2 #define XK_Last_Virtual_Screen 0xfed4 #define XK_Terminate_Server 0xfed5 #define XK_AccessX_Enable 0xfe70 #define XK_AccessX_Feedback_Enable 0xfe71 #define XK_RepeatKeys_Enable 0xfe72 #define XK_SlowKeys_Enable 0xfe73 #define XK_BounceKeys_Enable 0xfe74 #define XK_StickyKeys_Enable 0xfe75 #define XK_MouseKeys_Enable 0xfe76 #define XK_MouseKeys_Accel_Enable 0xfe77 #define XK_Overlay1_Enable 0xfe78 #define XK_Overlay2_Enable 0xfe79 #define XK_AudibleBell_Enable 0xfe7a #define XK_Pointer_Left 0xfee0 #define XK_Pointer_Right 0xfee1 #define XK_Pointer_Up 0xfee2 #define XK_Pointer_Down 0xfee3 #define XK_Pointer_UpLeft 0xfee4 #define XK_Pointer_UpRight 0xfee5 #define XK_Pointer_DownLeft 0xfee6 #define XK_Pointer_DownRight 0xfee7 #define XK_Pointer_Button_Dflt 0xfee8 #define XK_Pointer_Button1 0xfee9 #define XK_Pointer_Button2 0xfeea #define XK_Pointer_Button3 0xfeeb #define XK_Pointer_Button4 0xfeec #define XK_Pointer_Button5 0xfeed #define XK_Pointer_DblClick_Dflt 0xfeee #define XK_Pointer_DblClick1 0xfeef #define XK_Pointer_DblClick2 0xfef0 #define XK_Pointer_DblClick3 0xfef1 #define XK_Pointer_DblClick4 0xfef2 #define XK_Pointer_DblClick5 0xfef3 #define XK_Pointer_Drag_Dflt 0xfef4 #define XK_Pointer_Drag1 0xfef5 #define XK_Pointer_Drag2 0xfef6 #define XK_Pointer_Drag3 0xfef7 #define XK_Pointer_Drag4 0xfef8 #define XK_Pointer_Drag5 0xfefd #define XK_Pointer_EnableKeys 0xfef9 #define XK_Pointer_Accelerate 0xfefa #define XK_Pointer_DfltBtnNext 0xfefb #define XK_Pointer_DfltBtnPrev 0xfefc /* Single-Stroke Multiple-Character N-Graph Keysyms For The X Input Method */ #define XK_ch 0xfea0 #define XK_Ch 0xfea1 #define XK_CH 0xfea2 #define XK_c_h 0xfea3 #define XK_C_h 0xfea4 #define XK_C_H 0xfea5 #endif /* XK_XKB_KEYS */ /* * 3270 Terminal Keys * Byte 3 = 0xfd */ #ifdef XK_3270 #define XK_3270_Duplicate 0xfd01 #define XK_3270_FieldMark 0xfd02 #define XK_3270_Right2 0xfd03 #define XK_3270_Left2 0xfd04 #define XK_3270_BackTab 0xfd05 #define XK_3270_EraseEOF 0xfd06 #define XK_3270_EraseInput 0xfd07 #define XK_3270_Reset 0xfd08 #define XK_3270_Quit 0xfd09 #define XK_3270_PA1 0xfd0a #define XK_3270_PA2 0xfd0b #define XK_3270_PA3 0xfd0c #define XK_3270_Test 0xfd0d #define XK_3270_Attn 0xfd0e #define XK_3270_CursorBlink 0xfd0f #define XK_3270_AltCursor 0xfd10 #define XK_3270_KeyClick 0xfd11 #define XK_3270_Jump 0xfd12 #define XK_3270_Ident 0xfd13 #define XK_3270_Rule 0xfd14 #define XK_3270_Copy 0xfd15 #define XK_3270_Play 0xfd16 #define XK_3270_Setup 0xfd17 #define XK_3270_Record 0xfd18 #define XK_3270_ChangeScreen 0xfd19 #define XK_3270_DeleteWord 0xfd1a #define XK_3270_ExSelect 0xfd1b #define XK_3270_CursorSelect 0xfd1c #define XK_3270_PrintScreen 0xfd1d #define XK_3270_Enter 0xfd1e #endif /* XK_3270 */ /* * Latin 1 * (ISO/IEC 8859-1 = Unicode U+0020..U+00FF) * Byte 3 = 0 */ #ifdef XK_LATIN1 #define XK_space 0x0020 /* U+0020 SPACE */ #define XK_exclam 0x0021 /* U+0021 EXCLAMATION MARK */ #define XK_quotedbl 0x0022 /* U+0022 QUOTATION MARK */ #define XK_numbersign 0x0023 /* U+0023 NUMBER SIGN */ #define XK_dollar 0x0024 /* U+0024 DOLLAR SIGN */ #define XK_percent 0x0025 /* U+0025 PERCENT SIGN */ #define XK_ampersand 0x0026 /* U+0026 AMPERSAND */ #define XK_apostrophe 0x0027 /* U+0027 APOSTROPHE */ #define XK_quoteright 0x0027 /* deprecated */ #define XK_parenleft 0x0028 /* U+0028 LEFT PARENTHESIS */ #define XK_parenright 0x0029 /* U+0029 RIGHT PARENTHESIS */ #define XK_asterisk 0x002a /* U+002A ASTERISK */ #define XK_plus 0x002b /* U+002B PLUS SIGN */ #define XK_comma 0x002c /* U+002C COMMA */ #define XK_minus 0x002d /* U+002D HYPHEN-MINUS */ #define XK_period 0x002e /* U+002E FULL STOP */ #define XK_slash 0x002f /* U+002F SOLIDUS */ #define XK_0 0x0030 /* U+0030 DIGIT ZERO */ #define XK_1 0x0031 /* U+0031 DIGIT ONE */ #define XK_2 0x0032 /* U+0032 DIGIT TWO */ #define XK_3 0x0033 /* U+0033 DIGIT THREE */ #define XK_4 0x0034 /* U+0034 DIGIT FOUR */ #define XK_5 0x0035 /* U+0035 DIGIT FIVE */ #define XK_6 0x0036 /* U+0036 DIGIT SIX */ #define XK_7 0x0037 /* U+0037 DIGIT SEVEN */ #define XK_8 0x0038 /* U+0038 DIGIT EIGHT */ #define XK_9 0x0039 /* U+0039 DIGIT NINE */ #define XK_colon 0x003a /* U+003A COLON */ #define XK_semicolon 0x003b /* U+003B SEMICOLON */ #define XK_less 0x003c /* U+003C LESS-THAN SIGN */ #define XK_equal 0x003d /* U+003D EQUALS SIGN */ #define XK_greater 0x003e /* U+003E GREATER-THAN SIGN */ #define XK_question 0x003f /* U+003F QUESTION MARK */ #define XK_at 0x0040 /* U+0040 COMMERCIAL AT */ #define XK_A 0x0041 /* U+0041 LATIN CAPITAL LETTER A */ #define XK_B 0x0042 /* U+0042 LATIN CAPITAL LETTER B */ #define XK_C 0x0043 /* U+0043 LATIN CAPITAL LETTER C */ #define XK_D 0x0044 /* U+0044 LATIN CAPITAL LETTER D */ #define XK_E 0x0045 /* U+0045 LATIN CAPITAL LETTER E */ #define XK_F 0x0046 /* U+0046 LATIN CAPITAL LETTER F */ #define XK_G 0x0047 /* U+0047 LATIN CAPITAL LETTER G */ #define XK_H 0x0048 /* U+0048 LATIN CAPITAL LETTER H */ #define XK_I 0x0049 /* U+0049 LATIN CAPITAL LETTER I */ #define XK_J 0x004a /* U+004A LATIN CAPITAL LETTER J */ #define XK_K 0x004b /* U+004B LATIN CAPITAL LETTER K */ #define XK_L 0x004c /* U+004C LATIN CAPITAL LETTER L */ #define XK_M 0x004d /* U+004D LATIN CAPITAL LETTER M */ #define XK_N 0x004e /* U+004E LATIN CAPITAL LETTER N */ #define XK_O 0x004f /* U+004F LATIN CAPITAL LETTER O */ #define XK_P 0x0050 /* U+0050 LATIN CAPITAL LETTER P */ #define XK_Q 0x0051 /* U+0051 LATIN CAPITAL LETTER Q */ #define XK_R 0x0052 /* U+0052 LATIN CAPITAL LETTER R */ #define XK_S 0x0053 /* U+0053 LATIN CAPITAL LETTER S */ #define XK_T 0x0054 /* U+0054 LATIN CAPITAL LETTER T */ #define XK_U 0x0055 /* U+0055 LATIN CAPITAL LETTER U */ #define XK_V 0x0056 /* U+0056 LATIN CAPITAL LETTER V */ #define XK_W 0x0057 /* U+0057 LATIN CAPITAL LETTER W */ #define XK_X 0x0058 /* U+0058 LATIN CAPITAL LETTER X */ #define XK_Y 0x0059 /* U+0059 LATIN CAPITAL LETTER Y */ #define XK_Z 0x005a /* U+005A LATIN CAPITAL LETTER Z */ #define XK_bracketleft 0x005b /* U+005B LEFT SQUARE BRACKET */ #define XK_backslash 0x005c /* U+005C REVERSE SOLIDUS */ #define XK_bracketright 0x005d /* U+005D RIGHT SQUARE BRACKET */ #define XK_asciicircum 0x005e /* U+005E CIRCUMFLEX ACCENT */ #define XK_underscore 0x005f /* U+005F LOW LINE */ #define XK_grave 0x0060 /* U+0060 GRAVE ACCENT */ #define XK_quoteleft 0x0060 /* deprecated */ #define XK_a 0x0061 /* U+0061 LATIN SMALL LETTER A */ #define XK_b 0x0062 /* U+0062 LATIN SMALL LETTER B */ #define XK_c 0x0063 /* U+0063 LATIN SMALL LETTER C */ #define XK_d 0x0064 /* U+0064 LATIN SMALL LETTER D */ #define XK_e 0x0065 /* U+0065 LATIN SMALL LETTER E */ #define XK_f 0x0066 /* U+0066 LATIN SMALL LETTER F */ #define XK_g 0x0067 /* U+0067 LATIN SMALL LETTER G */ #define XK_h 0x0068 /* U+0068 LATIN SMALL LETTER H */ #define XK_i 0x0069 /* U+0069 LATIN SMALL LETTER I */ #define XK_j 0x006a /* U+006A LATIN SMALL LETTER J */ #define XK_k 0x006b /* U+006B LATIN SMALL LETTER K */ #define XK_l 0x006c /* U+006C LATIN SMALL LETTER L */ #define XK_m 0x006d /* U+006D LATIN SMALL LETTER M */ #define XK_n 0x006e /* U+006E LATIN SMALL LETTER N */ #define XK_o 0x006f /* U+006F LATIN SMALL LETTER O */ #define XK_p 0x0070 /* U+0070 LATIN SMALL LETTER P */ #define XK_q 0x0071 /* U+0071 LATIN SMALL LETTER Q */ #define XK_r 0x0072 /* U+0072 LATIN SMALL LETTER R */ #define XK_s 0x0073 /* U+0073 LATIN SMALL LETTER S */ #define XK_t 0x0074 /* U+0074 LATIN SMALL LETTER T */ #define XK_u 0x0075 /* U+0075 LATIN SMALL LETTER U */ #define XK_v 0x0076 /* U+0076 LATIN SMALL LETTER V */ #define XK_w 0x0077 /* U+0077 LATIN SMALL LETTER W */ #define XK_x 0x0078 /* U+0078 LATIN SMALL LETTER X */ #define XK_y 0x0079 /* U+0079 LATIN SMALL LETTER Y */ #define XK_z 0x007a /* U+007A LATIN SMALL LETTER Z */ #define XK_braceleft 0x007b /* U+007B LEFT CURLY BRACKET */ #define XK_bar 0x007c /* U+007C VERTICAL LINE */ #define XK_braceright 0x007d /* U+007D RIGHT CURLY BRACKET */ #define XK_asciitilde 0x007e /* U+007E TILDE */ #define XK_nobreakspace 0x00a0 /* U+00A0 NO-BREAK SPACE */ #define XK_exclamdown 0x00a1 /* U+00A1 INVERTED EXCLAMATION MARK */ #define XK_cent 0x00a2 /* U+00A2 CENT SIGN */ #define XK_sterling 0x00a3 /* U+00A3 POUND SIGN */ #define XK_currency 0x00a4 /* U+00A4 CURRENCY SIGN */ #define XK_yen 0x00a5 /* U+00A5 YEN SIGN */ #define XK_brokenbar 0x00a6 /* U+00A6 BROKEN BAR */ #define XK_section 0x00a7 /* U+00A7 SECTION SIGN */ #define XK_diaeresis 0x00a8 /* U+00A8 DIAERESIS */ #define XK_copyright 0x00a9 /* U+00A9 COPYRIGHT SIGN */ #define XK_ordfeminine 0x00aa /* U+00AA FEMININE ORDINAL INDICATOR */ #define XK_guillemotleft 0x00ab /* U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ #define XK_notsign 0x00ac /* U+00AC NOT SIGN */ #define XK_hyphen 0x00ad /* U+00AD SOFT HYPHEN */ #define XK_registered 0x00ae /* U+00AE REGISTERED SIGN */ #define XK_macron 0x00af /* U+00AF MACRON */ #define XK_degree 0x00b0 /* U+00B0 DEGREE SIGN */ #define XK_plusminus 0x00b1 /* U+00B1 PLUS-MINUS SIGN */ #define XK_twosuperior 0x00b2 /* U+00B2 SUPERSCRIPT TWO */ #define XK_threesuperior 0x00b3 /* U+00B3 SUPERSCRIPT THREE */ #define XK_acute 0x00b4 /* U+00B4 ACUTE ACCENT */ #define XK_mu 0x00b5 /* U+00B5 MICRO SIGN */ #define XK_paragraph 0x00b6 /* U+00B6 PILCROW SIGN */ #define XK_periodcentered 0x00b7 /* U+00B7 MIDDLE DOT */ #define XK_cedilla 0x00b8 /* U+00B8 CEDILLA */ #define XK_onesuperior 0x00b9 /* U+00B9 SUPERSCRIPT ONE */ #define XK_masculine 0x00ba /* U+00BA MASCULINE ORDINAL INDICATOR */ #define XK_guillemotright 0x00bb /* U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ #define XK_onequarter 0x00bc /* U+00BC VULGAR FRACTION ONE QUARTER */ #define XK_onehalf 0x00bd /* U+00BD VULGAR FRACTION ONE HALF */ #define XK_threequarters 0x00be /* U+00BE VULGAR FRACTION THREE QUARTERS */ #define XK_questiondown 0x00bf /* U+00BF INVERTED QUESTION MARK */ #define XK_Agrave 0x00c0 /* U+00C0 LATIN CAPITAL LETTER A WITH GRAVE */ #define XK_Aacute 0x00c1 /* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE */ #define XK_Acircumflex 0x00c2 /* U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ #define XK_Atilde 0x00c3 /* U+00C3 LATIN CAPITAL LETTER A WITH TILDE */ #define XK_Adiaeresis 0x00c4 /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */ #define XK_Aring 0x00c5 /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */ #define XK_AE 0x00c6 /* U+00C6 LATIN CAPITAL LETTER AE */ #define XK_Ccedilla 0x00c7 /* U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA */ #define XK_Egrave 0x00c8 /* U+00C8 LATIN CAPITAL LETTER E WITH GRAVE */ #define XK_Eacute 0x00c9 /* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */ #define XK_Ecircumflex 0x00ca /* U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ #define XK_Ediaeresis 0x00cb /* U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS */ #define XK_Igrave 0x00cc /* U+00CC LATIN CAPITAL LETTER I WITH GRAVE */ #define XK_Iacute 0x00cd /* U+00CD LATIN CAPITAL LETTER I WITH ACUTE */ #define XK_Icircumflex 0x00ce /* U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ #define XK_Idiaeresis 0x00cf /* U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS */ #define XK_ETH 0x00d0 /* U+00D0 LATIN CAPITAL LETTER ETH */ #define XK_Eth 0x00d0 /* deprecated */ #define XK_Ntilde 0x00d1 /* U+00D1 LATIN CAPITAL LETTER N WITH TILDE */ #define XK_Ograve 0x00d2 /* U+00D2 LATIN CAPITAL LETTER O WITH GRAVE */ #define XK_Oacute 0x00d3 /* U+00D3 LATIN CAPITAL LETTER O WITH ACUTE */ #define XK_Ocircumflex 0x00d4 /* U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ #define XK_Otilde 0x00d5 /* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */ #define XK_Odiaeresis 0x00d6 /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */ #define XK_multiply 0x00d7 /* U+00D7 MULTIPLICATION SIGN */ #define XK_Oslash 0x00d8 /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */ #define XK_Ooblique 0x00d8 /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */ #define XK_Ugrave 0x00d9 /* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */ #define XK_Uacute 0x00da /* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */ #define XK_Ucircumflex 0x00db /* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ #define XK_Udiaeresis 0x00dc /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */ #define XK_Yacute 0x00dd /* U+00DD LATIN CAPITAL LETTER Y WITH ACUTE */ #define XK_THORN 0x00de /* U+00DE LATIN CAPITAL LETTER THORN */ #define XK_Thorn 0x00de /* deprecated */ #define XK_ssharp 0x00df /* U+00DF LATIN SMALL LETTER SHARP S */ #define XK_agrave 0x00e0 /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */ #define XK_aacute 0x00e1 /* U+00E1 LATIN SMALL LETTER A WITH ACUTE */ #define XK_acircumflex 0x00e2 /* U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX */ #define XK_atilde 0x00e3 /* U+00E3 LATIN SMALL LETTER A WITH TILDE */ #define XK_adiaeresis 0x00e4 /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */ #define XK_aring 0x00e5 /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */ #define XK_ae 0x00e6 /* U+00E6 LATIN SMALL LETTER AE */ #define XK_ccedilla 0x00e7 /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */ #define XK_egrave 0x00e8 /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */ #define XK_eacute 0x00e9 /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */ #define XK_ecircumflex 0x00ea /* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */ #define XK_ediaeresis 0x00eb /* U+00EB LATIN SMALL LETTER E WITH DIAERESIS */ #define XK_igrave 0x00ec /* U+00EC LATIN SMALL LETTER I WITH GRAVE */ #define XK_iacute 0x00ed /* U+00ED LATIN SMALL LETTER I WITH ACUTE */ #define XK_icircumflex 0x00ee /* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */ #define XK_idiaeresis 0x00ef /* U+00EF LATIN SMALL LETTER I WITH DIAERESIS */ #define XK_eth 0x00f0 /* U+00F0 LATIN SMALL LETTER ETH */ #define XK_ntilde 0x00f1 /* U+00F1 LATIN SMALL LETTER N WITH TILDE */ #define XK_ograve 0x00f2 /* U+00F2 LATIN SMALL LETTER O WITH GRAVE */ #define XK_oacute 0x00f3 /* U+00F3 LATIN SMALL LETTER O WITH ACUTE */ #define XK_ocircumflex 0x00f4 /* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */ #define XK_otilde 0x00f5 /* U+00F5 LATIN SMALL LETTER O WITH TILDE */ #define XK_odiaeresis 0x00f6 /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */ #define XK_division 0x00f7 /* U+00F7 DIVISION SIGN */ #define XK_oslash 0x00f8 /* U+00F8 LATIN SMALL LETTER O WITH STROKE */ #define XK_ooblique 0x00f8 /* U+00F8 LATIN SMALL LETTER O WITH STROKE */ #define XK_ugrave 0x00f9 /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */ #define XK_uacute 0x00fa /* U+00FA LATIN SMALL LETTER U WITH ACUTE */ #define XK_ucircumflex 0x00fb /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */ #define XK_udiaeresis 0x00fc /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */ #define XK_yacute 0x00fd /* U+00FD LATIN SMALL LETTER Y WITH ACUTE */ #define XK_thorn 0x00fe /* U+00FE LATIN SMALL LETTER THORN */ #define XK_ydiaeresis 0x00ff /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */ #endif /* XK_LATIN1 */ /* * Latin 2 * Byte 3 = 1 */ #ifdef XK_LATIN2 #define XK_Aogonek 0x01a1 /* U+0104 LATIN CAPITAL LETTER A WITH OGONEK */ #define XK_breve 0x01a2 /* U+02D8 BREVE */ #define XK_Lstroke 0x01a3 /* U+0141 LATIN CAPITAL LETTER L WITH STROKE */ #define XK_Lcaron 0x01a5 /* U+013D LATIN CAPITAL LETTER L WITH CARON */ #define XK_Sacute 0x01a6 /* U+015A LATIN CAPITAL LETTER S WITH ACUTE */ #define XK_Scaron 0x01a9 /* U+0160 LATIN CAPITAL LETTER S WITH CARON */ #define XK_Scedilla 0x01aa /* U+015E LATIN CAPITAL LETTER S WITH CEDILLA */ #define XK_Tcaron 0x01ab /* U+0164 LATIN CAPITAL LETTER T WITH CARON */ #define XK_Zacute 0x01ac /* U+0179 LATIN CAPITAL LETTER Z WITH ACUTE */ #define XK_Zcaron 0x01ae /* U+017D LATIN CAPITAL LETTER Z WITH CARON */ #define XK_Zabovedot 0x01af /* U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE */ #define XK_aogonek 0x01b1 /* U+0105 LATIN SMALL LETTER A WITH OGONEK */ #define XK_ogonek 0x01b2 /* U+02DB OGONEK */ #define XK_lstroke 0x01b3 /* U+0142 LATIN SMALL LETTER L WITH STROKE */ #define XK_lcaron 0x01b5 /* U+013E LATIN SMALL LETTER L WITH CARON */ #define XK_sacute 0x01b6 /* U+015B LATIN SMALL LETTER S WITH ACUTE */ #define XK_caron 0x01b7 /* U+02C7 CARON */ #define XK_scaron 0x01b9 /* U+0161 LATIN SMALL LETTER S WITH CARON */ #define XK_scedilla 0x01ba /* U+015F LATIN SMALL LETTER S WITH CEDILLA */ #define XK_tcaron 0x01bb /* U+0165 LATIN SMALL LETTER T WITH CARON */ #define XK_zacute 0x01bc /* U+017A LATIN SMALL LETTER Z WITH ACUTE */ #define XK_doubleacute 0x01bd /* U+02DD DOUBLE ACUTE ACCENT */ #define XK_zcaron 0x01be /* U+017E LATIN SMALL LETTER Z WITH CARON */ #define XK_zabovedot 0x01bf /* U+017C LATIN SMALL LETTER Z WITH DOT ABOVE */ #define XK_Racute 0x01c0 /* U+0154 LATIN CAPITAL LETTER R WITH ACUTE */ #define XK_Abreve 0x01c3 /* U+0102 LATIN CAPITAL LETTER A WITH BREVE */ #define XK_Lacute 0x01c5 /* U+0139 LATIN CAPITAL LETTER L WITH ACUTE */ #define XK_Cacute 0x01c6 /* U+0106 LATIN CAPITAL LETTER C WITH ACUTE */ #define XK_Ccaron 0x01c8 /* U+010C LATIN CAPITAL LETTER C WITH CARON */ #define XK_Eogonek 0x01ca /* U+0118 LATIN CAPITAL LETTER E WITH OGONEK */ #define XK_Ecaron 0x01cc /* U+011A LATIN CAPITAL LETTER E WITH CARON */ #define XK_Dcaron 0x01cf /* U+010E LATIN CAPITAL LETTER D WITH CARON */ #define XK_Dstroke 0x01d0 /* U+0110 LATIN CAPITAL LETTER D WITH STROKE */ #define XK_Nacute 0x01d1 /* U+0143 LATIN CAPITAL LETTER N WITH ACUTE */ #define XK_Ncaron 0x01d2 /* U+0147 LATIN CAPITAL LETTER N WITH CARON */ #define XK_Odoubleacute 0x01d5 /* U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ #define XK_Rcaron 0x01d8 /* U+0158 LATIN CAPITAL LETTER R WITH CARON */ #define XK_Uring 0x01d9 /* U+016E LATIN CAPITAL LETTER U WITH RING ABOVE */ #define XK_Udoubleacute 0x01db /* U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ #define XK_Tcedilla 0x01de /* U+0162 LATIN CAPITAL LETTER T WITH CEDILLA */ #define XK_racute 0x01e0 /* U+0155 LATIN SMALL LETTER R WITH ACUTE */ #define XK_abreve 0x01e3 /* U+0103 LATIN SMALL LETTER A WITH BREVE */ #define XK_lacute 0x01e5 /* U+013A LATIN SMALL LETTER L WITH ACUTE */ #define XK_cacute 0x01e6 /* U+0107 LATIN SMALL LETTER C WITH ACUTE */ #define XK_ccaron 0x01e8 /* U+010D LATIN SMALL LETTER C WITH CARON */ #define XK_eogonek 0x01ea /* U+0119 LATIN SMALL LETTER E WITH OGONEK */ #define XK_ecaron 0x01ec /* U+011B LATIN SMALL LETTER E WITH CARON */ #define XK_dcaron 0x01ef /* U+010F LATIN SMALL LETTER D WITH CARON */ #define XK_dstroke 0x01f0 /* U+0111 LATIN SMALL LETTER D WITH STROKE */ #define XK_nacute 0x01f1 /* U+0144 LATIN SMALL LETTER N WITH ACUTE */ #define XK_ncaron 0x01f2 /* U+0148 LATIN SMALL LETTER N WITH CARON */ #define XK_odoubleacute 0x01f5 /* U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE */ #define XK_rcaron 0x01f8 /* U+0159 LATIN SMALL LETTER R WITH CARON */ #define XK_uring 0x01f9 /* U+016F LATIN SMALL LETTER U WITH RING ABOVE */ #define XK_udoubleacute 0x01fb /* U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE */ #define XK_tcedilla 0x01fe /* U+0163 LATIN SMALL LETTER T WITH CEDILLA */ #define XK_abovedot 0x01ff /* U+02D9 DOT ABOVE */ #endif /* XK_LATIN2 */ /* * Latin 3 * Byte 3 = 2 */ #ifdef XK_LATIN3 #define XK_Hstroke 0x02a1 /* U+0126 LATIN CAPITAL LETTER H WITH STROKE */ #define XK_Hcircumflex 0x02a6 /* U+0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ #define XK_Iabovedot 0x02a9 /* U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE */ #define XK_Gbreve 0x02ab /* U+011E LATIN CAPITAL LETTER G WITH BREVE */ #define XK_Jcircumflex 0x02ac /* U+0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ #define XK_hstroke 0x02b1 /* U+0127 LATIN SMALL LETTER H WITH STROKE */ #define XK_hcircumflex 0x02b6 /* U+0125 LATIN SMALL LETTER H WITH CIRCUMFLEX */ #define XK_idotless 0x02b9 /* U+0131 LATIN SMALL LETTER DOTLESS I */ #define XK_gbreve 0x02bb /* U+011F LATIN SMALL LETTER G WITH BREVE */ #define XK_jcircumflex 0x02bc /* U+0135 LATIN SMALL LETTER J WITH CIRCUMFLEX */ #define XK_Cabovedot 0x02c5 /* U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE */ #define XK_Ccircumflex 0x02c6 /* U+0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ #define XK_Gabovedot 0x02d5 /* U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE */ #define XK_Gcircumflex 0x02d8 /* U+011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ #define XK_Ubreve 0x02dd /* U+016C LATIN CAPITAL LETTER U WITH BREVE */ #define XK_Scircumflex 0x02de /* U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ #define XK_cabovedot 0x02e5 /* U+010B LATIN SMALL LETTER C WITH DOT ABOVE */ #define XK_ccircumflex 0x02e6 /* U+0109 LATIN SMALL LETTER C WITH CIRCUMFLEX */ #define XK_gabovedot 0x02f5 /* U+0121 LATIN SMALL LETTER G WITH DOT ABOVE */ #define XK_gcircumflex 0x02f8 /* U+011D LATIN SMALL LETTER G WITH CIRCUMFLEX */ #define XK_ubreve 0x02fd /* U+016D LATIN SMALL LETTER U WITH BREVE */ #define XK_scircumflex 0x02fe /* U+015D LATIN SMALL LETTER S WITH CIRCUMFLEX */ #endif /* XK_LATIN3 */ /* * Latin 4 * Byte 3 = 3 */ #ifdef XK_LATIN4 #define XK_kra 0x03a2 /* U+0138 LATIN SMALL LETTER KRA */ #define XK_kappa 0x03a2 /* deprecated */ #define XK_Rcedilla 0x03a3 /* U+0156 LATIN CAPITAL LETTER R WITH CEDILLA */ #define XK_Itilde 0x03a5 /* U+0128 LATIN CAPITAL LETTER I WITH TILDE */ #define XK_Lcedilla 0x03a6 /* U+013B LATIN CAPITAL LETTER L WITH CEDILLA */ #define XK_Emacron 0x03aa /* U+0112 LATIN CAPITAL LETTER E WITH MACRON */ #define XK_Gcedilla 0x03ab /* U+0122 LATIN CAPITAL LETTER G WITH CEDILLA */ #define XK_Tslash 0x03ac /* U+0166 LATIN CAPITAL LETTER T WITH STROKE */ #define XK_rcedilla 0x03b3 /* U+0157 LATIN SMALL LETTER R WITH CEDILLA */ #define XK_itilde 0x03b5 /* U+0129 LATIN SMALL LETTER I WITH TILDE */ #define XK_lcedilla 0x03b6 /* U+013C LATIN SMALL LETTER L WITH CEDILLA */ #define XK_emacron 0x03ba /* U+0113 LATIN SMALL LETTER E WITH MACRON */ #define XK_gcedilla 0x03bb /* U+0123 LATIN SMALL LETTER G WITH CEDILLA */ #define XK_tslash 0x03bc /* U+0167 LATIN SMALL LETTER T WITH STROKE */ #define XK_ENG 0x03bd /* U+014A LATIN CAPITAL LETTER ENG */ #define XK_eng 0x03bf /* U+014B LATIN SMALL LETTER ENG */ #define XK_Amacron 0x03c0 /* U+0100 LATIN CAPITAL LETTER A WITH MACRON */ #define XK_Iogonek 0x03c7 /* U+012E LATIN CAPITAL LETTER I WITH OGONEK */ #define XK_Eabovedot 0x03cc /* U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE */ #define XK_Imacron 0x03cf /* U+012A LATIN CAPITAL LETTER I WITH MACRON */ #define XK_Ncedilla 0x03d1 /* U+0145 LATIN CAPITAL LETTER N WITH CEDILLA */ #define XK_Omacron 0x03d2 /* U+014C LATIN CAPITAL LETTER O WITH MACRON */ #define XK_Kcedilla 0x03d3 /* U+0136 LATIN CAPITAL LETTER K WITH CEDILLA */ #define XK_Uogonek 0x03d9 /* U+0172 LATIN CAPITAL LETTER U WITH OGONEK */ #define XK_Utilde 0x03dd /* U+0168 LATIN CAPITAL LETTER U WITH TILDE */ #define XK_Umacron 0x03de /* U+016A LATIN CAPITAL LETTER U WITH MACRON */ #define XK_amacron 0x03e0 /* U+0101 LATIN SMALL LETTER A WITH MACRON */ #define XK_iogonek 0x03e7 /* U+012F LATIN SMALL LETTER I WITH OGONEK */ #define XK_eabovedot 0x03ec /* U+0117 LATIN SMALL LETTER E WITH DOT ABOVE */ #define XK_imacron 0x03ef /* U+012B LATIN SMALL LETTER I WITH MACRON */ #define XK_ncedilla 0x03f1 /* U+0146 LATIN SMALL LETTER N WITH CEDILLA */ #define XK_omacron 0x03f2 /* U+014D LATIN SMALL LETTER O WITH MACRON */ #define XK_kcedilla 0x03f3 /* U+0137 LATIN SMALL LETTER K WITH CEDILLA */ #define XK_uogonek 0x03f9 /* U+0173 LATIN SMALL LETTER U WITH OGONEK */ #define XK_utilde 0x03fd /* U+0169 LATIN SMALL LETTER U WITH TILDE */ #define XK_umacron 0x03fe /* U+016B LATIN SMALL LETTER U WITH MACRON */ #endif /* XK_LATIN4 */ /* * Latin 8 */ #ifdef XK_LATIN8 #define XK_Wcircumflex 0x1000174 /* U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX */ #define XK_wcircumflex 0x1000175 /* U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX */ #define XK_Ycircumflex 0x1000176 /* U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX */ #define XK_ycircumflex 0x1000177 /* U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX */ #define XK_Babovedot 0x1001e02 /* U+1E02 LATIN CAPITAL LETTER B WITH DOT ABOVE */ #define XK_babovedot 0x1001e03 /* U+1E03 LATIN SMALL LETTER B WITH DOT ABOVE */ #define XK_Dabovedot 0x1001e0a /* U+1E0A LATIN CAPITAL LETTER D WITH DOT ABOVE */ #define XK_dabovedot 0x1001e0b /* U+1E0B LATIN SMALL LETTER D WITH DOT ABOVE */ #define XK_Fabovedot 0x1001e1e /* U+1E1E LATIN CAPITAL LETTER F WITH DOT ABOVE */ #define XK_fabovedot 0x1001e1f /* U+1E1F LATIN SMALL LETTER F WITH DOT ABOVE */ #define XK_Mabovedot 0x1001e40 /* U+1E40 LATIN CAPITAL LETTER M WITH DOT ABOVE */ #define XK_mabovedot 0x1001e41 /* U+1E41 LATIN SMALL LETTER M WITH DOT ABOVE */ #define XK_Pabovedot 0x1001e56 /* U+1E56 LATIN CAPITAL LETTER P WITH DOT ABOVE */ #define XK_pabovedot 0x1001e57 /* U+1E57 LATIN SMALL LETTER P WITH DOT ABOVE */ #define XK_Sabovedot 0x1001e60 /* U+1E60 LATIN CAPITAL LETTER S WITH DOT ABOVE */ #define XK_sabovedot 0x1001e61 /* U+1E61 LATIN SMALL LETTER S WITH DOT ABOVE */ #define XK_Tabovedot 0x1001e6a /* U+1E6A LATIN CAPITAL LETTER T WITH DOT ABOVE */ #define XK_tabovedot 0x1001e6b /* U+1E6B LATIN SMALL LETTER T WITH DOT ABOVE */ #define XK_Wgrave 0x1001e80 /* U+1E80 LATIN CAPITAL LETTER W WITH GRAVE */ #define XK_wgrave 0x1001e81 /* U+1E81 LATIN SMALL LETTER W WITH GRAVE */ #define XK_Wacute 0x1001e82 /* U+1E82 LATIN CAPITAL LETTER W WITH ACUTE */ #define XK_wacute 0x1001e83 /* U+1E83 LATIN SMALL LETTER W WITH ACUTE */ #define XK_Wdiaeresis 0x1001e84 /* U+1E84 LATIN CAPITAL LETTER W WITH DIAERESIS */ #define XK_wdiaeresis 0x1001e85 /* U+1E85 LATIN SMALL LETTER W WITH DIAERESIS */ #define XK_Ygrave 0x1001ef2 /* U+1EF2 LATIN CAPITAL LETTER Y WITH GRAVE */ #define XK_ygrave 0x1001ef3 /* U+1EF3 LATIN SMALL LETTER Y WITH GRAVE */ #endif /* XK_LATIN8 */ /* * Latin 9 * Byte 3 = 0x13 */ #ifdef XK_LATIN9 #define XK_OE 0x13bc /* U+0152 LATIN CAPITAL LIGATURE OE */ #define XK_oe 0x13bd /* U+0153 LATIN SMALL LIGATURE OE */ #define XK_Ydiaeresis 0x13be /* U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS */ #endif /* XK_LATIN9 */ /* * Katakana * Byte 3 = 4 */ #ifdef XK_KATAKANA #define XK_overline 0x047e /* U+203E OVERLINE */ #define XK_kana_fullstop 0x04a1 /* U+3002 IDEOGRAPHIC FULL STOP */ #define XK_kana_openingbracket 0x04a2 /* U+300C LEFT CORNER BRACKET */ #define XK_kana_closingbracket 0x04a3 /* U+300D RIGHT CORNER BRACKET */ #define XK_kana_comma 0x04a4 /* U+3001 IDEOGRAPHIC COMMA */ #define XK_kana_conjunctive 0x04a5 /* U+30FB KATAKANA MIDDLE DOT */ #define XK_kana_middledot 0x04a5 /* deprecated */ #define XK_kana_WO 0x04a6 /* U+30F2 KATAKANA LETTER WO */ #define XK_kana_a 0x04a7 /* U+30A1 KATAKANA LETTER SMALL A */ #define XK_kana_i 0x04a8 /* U+30A3 KATAKANA LETTER SMALL I */ #define XK_kana_u 0x04a9 /* U+30A5 KATAKANA LETTER SMALL U */ #define XK_kana_e 0x04aa /* U+30A7 KATAKANA LETTER SMALL E */ #define XK_kana_o 0x04ab /* U+30A9 KATAKANA LETTER SMALL O */ #define XK_kana_ya 0x04ac /* U+30E3 KATAKANA LETTER SMALL YA */ #define XK_kana_yu 0x04ad /* U+30E5 KATAKANA LETTER SMALL YU */ #define XK_kana_yo 0x04ae /* U+30E7 KATAKANA LETTER SMALL YO */ #define XK_kana_tsu 0x04af /* U+30C3 KATAKANA LETTER SMALL TU */ #define XK_kana_tu 0x04af /* deprecated */ #define XK_prolongedsound 0x04b0 /* U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK */ #define XK_kana_A 0x04b1 /* U+30A2 KATAKANA LETTER A */ #define XK_kana_I 0x04b2 /* U+30A4 KATAKANA LETTER I */ #define XK_kana_U 0x04b3 /* U+30A6 KATAKANA LETTER U */ #define XK_kana_E 0x04b4 /* U+30A8 KATAKANA LETTER E */ #define XK_kana_O 0x04b5 /* U+30AA KATAKANA LETTER O */ #define XK_kana_KA 0x04b6 /* U+30AB KATAKANA LETTER KA */ #define XK_kana_KI 0x04b7 /* U+30AD KATAKANA LETTER KI */ #define XK_kana_KU 0x04b8 /* U+30AF KATAKANA LETTER KU */ #define XK_kana_KE 0x04b9 /* U+30B1 KATAKANA LETTER KE */ #define XK_kana_KO 0x04ba /* U+30B3 KATAKANA LETTER KO */ #define XK_kana_SA 0x04bb /* U+30B5 KATAKANA LETTER SA */ #define XK_kana_SHI 0x04bc /* U+30B7 KATAKANA LETTER SI */ #define XK_kana_SU 0x04bd /* U+30B9 KATAKANA LETTER SU */ #define XK_kana_SE 0x04be /* U+30BB KATAKANA LETTER SE */ #define XK_kana_SO 0x04bf /* U+30BD KATAKANA LETTER SO */ #define XK_kana_TA 0x04c0 /* U+30BF KATAKANA LETTER TA */ #define XK_kana_CHI 0x04c1 /* U+30C1 KATAKANA LETTER TI */ #define XK_kana_TI 0x04c1 /* deprecated */ #define XK_kana_TSU 0x04c2 /* U+30C4 KATAKANA LETTER TU */ #define XK_kana_TU 0x04c2 /* deprecated */ #define XK_kana_TE 0x04c3 /* U+30C6 KATAKANA LETTER TE */ #define XK_kana_TO 0x04c4 /* U+30C8 KATAKANA LETTER TO */ #define XK_kana_NA 0x04c5 /* U+30CA KATAKANA LETTER NA */ #define XK_kana_NI 0x04c6 /* U+30CB KATAKANA LETTER NI */ #define XK_kana_NU 0x04c7 /* U+30CC KATAKANA LETTER NU */ #define XK_kana_NE 0x04c8 /* U+30CD KATAKANA LETTER NE */ #define XK_kana_NO 0x04c9 /* U+30CE KATAKANA LETTER NO */ #define XK_kana_HA 0x04ca /* U+30CF KATAKANA LETTER HA */ #define XK_kana_HI 0x04cb /* U+30D2 KATAKANA LETTER HI */ #define XK_kana_FU 0x04cc /* U+30D5 KATAKANA LETTER HU */ #define XK_kana_HU 0x04cc /* deprecated */ #define XK_kana_HE 0x04cd /* U+30D8 KATAKANA LETTER HE */ #define XK_kana_HO 0x04ce /* U+30DB KATAKANA LETTER HO */ #define XK_kana_MA 0x04cf /* U+30DE KATAKANA LETTER MA */ #define XK_kana_MI 0x04d0 /* U+30DF KATAKANA LETTER MI */ #define XK_kana_MU 0x04d1 /* U+30E0 KATAKANA LETTER MU */ #define XK_kana_ME 0x04d2 /* U+30E1 KATAKANA LETTER ME */ #define XK_kana_MO 0x04d3 /* U+30E2 KATAKANA LETTER MO */ #define XK_kana_YA 0x04d4 /* U+30E4 KATAKANA LETTER YA */ #define XK_kana_YU 0x04d5 /* U+30E6 KATAKANA LETTER YU */ #define XK_kana_YO 0x04d6 /* U+30E8 KATAKANA LETTER YO */ #define XK_kana_RA 0x04d7 /* U+30E9 KATAKANA LETTER RA */ #define XK_kana_RI 0x04d8 /* U+30EA KATAKANA LETTER RI */ #define XK_kana_RU 0x04d9 /* U+30EB KATAKANA LETTER RU */ #define XK_kana_RE 0x04da /* U+30EC KATAKANA LETTER RE */ #define XK_kana_RO 0x04db /* U+30ED KATAKANA LETTER RO */ #define XK_kana_WA 0x04dc /* U+30EF KATAKANA LETTER WA */ #define XK_kana_N 0x04dd /* U+30F3 KATAKANA LETTER N */ #define XK_voicedsound 0x04de /* U+309B KATAKANA-HIRAGANA VOICED SOUND MARK */ #define XK_semivoicedsound 0x04df /* U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK */ #define XK_kana_switch 0xff7e /* Alias for mode_switch */ #endif /* XK_KATAKANA */ /* * Arabic * Byte 3 = 5 */ #ifdef XK_ARABIC #define XK_Farsi_0 0x10006f0 /* U+06F0 EXTENDED ARABIC-INDIC DIGIT ZERO */ #define XK_Farsi_1 0x10006f1 /* U+06F1 EXTENDED ARABIC-INDIC DIGIT ONE */ #define XK_Farsi_2 0x10006f2 /* U+06F2 EXTENDED ARABIC-INDIC DIGIT TWO */ #define XK_Farsi_3 0x10006f3 /* U+06F3 EXTENDED ARABIC-INDIC DIGIT THREE */ #define XK_Farsi_4 0x10006f4 /* U+06F4 EXTENDED ARABIC-INDIC DIGIT FOUR */ #define XK_Farsi_5 0x10006f5 /* U+06F5 EXTENDED ARABIC-INDIC DIGIT FIVE */ #define XK_Farsi_6 0x10006f6 /* U+06F6 EXTENDED ARABIC-INDIC DIGIT SIX */ #define XK_Farsi_7 0x10006f7 /* U+06F7 EXTENDED ARABIC-INDIC DIGIT SEVEN */ #define XK_Farsi_8 0x10006f8 /* U+06F8 EXTENDED ARABIC-INDIC DIGIT EIGHT */ #define XK_Farsi_9 0x10006f9 /* U+06F9 EXTENDED ARABIC-INDIC DIGIT NINE */ #define XK_Arabic_percent 0x100066a /* U+066A ARABIC PERCENT SIGN */ #define XK_Arabic_superscript_alef 0x1000670 /* U+0670 ARABIC LETTER SUPERSCRIPT ALEF */ #define XK_Arabic_tteh 0x1000679 /* U+0679 ARABIC LETTER TTEH */ #define XK_Arabic_peh 0x100067e /* U+067E ARABIC LETTER PEH */ #define XK_Arabic_tcheh 0x1000686 /* U+0686 ARABIC LETTER TCHEH */ #define XK_Arabic_ddal 0x1000688 /* U+0688 ARABIC LETTER DDAL */ #define XK_Arabic_rreh 0x1000691 /* U+0691 ARABIC LETTER RREH */ #define XK_Arabic_comma 0x05ac /* U+060C ARABIC COMMA */ #define XK_Arabic_fullstop 0x10006d4 /* U+06D4 ARABIC FULL STOP */ #define XK_Arabic_0 0x1000660 /* U+0660 ARABIC-INDIC DIGIT ZERO */ #define XK_Arabic_1 0x1000661 /* U+0661 ARABIC-INDIC DIGIT ONE */ #define XK_Arabic_2 0x1000662 /* U+0662 ARABIC-INDIC DIGIT TWO */ #define XK_Arabic_3 0x1000663 /* U+0663 ARABIC-INDIC DIGIT THREE */ #define XK_Arabic_4 0x1000664 /* U+0664 ARABIC-INDIC DIGIT FOUR */ #define XK_Arabic_5 0x1000665 /* U+0665 ARABIC-INDIC DIGIT FIVE */ #define XK_Arabic_6 0x1000666 /* U+0666 ARABIC-INDIC DIGIT SIX */ #define XK_Arabic_7 0x1000667 /* U+0667 ARABIC-INDIC DIGIT SEVEN */ #define XK_Arabic_8 0x1000668 /* U+0668 ARABIC-INDIC DIGIT EIGHT */ #define XK_Arabic_9 0x1000669 /* U+0669 ARABIC-INDIC DIGIT NINE */ #define XK_Arabic_semicolon 0x05bb /* U+061B ARABIC SEMICOLON */ #define XK_Arabic_question_mark 0x05bf /* U+061F ARABIC QUESTION MARK */ #define XK_Arabic_hamza 0x05c1 /* U+0621 ARABIC LETTER HAMZA */ #define XK_Arabic_maddaonalef 0x05c2 /* U+0622 ARABIC LETTER ALEF WITH MADDA ABOVE */ #define XK_Arabic_hamzaonalef 0x05c3 /* U+0623 ARABIC LETTER ALEF WITH HAMZA ABOVE */ #define XK_Arabic_hamzaonwaw 0x05c4 /* U+0624 ARABIC LETTER WAW WITH HAMZA ABOVE */ #define XK_Arabic_hamzaunderalef 0x05c5 /* U+0625 ARABIC LETTER ALEF WITH HAMZA BELOW */ #define XK_Arabic_hamzaonyeh 0x05c6 /* U+0626 ARABIC LETTER YEH WITH HAMZA ABOVE */ #define XK_Arabic_alef 0x05c7 /* U+0627 ARABIC LETTER ALEF */ #define XK_Arabic_beh 0x05c8 /* U+0628 ARABIC LETTER BEH */ #define XK_Arabic_tehmarbuta 0x05c9 /* U+0629 ARABIC LETTER TEH MARBUTA */ #define XK_Arabic_teh 0x05ca /* U+062A ARABIC LETTER TEH */ #define XK_Arabic_theh 0x05cb /* U+062B ARABIC LETTER THEH */ #define XK_Arabic_jeem 0x05cc /* U+062C ARABIC LETTER JEEM */ #define XK_Arabic_hah 0x05cd /* U+062D ARABIC LETTER HAH */ #define XK_Arabic_khah 0x05ce /* U+062E ARABIC LETTER KHAH */ #define XK_Arabic_dal 0x05cf /* U+062F ARABIC LETTER DAL */ #define XK_Arabic_thal 0x05d0 /* U+0630 ARABIC LETTER THAL */ #define XK_Arabic_ra 0x05d1 /* U+0631 ARABIC LETTER REH */ #define XK_Arabic_zain 0x05d2 /* U+0632 ARABIC LETTER ZAIN */ #define XK_Arabic_seen 0x05d3 /* U+0633 ARABIC LETTER SEEN */ #define XK_Arabic_sheen 0x05d4 /* U+0634 ARABIC LETTER SHEEN */ #define XK_Arabic_sad 0x05d5 /* U+0635 ARABIC LETTER SAD */ #define XK_Arabic_dad 0x05d6 /* U+0636 ARABIC LETTER DAD */ #define XK_Arabic_tah 0x05d7 /* U+0637 ARABIC LETTER TAH */ #define XK_Arabic_zah 0x05d8 /* U+0638 ARABIC LETTER ZAH */ #define XK_Arabic_ain 0x05d9 /* U+0639 ARABIC LETTER AIN */ #define XK_Arabic_ghain 0x05da /* U+063A ARABIC LETTER GHAIN */ #define XK_Arabic_tatweel 0x05e0 /* U+0640 ARABIC TATWEEL */ #define XK_Arabic_feh 0x05e1 /* U+0641 ARABIC LETTER FEH */ #define XK_Arabic_qaf 0x05e2 /* U+0642 ARABIC LETTER QAF */ #define XK_Arabic_kaf 0x05e3 /* U+0643 ARABIC LETTER KAF */ #define XK_Arabic_lam 0x05e4 /* U+0644 ARABIC LETTER LAM */ #define XK_Arabic_meem 0x05e5 /* U+0645 ARABIC LETTER MEEM */ #define XK_Arabic_noon 0x05e6 /* U+0646 ARABIC LETTER NOON */ #define XK_Arabic_ha 0x05e7 /* U+0647 ARABIC LETTER HEH */ #define XK_Arabic_heh 0x05e7 /* deprecated */ #define XK_Arabic_waw 0x05e8 /* U+0648 ARABIC LETTER WAW */ #define XK_Arabic_alefmaksura 0x05e9 /* U+0649 ARABIC LETTER ALEF MAKSURA */ #define XK_Arabic_yeh 0x05ea /* U+064A ARABIC LETTER YEH */ #define XK_Arabic_fathatan 0x05eb /* U+064B ARABIC FATHATAN */ #define XK_Arabic_dammatan 0x05ec /* U+064C ARABIC DAMMATAN */ #define XK_Arabic_kasratan 0x05ed /* U+064D ARABIC KASRATAN */ #define XK_Arabic_fatha 0x05ee /* U+064E ARABIC FATHA */ #define XK_Arabic_damma 0x05ef /* U+064F ARABIC DAMMA */ #define XK_Arabic_kasra 0x05f0 /* U+0650 ARABIC KASRA */ #define XK_Arabic_shadda 0x05f1 /* U+0651 ARABIC SHADDA */ #define XK_Arabic_sukun 0x05f2 /* U+0652 ARABIC SUKUN */ #define XK_Arabic_madda_above 0x1000653 /* U+0653 ARABIC MADDAH ABOVE */ #define XK_Arabic_hamza_above 0x1000654 /* U+0654 ARABIC HAMZA ABOVE */ #define XK_Arabic_hamza_below 0x1000655 /* U+0655 ARABIC HAMZA BELOW */ #define XK_Arabic_jeh 0x1000698 /* U+0698 ARABIC LETTER JEH */ #define XK_Arabic_veh 0x10006a4 /* U+06A4 ARABIC LETTER VEH */ #define XK_Arabic_keheh 0x10006a9 /* U+06A9 ARABIC LETTER KEHEH */ #define XK_Arabic_gaf 0x10006af /* U+06AF ARABIC LETTER GAF */ #define XK_Arabic_noon_ghunna 0x10006ba /* U+06BA ARABIC LETTER NOON GHUNNA */ #define XK_Arabic_heh_doachashmee 0x10006be /* U+06BE ARABIC LETTER HEH DOACHASHMEE */ #define XK_Farsi_yeh 0x10006cc /* U+06CC ARABIC LETTER FARSI YEH */ #define XK_Arabic_farsi_yeh 0x10006cc /* U+06CC ARABIC LETTER FARSI YEH */ #define XK_Arabic_yeh_baree 0x10006d2 /* U+06D2 ARABIC LETTER YEH BARREE */ #define XK_Arabic_heh_goal 0x10006c1 /* U+06C1 ARABIC LETTER HEH GOAL */ #define XK_Arabic_switch 0xff7e /* Alias for mode_switch */ #endif /* XK_ARABIC */ /* * Cyrillic * Byte 3 = 6 */ #ifdef XK_CYRILLIC #define XK_Cyrillic_GHE_bar 0x1000492 /* U+0492 CYRILLIC CAPITAL LETTER GHE WITH STROKE */ #define XK_Cyrillic_ghe_bar 0x1000493 /* U+0493 CYRILLIC SMALL LETTER GHE WITH STROKE */ #define XK_Cyrillic_ZHE_descender 0x1000496 /* U+0496 CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER */ #define XK_Cyrillic_zhe_descender 0x1000497 /* U+0497 CYRILLIC SMALL LETTER ZHE WITH DESCENDER */ #define XK_Cyrillic_KA_descender 0x100049a /* U+049A CYRILLIC CAPITAL LETTER KA WITH DESCENDER */ #define XK_Cyrillic_ka_descender 0x100049b /* U+049B CYRILLIC SMALL LETTER KA WITH DESCENDER */ #define XK_Cyrillic_KA_vertstroke 0x100049c /* U+049C CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE */ #define XK_Cyrillic_ka_vertstroke 0x100049d /* U+049D CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE */ #define XK_Cyrillic_EN_descender 0x10004a2 /* U+04A2 CYRILLIC CAPITAL LETTER EN WITH DESCENDER */ #define XK_Cyrillic_en_descender 0x10004a3 /* U+04A3 CYRILLIC SMALL LETTER EN WITH DESCENDER */ #define XK_Cyrillic_U_straight 0x10004ae /* U+04AE CYRILLIC CAPITAL LETTER STRAIGHT U */ #define XK_Cyrillic_u_straight 0x10004af /* U+04AF CYRILLIC SMALL LETTER STRAIGHT U */ #define XK_Cyrillic_U_straight_bar 0x10004b0 /* U+04B0 CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE */ #define XK_Cyrillic_u_straight_bar 0x10004b1 /* U+04B1 CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE */ #define XK_Cyrillic_HA_descender 0x10004b2 /* U+04B2 CYRILLIC CAPITAL LETTER HA WITH DESCENDER */ #define XK_Cyrillic_ha_descender 0x10004b3 /* U+04B3 CYRILLIC SMALL LETTER HA WITH DESCENDER */ #define XK_Cyrillic_CHE_descender 0x10004b6 /* U+04B6 CYRILLIC CAPITAL LETTER CHE WITH DESCENDER */ #define XK_Cyrillic_che_descender 0x10004b7 /* U+04B7 CYRILLIC SMALL LETTER CHE WITH DESCENDER */ #define XK_Cyrillic_CHE_vertstroke 0x10004b8 /* U+04B8 CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE */ #define XK_Cyrillic_che_vertstroke 0x10004b9 /* U+04B9 CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE */ #define XK_Cyrillic_SHHA 0x10004ba /* U+04BA CYRILLIC CAPITAL LETTER SHHA */ #define XK_Cyrillic_shha 0x10004bb /* U+04BB CYRILLIC SMALL LETTER SHHA */ #define XK_Cyrillic_SCHWA 0x10004d8 /* U+04D8 CYRILLIC CAPITAL LETTER SCHWA */ #define XK_Cyrillic_schwa 0x10004d9 /* U+04D9 CYRILLIC SMALL LETTER SCHWA */ #define XK_Cyrillic_I_macron 0x10004e2 /* U+04E2 CYRILLIC CAPITAL LETTER I WITH MACRON */ #define XK_Cyrillic_i_macron 0x10004e3 /* U+04E3 CYRILLIC SMALL LETTER I WITH MACRON */ #define XK_Cyrillic_O_bar 0x10004e8 /* U+04E8 CYRILLIC CAPITAL LETTER BARRED O */ #define XK_Cyrillic_o_bar 0x10004e9 /* U+04E9 CYRILLIC SMALL LETTER BARRED O */ #define XK_Cyrillic_U_macron 0x10004ee /* U+04EE CYRILLIC CAPITAL LETTER U WITH MACRON */ #define XK_Cyrillic_u_macron 0x10004ef /* U+04EF CYRILLIC SMALL LETTER U WITH MACRON */ #define XK_Serbian_dje 0x06a1 /* U+0452 CYRILLIC SMALL LETTER DJE */ #define XK_Macedonia_gje 0x06a2 /* U+0453 CYRILLIC SMALL LETTER GJE */ #define XK_Cyrillic_io 0x06a3 /* U+0451 CYRILLIC SMALL LETTER IO */ #define XK_Ukrainian_ie 0x06a4 /* U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE */ #define XK_Ukranian_je 0x06a4 /* deprecated */ #define XK_Macedonia_dse 0x06a5 /* U+0455 CYRILLIC SMALL LETTER DZE */ #define XK_Ukrainian_i 0x06a6 /* U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ #define XK_Ukranian_i 0x06a6 /* deprecated */ #define XK_Ukrainian_yi 0x06a7 /* U+0457 CYRILLIC SMALL LETTER YI */ #define XK_Ukranian_yi 0x06a7 /* deprecated */ #define XK_Cyrillic_je 0x06a8 /* U+0458 CYRILLIC SMALL LETTER JE */ #define XK_Serbian_je 0x06a8 /* deprecated */ #define XK_Cyrillic_lje 0x06a9 /* U+0459 CYRILLIC SMALL LETTER LJE */ #define XK_Serbian_lje 0x06a9 /* deprecated */ #define XK_Cyrillic_nje 0x06aa /* U+045A CYRILLIC SMALL LETTER NJE */ #define XK_Serbian_nje 0x06aa /* deprecated */ #define XK_Serbian_tshe 0x06ab /* U+045B CYRILLIC SMALL LETTER TSHE */ #define XK_Macedonia_kje 0x06ac /* U+045C CYRILLIC SMALL LETTER KJE */ #define XK_Ukrainian_ghe_with_upturn 0x06ad /* U+0491 CYRILLIC SMALL LETTER GHE WITH UPTURN */ #define XK_Byelorussian_shortu 0x06ae /* U+045E CYRILLIC SMALL LETTER SHORT U */ #define XK_Cyrillic_dzhe 0x06af /* U+045F CYRILLIC SMALL LETTER DZHE */ #define XK_Serbian_dze 0x06af /* deprecated */ #define XK_numerosign 0x06b0 /* U+2116 NUMERO SIGN */ #define XK_Serbian_DJE 0x06b1 /* U+0402 CYRILLIC CAPITAL LETTER DJE */ #define XK_Macedonia_GJE 0x06b2 /* U+0403 CYRILLIC CAPITAL LETTER GJE */ #define XK_Cyrillic_IO 0x06b3 /* U+0401 CYRILLIC CAPITAL LETTER IO */ #define XK_Ukrainian_IE 0x06b4 /* U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE */ #define XK_Ukranian_JE 0x06b4 /* deprecated */ #define XK_Macedonia_DSE 0x06b5 /* U+0405 CYRILLIC CAPITAL LETTER DZE */ #define XK_Ukrainian_I 0x06b6 /* U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ #define XK_Ukranian_I 0x06b6 /* deprecated */ #define XK_Ukrainian_YI 0x06b7 /* U+0407 CYRILLIC CAPITAL LETTER YI */ #define XK_Ukranian_YI 0x06b7 /* deprecated */ #define XK_Cyrillic_JE 0x06b8 /* U+0408 CYRILLIC CAPITAL LETTER JE */ #define XK_Serbian_JE 0x06b8 /* deprecated */ #define XK_Cyrillic_LJE 0x06b9 /* U+0409 CYRILLIC CAPITAL LETTER LJE */ #define XK_Serbian_LJE 0x06b9 /* deprecated */ #define XK_Cyrillic_NJE 0x06ba /* U+040A CYRILLIC CAPITAL LETTER NJE */ #define XK_Serbian_NJE 0x06ba /* deprecated */ #define XK_Serbian_TSHE 0x06bb /* U+040B CYRILLIC CAPITAL LETTER TSHE */ #define XK_Macedonia_KJE 0x06bc /* U+040C CYRILLIC CAPITAL LETTER KJE */ #define XK_Ukrainian_GHE_WITH_UPTURN 0x06bd /* U+0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ #define XK_Byelorussian_SHORTU 0x06be /* U+040E CYRILLIC CAPITAL LETTER SHORT U */ #define XK_Cyrillic_DZHE 0x06bf /* U+040F CYRILLIC CAPITAL LETTER DZHE */ #define XK_Serbian_DZE 0x06bf /* deprecated */ #define XK_Cyrillic_yu 0x06c0 /* U+044E CYRILLIC SMALL LETTER YU */ #define XK_Cyrillic_a 0x06c1 /* U+0430 CYRILLIC SMALL LETTER A */ #define XK_Cyrillic_be 0x06c2 /* U+0431 CYRILLIC SMALL LETTER BE */ #define XK_Cyrillic_tse 0x06c3 /* U+0446 CYRILLIC SMALL LETTER TSE */ #define XK_Cyrillic_de 0x06c4 /* U+0434 CYRILLIC SMALL LETTER DE */ #define XK_Cyrillic_ie 0x06c5 /* U+0435 CYRILLIC SMALL LETTER IE */ #define XK_Cyrillic_ef 0x06c6 /* U+0444 CYRILLIC SMALL LETTER EF */ #define XK_Cyrillic_ghe 0x06c7 /* U+0433 CYRILLIC SMALL LETTER GHE */ #define XK_Cyrillic_ha 0x06c8 /* U+0445 CYRILLIC SMALL LETTER HA */ #define XK_Cyrillic_i 0x06c9 /* U+0438 CYRILLIC SMALL LETTER I */ #define XK_Cyrillic_shorti 0x06ca /* U+0439 CYRILLIC SMALL LETTER SHORT I */ #define XK_Cyrillic_ka 0x06cb /* U+043A CYRILLIC SMALL LETTER KA */ #define XK_Cyrillic_el 0x06cc /* U+043B CYRILLIC SMALL LETTER EL */ #define XK_Cyrillic_em 0x06cd /* U+043C CYRILLIC SMALL LETTER EM */ #define XK_Cyrillic_en 0x06ce /* U+043D CYRILLIC SMALL LETTER EN */ #define XK_Cyrillic_o 0x06cf /* U+043E CYRILLIC SMALL LETTER O */ #define XK_Cyrillic_pe 0x06d0 /* U+043F CYRILLIC SMALL LETTER PE */ #define XK_Cyrillic_ya 0x06d1 /* U+044F CYRILLIC SMALL LETTER YA */ #define XK_Cyrillic_er 0x06d2 /* U+0440 CYRILLIC SMALL LETTER ER */ #define XK_Cyrillic_es 0x06d3 /* U+0441 CYRILLIC SMALL LETTER ES */ #define XK_Cyrillic_te 0x06d4 /* U+0442 CYRILLIC SMALL LETTER TE */ #define XK_Cyrillic_u 0x06d5 /* U+0443 CYRILLIC SMALL LETTER U */ #define XK_Cyrillic_zhe 0x06d6 /* U+0436 CYRILLIC SMALL LETTER ZHE */ #define XK_Cyrillic_ve 0x06d7 /* U+0432 CYRILLIC SMALL LETTER VE */ #define XK_Cyrillic_softsign 0x06d8 /* U+044C CYRILLIC SMALL LETTER SOFT SIGN */ #define XK_Cyrillic_yeru 0x06d9 /* U+044B CYRILLIC SMALL LETTER YERU */ #define XK_Cyrillic_ze 0x06da /* U+0437 CYRILLIC SMALL LETTER ZE */ #define XK_Cyrillic_sha 0x06db /* U+0448 CYRILLIC SMALL LETTER SHA */ #define XK_Cyrillic_e 0x06dc /* U+044D CYRILLIC SMALL LETTER E */ #define XK_Cyrillic_shcha 0x06dd /* U+0449 CYRILLIC SMALL LETTER SHCHA */ #define XK_Cyrillic_che 0x06de /* U+0447 CYRILLIC SMALL LETTER CHE */ #define XK_Cyrillic_hardsign 0x06df /* U+044A CYRILLIC SMALL LETTER HARD SIGN */ #define XK_Cyrillic_YU 0x06e0 /* U+042E CYRILLIC CAPITAL LETTER YU */ #define XK_Cyrillic_A 0x06e1 /* U+0410 CYRILLIC CAPITAL LETTER A */ #define XK_Cyrillic_BE 0x06e2 /* U+0411 CYRILLIC CAPITAL LETTER BE */ #define XK_Cyrillic_TSE 0x06e3 /* U+0426 CYRILLIC CAPITAL LETTER TSE */ #define XK_Cyrillic_DE 0x06e4 /* U+0414 CYRILLIC CAPITAL LETTER DE */ #define XK_Cyrillic_IE 0x06e5 /* U+0415 CYRILLIC CAPITAL LETTER IE */ #define XK_Cyrillic_EF 0x06e6 /* U+0424 CYRILLIC CAPITAL LETTER EF */ #define XK_Cyrillic_GHE 0x06e7 /* U+0413 CYRILLIC CAPITAL LETTER GHE */ #define XK_Cyrillic_HA 0x06e8 /* U+0425 CYRILLIC CAPITAL LETTER HA */ #define XK_Cyrillic_I 0x06e9 /* U+0418 CYRILLIC CAPITAL LETTER I */ #define XK_Cyrillic_SHORTI 0x06ea /* U+0419 CYRILLIC CAPITAL LETTER SHORT I */ #define XK_Cyrillic_KA 0x06eb /* U+041A CYRILLIC CAPITAL LETTER KA */ #define XK_Cyrillic_EL 0x06ec /* U+041B CYRILLIC CAPITAL LETTER EL */ #define XK_Cyrillic_EM 0x06ed /* U+041C CYRILLIC CAPITAL LETTER EM */ #define XK_Cyrillic_EN 0x06ee /* U+041D CYRILLIC CAPITAL LETTER EN */ #define XK_Cyrillic_O 0x06ef /* U+041E CYRILLIC CAPITAL LETTER O */ #define XK_Cyrillic_PE 0x06f0 /* U+041F CYRILLIC CAPITAL LETTER PE */ #define XK_Cyrillic_YA 0x06f1 /* U+042F CYRILLIC CAPITAL LETTER YA */ #define XK_Cyrillic_ER 0x06f2 /* U+0420 CYRILLIC CAPITAL LETTER ER */ #define XK_Cyrillic_ES 0x06f3 /* U+0421 CYRILLIC CAPITAL LETTER ES */ #define XK_Cyrillic_TE 0x06f4 /* U+0422 CYRILLIC CAPITAL LETTER TE */ #define XK_Cyrillic_U 0x06f5 /* U+0423 CYRILLIC CAPITAL LETTER U */ #define XK_Cyrillic_ZHE 0x06f6 /* U+0416 CYRILLIC CAPITAL LETTER ZHE */ #define XK_Cyrillic_VE 0x06f7 /* U+0412 CYRILLIC CAPITAL LETTER VE */ #define XK_Cyrillic_SOFTSIGN 0x06f8 /* U+042C CYRILLIC CAPITAL LETTER SOFT SIGN */ #define XK_Cyrillic_YERU 0x06f9 /* U+042B CYRILLIC CAPITAL LETTER YERU */ #define XK_Cyrillic_ZE 0x06fa /* U+0417 CYRILLIC CAPITAL LETTER ZE */ #define XK_Cyrillic_SHA 0x06fb /* U+0428 CYRILLIC CAPITAL LETTER SHA */ #define XK_Cyrillic_E 0x06fc /* U+042D CYRILLIC CAPITAL LETTER E */ #define XK_Cyrillic_SHCHA 0x06fd /* U+0429 CYRILLIC CAPITAL LETTER SHCHA */ #define XK_Cyrillic_CHE 0x06fe /* U+0427 CYRILLIC CAPITAL LETTER CHE */ #define XK_Cyrillic_HARDSIGN 0x06ff /* U+042A CYRILLIC CAPITAL LETTER HARD SIGN */ #endif /* XK_CYRILLIC */ /* * Greek * (based on an early draft of, and not quite identical to, ISO/IEC 8859-7) * Byte 3 = 7 */ #ifdef XK_GREEK #define XK_Greek_ALPHAaccent 0x07a1 /* U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS */ #define XK_Greek_EPSILONaccent 0x07a2 /* U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS */ #define XK_Greek_ETAaccent 0x07a3 /* U+0389 GREEK CAPITAL LETTER ETA WITH TONOS */ #define XK_Greek_IOTAaccent 0x07a4 /* U+038A GREEK CAPITAL LETTER IOTA WITH TONOS */ #define XK_Greek_IOTAdieresis 0x07a5 /* U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ #define XK_Greek_IOTAdiaeresis 0x07a5 /* old typo */ #define XK_Greek_OMICRONaccent 0x07a7 /* U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS */ #define XK_Greek_UPSILONaccent 0x07a8 /* U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS */ #define XK_Greek_UPSILONdieresis 0x07a9 /* U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ #define XK_Greek_OMEGAaccent 0x07ab /* U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS */ #define XK_Greek_accentdieresis 0x07ae /* U+0385 GREEK DIALYTIKA TONOS */ #define XK_Greek_horizbar 0x07af /* U+2015 HORIZONTAL BAR */ #define XK_Greek_alphaaccent 0x07b1 /* U+03AC GREEK SMALL LETTER ALPHA WITH TONOS */ #define XK_Greek_epsilonaccent 0x07b2 /* U+03AD GREEK SMALL LETTER EPSILON WITH TONOS */ #define XK_Greek_etaaccent 0x07b3 /* U+03AE GREEK SMALL LETTER ETA WITH TONOS */ #define XK_Greek_iotaaccent 0x07b4 /* U+03AF GREEK SMALL LETTER IOTA WITH TONOS */ #define XK_Greek_iotadieresis 0x07b5 /* U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA */ #define XK_Greek_iotaaccentdieresis 0x07b6 /* U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ #define XK_Greek_omicronaccent 0x07b7 /* U+03CC GREEK SMALL LETTER OMICRON WITH TONOS */ #define XK_Greek_upsilonaccent 0x07b8 /* U+03CD GREEK SMALL LETTER UPSILON WITH TONOS */ #define XK_Greek_upsilondieresis 0x07b9 /* U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ #define XK_Greek_upsilonaccentdieresis 0x07ba /* U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ #define XK_Greek_omegaaccent 0x07bb /* U+03CE GREEK SMALL LETTER OMEGA WITH TONOS */ #define XK_Greek_ALPHA 0x07c1 /* U+0391 GREEK CAPITAL LETTER ALPHA */ #define XK_Greek_BETA 0x07c2 /* U+0392 GREEK CAPITAL LETTER BETA */ #define XK_Greek_GAMMA 0x07c3 /* U+0393 GREEK CAPITAL LETTER GAMMA */ #define XK_Greek_DELTA 0x07c4 /* U+0394 GREEK CAPITAL LETTER DELTA */ #define XK_Greek_EPSILON 0x07c5 /* U+0395 GREEK CAPITAL LETTER EPSILON */ #define XK_Greek_ZETA 0x07c6 /* U+0396 GREEK CAPITAL LETTER ZETA */ #define XK_Greek_ETA 0x07c7 /* U+0397 GREEK CAPITAL LETTER ETA */ #define XK_Greek_THETA 0x07c8 /* U+0398 GREEK CAPITAL LETTER THETA */ #define XK_Greek_IOTA 0x07c9 /* U+0399 GREEK CAPITAL LETTER IOTA */ #define XK_Greek_KAPPA 0x07ca /* U+039A GREEK CAPITAL LETTER KAPPA */ #define XK_Greek_LAMDA 0x07cb /* U+039B GREEK CAPITAL LETTER LAMDA */ #define XK_Greek_LAMBDA 0x07cb /* U+039B GREEK CAPITAL LETTER LAMDA */ #define XK_Greek_MU 0x07cc /* U+039C GREEK CAPITAL LETTER MU */ #define XK_Greek_NU 0x07cd /* U+039D GREEK CAPITAL LETTER NU */ #define XK_Greek_XI 0x07ce /* U+039E GREEK CAPITAL LETTER XI */ #define XK_Greek_OMICRON 0x07cf /* U+039F GREEK CAPITAL LETTER OMICRON */ #define XK_Greek_PI 0x07d0 /* U+03A0 GREEK CAPITAL LETTER PI */ #define XK_Greek_RHO 0x07d1 /* U+03A1 GREEK CAPITAL LETTER RHO */ #define XK_Greek_SIGMA 0x07d2 /* U+03A3 GREEK CAPITAL LETTER SIGMA */ #define XK_Greek_TAU 0x07d4 /* U+03A4 GREEK CAPITAL LETTER TAU */ #define XK_Greek_UPSILON 0x07d5 /* U+03A5 GREEK CAPITAL LETTER UPSILON */ #define XK_Greek_PHI 0x07d6 /* U+03A6 GREEK CAPITAL LETTER PHI */ #define XK_Greek_CHI 0x07d7 /* U+03A7 GREEK CAPITAL LETTER CHI */ #define XK_Greek_PSI 0x07d8 /* U+03A8 GREEK CAPITAL LETTER PSI */ #define XK_Greek_OMEGA 0x07d9 /* U+03A9 GREEK CAPITAL LETTER OMEGA */ #define XK_Greek_alpha 0x07e1 /* U+03B1 GREEK SMALL LETTER ALPHA */ #define XK_Greek_beta 0x07e2 /* U+03B2 GREEK SMALL LETTER BETA */ #define XK_Greek_gamma 0x07e3 /* U+03B3 GREEK SMALL LETTER GAMMA */ #define XK_Greek_delta 0x07e4 /* U+03B4 GREEK SMALL LETTER DELTA */ #define XK_Greek_epsilon 0x07e5 /* U+03B5 GREEK SMALL LETTER EPSILON */ #define XK_Greek_zeta 0x07e6 /* U+03B6 GREEK SMALL LETTER ZETA */ #define XK_Greek_eta 0x07e7 /* U+03B7 GREEK SMALL LETTER ETA */ #define XK_Greek_theta 0x07e8 /* U+03B8 GREEK SMALL LETTER THETA */ #define XK_Greek_iota 0x07e9 /* U+03B9 GREEK SMALL LETTER IOTA */ #define XK_Greek_kappa 0x07ea /* U+03BA GREEK SMALL LETTER KAPPA */ #define XK_Greek_lamda 0x07eb /* U+03BB GREEK SMALL LETTER LAMDA */ #define XK_Greek_lambda 0x07eb /* U+03BB GREEK SMALL LETTER LAMDA */ #define XK_Greek_mu 0x07ec /* U+03BC GREEK SMALL LETTER MU */ #define XK_Greek_nu 0x07ed /* U+03BD GREEK SMALL LETTER NU */ #define XK_Greek_xi 0x07ee /* U+03BE GREEK SMALL LETTER XI */ #define XK_Greek_omicron 0x07ef /* U+03BF GREEK SMALL LETTER OMICRON */ #define XK_Greek_pi 0x07f0 /* U+03C0 GREEK SMALL LETTER PI */ #define XK_Greek_rho 0x07f1 /* U+03C1 GREEK SMALL LETTER RHO */ #define XK_Greek_sigma 0x07f2 /* U+03C3 GREEK SMALL LETTER SIGMA */ #define XK_Greek_finalsmallsigma 0x07f3 /* U+03C2 GREEK SMALL LETTER FINAL SIGMA */ #define XK_Greek_tau 0x07f4 /* U+03C4 GREEK SMALL LETTER TAU */ #define XK_Greek_upsilon 0x07f5 /* U+03C5 GREEK SMALL LETTER UPSILON */ #define XK_Greek_phi 0x07f6 /* U+03C6 GREEK SMALL LETTER PHI */ #define XK_Greek_chi 0x07f7 /* U+03C7 GREEK SMALL LETTER CHI */ #define XK_Greek_psi 0x07f8 /* U+03C8 GREEK SMALL LETTER PSI */ #define XK_Greek_omega 0x07f9 /* U+03C9 GREEK SMALL LETTER OMEGA */ #define XK_Greek_switch 0xff7e /* Alias for mode_switch */ #endif /* XK_GREEK */ /* * Technical * (from the DEC VT330/VT420 Technical Character Set, http://vt100.net/charsets/technical.html) * Byte 3 = 8 */ #ifdef XK_TECHNICAL #define XK_leftradical 0x08a1 /* U+23B7 RADICAL SYMBOL BOTTOM */ #define XK_topleftradical 0x08a2 /*(U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT)*/ #define XK_horizconnector 0x08a3 /*(U+2500 BOX DRAWINGS LIGHT HORIZONTAL)*/ #define XK_topintegral 0x08a4 /* U+2320 TOP HALF INTEGRAL */ #define XK_botintegral 0x08a5 /* U+2321 BOTTOM HALF INTEGRAL */ #define XK_vertconnector 0x08a6 /*(U+2502 BOX DRAWINGS LIGHT VERTICAL)*/ #define XK_topleftsqbracket 0x08a7 /* U+23A1 LEFT SQUARE BRACKET UPPER CORNER */ #define XK_botleftsqbracket 0x08a8 /* U+23A3 LEFT SQUARE BRACKET LOWER CORNER */ #define XK_toprightsqbracket 0x08a9 /* U+23A4 RIGHT SQUARE BRACKET UPPER CORNER */ #define XK_botrightsqbracket 0x08aa /* U+23A6 RIGHT SQUARE BRACKET LOWER CORNER */ #define XK_topleftparens 0x08ab /* U+239B LEFT PARENTHESIS UPPER HOOK */ #define XK_botleftparens 0x08ac /* U+239D LEFT PARENTHESIS LOWER HOOK */ #define XK_toprightparens 0x08ad /* U+239E RIGHT PARENTHESIS UPPER HOOK */ #define XK_botrightparens 0x08ae /* U+23A0 RIGHT PARENTHESIS LOWER HOOK */ #define XK_leftmiddlecurlybrace 0x08af /* U+23A8 LEFT CURLY BRACKET MIDDLE PIECE */ #define XK_rightmiddlecurlybrace 0x08b0 /* U+23AC RIGHT CURLY BRACKET MIDDLE PIECE */ #define XK_topleftsummation 0x08b1 #define XK_botleftsummation 0x08b2 #define XK_topvertsummationconnector 0x08b3 #define XK_botvertsummationconnector 0x08b4 #define XK_toprightsummation 0x08b5 #define XK_botrightsummation 0x08b6 #define XK_rightmiddlesummation 0x08b7 #define XK_lessthanequal 0x08bc /* U+2264 LESS-THAN OR EQUAL TO */ #define XK_notequal 0x08bd /* U+2260 NOT EQUAL TO */ #define XK_greaterthanequal 0x08be /* U+2265 GREATER-THAN OR EQUAL TO */ #define XK_integral 0x08bf /* U+222B INTEGRAL */ #define XK_therefore 0x08c0 /* U+2234 THEREFORE */ #define XK_variation 0x08c1 /* U+221D PROPORTIONAL TO */ #define XK_infinity 0x08c2 /* U+221E INFINITY */ #define XK_nabla 0x08c5 /* U+2207 NABLA */ #define XK_approximate 0x08c8 /* U+223C TILDE OPERATOR */ #define XK_similarequal 0x08c9 /* U+2243 ASYMPTOTICALLY EQUAL TO */ #define XK_ifonlyif 0x08cd /* U+21D4 LEFT RIGHT DOUBLE ARROW */ #define XK_implies 0x08ce /* U+21D2 RIGHTWARDS DOUBLE ARROW */ #define XK_identical 0x08cf /* U+2261 IDENTICAL TO */ #define XK_radical 0x08d6 /* U+221A SQUARE ROOT */ #define XK_includedin 0x08da /* U+2282 SUBSET OF */ #define XK_includes 0x08db /* U+2283 SUPERSET OF */ #define XK_intersection 0x08dc /* U+2229 INTERSECTION */ #define XK_union 0x08dd /* U+222A UNION */ #define XK_logicaland 0x08de /* U+2227 LOGICAL AND */ #define XK_logicalor 0x08df /* U+2228 LOGICAL OR */ #define XK_partialderivative 0x08ef /* U+2202 PARTIAL DIFFERENTIAL */ #define XK_function 0x08f6 /* U+0192 LATIN SMALL LETTER F WITH HOOK */ #define XK_leftarrow 0x08fb /* U+2190 LEFTWARDS ARROW */ #define XK_uparrow 0x08fc /* U+2191 UPWARDS ARROW */ #define XK_rightarrow 0x08fd /* U+2192 RIGHTWARDS ARROW */ #define XK_downarrow 0x08fe /* U+2193 DOWNWARDS ARROW */ #endif /* XK_TECHNICAL */ /* * Special * (from the DEC VT100 Special Graphics Character Set) * Byte 3 = 9 */ #ifdef XK_SPECIAL #define XK_blank 0x09df #define XK_soliddiamond 0x09e0 /* U+25C6 BLACK DIAMOND */ #define XK_checkerboard 0x09e1 /* U+2592 MEDIUM SHADE */ #define XK_ht 0x09e2 /* U+2409 SYMBOL FOR HORIZONTAL TABULATION */ #define XK_ff 0x09e3 /* U+240C SYMBOL FOR FORM FEED */ #define XK_cr 0x09e4 /* U+240D SYMBOL FOR CARRIAGE RETURN */ #define XK_lf 0x09e5 /* U+240A SYMBOL FOR LINE FEED */ #define XK_nl 0x09e8 /* U+2424 SYMBOL FOR NEWLINE */ #define XK_vt 0x09e9 /* U+240B SYMBOL FOR VERTICAL TABULATION */ #define XK_lowrightcorner 0x09ea /* U+2518 BOX DRAWINGS LIGHT UP AND LEFT */ #define XK_uprightcorner 0x09eb /* U+2510 BOX DRAWINGS LIGHT DOWN AND LEFT */ #define XK_upleftcorner 0x09ec /* U+250C BOX DRAWINGS LIGHT DOWN AND RIGHT */ #define XK_lowleftcorner 0x09ed /* U+2514 BOX DRAWINGS LIGHT UP AND RIGHT */ #define XK_crossinglines 0x09ee /* U+253C BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ #define XK_horizlinescan1 0x09ef /* U+23BA HORIZONTAL SCAN LINE-1 */ #define XK_horizlinescan3 0x09f0 /* U+23BB HORIZONTAL SCAN LINE-3 */ #define XK_horizlinescan5 0x09f1 /* U+2500 BOX DRAWINGS LIGHT HORIZONTAL */ #define XK_horizlinescan7 0x09f2 /* U+23BC HORIZONTAL SCAN LINE-7 */ #define XK_horizlinescan9 0x09f3 /* U+23BD HORIZONTAL SCAN LINE-9 */ #define XK_leftt 0x09f4 /* U+251C BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ #define XK_rightt 0x09f5 /* U+2524 BOX DRAWINGS LIGHT VERTICAL AND LEFT */ #define XK_bott 0x09f6 /* U+2534 BOX DRAWINGS LIGHT UP AND HORIZONTAL */ #define XK_topt 0x09f7 /* U+252C BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ #define XK_vertbar 0x09f8 /* U+2502 BOX DRAWINGS LIGHT VERTICAL */ #endif /* XK_SPECIAL */ /* * Publishing * (these are probably from a long forgotten DEC Publishing * font that once shipped with DECwrite) * Byte 3 = 0x0a */ #ifdef XK_PUBLISHING #define XK_emspace 0x0aa1 /* U+2003 EM SPACE */ #define XK_enspace 0x0aa2 /* U+2002 EN SPACE */ #define XK_em3space 0x0aa3 /* U+2004 THREE-PER-EM SPACE */ #define XK_em4space 0x0aa4 /* U+2005 FOUR-PER-EM SPACE */ #define XK_digitspace 0x0aa5 /* U+2007 FIGURE SPACE */ #define XK_punctspace 0x0aa6 /* U+2008 PUNCTUATION SPACE */ #define XK_thinspace 0x0aa7 /* U+2009 THIN SPACE */ #define XK_hairspace 0x0aa8 /* U+200A HAIR SPACE */ #define XK_emdash 0x0aa9 /* U+2014 EM DASH */ #define XK_endash 0x0aaa /* U+2013 EN DASH */ #define XK_signifblank 0x0aac /*(U+2423 OPEN BOX)*/ #define XK_ellipsis 0x0aae /* U+2026 HORIZONTAL ELLIPSIS */ #define XK_doubbaselinedot 0x0aaf /* U+2025 TWO DOT LEADER */ #define XK_onethird 0x0ab0 /* U+2153 VULGAR FRACTION ONE THIRD */ #define XK_twothirds 0x0ab1 /* U+2154 VULGAR FRACTION TWO THIRDS */ #define XK_onefifth 0x0ab2 /* U+2155 VULGAR FRACTION ONE FIFTH */ #define XK_twofifths 0x0ab3 /* U+2156 VULGAR FRACTION TWO FIFTHS */ #define XK_threefifths 0x0ab4 /* U+2157 VULGAR FRACTION THREE FIFTHS */ #define XK_fourfifths 0x0ab5 /* U+2158 VULGAR FRACTION FOUR FIFTHS */ #define XK_onesixth 0x0ab6 /* U+2159 VULGAR FRACTION ONE SIXTH */ #define XK_fivesixths 0x0ab7 /* U+215A VULGAR FRACTION FIVE SIXTHS */ #define XK_careof 0x0ab8 /* U+2105 CARE OF */ #define XK_figdash 0x0abb /* U+2012 FIGURE DASH */ #define XK_leftanglebracket 0x0abc /*(U+27E8 MATHEMATICAL LEFT ANGLE BRACKET)*/ #define XK_decimalpoint 0x0abd /*(U+002E FULL STOP)*/ #define XK_rightanglebracket 0x0abe /*(U+27E9 MATHEMATICAL RIGHT ANGLE BRACKET)*/ #define XK_marker 0x0abf #define XK_oneeighth 0x0ac3 /* U+215B VULGAR FRACTION ONE EIGHTH */ #define XK_threeeighths 0x0ac4 /* U+215C VULGAR FRACTION THREE EIGHTHS */ #define XK_fiveeighths 0x0ac5 /* U+215D VULGAR FRACTION FIVE EIGHTHS */ #define XK_seveneighths 0x0ac6 /* U+215E VULGAR FRACTION SEVEN EIGHTHS */ #define XK_trademark 0x0ac9 /* U+2122 TRADE MARK SIGN */ #define XK_signaturemark 0x0aca /*(U+2613 SALTIRE)*/ #define XK_trademarkincircle 0x0acb #define XK_leftopentriangle 0x0acc /*(U+25C1 WHITE LEFT-POINTING TRIANGLE)*/ #define XK_rightopentriangle 0x0acd /*(U+25B7 WHITE RIGHT-POINTING TRIANGLE)*/ #define XK_emopencircle 0x0ace /*(U+25CB WHITE CIRCLE)*/ #define XK_emopenrectangle 0x0acf /*(U+25AF WHITE VERTICAL RECTANGLE)*/ #define XK_leftsinglequotemark 0x0ad0 /* U+2018 LEFT SINGLE QUOTATION MARK */ #define XK_rightsinglequotemark 0x0ad1 /* U+2019 RIGHT SINGLE QUOTATION MARK */ #define XK_leftdoublequotemark 0x0ad2 /* U+201C LEFT DOUBLE QUOTATION MARK */ #define XK_rightdoublequotemark 0x0ad3 /* U+201D RIGHT DOUBLE QUOTATION MARK */ #define XK_prescription 0x0ad4 /* U+211E PRESCRIPTION TAKE */ #define XK_permille 0x0ad5 /* U+2030 PER MILLE SIGN */ #define XK_minutes 0x0ad6 /* U+2032 PRIME */ #define XK_seconds 0x0ad7 /* U+2033 DOUBLE PRIME */ #define XK_latincross 0x0ad9 /* U+271D LATIN CROSS */ #define XK_hexagram 0x0ada #define XK_filledrectbullet 0x0adb /*(U+25AC BLACK RECTANGLE)*/ #define XK_filledlefttribullet 0x0adc /*(U+25C0 BLACK LEFT-POINTING TRIANGLE)*/ #define XK_filledrighttribullet 0x0add /*(U+25B6 BLACK RIGHT-POINTING TRIANGLE)*/ #define XK_emfilledcircle 0x0ade /*(U+25CF BLACK CIRCLE)*/ #define XK_emfilledrect 0x0adf /*(U+25AE BLACK VERTICAL RECTANGLE)*/ #define XK_enopencircbullet 0x0ae0 /*(U+25E6 WHITE BULLET)*/ #define XK_enopensquarebullet 0x0ae1 /*(U+25AB WHITE SMALL SQUARE)*/ #define XK_openrectbullet 0x0ae2 /*(U+25AD WHITE RECTANGLE)*/ #define XK_opentribulletup 0x0ae3 /*(U+25B3 WHITE UP-POINTING TRIANGLE)*/ #define XK_opentribulletdown 0x0ae4 /*(U+25BD WHITE DOWN-POINTING TRIANGLE)*/ #define XK_openstar 0x0ae5 /*(U+2606 WHITE STAR)*/ #define XK_enfilledcircbullet 0x0ae6 /*(U+2022 BULLET)*/ #define XK_enfilledsqbullet 0x0ae7 /*(U+25AA BLACK SMALL SQUARE)*/ #define XK_filledtribulletup 0x0ae8 /*(U+25B2 BLACK UP-POINTING TRIANGLE)*/ #define XK_filledtribulletdown 0x0ae9 /*(U+25BC BLACK DOWN-POINTING TRIANGLE)*/ #define XK_leftpointer 0x0aea /*(U+261C WHITE LEFT POINTING INDEX)*/ #define XK_rightpointer 0x0aeb /*(U+261E WHITE RIGHT POINTING INDEX)*/ #define XK_club 0x0aec /* U+2663 BLACK CLUB SUIT */ #define XK_diamond 0x0aed /* U+2666 BLACK DIAMOND SUIT */ #define XK_heart 0x0aee /* U+2665 BLACK HEART SUIT */ #define XK_maltesecross 0x0af0 /* U+2720 MALTESE CROSS */ #define XK_dagger 0x0af1 /* U+2020 DAGGER */ #define XK_doubledagger 0x0af2 /* U+2021 DOUBLE DAGGER */ #define XK_checkmark 0x0af3 /* U+2713 CHECK MARK */ #define XK_ballotcross 0x0af4 /* U+2717 BALLOT X */ #define XK_musicalsharp 0x0af5 /* U+266F MUSIC SHARP SIGN */ #define XK_musicalflat 0x0af6 /* U+266D MUSIC FLAT SIGN */ #define XK_malesymbol 0x0af7 /* U+2642 MALE SIGN */ #define XK_femalesymbol 0x0af8 /* U+2640 FEMALE SIGN */ #define XK_telephone 0x0af9 /* U+260E BLACK TELEPHONE */ #define XK_telephonerecorder 0x0afa /* U+2315 TELEPHONE RECORDER */ #define XK_phonographcopyright 0x0afb /* U+2117 SOUND RECORDING COPYRIGHT */ #define XK_caret 0x0afc /* U+2038 CARET */ #define XK_singlelowquotemark 0x0afd /* U+201A SINGLE LOW-9 QUOTATION MARK */ #define XK_doublelowquotemark 0x0afe /* U+201E DOUBLE LOW-9 QUOTATION MARK */ #define XK_cursor 0x0aff #endif /* XK_PUBLISHING */ /* * APL * Byte 3 = 0x0b */ #ifdef XK_APL #define XK_leftcaret 0x0ba3 /*(U+003C LESS-THAN SIGN)*/ #define XK_rightcaret 0x0ba6 /*(U+003E GREATER-THAN SIGN)*/ #define XK_downcaret 0x0ba8 /*(U+2228 LOGICAL OR)*/ #define XK_upcaret 0x0ba9 /*(U+2227 LOGICAL AND)*/ #define XK_overbar 0x0bc0 /*(U+00AF MACRON)*/ #define XK_downtack 0x0bc2 /* U+22A4 DOWN TACK */ #define XK_upshoe 0x0bc3 /*(U+2229 INTERSECTION)*/ #define XK_downstile 0x0bc4 /* U+230A LEFT FLOOR */ #define XK_underbar 0x0bc6 /*(U+005F LOW LINE)*/ #define XK_jot 0x0bca /* U+2218 RING OPERATOR */ #define XK_quad 0x0bcc /* U+2395 APL FUNCTIONAL SYMBOL QUAD */ #define XK_uptack 0x0bce /* U+22A5 UP TACK */ #define XK_circle 0x0bcf /* U+25CB WHITE CIRCLE */ #define XK_upstile 0x0bd3 /* U+2308 LEFT CEILING */ #define XK_downshoe 0x0bd6 /*(U+222A UNION)*/ #define XK_rightshoe 0x0bd8 /*(U+2283 SUPERSET OF)*/ #define XK_leftshoe 0x0bda /*(U+2282 SUBSET OF)*/ #define XK_lefttack 0x0bdc /* U+22A3 LEFT TACK */ #define XK_righttack 0x0bfc /* U+22A2 RIGHT TACK */ #endif /* XK_APL */ /* * Hebrew * Byte 3 = 0x0c */ #ifdef XK_HEBREW #define XK_hebrew_doublelowline 0x0cdf /* U+2017 DOUBLE LOW LINE */ #define XK_hebrew_aleph 0x0ce0 /* U+05D0 HEBREW LETTER ALEF */ #define XK_hebrew_bet 0x0ce1 /* U+05D1 HEBREW LETTER BET */ #define XK_hebrew_beth 0x0ce1 /* deprecated */ #define XK_hebrew_gimel 0x0ce2 /* U+05D2 HEBREW LETTER GIMEL */ #define XK_hebrew_gimmel 0x0ce2 /* deprecated */ #define XK_hebrew_dalet 0x0ce3 /* U+05D3 HEBREW LETTER DALET */ #define XK_hebrew_daleth 0x0ce3 /* deprecated */ #define XK_hebrew_he 0x0ce4 /* U+05D4 HEBREW LETTER HE */ #define XK_hebrew_waw 0x0ce5 /* U+05D5 HEBREW LETTER VAV */ #define XK_hebrew_zain 0x0ce6 /* U+05D6 HEBREW LETTER ZAYIN */ #define XK_hebrew_zayin 0x0ce6 /* deprecated */ #define XK_hebrew_chet 0x0ce7 /* U+05D7 HEBREW LETTER HET */ #define XK_hebrew_het 0x0ce7 /* deprecated */ #define XK_hebrew_tet 0x0ce8 /* U+05D8 HEBREW LETTER TET */ #define XK_hebrew_teth 0x0ce8 /* deprecated */ #define XK_hebrew_yod 0x0ce9 /* U+05D9 HEBREW LETTER YOD */ #define XK_hebrew_finalkaph 0x0cea /* U+05DA HEBREW LETTER FINAL KAF */ #define XK_hebrew_kaph 0x0ceb /* U+05DB HEBREW LETTER KAF */ #define XK_hebrew_lamed 0x0cec /* U+05DC HEBREW LETTER LAMED */ #define XK_hebrew_finalmem 0x0ced /* U+05DD HEBREW LETTER FINAL MEM */ #define XK_hebrew_mem 0x0cee /* U+05DE HEBREW LETTER MEM */ #define XK_hebrew_finalnun 0x0cef /* U+05DF HEBREW LETTER FINAL NUN */ #define XK_hebrew_nun 0x0cf0 /* U+05E0 HEBREW LETTER NUN */ #define XK_hebrew_samech 0x0cf1 /* U+05E1 HEBREW LETTER SAMEKH */ #define XK_hebrew_samekh 0x0cf1 /* deprecated */ #define XK_hebrew_ayin 0x0cf2 /* U+05E2 HEBREW LETTER AYIN */ #define XK_hebrew_finalpe 0x0cf3 /* U+05E3 HEBREW LETTER FINAL PE */ #define XK_hebrew_pe 0x0cf4 /* U+05E4 HEBREW LETTER PE */ #define XK_hebrew_finalzade 0x0cf5 /* U+05E5 HEBREW LETTER FINAL TSADI */ #define XK_hebrew_finalzadi 0x0cf5 /* deprecated */ #define XK_hebrew_zade 0x0cf6 /* U+05E6 HEBREW LETTER TSADI */ #define XK_hebrew_zadi 0x0cf6 /* deprecated */ #define XK_hebrew_qoph 0x0cf7 /* U+05E7 HEBREW LETTER QOF */ #define XK_hebrew_kuf 0x0cf7 /* deprecated */ #define XK_hebrew_resh 0x0cf8 /* U+05E8 HEBREW LETTER RESH */ #define XK_hebrew_shin 0x0cf9 /* U+05E9 HEBREW LETTER SHIN */ #define XK_hebrew_taw 0x0cfa /* U+05EA HEBREW LETTER TAV */ #define XK_hebrew_taf 0x0cfa /* deprecated */ #define XK_Hebrew_switch 0xff7e /* Alias for mode_switch */ #endif /* XK_HEBREW */ /* * Thai * Byte 3 = 0x0d */ #ifdef XK_THAI #define XK_Thai_kokai 0x0da1 /* U+0E01 THAI CHARACTER KO KAI */ #define XK_Thai_khokhai 0x0da2 /* U+0E02 THAI CHARACTER KHO KHAI */ #define XK_Thai_khokhuat 0x0da3 /* U+0E03 THAI CHARACTER KHO KHUAT */ #define XK_Thai_khokhwai 0x0da4 /* U+0E04 THAI CHARACTER KHO KHWAI */ #define XK_Thai_khokhon 0x0da5 /* U+0E05 THAI CHARACTER KHO KHON */ #define XK_Thai_khorakhang 0x0da6 /* U+0E06 THAI CHARACTER KHO RAKHANG */ #define XK_Thai_ngongu 0x0da7 /* U+0E07 THAI CHARACTER NGO NGU */ #define XK_Thai_chochan 0x0da8 /* U+0E08 THAI CHARACTER CHO CHAN */ #define XK_Thai_choching 0x0da9 /* U+0E09 THAI CHARACTER CHO CHING */ #define XK_Thai_chochang 0x0daa /* U+0E0A THAI CHARACTER CHO CHANG */ #define XK_Thai_soso 0x0dab /* U+0E0B THAI CHARACTER SO SO */ #define XK_Thai_chochoe 0x0dac /* U+0E0C THAI CHARACTER CHO CHOE */ #define XK_Thai_yoying 0x0dad /* U+0E0D THAI CHARACTER YO YING */ #define XK_Thai_dochada 0x0dae /* U+0E0E THAI CHARACTER DO CHADA */ #define XK_Thai_topatak 0x0daf /* U+0E0F THAI CHARACTER TO PATAK */ #define XK_Thai_thothan 0x0db0 /* U+0E10 THAI CHARACTER THO THAN */ #define XK_Thai_thonangmontho 0x0db1 /* U+0E11 THAI CHARACTER THO NANGMONTHO */ #define XK_Thai_thophuthao 0x0db2 /* U+0E12 THAI CHARACTER THO PHUTHAO */ #define XK_Thai_nonen 0x0db3 /* U+0E13 THAI CHARACTER NO NEN */ #define XK_Thai_dodek 0x0db4 /* U+0E14 THAI CHARACTER DO DEK */ #define XK_Thai_totao 0x0db5 /* U+0E15 THAI CHARACTER TO TAO */ #define XK_Thai_thothung 0x0db6 /* U+0E16 THAI CHARACTER THO THUNG */ #define XK_Thai_thothahan 0x0db7 /* U+0E17 THAI CHARACTER THO THAHAN */ #define XK_Thai_thothong 0x0db8 /* U+0E18 THAI CHARACTER THO THONG */ #define XK_Thai_nonu 0x0db9 /* U+0E19 THAI CHARACTER NO NU */ #define XK_Thai_bobaimai 0x0dba /* U+0E1A THAI CHARACTER BO BAIMAI */ #define XK_Thai_popla 0x0dbb /* U+0E1B THAI CHARACTER PO PLA */ #define XK_Thai_phophung 0x0dbc /* U+0E1C THAI CHARACTER PHO PHUNG */ #define XK_Thai_fofa 0x0dbd /* U+0E1D THAI CHARACTER FO FA */ #define XK_Thai_phophan 0x0dbe /* U+0E1E THAI CHARACTER PHO PHAN */ #define XK_Thai_fofan 0x0dbf /* U+0E1F THAI CHARACTER FO FAN */ #define XK_Thai_phosamphao 0x0dc0 /* U+0E20 THAI CHARACTER PHO SAMPHAO */ #define XK_Thai_moma 0x0dc1 /* U+0E21 THAI CHARACTER MO MA */ #define XK_Thai_yoyak 0x0dc2 /* U+0E22 THAI CHARACTER YO YAK */ #define XK_Thai_rorua 0x0dc3 /* U+0E23 THAI CHARACTER RO RUA */ #define XK_Thai_ru 0x0dc4 /* U+0E24 THAI CHARACTER RU */ #define XK_Thai_loling 0x0dc5 /* U+0E25 THAI CHARACTER LO LING */ #define XK_Thai_lu 0x0dc6 /* U+0E26 THAI CHARACTER LU */ #define XK_Thai_wowaen 0x0dc7 /* U+0E27 THAI CHARACTER WO WAEN */ #define XK_Thai_sosala 0x0dc8 /* U+0E28 THAI CHARACTER SO SALA */ #define XK_Thai_sorusi 0x0dc9 /* U+0E29 THAI CHARACTER SO RUSI */ #define XK_Thai_sosua 0x0dca /* U+0E2A THAI CHARACTER SO SUA */ #define XK_Thai_hohip 0x0dcb /* U+0E2B THAI CHARACTER HO HIP */ #define XK_Thai_lochula 0x0dcc /* U+0E2C THAI CHARACTER LO CHULA */ #define XK_Thai_oang 0x0dcd /* U+0E2D THAI CHARACTER O ANG */ #define XK_Thai_honokhuk 0x0dce /* U+0E2E THAI CHARACTER HO NOKHUK */ #define XK_Thai_paiyannoi 0x0dcf /* U+0E2F THAI CHARACTER PAIYANNOI */ #define XK_Thai_saraa 0x0dd0 /* U+0E30 THAI CHARACTER SARA A */ #define XK_Thai_maihanakat 0x0dd1 /* U+0E31 THAI CHARACTER MAI HAN-AKAT */ #define XK_Thai_saraaa 0x0dd2 /* U+0E32 THAI CHARACTER SARA AA */ #define XK_Thai_saraam 0x0dd3 /* U+0E33 THAI CHARACTER SARA AM */ #define XK_Thai_sarai 0x0dd4 /* U+0E34 THAI CHARACTER SARA I */ #define XK_Thai_saraii 0x0dd5 /* U+0E35 THAI CHARACTER SARA II */ #define XK_Thai_saraue 0x0dd6 /* U+0E36 THAI CHARACTER SARA UE */ #define XK_Thai_sarauee 0x0dd7 /* U+0E37 THAI CHARACTER SARA UEE */ #define XK_Thai_sarau 0x0dd8 /* U+0E38 THAI CHARACTER SARA U */ #define XK_Thai_sarauu 0x0dd9 /* U+0E39 THAI CHARACTER SARA UU */ #define XK_Thai_phinthu 0x0dda /* U+0E3A THAI CHARACTER PHINTHU */ #define XK_Thai_maihanakat_maitho 0x0dde #define XK_Thai_baht 0x0ddf /* U+0E3F THAI CURRENCY SYMBOL BAHT */ #define XK_Thai_sarae 0x0de0 /* U+0E40 THAI CHARACTER SARA E */ #define XK_Thai_saraae 0x0de1 /* U+0E41 THAI CHARACTER SARA AE */ #define XK_Thai_sarao 0x0de2 /* U+0E42 THAI CHARACTER SARA O */ #define XK_Thai_saraaimaimuan 0x0de3 /* U+0E43 THAI CHARACTER SARA AI MAIMUAN */ #define XK_Thai_saraaimaimalai 0x0de4 /* U+0E44 THAI CHARACTER SARA AI MAIMALAI */ #define XK_Thai_lakkhangyao 0x0de5 /* U+0E45 THAI CHARACTER LAKKHANGYAO */ #define XK_Thai_maiyamok 0x0de6 /* U+0E46 THAI CHARACTER MAIYAMOK */ #define XK_Thai_maitaikhu 0x0de7 /* U+0E47 THAI CHARACTER MAITAIKHU */ #define XK_Thai_maiek 0x0de8 /* U+0E48 THAI CHARACTER MAI EK */ #define XK_Thai_maitho 0x0de9 /* U+0E49 THAI CHARACTER MAI THO */ #define XK_Thai_maitri 0x0dea /* U+0E4A THAI CHARACTER MAI TRI */ #define XK_Thai_maichattawa 0x0deb /* U+0E4B THAI CHARACTER MAI CHATTAWA */ #define XK_Thai_thanthakhat 0x0dec /* U+0E4C THAI CHARACTER THANTHAKHAT */ #define XK_Thai_nikhahit 0x0ded /* U+0E4D THAI CHARACTER NIKHAHIT */ #define XK_Thai_leksun 0x0df0 /* U+0E50 THAI DIGIT ZERO */ #define XK_Thai_leknung 0x0df1 /* U+0E51 THAI DIGIT ONE */ #define XK_Thai_leksong 0x0df2 /* U+0E52 THAI DIGIT TWO */ #define XK_Thai_leksam 0x0df3 /* U+0E53 THAI DIGIT THREE */ #define XK_Thai_leksi 0x0df4 /* U+0E54 THAI DIGIT FOUR */ #define XK_Thai_lekha 0x0df5 /* U+0E55 THAI DIGIT FIVE */ #define XK_Thai_lekhok 0x0df6 /* U+0E56 THAI DIGIT SIX */ #define XK_Thai_lekchet 0x0df7 /* U+0E57 THAI DIGIT SEVEN */ #define XK_Thai_lekpaet 0x0df8 /* U+0E58 THAI DIGIT EIGHT */ #define XK_Thai_lekkao 0x0df9 /* U+0E59 THAI DIGIT NINE */ #endif /* XK_THAI */ /* * Korean * Byte 3 = 0x0e */ #ifdef XK_KOREAN #define XK_Hangul 0xff31 /* Hangul start/stop(toggle) */ #define XK_Hangul_Start 0xff32 /* Hangul start */ #define XK_Hangul_End 0xff33 /* Hangul end, English start */ #define XK_Hangul_Hanja 0xff34 /* Start Hangul->Hanja Conversion */ #define XK_Hangul_Jamo 0xff35 /* Hangul Jamo mode */ #define XK_Hangul_Romaja 0xff36 /* Hangul Romaja mode */ #define XK_Hangul_Codeinput 0xff37 /* Hangul code input mode */ #define XK_Hangul_Jeonja 0xff38 /* Jeonja mode */ #define XK_Hangul_Banja 0xff39 /* Banja mode */ #define XK_Hangul_PreHanja 0xff3a /* Pre Hanja conversion */ #define XK_Hangul_PostHanja 0xff3b /* Post Hanja conversion */ #define XK_Hangul_SingleCandidate 0xff3c /* Single candidate */ #define XK_Hangul_MultipleCandidate 0xff3d /* Multiple candidate */ #define XK_Hangul_PreviousCandidate 0xff3e /* Previous candidate */ #define XK_Hangul_Special 0xff3f /* Special symbols */ #define XK_Hangul_switch 0xff7e /* Alias for mode_switch */ /* Hangul Consonant Characters */ #define XK_Hangul_Kiyeog 0x0ea1 #define XK_Hangul_SsangKiyeog 0x0ea2 #define XK_Hangul_KiyeogSios 0x0ea3 #define XK_Hangul_Nieun 0x0ea4 #define XK_Hangul_NieunJieuj 0x0ea5 #define XK_Hangul_NieunHieuh 0x0ea6 #define XK_Hangul_Dikeud 0x0ea7 #define XK_Hangul_SsangDikeud 0x0ea8 #define XK_Hangul_Rieul 0x0ea9 #define XK_Hangul_RieulKiyeog 0x0eaa #define XK_Hangul_RieulMieum 0x0eab #define XK_Hangul_RieulPieub 0x0eac #define XK_Hangul_RieulSios 0x0ead #define XK_Hangul_RieulTieut 0x0eae #define XK_Hangul_RieulPhieuf 0x0eaf #define XK_Hangul_RieulHieuh 0x0eb0 #define XK_Hangul_Mieum 0x0eb1 #define XK_Hangul_Pieub 0x0eb2 #define XK_Hangul_SsangPieub 0x0eb3 #define XK_Hangul_PieubSios 0x0eb4 #define XK_Hangul_Sios 0x0eb5 #define XK_Hangul_SsangSios 0x0eb6 #define XK_Hangul_Ieung 0x0eb7 #define XK_Hangul_Jieuj 0x0eb8 #define XK_Hangul_SsangJieuj 0x0eb9 #define XK_Hangul_Cieuc 0x0eba #define XK_Hangul_Khieuq 0x0ebb #define XK_Hangul_Tieut 0x0ebc #define XK_Hangul_Phieuf 0x0ebd #define XK_Hangul_Hieuh 0x0ebe /* Hangul Vowel Characters */ #define XK_Hangul_A 0x0ebf #define XK_Hangul_AE 0x0ec0 #define XK_Hangul_YA 0x0ec1 #define XK_Hangul_YAE 0x0ec2 #define XK_Hangul_EO 0x0ec3 #define XK_Hangul_E 0x0ec4 #define XK_Hangul_YEO 0x0ec5 #define XK_Hangul_YE 0x0ec6 #define XK_Hangul_O 0x0ec7 #define XK_Hangul_WA 0x0ec8 #define XK_Hangul_WAE 0x0ec9 #define XK_Hangul_OE 0x0eca #define XK_Hangul_YO 0x0ecb #define XK_Hangul_U 0x0ecc #define XK_Hangul_WEO 0x0ecd #define XK_Hangul_WE 0x0ece #define XK_Hangul_WI 0x0ecf #define XK_Hangul_YU 0x0ed0 #define XK_Hangul_EU 0x0ed1 #define XK_Hangul_YI 0x0ed2 #define XK_Hangul_I 0x0ed3 /* Hangul syllable-final (JongSeong) Characters */ #define XK_Hangul_J_Kiyeog 0x0ed4 #define XK_Hangul_J_SsangKiyeog 0x0ed5 #define XK_Hangul_J_KiyeogSios 0x0ed6 #define XK_Hangul_J_Nieun 0x0ed7 #define XK_Hangul_J_NieunJieuj 0x0ed8 #define XK_Hangul_J_NieunHieuh 0x0ed9 #define XK_Hangul_J_Dikeud 0x0eda #define XK_Hangul_J_Rieul 0x0edb #define XK_Hangul_J_RieulKiyeog 0x0edc #define XK_Hangul_J_RieulMieum 0x0edd #define XK_Hangul_J_RieulPieub 0x0ede #define XK_Hangul_J_RieulSios 0x0edf #define XK_Hangul_J_RieulTieut 0x0ee0 #define XK_Hangul_J_RieulPhieuf 0x0ee1 #define XK_Hangul_J_RieulHieuh 0x0ee2 #define XK_Hangul_J_Mieum 0x0ee3 #define XK_Hangul_J_Pieub 0x0ee4 #define XK_Hangul_J_PieubSios 0x0ee5 #define XK_Hangul_J_Sios 0x0ee6 #define XK_Hangul_J_SsangSios 0x0ee7 #define XK_Hangul_J_Ieung 0x0ee8 #define XK_Hangul_J_Jieuj 0x0ee9 #define XK_Hangul_J_Cieuc 0x0eea #define XK_Hangul_J_Khieuq 0x0eeb #define XK_Hangul_J_Tieut 0x0eec #define XK_Hangul_J_Phieuf 0x0eed #define XK_Hangul_J_Hieuh 0x0eee /* Ancient Hangul Consonant Characters */ #define XK_Hangul_RieulYeorinHieuh 0x0eef #define XK_Hangul_SunkyeongeumMieum 0x0ef0 #define XK_Hangul_SunkyeongeumPieub 0x0ef1 #define XK_Hangul_PanSios 0x0ef2 #define XK_Hangul_KkogjiDalrinIeung 0x0ef3 #define XK_Hangul_SunkyeongeumPhieuf 0x0ef4 #define XK_Hangul_YeorinHieuh 0x0ef5 /* Ancient Hangul Vowel Characters */ #define XK_Hangul_AraeA 0x0ef6 #define XK_Hangul_AraeAE 0x0ef7 /* Ancient Hangul syllable-final (JongSeong) Characters */ #define XK_Hangul_J_PanSios 0x0ef8 #define XK_Hangul_J_KkogjiDalrinIeung 0x0ef9 #define XK_Hangul_J_YeorinHieuh 0x0efa /* Korean currency symbol */ #define XK_Korean_Won 0x0eff /*(U+20A9 WON SIGN)*/ #endif /* XK_KOREAN */ /* * Armenian */ #ifdef XK_ARMENIAN #define XK_Armenian_ligature_ew 0x1000587 /* U+0587 ARMENIAN SMALL LIGATURE ECH YIWN */ #define XK_Armenian_full_stop 0x1000589 /* U+0589 ARMENIAN FULL STOP */ #define XK_Armenian_verjaket 0x1000589 /* U+0589 ARMENIAN FULL STOP */ #define XK_Armenian_separation_mark 0x100055d /* U+055D ARMENIAN COMMA */ #define XK_Armenian_but 0x100055d /* U+055D ARMENIAN COMMA */ #define XK_Armenian_hyphen 0x100058a /* U+058A ARMENIAN HYPHEN */ #define XK_Armenian_yentamna 0x100058a /* U+058A ARMENIAN HYPHEN */ #define XK_Armenian_exclam 0x100055c /* U+055C ARMENIAN EXCLAMATION MARK */ #define XK_Armenian_amanak 0x100055c /* U+055C ARMENIAN EXCLAMATION MARK */ #define XK_Armenian_accent 0x100055b /* U+055B ARMENIAN EMPHASIS MARK */ #define XK_Armenian_shesht 0x100055b /* U+055B ARMENIAN EMPHASIS MARK */ #define XK_Armenian_question 0x100055e /* U+055E ARMENIAN QUESTION MARK */ #define XK_Armenian_paruyk 0x100055e /* U+055E ARMENIAN QUESTION MARK */ #define XK_Armenian_AYB 0x1000531 /* U+0531 ARMENIAN CAPITAL LETTER AYB */ #define XK_Armenian_ayb 0x1000561 /* U+0561 ARMENIAN SMALL LETTER AYB */ #define XK_Armenian_BEN 0x1000532 /* U+0532 ARMENIAN CAPITAL LETTER BEN */ #define XK_Armenian_ben 0x1000562 /* U+0562 ARMENIAN SMALL LETTER BEN */ #define XK_Armenian_GIM 0x1000533 /* U+0533 ARMENIAN CAPITAL LETTER GIM */ #define XK_Armenian_gim 0x1000563 /* U+0563 ARMENIAN SMALL LETTER GIM */ #define XK_Armenian_DA 0x1000534 /* U+0534 ARMENIAN CAPITAL LETTER DA */ #define XK_Armenian_da 0x1000564 /* U+0564 ARMENIAN SMALL LETTER DA */ #define XK_Armenian_YECH 0x1000535 /* U+0535 ARMENIAN CAPITAL LETTER ECH */ #define XK_Armenian_yech 0x1000565 /* U+0565 ARMENIAN SMALL LETTER ECH */ #define XK_Armenian_ZA 0x1000536 /* U+0536 ARMENIAN CAPITAL LETTER ZA */ #define XK_Armenian_za 0x1000566 /* U+0566 ARMENIAN SMALL LETTER ZA */ #define XK_Armenian_E 0x1000537 /* U+0537 ARMENIAN CAPITAL LETTER EH */ #define XK_Armenian_e 0x1000567 /* U+0567 ARMENIAN SMALL LETTER EH */ #define XK_Armenian_AT 0x1000538 /* U+0538 ARMENIAN CAPITAL LETTER ET */ #define XK_Armenian_at 0x1000568 /* U+0568 ARMENIAN SMALL LETTER ET */ #define XK_Armenian_TO 0x1000539 /* U+0539 ARMENIAN CAPITAL LETTER TO */ #define XK_Armenian_to 0x1000569 /* U+0569 ARMENIAN SMALL LETTER TO */ #define XK_Armenian_ZHE 0x100053a /* U+053A ARMENIAN CAPITAL LETTER ZHE */ #define XK_Armenian_zhe 0x100056a /* U+056A ARMENIAN SMALL LETTER ZHE */ #define XK_Armenian_INI 0x100053b /* U+053B ARMENIAN CAPITAL LETTER INI */ #define XK_Armenian_ini 0x100056b /* U+056B ARMENIAN SMALL LETTER INI */ #define XK_Armenian_LYUN 0x100053c /* U+053C ARMENIAN CAPITAL LETTER LIWN */ #define XK_Armenian_lyun 0x100056c /* U+056C ARMENIAN SMALL LETTER LIWN */ #define XK_Armenian_KHE 0x100053d /* U+053D ARMENIAN CAPITAL LETTER XEH */ #define XK_Armenian_khe 0x100056d /* U+056D ARMENIAN SMALL LETTER XEH */ #define XK_Armenian_TSA 0x100053e /* U+053E ARMENIAN CAPITAL LETTER CA */ #define XK_Armenian_tsa 0x100056e /* U+056E ARMENIAN SMALL LETTER CA */ #define XK_Armenian_KEN 0x100053f /* U+053F ARMENIAN CAPITAL LETTER KEN */ #define XK_Armenian_ken 0x100056f /* U+056F ARMENIAN SMALL LETTER KEN */ #define XK_Armenian_HO 0x1000540 /* U+0540 ARMENIAN CAPITAL LETTER HO */ #define XK_Armenian_ho 0x1000570 /* U+0570 ARMENIAN SMALL LETTER HO */ #define XK_Armenian_DZA 0x1000541 /* U+0541 ARMENIAN CAPITAL LETTER JA */ #define XK_Armenian_dza 0x1000571 /* U+0571 ARMENIAN SMALL LETTER JA */ #define XK_Armenian_GHAT 0x1000542 /* U+0542 ARMENIAN CAPITAL LETTER GHAD */ #define XK_Armenian_ghat 0x1000572 /* U+0572 ARMENIAN SMALL LETTER GHAD */ #define XK_Armenian_TCHE 0x1000543 /* U+0543 ARMENIAN CAPITAL LETTER CHEH */ #define XK_Armenian_tche 0x1000573 /* U+0573 ARMENIAN SMALL LETTER CHEH */ #define XK_Armenian_MEN 0x1000544 /* U+0544 ARMENIAN CAPITAL LETTER MEN */ #define XK_Armenian_men 0x1000574 /* U+0574 ARMENIAN SMALL LETTER MEN */ #define XK_Armenian_HI 0x1000545 /* U+0545 ARMENIAN CAPITAL LETTER YI */ #define XK_Armenian_hi 0x1000575 /* U+0575 ARMENIAN SMALL LETTER YI */ #define XK_Armenian_NU 0x1000546 /* U+0546 ARMENIAN CAPITAL LETTER NOW */ #define XK_Armenian_nu 0x1000576 /* U+0576 ARMENIAN SMALL LETTER NOW */ #define XK_Armenian_SHA 0x1000547 /* U+0547 ARMENIAN CAPITAL LETTER SHA */ #define XK_Armenian_sha 0x1000577 /* U+0577 ARMENIAN SMALL LETTER SHA */ #define XK_Armenian_VO 0x1000548 /* U+0548 ARMENIAN CAPITAL LETTER VO */ #define XK_Armenian_vo 0x1000578 /* U+0578 ARMENIAN SMALL LETTER VO */ #define XK_Armenian_CHA 0x1000549 /* U+0549 ARMENIAN CAPITAL LETTER CHA */ #define XK_Armenian_cha 0x1000579 /* U+0579 ARMENIAN SMALL LETTER CHA */ #define XK_Armenian_PE 0x100054a /* U+054A ARMENIAN CAPITAL LETTER PEH */ #define XK_Armenian_pe 0x100057a /* U+057A ARMENIAN SMALL LETTER PEH */ #define XK_Armenian_JE 0x100054b /* U+054B ARMENIAN CAPITAL LETTER JHEH */ #define XK_Armenian_je 0x100057b /* U+057B ARMENIAN SMALL LETTER JHEH */ #define XK_Armenian_RA 0x100054c /* U+054C ARMENIAN CAPITAL LETTER RA */ #define XK_Armenian_ra 0x100057c /* U+057C ARMENIAN SMALL LETTER RA */ #define XK_Armenian_SE 0x100054d /* U+054D ARMENIAN CAPITAL LETTER SEH */ #define XK_Armenian_se 0x100057d /* U+057D ARMENIAN SMALL LETTER SEH */ #define XK_Armenian_VEV 0x100054e /* U+054E ARMENIAN CAPITAL LETTER VEW */ #define XK_Armenian_vev 0x100057e /* U+057E ARMENIAN SMALL LETTER VEW */ #define XK_Armenian_TYUN 0x100054f /* U+054F ARMENIAN CAPITAL LETTER TIWN */ #define XK_Armenian_tyun 0x100057f /* U+057F ARMENIAN SMALL LETTER TIWN */ #define XK_Armenian_RE 0x1000550 /* U+0550 ARMENIAN CAPITAL LETTER REH */ #define XK_Armenian_re 0x1000580 /* U+0580 ARMENIAN SMALL LETTER REH */ #define XK_Armenian_TSO 0x1000551 /* U+0551 ARMENIAN CAPITAL LETTER CO */ #define XK_Armenian_tso 0x1000581 /* U+0581 ARMENIAN SMALL LETTER CO */ #define XK_Armenian_VYUN 0x1000552 /* U+0552 ARMENIAN CAPITAL LETTER YIWN */ #define XK_Armenian_vyun 0x1000582 /* U+0582 ARMENIAN SMALL LETTER YIWN */ #define XK_Armenian_PYUR 0x1000553 /* U+0553 ARMENIAN CAPITAL LETTER PIWR */ #define XK_Armenian_pyur 0x1000583 /* U+0583 ARMENIAN SMALL LETTER PIWR */ #define XK_Armenian_KE 0x1000554 /* U+0554 ARMENIAN CAPITAL LETTER KEH */ #define XK_Armenian_ke 0x1000584 /* U+0584 ARMENIAN SMALL LETTER KEH */ #define XK_Armenian_O 0x1000555 /* U+0555 ARMENIAN CAPITAL LETTER OH */ #define XK_Armenian_o 0x1000585 /* U+0585 ARMENIAN SMALL LETTER OH */ #define XK_Armenian_FE 0x1000556 /* U+0556 ARMENIAN CAPITAL LETTER FEH */ #define XK_Armenian_fe 0x1000586 /* U+0586 ARMENIAN SMALL LETTER FEH */ #define XK_Armenian_apostrophe 0x100055a /* U+055A ARMENIAN APOSTROPHE */ #endif /* XK_ARMENIAN */ /* * Georgian */ #ifdef XK_GEORGIAN #define XK_Georgian_an 0x10010d0 /* U+10D0 GEORGIAN LETTER AN */ #define XK_Georgian_ban 0x10010d1 /* U+10D1 GEORGIAN LETTER BAN */ #define XK_Georgian_gan 0x10010d2 /* U+10D2 GEORGIAN LETTER GAN */ #define XK_Georgian_don 0x10010d3 /* U+10D3 GEORGIAN LETTER DON */ #define XK_Georgian_en 0x10010d4 /* U+10D4 GEORGIAN LETTER EN */ #define XK_Georgian_vin 0x10010d5 /* U+10D5 GEORGIAN LETTER VIN */ #define XK_Georgian_zen 0x10010d6 /* U+10D6 GEORGIAN LETTER ZEN */ #define XK_Georgian_tan 0x10010d7 /* U+10D7 GEORGIAN LETTER TAN */ #define XK_Georgian_in 0x10010d8 /* U+10D8 GEORGIAN LETTER IN */ #define XK_Georgian_kan 0x10010d9 /* U+10D9 GEORGIAN LETTER KAN */ #define XK_Georgian_las 0x10010da /* U+10DA GEORGIAN LETTER LAS */ #define XK_Georgian_man 0x10010db /* U+10DB GEORGIAN LETTER MAN */ #define XK_Georgian_nar 0x10010dc /* U+10DC GEORGIAN LETTER NAR */ #define XK_Georgian_on 0x10010dd /* U+10DD GEORGIAN LETTER ON */ #define XK_Georgian_par 0x10010de /* U+10DE GEORGIAN LETTER PAR */ #define XK_Georgian_zhar 0x10010df /* U+10DF GEORGIAN LETTER ZHAR */ #define XK_Georgian_rae 0x10010e0 /* U+10E0 GEORGIAN LETTER RAE */ #define XK_Georgian_san 0x10010e1 /* U+10E1 GEORGIAN LETTER SAN */ #define XK_Georgian_tar 0x10010e2 /* U+10E2 GEORGIAN LETTER TAR */ #define XK_Georgian_un 0x10010e3 /* U+10E3 GEORGIAN LETTER UN */ #define XK_Georgian_phar 0x10010e4 /* U+10E4 GEORGIAN LETTER PHAR */ #define XK_Georgian_khar 0x10010e5 /* U+10E5 GEORGIAN LETTER KHAR */ #define XK_Georgian_ghan 0x10010e6 /* U+10E6 GEORGIAN LETTER GHAN */ #define XK_Georgian_qar 0x10010e7 /* U+10E7 GEORGIAN LETTER QAR */ #define XK_Georgian_shin 0x10010e8 /* U+10E8 GEORGIAN LETTER SHIN */ #define XK_Georgian_chin 0x10010e9 /* U+10E9 GEORGIAN LETTER CHIN */ #define XK_Georgian_can 0x10010ea /* U+10EA GEORGIAN LETTER CAN */ #define XK_Georgian_jil 0x10010eb /* U+10EB GEORGIAN LETTER JIL */ #define XK_Georgian_cil 0x10010ec /* U+10EC GEORGIAN LETTER CIL */ #define XK_Georgian_char 0x10010ed /* U+10ED GEORGIAN LETTER CHAR */ #define XK_Georgian_xan 0x10010ee /* U+10EE GEORGIAN LETTER XAN */ #define XK_Georgian_jhan 0x10010ef /* U+10EF GEORGIAN LETTER JHAN */ #define XK_Georgian_hae 0x10010f0 /* U+10F0 GEORGIAN LETTER HAE */ #define XK_Georgian_he 0x10010f1 /* U+10F1 GEORGIAN LETTER HE */ #define XK_Georgian_hie 0x10010f2 /* U+10F2 GEORGIAN LETTER HIE */ #define XK_Georgian_we 0x10010f3 /* U+10F3 GEORGIAN LETTER WE */ #define XK_Georgian_har 0x10010f4 /* U+10F4 GEORGIAN LETTER HAR */ #define XK_Georgian_hoe 0x10010f5 /* U+10F5 GEORGIAN LETTER HOE */ #define XK_Georgian_fi 0x10010f6 /* U+10F6 GEORGIAN LETTER FI */ #endif /* XK_GEORGIAN */ /* * Azeri (and other Turkic or Caucasian languages) */ #ifdef XK_CAUCASUS /* latin */ #define XK_Xabovedot 0x1001e8a /* U+1E8A LATIN CAPITAL LETTER X WITH DOT ABOVE */ #define XK_Ibreve 0x100012c /* U+012C LATIN CAPITAL LETTER I WITH BREVE */ #define XK_Zstroke 0x10001b5 /* U+01B5 LATIN CAPITAL LETTER Z WITH STROKE */ #define XK_Gcaron 0x10001e6 /* U+01E6 LATIN CAPITAL LETTER G WITH CARON */ #define XK_Ocaron 0x10001d1 /* U+01D2 LATIN CAPITAL LETTER O WITH CARON */ #define XK_Obarred 0x100019f /* U+019F LATIN CAPITAL LETTER O WITH MIDDLE TILDE */ #define XK_xabovedot 0x1001e8b /* U+1E8B LATIN SMALL LETTER X WITH DOT ABOVE */ #define XK_ibreve 0x100012d /* U+012D LATIN SMALL LETTER I WITH BREVE */ #define XK_zstroke 0x10001b6 /* U+01B6 LATIN SMALL LETTER Z WITH STROKE */ #define XK_gcaron 0x10001e7 /* U+01E7 LATIN SMALL LETTER G WITH CARON */ #define XK_ocaron 0x10001d2 /* U+01D2 LATIN SMALL LETTER O WITH CARON */ #define XK_obarred 0x1000275 /* U+0275 LATIN SMALL LETTER BARRED O */ #define XK_SCHWA 0x100018f /* U+018F LATIN CAPITAL LETTER SCHWA */ #define XK_schwa 0x1000259 /* U+0259 LATIN SMALL LETTER SCHWA */ #define XK_EZH 0x10001b7 /* U+01B7 LATIN CAPITAL LETTER EZH */ #define XK_ezh 0x1000292 /* U+0292 LATIN SMALL LETTER EZH */ /* those are not really Caucasus */ /* For Inupiak */ #define XK_Lbelowdot 0x1001e36 /* U+1E36 LATIN CAPITAL LETTER L WITH DOT BELOW */ #define XK_lbelowdot 0x1001e37 /* U+1E37 LATIN SMALL LETTER L WITH DOT BELOW */ #endif /* XK_CAUCASUS */ /* * Vietnamese */ #ifdef XK_VIETNAMESE #define XK_Abelowdot 0x1001ea0 /* U+1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW */ #define XK_abelowdot 0x1001ea1 /* U+1EA1 LATIN SMALL LETTER A WITH DOT BELOW */ #define XK_Ahook 0x1001ea2 /* U+1EA2 LATIN CAPITAL LETTER A WITH HOOK ABOVE */ #define XK_ahook 0x1001ea3 /* U+1EA3 LATIN SMALL LETTER A WITH HOOK ABOVE */ #define XK_Acircumflexacute 0x1001ea4 /* U+1EA4 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE */ #define XK_acircumflexacute 0x1001ea5 /* U+1EA5 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE */ #define XK_Acircumflexgrave 0x1001ea6 /* U+1EA6 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE */ #define XK_acircumflexgrave 0x1001ea7 /* U+1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE */ #define XK_Acircumflexhook 0x1001ea8 /* U+1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ #define XK_acircumflexhook 0x1001ea9 /* U+1EA9 LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE */ #define XK_Acircumflextilde 0x1001eaa /* U+1EAA LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE */ #define XK_acircumflextilde 0x1001eab /* U+1EAB LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE */ #define XK_Acircumflexbelowdot 0x1001eac /* U+1EAC LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ #define XK_acircumflexbelowdot 0x1001ead /* U+1EAD LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW */ #define XK_Abreveacute 0x1001eae /* U+1EAE LATIN CAPITAL LETTER A WITH BREVE AND ACUTE */ #define XK_abreveacute 0x1001eaf /* U+1EAF LATIN SMALL LETTER A WITH BREVE AND ACUTE */ #define XK_Abrevegrave 0x1001eb0 /* U+1EB0 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE */ #define XK_abrevegrave 0x1001eb1 /* U+1EB1 LATIN SMALL LETTER A WITH BREVE AND GRAVE */ #define XK_Abrevehook 0x1001eb2 /* U+1EB2 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE */ #define XK_abrevehook 0x1001eb3 /* U+1EB3 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE */ #define XK_Abrevetilde 0x1001eb4 /* U+1EB4 LATIN CAPITAL LETTER A WITH BREVE AND TILDE */ #define XK_abrevetilde 0x1001eb5 /* U+1EB5 LATIN SMALL LETTER A WITH BREVE AND TILDE */ #define XK_Abrevebelowdot 0x1001eb6 /* U+1EB6 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW */ #define XK_abrevebelowdot 0x1001eb7 /* U+1EB7 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW */ #define XK_Ebelowdot 0x1001eb8 /* U+1EB8 LATIN CAPITAL LETTER E WITH DOT BELOW */ #define XK_ebelowdot 0x1001eb9 /* U+1EB9 LATIN SMALL LETTER E WITH DOT BELOW */ #define XK_Ehook 0x1001eba /* U+1EBA LATIN CAPITAL LETTER E WITH HOOK ABOVE */ #define XK_ehook 0x1001ebb /* U+1EBB LATIN SMALL LETTER E WITH HOOK ABOVE */ #define XK_Etilde 0x1001ebc /* U+1EBC LATIN CAPITAL LETTER E WITH TILDE */ #define XK_etilde 0x1001ebd /* U+1EBD LATIN SMALL LETTER E WITH TILDE */ #define XK_Ecircumflexacute 0x1001ebe /* U+1EBE LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE */ #define XK_ecircumflexacute 0x1001ebf /* U+1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE */ #define XK_Ecircumflexgrave 0x1001ec0 /* U+1EC0 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE */ #define XK_ecircumflexgrave 0x1001ec1 /* U+1EC1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE */ #define XK_Ecircumflexhook 0x1001ec2 /* U+1EC2 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ #define XK_ecircumflexhook 0x1001ec3 /* U+1EC3 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE */ #define XK_Ecircumflextilde 0x1001ec4 /* U+1EC4 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE */ #define XK_ecircumflextilde 0x1001ec5 /* U+1EC5 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE */ #define XK_Ecircumflexbelowdot 0x1001ec6 /* U+1EC6 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ #define XK_ecircumflexbelowdot 0x1001ec7 /* U+1EC7 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW */ #define XK_Ihook 0x1001ec8 /* U+1EC8 LATIN CAPITAL LETTER I WITH HOOK ABOVE */ #define XK_ihook 0x1001ec9 /* U+1EC9 LATIN SMALL LETTER I WITH HOOK ABOVE */ #define XK_Ibelowdot 0x1001eca /* U+1ECA LATIN CAPITAL LETTER I WITH DOT BELOW */ #define XK_ibelowdot 0x1001ecb /* U+1ECB LATIN SMALL LETTER I WITH DOT BELOW */ #define XK_Obelowdot 0x1001ecc /* U+1ECC LATIN CAPITAL LETTER O WITH DOT BELOW */ #define XK_obelowdot 0x1001ecd /* U+1ECD LATIN SMALL LETTER O WITH DOT BELOW */ #define XK_Ohook 0x1001ece /* U+1ECE LATIN CAPITAL LETTER O WITH HOOK ABOVE */ #define XK_ohook 0x1001ecf /* U+1ECF LATIN SMALL LETTER O WITH HOOK ABOVE */ #define XK_Ocircumflexacute 0x1001ed0 /* U+1ED0 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE */ #define XK_ocircumflexacute 0x1001ed1 /* U+1ED1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE */ #define XK_Ocircumflexgrave 0x1001ed2 /* U+1ED2 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE */ #define XK_ocircumflexgrave 0x1001ed3 /* U+1ED3 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE */ #define XK_Ocircumflexhook 0x1001ed4 /* U+1ED4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ #define XK_ocircumflexhook 0x1001ed5 /* U+1ED5 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE */ #define XK_Ocircumflextilde 0x1001ed6 /* U+1ED6 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE */ #define XK_ocircumflextilde 0x1001ed7 /* U+1ED7 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE */ #define XK_Ocircumflexbelowdot 0x1001ed8 /* U+1ED8 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ #define XK_ocircumflexbelowdot 0x1001ed9 /* U+1ED9 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW */ #define XK_Ohornacute 0x1001eda /* U+1EDA LATIN CAPITAL LETTER O WITH HORN AND ACUTE */ #define XK_ohornacute 0x1001edb /* U+1EDB LATIN SMALL LETTER O WITH HORN AND ACUTE */ #define XK_Ohorngrave 0x1001edc /* U+1EDC LATIN CAPITAL LETTER O WITH HORN AND GRAVE */ #define XK_ohorngrave 0x1001edd /* U+1EDD LATIN SMALL LETTER O WITH HORN AND GRAVE */ #define XK_Ohornhook 0x1001ede /* U+1EDE LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE */ #define XK_ohornhook 0x1001edf /* U+1EDF LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE */ #define XK_Ohorntilde 0x1001ee0 /* U+1EE0 LATIN CAPITAL LETTER O WITH HORN AND TILDE */ #define XK_ohorntilde 0x1001ee1 /* U+1EE1 LATIN SMALL LETTER O WITH HORN AND TILDE */ #define XK_Ohornbelowdot 0x1001ee2 /* U+1EE2 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW */ #define XK_ohornbelowdot 0x1001ee3 /* U+1EE3 LATIN SMALL LETTER O WITH HORN AND DOT BELOW */ #define XK_Ubelowdot 0x1001ee4 /* U+1EE4 LATIN CAPITAL LETTER U WITH DOT BELOW */ #define XK_ubelowdot 0x1001ee5 /* U+1EE5 LATIN SMALL LETTER U WITH DOT BELOW */ #define XK_Uhook 0x1001ee6 /* U+1EE6 LATIN CAPITAL LETTER U WITH HOOK ABOVE */ #define XK_uhook 0x1001ee7 /* U+1EE7 LATIN SMALL LETTER U WITH HOOK ABOVE */ #define XK_Uhornacute 0x1001ee8 /* U+1EE8 LATIN CAPITAL LETTER U WITH HORN AND ACUTE */ #define XK_uhornacute 0x1001ee9 /* U+1EE9 LATIN SMALL LETTER U WITH HORN AND ACUTE */ #define XK_Uhorngrave 0x1001eea /* U+1EEA LATIN CAPITAL LETTER U WITH HORN AND GRAVE */ #define XK_uhorngrave 0x1001eeb /* U+1EEB LATIN SMALL LETTER U WITH HORN AND GRAVE */ #define XK_Uhornhook 0x1001eec /* U+1EEC LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE */ #define XK_uhornhook 0x1001eed /* U+1EED LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE */ #define XK_Uhorntilde 0x1001eee /* U+1EEE LATIN CAPITAL LETTER U WITH HORN AND TILDE */ #define XK_uhorntilde 0x1001eef /* U+1EEF LATIN SMALL LETTER U WITH HORN AND TILDE */ #define XK_Uhornbelowdot 0x1001ef0 /* U+1EF0 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW */ #define XK_uhornbelowdot 0x1001ef1 /* U+1EF1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW */ #define XK_Ybelowdot 0x1001ef4 /* U+1EF4 LATIN CAPITAL LETTER Y WITH DOT BELOW */ #define XK_ybelowdot 0x1001ef5 /* U+1EF5 LATIN SMALL LETTER Y WITH DOT BELOW */ #define XK_Yhook 0x1001ef6 /* U+1EF6 LATIN CAPITAL LETTER Y WITH HOOK ABOVE */ #define XK_yhook 0x1001ef7 /* U+1EF7 LATIN SMALL LETTER Y WITH HOOK ABOVE */ #define XK_Ytilde 0x1001ef8 /* U+1EF8 LATIN CAPITAL LETTER Y WITH TILDE */ #define XK_ytilde 0x1001ef9 /* U+1EF9 LATIN SMALL LETTER Y WITH TILDE */ #define XK_Ohorn 0x10001a0 /* U+01A0 LATIN CAPITAL LETTER O WITH HORN */ #define XK_ohorn 0x10001a1 /* U+01A1 LATIN SMALL LETTER O WITH HORN */ #define XK_Uhorn 0x10001af /* U+01AF LATIN CAPITAL LETTER U WITH HORN */ #define XK_uhorn 0x10001b0 /* U+01B0 LATIN SMALL LETTER U WITH HORN */ #endif /* XK_VIETNAMESE */ #ifdef XK_CURRENCY #define XK_EcuSign 0x10020a0 /* U+20A0 EURO-CURRENCY SIGN */ #define XK_ColonSign 0x10020a1 /* U+20A1 COLON SIGN */ #define XK_CruzeiroSign 0x10020a2 /* U+20A2 CRUZEIRO SIGN */ #define XK_FFrancSign 0x10020a3 /* U+20A3 FRENCH FRANC SIGN */ #define XK_LiraSign 0x10020a4 /* U+20A4 LIRA SIGN */ #define XK_MillSign 0x10020a5 /* U+20A5 MILL SIGN */ #define XK_NairaSign 0x10020a6 /* U+20A6 NAIRA SIGN */ #define XK_PesetaSign 0x10020a7 /* U+20A7 PESETA SIGN */ #define XK_RupeeSign 0x10020a8 /* U+20A8 RUPEE SIGN */ #define XK_WonSign 0x10020a9 /* U+20A9 WON SIGN */ #define XK_NewSheqelSign 0x10020aa /* U+20AA NEW SHEQEL SIGN */ #define XK_DongSign 0x10020ab /* U+20AB DONG SIGN */ #define XK_EuroSign 0x20ac /* U+20AC EURO SIGN */ #endif /* XK_CURRENCY */ #ifdef XK_MATHEMATICAL /* one, two and three are defined above. */ #define XK_zerosuperior 0x1002070 /* U+2070 SUPERSCRIPT ZERO */ #define XK_foursuperior 0x1002074 /* U+2074 SUPERSCRIPT FOUR */ #define XK_fivesuperior 0x1002075 /* U+2075 SUPERSCRIPT FIVE */ #define XK_sixsuperior 0x1002076 /* U+2076 SUPERSCRIPT SIX */ #define XK_sevensuperior 0x1002077 /* U+2077 SUPERSCRIPT SEVEN */ #define XK_eightsuperior 0x1002078 /* U+2078 SUPERSCRIPT EIGHT */ #define XK_ninesuperior 0x1002079 /* U+2079 SUPERSCRIPT NINE */ #define XK_zerosubscript 0x1002080 /* U+2080 SUBSCRIPT ZERO */ #define XK_onesubscript 0x1002081 /* U+2081 SUBSCRIPT ONE */ #define XK_twosubscript 0x1002082 /* U+2082 SUBSCRIPT TWO */ #define XK_threesubscript 0x1002083 /* U+2083 SUBSCRIPT THREE */ #define XK_foursubscript 0x1002084 /* U+2084 SUBSCRIPT FOUR */ #define XK_fivesubscript 0x1002085 /* U+2085 SUBSCRIPT FIVE */ #define XK_sixsubscript 0x1002086 /* U+2086 SUBSCRIPT SIX */ #define XK_sevensubscript 0x1002087 /* U+2087 SUBSCRIPT SEVEN */ #define XK_eightsubscript 0x1002088 /* U+2088 SUBSCRIPT EIGHT */ #define XK_ninesubscript 0x1002089 /* U+2089 SUBSCRIPT NINE */ #define XK_partdifferential 0x1002202 /* U+2202 PARTIAL DIFFERENTIAL */ #define XK_emptyset 0x1002205 /* U+2205 NULL SET */ #define XK_elementof 0x1002208 /* U+2208 ELEMENT OF */ #define XK_notelementof 0x1002209 /* U+2209 NOT AN ELEMENT OF */ #define XK_containsas 0x100220B /* U+220B CONTAINS AS MEMBER */ #define XK_squareroot 0x100221A /* U+221A SQUARE ROOT */ #define XK_cuberoot 0x100221B /* U+221B CUBE ROOT */ #define XK_fourthroot 0x100221C /* U+221C FOURTH ROOT */ #define XK_dintegral 0x100222C /* U+222C DOUBLE INTEGRAL */ #define XK_tintegral 0x100222D /* U+222D TRIPLE INTEGRAL */ #define XK_because 0x1002235 /* U+2235 BECAUSE */ #define XK_approxeq 0x1002248 /* U+2245 ALMOST EQUAL TO */ #define XK_notapproxeq 0x1002247 /* U+2247 NOT ALMOST EQUAL TO */ #define XK_notidentical 0x1002262 /* U+2262 NOT IDENTICAL TO */ #define XK_stricteq 0x1002263 /* U+2263 STRICTLY EQUIVALENT TO */ #endif /* XK_MATHEMATICAL */ #ifdef XK_BRAILLE #define XK_braille_dot_1 0xfff1 #define XK_braille_dot_2 0xfff2 #define XK_braille_dot_3 0xfff3 #define XK_braille_dot_4 0xfff4 #define XK_braille_dot_5 0xfff5 #define XK_braille_dot_6 0xfff6 #define XK_braille_dot_7 0xfff7 #define XK_braille_dot_8 0xfff8 #define XK_braille_dot_9 0xfff9 #define XK_braille_dot_10 0xfffa #define XK_braille_blank 0x1002800 /* U+2800 BRAILLE PATTERN BLANK */ #define XK_braille_dots_1 0x1002801 /* U+2801 BRAILLE PATTERN DOTS-1 */ #define XK_braille_dots_2 0x1002802 /* U+2802 BRAILLE PATTERN DOTS-2 */ #define XK_braille_dots_12 0x1002803 /* U+2803 BRAILLE PATTERN DOTS-12 */ #define XK_braille_dots_3 0x1002804 /* U+2804 BRAILLE PATTERN DOTS-3 */ #define XK_braille_dots_13 0x1002805 /* U+2805 BRAILLE PATTERN DOTS-13 */ #define XK_braille_dots_23 0x1002806 /* U+2806 BRAILLE PATTERN DOTS-23 */ #define XK_braille_dots_123 0x1002807 /* U+2807 BRAILLE PATTERN DOTS-123 */ #define XK_braille_dots_4 0x1002808 /* U+2808 BRAILLE PATTERN DOTS-4 */ #define XK_braille_dots_14 0x1002809 /* U+2809 BRAILLE PATTERN DOTS-14 */ #define XK_braille_dots_24 0x100280a /* U+280a BRAILLE PATTERN DOTS-24 */ #define XK_braille_dots_124 0x100280b /* U+280b BRAILLE PATTERN DOTS-124 */ #define XK_braille_dots_34 0x100280c /* U+280c BRAILLE PATTERN DOTS-34 */ #define XK_braille_dots_134 0x100280d /* U+280d BRAILLE PATTERN DOTS-134 */ #define XK_braille_dots_234 0x100280e /* U+280e BRAILLE PATTERN DOTS-234 */ #define XK_braille_dots_1234 0x100280f /* U+280f BRAILLE PATTERN DOTS-1234 */ #define XK_braille_dots_5 0x1002810 /* U+2810 BRAILLE PATTERN DOTS-5 */ #define XK_braille_dots_15 0x1002811 /* U+2811 BRAILLE PATTERN DOTS-15 */ #define XK_braille_dots_25 0x1002812 /* U+2812 BRAILLE PATTERN DOTS-25 */ #define XK_braille_dots_125 0x1002813 /* U+2813 BRAILLE PATTERN DOTS-125 */ #define XK_braille_dots_35 0x1002814 /* U+2814 BRAILLE PATTERN DOTS-35 */ #define XK_braille_dots_135 0x1002815 /* U+2815 BRAILLE PATTERN DOTS-135 */ #define XK_braille_dots_235 0x1002816 /* U+2816 BRAILLE PATTERN DOTS-235 */ #define XK_braille_dots_1235 0x1002817 /* U+2817 BRAILLE PATTERN DOTS-1235 */ #define XK_braille_dots_45 0x1002818 /* U+2818 BRAILLE PATTERN DOTS-45 */ #define XK_braille_dots_145 0x1002819 /* U+2819 BRAILLE PATTERN DOTS-145 */ #define XK_braille_dots_245 0x100281a /* U+281a BRAILLE PATTERN DOTS-245 */ #define XK_braille_dots_1245 0x100281b /* U+281b BRAILLE PATTERN DOTS-1245 */ #define XK_braille_dots_345 0x100281c /* U+281c BRAILLE PATTERN DOTS-345 */ #define XK_braille_dots_1345 0x100281d /* U+281d BRAILLE PATTERN DOTS-1345 */ #define XK_braille_dots_2345 0x100281e /* U+281e BRAILLE PATTERN DOTS-2345 */ #define XK_braille_dots_12345 0x100281f /* U+281f BRAILLE PATTERN DOTS-12345 */ #define XK_braille_dots_6 0x1002820 /* U+2820 BRAILLE PATTERN DOTS-6 */ #define XK_braille_dots_16 0x1002821 /* U+2821 BRAILLE PATTERN DOTS-16 */ #define XK_braille_dots_26 0x1002822 /* U+2822 BRAILLE PATTERN DOTS-26 */ #define XK_braille_dots_126 0x1002823 /* U+2823 BRAILLE PATTERN DOTS-126 */ #define XK_braille_dots_36 0x1002824 /* U+2824 BRAILLE PATTERN DOTS-36 */ #define XK_braille_dots_136 0x1002825 /* U+2825 BRAILLE PATTERN DOTS-136 */ #define XK_braille_dots_236 0x1002826 /* U+2826 BRAILLE PATTERN DOTS-236 */ #define XK_braille_dots_1236 0x1002827 /* U+2827 BRAILLE PATTERN DOTS-1236 */ #define XK_braille_dots_46 0x1002828 /* U+2828 BRAILLE PATTERN DOTS-46 */ #define XK_braille_dots_146 0x1002829 /* U+2829 BRAILLE PATTERN DOTS-146 */ #define XK_braille_dots_246 0x100282a /* U+282a BRAILLE PATTERN DOTS-246 */ #define XK_braille_dots_1246 0x100282b /* U+282b BRAILLE PATTERN DOTS-1246 */ #define XK_braille_dots_346 0x100282c /* U+282c BRAILLE PATTERN DOTS-346 */ #define XK_braille_dots_1346 0x100282d /* U+282d BRAILLE PATTERN DOTS-1346 */ #define XK_braille_dots_2346 0x100282e /* U+282e BRAILLE PATTERN DOTS-2346 */ #define XK_braille_dots_12346 0x100282f /* U+282f BRAILLE PATTERN DOTS-12346 */ #define XK_braille_dots_56 0x1002830 /* U+2830 BRAILLE PATTERN DOTS-56 */ #define XK_braille_dots_156 0x1002831 /* U+2831 BRAILLE PATTERN DOTS-156 */ #define XK_braille_dots_256 0x1002832 /* U+2832 BRAILLE PATTERN DOTS-256 */ #define XK_braille_dots_1256 0x1002833 /* U+2833 BRAILLE PATTERN DOTS-1256 */ #define XK_braille_dots_356 0x1002834 /* U+2834 BRAILLE PATTERN DOTS-356 */ #define XK_braille_dots_1356 0x1002835 /* U+2835 BRAILLE PATTERN DOTS-1356 */ #define XK_braille_dots_2356 0x1002836 /* U+2836 BRAILLE PATTERN DOTS-2356 */ #define XK_braille_dots_12356 0x1002837 /* U+2837 BRAILLE PATTERN DOTS-12356 */ #define XK_braille_dots_456 0x1002838 /* U+2838 BRAILLE PATTERN DOTS-456 */ #define XK_braille_dots_1456 0x1002839 /* U+2839 BRAILLE PATTERN DOTS-1456 */ #define XK_braille_dots_2456 0x100283a /* U+283a BRAILLE PATTERN DOTS-2456 */ #define XK_braille_dots_12456 0x100283b /* U+283b BRAILLE PATTERN DOTS-12456 */ #define XK_braille_dots_3456 0x100283c /* U+283c BRAILLE PATTERN DOTS-3456 */ #define XK_braille_dots_13456 0x100283d /* U+283d BRAILLE PATTERN DOTS-13456 */ #define XK_braille_dots_23456 0x100283e /* U+283e BRAILLE PATTERN DOTS-23456 */ #define XK_braille_dots_123456 0x100283f /* U+283f BRAILLE PATTERN DOTS-123456 */ #define XK_braille_dots_7 0x1002840 /* U+2840 BRAILLE PATTERN DOTS-7 */ #define XK_braille_dots_17 0x1002841 /* U+2841 BRAILLE PATTERN DOTS-17 */ #define XK_braille_dots_27 0x1002842 /* U+2842 BRAILLE PATTERN DOTS-27 */ #define XK_braille_dots_127 0x1002843 /* U+2843 BRAILLE PATTERN DOTS-127 */ #define XK_braille_dots_37 0x1002844 /* U+2844 BRAILLE PATTERN DOTS-37 */ #define XK_braille_dots_137 0x1002845 /* U+2845 BRAILLE PATTERN DOTS-137 */ #define XK_braille_dots_237 0x1002846 /* U+2846 BRAILLE PATTERN DOTS-237 */ #define XK_braille_dots_1237 0x1002847 /* U+2847 BRAILLE PATTERN DOTS-1237 */ #define XK_braille_dots_47 0x1002848 /* U+2848 BRAILLE PATTERN DOTS-47 */ #define XK_braille_dots_147 0x1002849 /* U+2849 BRAILLE PATTERN DOTS-147 */ #define XK_braille_dots_247 0x100284a /* U+284a BRAILLE PATTERN DOTS-247 */ #define XK_braille_dots_1247 0x100284b /* U+284b BRAILLE PATTERN DOTS-1247 */ #define XK_braille_dots_347 0x100284c /* U+284c BRAILLE PATTERN DOTS-347 */ #define XK_braille_dots_1347 0x100284d /* U+284d BRAILLE PATTERN DOTS-1347 */ #define XK_braille_dots_2347 0x100284e /* U+284e BRAILLE PATTERN DOTS-2347 */ #define XK_braille_dots_12347 0x100284f /* U+284f BRAILLE PATTERN DOTS-12347 */ #define XK_braille_dots_57 0x1002850 /* U+2850 BRAILLE PATTERN DOTS-57 */ #define XK_braille_dots_157 0x1002851 /* U+2851 BRAILLE PATTERN DOTS-157 */ #define XK_braille_dots_257 0x1002852 /* U+2852 BRAILLE PATTERN DOTS-257 */ #define XK_braille_dots_1257 0x1002853 /* U+2853 BRAILLE PATTERN DOTS-1257 */ #define XK_braille_dots_357 0x1002854 /* U+2854 BRAILLE PATTERN DOTS-357 */ #define XK_braille_dots_1357 0x1002855 /* U+2855 BRAILLE PATTERN DOTS-1357 */ #define XK_braille_dots_2357 0x1002856 /* U+2856 BRAILLE PATTERN DOTS-2357 */ #define XK_braille_dots_12357 0x1002857 /* U+2857 BRAILLE PATTERN DOTS-12357 */ #define XK_braille_dots_457 0x1002858 /* U+2858 BRAILLE PATTERN DOTS-457 */ #define XK_braille_dots_1457 0x1002859 /* U+2859 BRAILLE PATTERN DOTS-1457 */ #define XK_braille_dots_2457 0x100285a /* U+285a BRAILLE PATTERN DOTS-2457 */ #define XK_braille_dots_12457 0x100285b /* U+285b BRAILLE PATTERN DOTS-12457 */ #define XK_braille_dots_3457 0x100285c /* U+285c BRAILLE PATTERN DOTS-3457 */ #define XK_braille_dots_13457 0x100285d /* U+285d BRAILLE PATTERN DOTS-13457 */ #define XK_braille_dots_23457 0x100285e /* U+285e BRAILLE PATTERN DOTS-23457 */ #define XK_braille_dots_123457 0x100285f /* U+285f BRAILLE PATTERN DOTS-123457 */ #define XK_braille_dots_67 0x1002860 /* U+2860 BRAILLE PATTERN DOTS-67 */ #define XK_braille_dots_167 0x1002861 /* U+2861 BRAILLE PATTERN DOTS-167 */ #define XK_braille_dots_267 0x1002862 /* U+2862 BRAILLE PATTERN DOTS-267 */ #define XK_braille_dots_1267 0x1002863 /* U+2863 BRAILLE PATTERN DOTS-1267 */ #define XK_braille_dots_367 0x1002864 /* U+2864 BRAILLE PATTERN DOTS-367 */ #define XK_braille_dots_1367 0x1002865 /* U+2865 BRAILLE PATTERN DOTS-1367 */ #define XK_braille_dots_2367 0x1002866 /* U+2866 BRAILLE PATTERN DOTS-2367 */ #define XK_braille_dots_12367 0x1002867 /* U+2867 BRAILLE PATTERN DOTS-12367 */ #define XK_braille_dots_467 0x1002868 /* U+2868 BRAILLE PATTERN DOTS-467 */ #define XK_braille_dots_1467 0x1002869 /* U+2869 BRAILLE PATTERN DOTS-1467 */ #define XK_braille_dots_2467 0x100286a /* U+286a BRAILLE PATTERN DOTS-2467 */ #define XK_braille_dots_12467 0x100286b /* U+286b BRAILLE PATTERN DOTS-12467 */ #define XK_braille_dots_3467 0x100286c /* U+286c BRAILLE PATTERN DOTS-3467 */ #define XK_braille_dots_13467 0x100286d /* U+286d BRAILLE PATTERN DOTS-13467 */ #define XK_braille_dots_23467 0x100286e /* U+286e BRAILLE PATTERN DOTS-23467 */ #define XK_braille_dots_123467 0x100286f /* U+286f BRAILLE PATTERN DOTS-123467 */ #define XK_braille_dots_567 0x1002870 /* U+2870 BRAILLE PATTERN DOTS-567 */ #define XK_braille_dots_1567 0x1002871 /* U+2871 BRAILLE PATTERN DOTS-1567 */ #define XK_braille_dots_2567 0x1002872 /* U+2872 BRAILLE PATTERN DOTS-2567 */ #define XK_braille_dots_12567 0x1002873 /* U+2873 BRAILLE PATTERN DOTS-12567 */ #define XK_braille_dots_3567 0x1002874 /* U+2874 BRAILLE PATTERN DOTS-3567 */ #define XK_braille_dots_13567 0x1002875 /* U+2875 BRAILLE PATTERN DOTS-13567 */ #define XK_braille_dots_23567 0x1002876 /* U+2876 BRAILLE PATTERN DOTS-23567 */ #define XK_braille_dots_123567 0x1002877 /* U+2877 BRAILLE PATTERN DOTS-123567 */ #define XK_braille_dots_4567 0x1002878 /* U+2878 BRAILLE PATTERN DOTS-4567 */ #define XK_braille_dots_14567 0x1002879 /* U+2879 BRAILLE PATTERN DOTS-14567 */ #define XK_braille_dots_24567 0x100287a /* U+287a BRAILLE PATTERN DOTS-24567 */ #define XK_braille_dots_124567 0x100287b /* U+287b BRAILLE PATTERN DOTS-124567 */ #define XK_braille_dots_34567 0x100287c /* U+287c BRAILLE PATTERN DOTS-34567 */ #define XK_braille_dots_134567 0x100287d /* U+287d BRAILLE PATTERN DOTS-134567 */ #define XK_braille_dots_234567 0x100287e /* U+287e BRAILLE PATTERN DOTS-234567 */ #define XK_braille_dots_1234567 0x100287f /* U+287f BRAILLE PATTERN DOTS-1234567 */ #define XK_braille_dots_8 0x1002880 /* U+2880 BRAILLE PATTERN DOTS-8 */ #define XK_braille_dots_18 0x1002881 /* U+2881 BRAILLE PATTERN DOTS-18 */ #define XK_braille_dots_28 0x1002882 /* U+2882 BRAILLE PATTERN DOTS-28 */ #define XK_braille_dots_128 0x1002883 /* U+2883 BRAILLE PATTERN DOTS-128 */ #define XK_braille_dots_38 0x1002884 /* U+2884 BRAILLE PATTERN DOTS-38 */ #define XK_braille_dots_138 0x1002885 /* U+2885 BRAILLE PATTERN DOTS-138 */ #define XK_braille_dots_238 0x1002886 /* U+2886 BRAILLE PATTERN DOTS-238 */ #define XK_braille_dots_1238 0x1002887 /* U+2887 BRAILLE PATTERN DOTS-1238 */ #define XK_braille_dots_48 0x1002888 /* U+2888 BRAILLE PATTERN DOTS-48 */ #define XK_braille_dots_148 0x1002889 /* U+2889 BRAILLE PATTERN DOTS-148 */ #define XK_braille_dots_248 0x100288a /* U+288a BRAILLE PATTERN DOTS-248 */ #define XK_braille_dots_1248 0x100288b /* U+288b BRAILLE PATTERN DOTS-1248 */ #define XK_braille_dots_348 0x100288c /* U+288c BRAILLE PATTERN DOTS-348 */ #define XK_braille_dots_1348 0x100288d /* U+288d BRAILLE PATTERN DOTS-1348 */ #define XK_braille_dots_2348 0x100288e /* U+288e BRAILLE PATTERN DOTS-2348 */ #define XK_braille_dots_12348 0x100288f /* U+288f BRAILLE PATTERN DOTS-12348 */ #define XK_braille_dots_58 0x1002890 /* U+2890 BRAILLE PATTERN DOTS-58 */ #define XK_braille_dots_158 0x1002891 /* U+2891 BRAILLE PATTERN DOTS-158 */ #define XK_braille_dots_258 0x1002892 /* U+2892 BRAILLE PATTERN DOTS-258 */ #define XK_braille_dots_1258 0x1002893 /* U+2893 BRAILLE PATTERN DOTS-1258 */ #define XK_braille_dots_358 0x1002894 /* U+2894 BRAILLE PATTERN DOTS-358 */ #define XK_braille_dots_1358 0x1002895 /* U+2895 BRAILLE PATTERN DOTS-1358 */ #define XK_braille_dots_2358 0x1002896 /* U+2896 BRAILLE PATTERN DOTS-2358 */ #define XK_braille_dots_12358 0x1002897 /* U+2897 BRAILLE PATTERN DOTS-12358 */ #define XK_braille_dots_458 0x1002898 /* U+2898 BRAILLE PATTERN DOTS-458 */ #define XK_braille_dots_1458 0x1002899 /* U+2899 BRAILLE PATTERN DOTS-1458 */ #define XK_braille_dots_2458 0x100289a /* U+289a BRAILLE PATTERN DOTS-2458 */ #define XK_braille_dots_12458 0x100289b /* U+289b BRAILLE PATTERN DOTS-12458 */ #define XK_braille_dots_3458 0x100289c /* U+289c BRAILLE PATTERN DOTS-3458 */ #define XK_braille_dots_13458 0x100289d /* U+289d BRAILLE PATTERN DOTS-13458 */ #define XK_braille_dots_23458 0x100289e /* U+289e BRAILLE PATTERN DOTS-23458 */ #define XK_braille_dots_123458 0x100289f /* U+289f BRAILLE PATTERN DOTS-123458 */ #define XK_braille_dots_68 0x10028a0 /* U+28a0 BRAILLE PATTERN DOTS-68 */ #define XK_braille_dots_168 0x10028a1 /* U+28a1 BRAILLE PATTERN DOTS-168 */ #define XK_braille_dots_268 0x10028a2 /* U+28a2 BRAILLE PATTERN DOTS-268 */ #define XK_braille_dots_1268 0x10028a3 /* U+28a3 BRAILLE PATTERN DOTS-1268 */ #define XK_braille_dots_368 0x10028a4 /* U+28a4 BRAILLE PATTERN DOTS-368 */ #define XK_braille_dots_1368 0x10028a5 /* U+28a5 BRAILLE PATTERN DOTS-1368 */ #define XK_braille_dots_2368 0x10028a6 /* U+28a6 BRAILLE PATTERN DOTS-2368 */ #define XK_braille_dots_12368 0x10028a7 /* U+28a7 BRAILLE PATTERN DOTS-12368 */ #define XK_braille_dots_468 0x10028a8 /* U+28a8 BRAILLE PATTERN DOTS-468 */ #define XK_braille_dots_1468 0x10028a9 /* U+28a9 BRAILLE PATTERN DOTS-1468 */ #define XK_braille_dots_2468 0x10028aa /* U+28aa BRAILLE PATTERN DOTS-2468 */ #define XK_braille_dots_12468 0x10028ab /* U+28ab BRAILLE PATTERN DOTS-12468 */ #define XK_braille_dots_3468 0x10028ac /* U+28ac BRAILLE PATTERN DOTS-3468 */ #define XK_braille_dots_13468 0x10028ad /* U+28ad BRAILLE PATTERN DOTS-13468 */ #define XK_braille_dots_23468 0x10028ae /* U+28ae BRAILLE PATTERN DOTS-23468 */ #define XK_braille_dots_123468 0x10028af /* U+28af BRAILLE PATTERN DOTS-123468 */ #define XK_braille_dots_568 0x10028b0 /* U+28b0 BRAILLE PATTERN DOTS-568 */ #define XK_braille_dots_1568 0x10028b1 /* U+28b1 BRAILLE PATTERN DOTS-1568 */ #define XK_braille_dots_2568 0x10028b2 /* U+28b2 BRAILLE PATTERN DOTS-2568 */ #define XK_braille_dots_12568 0x10028b3 /* U+28b3 BRAILLE PATTERN DOTS-12568 */ #define XK_braille_dots_3568 0x10028b4 /* U+28b4 BRAILLE PATTERN DOTS-3568 */ #define XK_braille_dots_13568 0x10028b5 /* U+28b5 BRAILLE PATTERN DOTS-13568 */ #define XK_braille_dots_23568 0x10028b6 /* U+28b6 BRAILLE PATTERN DOTS-23568 */ #define XK_braille_dots_123568 0x10028b7 /* U+28b7 BRAILLE PATTERN DOTS-123568 */ #define XK_braille_dots_4568 0x10028b8 /* U+28b8 BRAILLE PATTERN DOTS-4568 */ #define XK_braille_dots_14568 0x10028b9 /* U+28b9 BRAILLE PATTERN DOTS-14568 */ #define XK_braille_dots_24568 0x10028ba /* U+28ba BRAILLE PATTERN DOTS-24568 */ #define XK_braille_dots_124568 0x10028bb /* U+28bb BRAILLE PATTERN DOTS-124568 */ #define XK_braille_dots_34568 0x10028bc /* U+28bc BRAILLE PATTERN DOTS-34568 */ #define XK_braille_dots_134568 0x10028bd /* U+28bd BRAILLE PATTERN DOTS-134568 */ #define XK_braille_dots_234568 0x10028be /* U+28be BRAILLE PATTERN DOTS-234568 */ #define XK_braille_dots_1234568 0x10028bf /* U+28bf BRAILLE PATTERN DOTS-1234568 */ #define XK_braille_dots_78 0x10028c0 /* U+28c0 BRAILLE PATTERN DOTS-78 */ #define XK_braille_dots_178 0x10028c1 /* U+28c1 BRAILLE PATTERN DOTS-178 */ #define XK_braille_dots_278 0x10028c2 /* U+28c2 BRAILLE PATTERN DOTS-278 */ #define XK_braille_dots_1278 0x10028c3 /* U+28c3 BRAILLE PATTERN DOTS-1278 */ #define XK_braille_dots_378 0x10028c4 /* U+28c4 BRAILLE PATTERN DOTS-378 */ #define XK_braille_dots_1378 0x10028c5 /* U+28c5 BRAILLE PATTERN DOTS-1378 */ #define XK_braille_dots_2378 0x10028c6 /* U+28c6 BRAILLE PATTERN DOTS-2378 */ #define XK_braille_dots_12378 0x10028c7 /* U+28c7 BRAILLE PATTERN DOTS-12378 */ #define XK_braille_dots_478 0x10028c8 /* U+28c8 BRAILLE PATTERN DOTS-478 */ #define XK_braille_dots_1478 0x10028c9 /* U+28c9 BRAILLE PATTERN DOTS-1478 */ #define XK_braille_dots_2478 0x10028ca /* U+28ca BRAILLE PATTERN DOTS-2478 */ #define XK_braille_dots_12478 0x10028cb /* U+28cb BRAILLE PATTERN DOTS-12478 */ #define XK_braille_dots_3478 0x10028cc /* U+28cc BRAILLE PATTERN DOTS-3478 */ #define XK_braille_dots_13478 0x10028cd /* U+28cd BRAILLE PATTERN DOTS-13478 */ #define XK_braille_dots_23478 0x10028ce /* U+28ce BRAILLE PATTERN DOTS-23478 */ #define XK_braille_dots_123478 0x10028cf /* U+28cf BRAILLE PATTERN DOTS-123478 */ #define XK_braille_dots_578 0x10028d0 /* U+28d0 BRAILLE PATTERN DOTS-578 */ #define XK_braille_dots_1578 0x10028d1 /* U+28d1 BRAILLE PATTERN DOTS-1578 */ #define XK_braille_dots_2578 0x10028d2 /* U+28d2 BRAILLE PATTERN DOTS-2578 */ #define XK_braille_dots_12578 0x10028d3 /* U+28d3 BRAILLE PATTERN DOTS-12578 */ #define XK_braille_dots_3578 0x10028d4 /* U+28d4 BRAILLE PATTERN DOTS-3578 */ #define XK_braille_dots_13578 0x10028d5 /* U+28d5 BRAILLE PATTERN DOTS-13578 */ #define XK_braille_dots_23578 0x10028d6 /* U+28d6 BRAILLE PATTERN DOTS-23578 */ #define XK_braille_dots_123578 0x10028d7 /* U+28d7 BRAILLE PATTERN DOTS-123578 */ #define XK_braille_dots_4578 0x10028d8 /* U+28d8 BRAILLE PATTERN DOTS-4578 */ #define XK_braille_dots_14578 0x10028d9 /* U+28d9 BRAILLE PATTERN DOTS-14578 */ #define XK_braille_dots_24578 0x10028da /* U+28da BRAILLE PATTERN DOTS-24578 */ #define XK_braille_dots_124578 0x10028db /* U+28db BRAILLE PATTERN DOTS-124578 */ #define XK_braille_dots_34578 0x10028dc /* U+28dc BRAILLE PATTERN DOTS-34578 */ #define XK_braille_dots_134578 0x10028dd /* U+28dd BRAILLE PATTERN DOTS-134578 */ #define XK_braille_dots_234578 0x10028de /* U+28de BRAILLE PATTERN DOTS-234578 */ #define XK_braille_dots_1234578 0x10028df /* U+28df BRAILLE PATTERN DOTS-1234578 */ #define XK_braille_dots_678 0x10028e0 /* U+28e0 BRAILLE PATTERN DOTS-678 */ #define XK_braille_dots_1678 0x10028e1 /* U+28e1 BRAILLE PATTERN DOTS-1678 */ #define XK_braille_dots_2678 0x10028e2 /* U+28e2 BRAILLE PATTERN DOTS-2678 */ #define XK_braille_dots_12678 0x10028e3 /* U+28e3 BRAILLE PATTERN DOTS-12678 */ #define XK_braille_dots_3678 0x10028e4 /* U+28e4 BRAILLE PATTERN DOTS-3678 */ #define XK_braille_dots_13678 0x10028e5 /* U+28e5 BRAILLE PATTERN DOTS-13678 */ #define XK_braille_dots_23678 0x10028e6 /* U+28e6 BRAILLE PATTERN DOTS-23678 */ #define XK_braille_dots_123678 0x10028e7 /* U+28e7 BRAILLE PATTERN DOTS-123678 */ #define XK_braille_dots_4678 0x10028e8 /* U+28e8 BRAILLE PATTERN DOTS-4678 */ #define XK_braille_dots_14678 0x10028e9 /* U+28e9 BRAILLE PATTERN DOTS-14678 */ #define XK_braille_dots_24678 0x10028ea /* U+28ea BRAILLE PATTERN DOTS-24678 */ #define XK_braille_dots_124678 0x10028eb /* U+28eb BRAILLE PATTERN DOTS-124678 */ #define XK_braille_dots_34678 0x10028ec /* U+28ec BRAILLE PATTERN DOTS-34678 */ #define XK_braille_dots_134678 0x10028ed /* U+28ed BRAILLE PATTERN DOTS-134678 */ #define XK_braille_dots_234678 0x10028ee /* U+28ee BRAILLE PATTERN DOTS-234678 */ #define XK_braille_dots_1234678 0x10028ef /* U+28ef BRAILLE PATTERN DOTS-1234678 */ #define XK_braille_dots_5678 0x10028f0 /* U+28f0 BRAILLE PATTERN DOTS-5678 */ #define XK_braille_dots_15678 0x10028f1 /* U+28f1 BRAILLE PATTERN DOTS-15678 */ #define XK_braille_dots_25678 0x10028f2 /* U+28f2 BRAILLE PATTERN DOTS-25678 */ #define XK_braille_dots_125678 0x10028f3 /* U+28f3 BRAILLE PATTERN DOTS-125678 */ #define XK_braille_dots_35678 0x10028f4 /* U+28f4 BRAILLE PATTERN DOTS-35678 */ #define XK_braille_dots_135678 0x10028f5 /* U+28f5 BRAILLE PATTERN DOTS-135678 */ #define XK_braille_dots_235678 0x10028f6 /* U+28f6 BRAILLE PATTERN DOTS-235678 */ #define XK_braille_dots_1235678 0x10028f7 /* U+28f7 BRAILLE PATTERN DOTS-1235678 */ #define XK_braille_dots_45678 0x10028f8 /* U+28f8 BRAILLE PATTERN DOTS-45678 */ #define XK_braille_dots_145678 0x10028f9 /* U+28f9 BRAILLE PATTERN DOTS-145678 */ #define XK_braille_dots_245678 0x10028fa /* U+28fa BRAILLE PATTERN DOTS-245678 */ #define XK_braille_dots_1245678 0x10028fb /* U+28fb BRAILLE PATTERN DOTS-1245678 */ #define XK_braille_dots_345678 0x10028fc /* U+28fc BRAILLE PATTERN DOTS-345678 */ #define XK_braille_dots_1345678 0x10028fd /* U+28fd BRAILLE PATTERN DOTS-1345678 */ #define XK_braille_dots_2345678 0x10028fe /* U+28fe BRAILLE PATTERN DOTS-2345678 */ #define XK_braille_dots_12345678 0x10028ff /* U+28ff BRAILLE PATTERN DOTS-12345678 */ #endif /* XK_BRAILLE */ /* * Sinhala (http://unicode.org/charts/PDF/U0D80.pdf) * http://www.nongnu.org/sinhala/doc/transliteration/sinhala-transliteration_6.html */ #ifdef XK_SINHALA #define XK_Sinh_ng 0x1000d82 /* U+0D82 SINHALA ANUSVARAYA */ #define XK_Sinh_h2 0x1000d83 /* U+0D83 SINHALA VISARGAYA */ #define XK_Sinh_a 0x1000d85 /* U+0D85 SINHALA AYANNA */ #define XK_Sinh_aa 0x1000d86 /* U+0D86 SINHALA AAYANNA */ #define XK_Sinh_ae 0x1000d87 /* U+0D87 SINHALA AEYANNA */ #define XK_Sinh_aee 0x1000d88 /* U+0D88 SINHALA AEEYANNA */ #define XK_Sinh_i 0x1000d89 /* U+0D89 SINHALA IYANNA */ #define XK_Sinh_ii 0x1000d8a /* U+0D8A SINHALA IIYANNA */ #define XK_Sinh_u 0x1000d8b /* U+0D8B SINHALA UYANNA */ #define XK_Sinh_uu 0x1000d8c /* U+0D8C SINHALA UUYANNA */ #define XK_Sinh_ri 0x1000d8d /* U+0D8D SINHALA IRUYANNA */ #define XK_Sinh_rii 0x1000d8e /* U+0D8E SINHALA IRUUYANNA */ #define XK_Sinh_lu 0x1000d8f /* U+0D8F SINHALA ILUYANNA */ #define XK_Sinh_luu 0x1000d90 /* U+0D90 SINHALA ILUUYANNA */ #define XK_Sinh_e 0x1000d91 /* U+0D91 SINHALA EYANNA */ #define XK_Sinh_ee 0x1000d92 /* U+0D92 SINHALA EEYANNA */ #define XK_Sinh_ai 0x1000d93 /* U+0D93 SINHALA AIYANNA */ #define XK_Sinh_o 0x1000d94 /* U+0D94 SINHALA OYANNA */ #define XK_Sinh_oo 0x1000d95 /* U+0D95 SINHALA OOYANNA */ #define XK_Sinh_au 0x1000d96 /* U+0D96 SINHALA AUYANNA */ #define XK_Sinh_ka 0x1000d9a /* U+0D9A SINHALA KAYANNA */ #define XK_Sinh_kha 0x1000d9b /* U+0D9B SINHALA MAHA. KAYANNA */ #define XK_Sinh_ga 0x1000d9c /* U+0D9C SINHALA GAYANNA */ #define XK_Sinh_gha 0x1000d9d /* U+0D9D SINHALA MAHA. GAYANNA */ #define XK_Sinh_ng2 0x1000d9e /* U+0D9E SINHALA KANTAJA NAASIKYAYA */ #define XK_Sinh_nga 0x1000d9f /* U+0D9F SINHALA SANYAKA GAYANNA */ #define XK_Sinh_ca 0x1000da0 /* U+0DA0 SINHALA CAYANNA */ #define XK_Sinh_cha 0x1000da1 /* U+0DA1 SINHALA MAHA. CAYANNA */ #define XK_Sinh_ja 0x1000da2 /* U+0DA2 SINHALA JAYANNA */ #define XK_Sinh_jha 0x1000da3 /* U+0DA3 SINHALA MAHA. JAYANNA */ #define XK_Sinh_nya 0x1000da4 /* U+0DA4 SINHALA TAALUJA NAASIKYAYA */ #define XK_Sinh_jnya 0x1000da5 /* U+0DA5 SINHALA TAALUJA SANYOOGA NAASIKYAYA */ #define XK_Sinh_nja 0x1000da6 /* U+0DA6 SINHALA SANYAKA JAYANNA */ #define XK_Sinh_tta 0x1000da7 /* U+0DA7 SINHALA TTAYANNA */ #define XK_Sinh_ttha 0x1000da8 /* U+0DA8 SINHALA MAHA. TTAYANNA */ #define XK_Sinh_dda 0x1000da9 /* U+0DA9 SINHALA DDAYANNA */ #define XK_Sinh_ddha 0x1000daa /* U+0DAA SINHALA MAHA. DDAYANNA */ #define XK_Sinh_nna 0x1000dab /* U+0DAB SINHALA MUURDHAJA NAYANNA */ #define XK_Sinh_ndda 0x1000dac /* U+0DAC SINHALA SANYAKA DDAYANNA */ #define XK_Sinh_tha 0x1000dad /* U+0DAD SINHALA TAYANNA */ #define XK_Sinh_thha 0x1000dae /* U+0DAE SINHALA MAHA. TAYANNA */ #define XK_Sinh_dha 0x1000daf /* U+0DAF SINHALA DAYANNA */ #define XK_Sinh_dhha 0x1000db0 /* U+0DB0 SINHALA MAHA. DAYANNA */ #define XK_Sinh_na 0x1000db1 /* U+0DB1 SINHALA DANTAJA NAYANNA */ #define XK_Sinh_ndha 0x1000db3 /* U+0DB3 SINHALA SANYAKA DAYANNA */ #define XK_Sinh_pa 0x1000db4 /* U+0DB4 SINHALA PAYANNA */ #define XK_Sinh_pha 0x1000db5 /* U+0DB5 SINHALA MAHA. PAYANNA */ #define XK_Sinh_ba 0x1000db6 /* U+0DB6 SINHALA BAYANNA */ #define XK_Sinh_bha 0x1000db7 /* U+0DB7 SINHALA MAHA. BAYANNA */ #define XK_Sinh_ma 0x1000db8 /* U+0DB8 SINHALA MAYANNA */ #define XK_Sinh_mba 0x1000db9 /* U+0DB9 SINHALA AMBA BAYANNA */ #define XK_Sinh_ya 0x1000dba /* U+0DBA SINHALA YAYANNA */ #define XK_Sinh_ra 0x1000dbb /* U+0DBB SINHALA RAYANNA */ #define XK_Sinh_la 0x1000dbd /* U+0DBD SINHALA DANTAJA LAYANNA */ #define XK_Sinh_va 0x1000dc0 /* U+0DC0 SINHALA VAYANNA */ #define XK_Sinh_sha 0x1000dc1 /* U+0DC1 SINHALA TAALUJA SAYANNA */ #define XK_Sinh_ssha 0x1000dc2 /* U+0DC2 SINHALA MUURDHAJA SAYANNA */ #define XK_Sinh_sa 0x1000dc3 /* U+0DC3 SINHALA DANTAJA SAYANNA */ #define XK_Sinh_ha 0x1000dc4 /* U+0DC4 SINHALA HAYANNA */ #define XK_Sinh_lla 0x1000dc5 /* U+0DC5 SINHALA MUURDHAJA LAYANNA */ #define XK_Sinh_fa 0x1000dc6 /* U+0DC6 SINHALA FAYANNA */ #define XK_Sinh_al 0x1000dca /* U+0DCA SINHALA AL-LAKUNA */ #define XK_Sinh_aa2 0x1000dcf /* U+0DCF SINHALA AELA-PILLA */ #define XK_Sinh_ae2 0x1000dd0 /* U+0DD0 SINHALA AEDA-PILLA */ #define XK_Sinh_aee2 0x1000dd1 /* U+0DD1 SINHALA DIGA AEDA-PILLA */ #define XK_Sinh_i2 0x1000dd2 /* U+0DD2 SINHALA IS-PILLA */ #define XK_Sinh_ii2 0x1000dd3 /* U+0DD3 SINHALA DIGA IS-PILLA */ #define XK_Sinh_u2 0x1000dd4 /* U+0DD4 SINHALA PAA-PILLA */ #define XK_Sinh_uu2 0x1000dd6 /* U+0DD6 SINHALA DIGA PAA-PILLA */ #define XK_Sinh_ru2 0x1000dd8 /* U+0DD8 SINHALA GAETTA-PILLA */ #define XK_Sinh_e2 0x1000dd9 /* U+0DD9 SINHALA KOMBUVA */ #define XK_Sinh_ee2 0x1000dda /* U+0DDA SINHALA DIGA KOMBUVA */ #define XK_Sinh_ai2 0x1000ddb /* U+0DDB SINHALA KOMBU DEKA */ #define XK_Sinh_o2 0x1000ddc /* U+0DDC SINHALA KOMBUVA HAA AELA-PILLA*/ #define XK_Sinh_oo2 0x1000ddd /* U+0DDD SINHALA KOMBUVA HAA DIGA AELA-PILLA*/ #define XK_Sinh_au2 0x1000dde /* U+0DDE SINHALA KOMBUVA HAA GAYANUKITTA */ #define XK_Sinh_lu2 0x1000ddf /* U+0DDF SINHALA GAYANUKITTA */ #define XK_Sinh_ruu2 0x1000df2 /* U+0DF2 SINHALA DIGA GAETTA-PILLA */ #define XK_Sinh_luu2 0x1000df3 /* U+0DF3 SINHALA DIGA GAYANUKITTA */ #define XK_Sinh_kunddaliya 0x1000df4 /* U+0DF4 SINHALA KUNDDALIYA */ #endif /* XK_SINHALA */ ================================================ FILE: Libraries/Core/RPi/Headers/aes/aes.h ================================================ /* The MIT License Copyright (C) 2011 Zilong Tan (labytan@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* * aes.h * * @version 3.0 (December 2000) * * Optimised ANSI C code for the Rijndael cipher (now AES) * * @author Vincent Rijmen * @author Antoon Bosselaers * @author Paulo Barreto * * This code is hereby placed in the public domain. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __ULIB_AES_H #define __ULIB_AES_H #include #define AES_MAXNR 14 #define AES_BLOCK_SIZE 16 struct aes_key_st { uint32_t rd_key[4 *(AES_MAXNR + 1)]; int rounds; }; typedef struct aes_key_st AES_KEY; #ifdef __cplusplus extern "C" { #endif /* bits can be 128, 192 or 256 */ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); /* in/out can be the same for ECB encryption/decryption */ void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); void AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); /* in/out can be the same */ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, unsigned long nblock, const AES_KEY *key); /* in/out MUST be DIFFERENT */ void AES_cbc_decrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, unsigned long nblock, const AES_KEY *key); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/base64/base64.h ================================================ #include std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_decode(std::string const& s); ================================================ FILE: Libraries/Core/RPi/Headers/bcm_host.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Header file with useful bits from other headers #ifndef BCM_HOST_H #define BCM_HOST_H #include #ifdef __cplusplus extern "C" { #endif void bcm_host_init(void); void bcm_host_deinit(void); int32_t graphics_get_display_size( const uint16_t display_number, uint32_t *width, uint32_t *height); unsigned bcm_host_get_peripheral_address(void); unsigned bcm_host_get_peripheral_size(void); unsigned bcm_host_get_sdram_address(void); #include "interface/vmcs_host/vc_dispmanx.h" #include "interface/vmcs_host/vc_tvservice.h" #include "interface/vmcs_host/vc_cec.h" #include "interface/vmcs_host/vc_cecservice.h" #include "interface/vmcs_host/vcgencmd.h" #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/curl/curl.h ================================================ #ifndef __CURL_CURL_H #define __CURL_CURL_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* * If you have libcurl problems, all docs and details are found here: * http://curl.haxx.se/libcurl/ * * curl-library mailing list subscription and unsubscription web interface: * http://cool.haxx.se/mailman/listinfo/curl-library/ */ #include "curlver.h" /* libcurl version defines */ #include "curlbuild.h" /* libcurl build definitions */ #include "curlrules.h" /* libcurl rules enforcement */ /* * Define WIN32 when build target is Win32 API */ #if (defined(_WIN32) || defined(__WIN32__)) && \ !defined(WIN32) && !defined(__SYMBIAN32__) #define WIN32 #endif #include #include #if defined(__FreeBSD__) && (__FreeBSD__ >= 2) /* Needed for __FreeBSD_version symbol definition */ #include #endif /* The include stuff here below is mainly for time_t! */ #include #include #if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__) #if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__)) /* The check above prevents the winsock2 inclusion if winsock.h already was included, since they can't co-exist without problems */ #include #include #endif #endif /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish libc5-based Linux systems. Only include it on systems that are known to require it! */ #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \ defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \ defined(ANDROID) || defined(__ANDROID__) || defined(__OpenBSD__) || \ (defined(__FreeBSD_version) && (__FreeBSD_version < 800000)) #include #endif #if !defined(WIN32) && !defined(_WIN32_WCE) #include #endif #if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__) #include #endif #ifdef __BEOS__ #include #endif #ifdef __cplusplus extern "C" { #endif typedef void CURL; /* * libcurl external API function linkage decorations. */ #ifdef CURL_STATICLIB # define CURL_EXTERN #elif defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__) # if defined(BUILDING_LIBCURL) # define CURL_EXTERN __declspec(dllexport) # else # define CURL_EXTERN __declspec(dllimport) # endif #elif defined(BUILDING_LIBCURL) && defined(CURL_HIDDEN_SYMBOLS) # define CURL_EXTERN CURL_EXTERN_SYMBOL #else # define CURL_EXTERN #endif #ifndef curl_socket_typedef /* socket typedef */ #if defined(WIN32) && !defined(__LWIP_OPT_H__) typedef SOCKET curl_socket_t; #define CURL_SOCKET_BAD INVALID_SOCKET #else typedef int curl_socket_t; #define CURL_SOCKET_BAD -1 #endif #define curl_socket_typedef #endif /* curl_socket_typedef */ struct curl_httppost { struct curl_httppost *next; /* next entry in the list */ char *name; /* pointer to allocated name */ long namelength; /* length of name length */ char *contents; /* pointer to allocated data contents */ long contentslength; /* length of contents field */ char *buffer; /* pointer to allocated buffer contents */ long bufferlength; /* length of buffer field */ char *contenttype; /* Content-Type */ struct curl_slist* contentheader; /* list of extra headers for this form */ struct curl_httppost *more; /* if one field name has more than one file, this link should link to following files */ long flags; /* as defined below */ #define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */ #define HTTPPOST_READFILE (1<<1) /* specified content is a file name */ #define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer do not free in formfree */ #define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer do not free in formfree */ #define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */ #define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */ #define HTTPPOST_CALLBACK (1<<6) /* upload file contents by using the regular read callback to get the data and pass the given pointer as custom pointer */ char *showfilename; /* The file name to show. If not set, the actual file name will be used (if this is a file part) */ void *userp; /* custom pointer used for HTTPPOST_CALLBACK posts */ }; /* This is the CURLOPT_PROGRESSFUNCTION callback proto. It is now considered deprecated but was the only choice up until 7.31.0 */ typedef int (*curl_progress_callback)(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow); /* This is the CURLOPT_XFERINFOFUNCTION callback proto. It was introduced in 7.32.0, it avoids floating point and provides more detailed information. */ typedef int (*curl_xferinfo_callback)(void *clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t ultotal, curl_off_t ulnow); #ifndef CURL_MAX_WRITE_SIZE /* Tests have proven that 20K is a very bad buffer size for uploads on Windows, while 16K for some odd reason performed a lot better. We do the ifndef check to allow this value to easier be changed at build time for those who feel adventurous. The practical minimum is about 400 bytes since libcurl uses a buffer of this size as a scratch area (unrelated to network send operations). */ #define CURL_MAX_WRITE_SIZE 16384 #endif #ifndef CURL_MAX_HTTP_HEADER /* The only reason to have a max limit for this is to avoid the risk of a bad server feeding libcurl with a never-ending header that will cause reallocs infinitely */ #define CURL_MAX_HTTP_HEADER (100*1024) #endif /* This is a magic return code for the write callback that, when returned, will signal libcurl to pause receiving on the current transfer. */ #define CURL_WRITEFUNC_PAUSE 0x10000001 typedef size_t (*curl_write_callback)(char *buffer, size_t size, size_t nitems, void *outstream); /* enumeration of file types */ typedef enum { CURLFILETYPE_FILE = 0, CURLFILETYPE_DIRECTORY, CURLFILETYPE_SYMLINK, CURLFILETYPE_DEVICE_BLOCK, CURLFILETYPE_DEVICE_CHAR, CURLFILETYPE_NAMEDPIPE, CURLFILETYPE_SOCKET, CURLFILETYPE_DOOR, /* is possible only on Sun Solaris now */ CURLFILETYPE_UNKNOWN /* should never occur */ } curlfiletype; #define CURLFINFOFLAG_KNOWN_FILENAME (1<<0) #define CURLFINFOFLAG_KNOWN_FILETYPE (1<<1) #define CURLFINFOFLAG_KNOWN_TIME (1<<2) #define CURLFINFOFLAG_KNOWN_PERM (1<<3) #define CURLFINFOFLAG_KNOWN_UID (1<<4) #define CURLFINFOFLAG_KNOWN_GID (1<<5) #define CURLFINFOFLAG_KNOWN_SIZE (1<<6) #define CURLFINFOFLAG_KNOWN_HLINKCOUNT (1<<7) /* Content of this structure depends on information which is known and is achievable (e.g. by FTP LIST parsing). Please see the url_easy_setopt(3) man page for callbacks returning this structure -- some fields are mandatory, some others are optional. The FLAG field has special meaning. */ struct curl_fileinfo { char *filename; curlfiletype filetype; time_t time; unsigned int perm; int uid; int gid; curl_off_t size; long int hardlinks; struct { /* If some of these fields is not NULL, it is a pointer to b_data. */ char *time; char *perm; char *user; char *group; char *target; /* pointer to the target filename of a symlink */ } strings; unsigned int flags; /* used internally */ char * b_data; size_t b_size; size_t b_used; }; /* return codes for CURLOPT_CHUNK_BGN_FUNCTION */ #define CURL_CHUNK_BGN_FUNC_OK 0 #define CURL_CHUNK_BGN_FUNC_FAIL 1 /* tell the lib to end the task */ #define CURL_CHUNK_BGN_FUNC_SKIP 2 /* skip this chunk over */ /* if splitting of data transfer is enabled, this callback is called before download of an individual chunk started. Note that parameter "remains" works only for FTP wildcard downloading (for now), otherwise is not used */ typedef long (*curl_chunk_bgn_callback)(const void *transfer_info, void *ptr, int remains); /* return codes for CURLOPT_CHUNK_END_FUNCTION */ #define CURL_CHUNK_END_FUNC_OK 0 #define CURL_CHUNK_END_FUNC_FAIL 1 /* tell the lib to end the task */ /* If splitting of data transfer is enabled this callback is called after download of an individual chunk finished. Note! After this callback was set then it have to be called FOR ALL chunks. Even if downloading of this chunk was skipped in CHUNK_BGN_FUNC. This is the reason why we don't need "transfer_info" parameter in this callback and we are not interested in "remains" parameter too. */ typedef long (*curl_chunk_end_callback)(void *ptr); /* return codes for FNMATCHFUNCTION */ #define CURL_FNMATCHFUNC_MATCH 0 /* string corresponds to the pattern */ #define CURL_FNMATCHFUNC_NOMATCH 1 /* pattern doesn't match the string */ #define CURL_FNMATCHFUNC_FAIL 2 /* an error occurred */ /* callback type for wildcard downloading pattern matching. If the string matches the pattern, return CURL_FNMATCHFUNC_MATCH value, etc. */ typedef int (*curl_fnmatch_callback)(void *ptr, const char *pattern, const char *string); /* These are the return codes for the seek callbacks */ #define CURL_SEEKFUNC_OK 0 #define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */ #define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so libcurl might try other means instead */ typedef int (*curl_seek_callback)(void *instream, curl_off_t offset, int origin); /* 'whence' */ /* This is a return code for the read callback that, when returned, will signal libcurl to immediately abort the current transfer. */ #define CURL_READFUNC_ABORT 0x10000000 /* This is a return code for the read callback that, when returned, will signal libcurl to pause sending data on the current transfer. */ #define CURL_READFUNC_PAUSE 0x10000001 typedef size_t (*curl_read_callback)(char *buffer, size_t size, size_t nitems, void *instream); typedef enum { CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */ CURLSOCKTYPE_ACCEPT, /* socket created by accept() call */ CURLSOCKTYPE_LAST /* never use */ } curlsocktype; /* The return code from the sockopt_callback can signal information back to libcurl: */ #define CURL_SOCKOPT_OK 0 #define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return CURLE_ABORTED_BY_CALLBACK */ #define CURL_SOCKOPT_ALREADY_CONNECTED 2 typedef int (*curl_sockopt_callback)(void *clientp, curl_socket_t curlfd, curlsocktype purpose); struct curl_sockaddr { int family; int socktype; int protocol; unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it turned really ugly and painful on the systems that lack this type */ struct sockaddr addr; }; typedef curl_socket_t (*curl_opensocket_callback)(void *clientp, curlsocktype purpose, struct curl_sockaddr *address); typedef int (*curl_closesocket_callback)(void *clientp, curl_socket_t item); typedef enum { CURLIOE_OK, /* I/O operation successful */ CURLIOE_UNKNOWNCMD, /* command was unknown to callback */ CURLIOE_FAILRESTART, /* failed to restart the read */ CURLIOE_LAST /* never use */ } curlioerr; typedef enum { CURLIOCMD_NOP, /* no operation */ CURLIOCMD_RESTARTREAD, /* restart the read stream from start */ CURLIOCMD_LAST /* never use */ } curliocmd; typedef curlioerr (*curl_ioctl_callback)(CURL *handle, int cmd, void *clientp); /* * The following typedef's are signatures of malloc, free, realloc, strdup and * calloc respectively. Function pointers of these types can be passed to the * curl_global_init_mem() function to set user defined memory management * callback routines. */ typedef void *(*curl_malloc_callback)(size_t size); typedef void (*curl_free_callback)(void *ptr); typedef void *(*curl_realloc_callback)(void *ptr, size_t size); typedef char *(*curl_strdup_callback)(const char *str); typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); /* the kind of data that is passed to information_callback*/ typedef enum { CURLINFO_TEXT = 0, CURLINFO_HEADER_IN, /* 1 */ CURLINFO_HEADER_OUT, /* 2 */ CURLINFO_DATA_IN, /* 3 */ CURLINFO_DATA_OUT, /* 4 */ CURLINFO_SSL_DATA_IN, /* 5 */ CURLINFO_SSL_DATA_OUT, /* 6 */ CURLINFO_END } curl_infotype; typedef int (*curl_debug_callback) (CURL *handle, /* the handle/transfer this concerns */ curl_infotype type, /* what kind of data */ char *data, /* points to the data */ size_t size, /* size of the data pointed to */ void *userptr); /* whatever the user please */ /* All possible error codes from all sorts of curl functions. Future versions may return other values, stay prepared. Always add new return codes last. Never *EVER* remove any. The return codes must remain the same! */ typedef enum { CURLE_OK = 0, CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ CURLE_FAILED_INIT, /* 2 */ CURLE_URL_MALFORMAT, /* 3 */ CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for 7.17.0, reused in April 2011 for 7.21.5] */ CURLE_COULDNT_RESOLVE_PROXY, /* 5 */ CURLE_COULDNT_RESOLVE_HOST, /* 6 */ CURLE_COULDNT_CONNECT, /* 7 */ CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */ CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server due to lack of access - when login fails this is not returned. */ CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for 7.15.4, reused in Dec 2011 for 7.24.0]*/ CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */ CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server [was obsoleted in August 2007 for 7.17.0, reused in Dec 2011 for 7.24.0]*/ CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */ CURLE_FTP_WEIRD_227_FORMAT, /* 14 */ CURLE_FTP_CANT_GET_HOST, /* 15 */ CURLE_HTTP2, /* 16 - A problem in the http2 framing layer. [was obsoleted in August 2007 for 7.17.0, reused in July 2014 for 7.38.0] */ CURLE_FTP_COULDNT_SET_TYPE, /* 17 */ CURLE_PARTIAL_FILE, /* 18 */ CURLE_FTP_COULDNT_RETR_FILE, /* 19 */ CURLE_OBSOLETE20, /* 20 - NOT USED */ CURLE_QUOTE_ERROR, /* 21 - quote command failure */ CURLE_HTTP_RETURNED_ERROR, /* 22 */ CURLE_WRITE_ERROR, /* 23 */ CURLE_OBSOLETE24, /* 24 - NOT USED */ CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */ CURLE_READ_ERROR, /* 26 - couldn't open/read from file */ CURLE_OUT_OF_MEMORY, /* 27 */ /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error instead of a memory allocation error if CURL_DOES_CONVERSIONS is defined */ CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */ CURLE_OBSOLETE29, /* 29 - NOT USED */ CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */ CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */ CURLE_OBSOLETE32, /* 32 - NOT USED */ CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */ CURLE_HTTP_POST_ERROR, /* 34 */ CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */ CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */ CURLE_FILE_COULDNT_READ_FILE, /* 37 */ CURLE_LDAP_CANNOT_BIND, /* 38 */ CURLE_LDAP_SEARCH_FAILED, /* 39 */ CURLE_OBSOLETE40, /* 40 - NOT USED */ CURLE_FUNCTION_NOT_FOUND, /* 41 */ CURLE_ABORTED_BY_CALLBACK, /* 42 */ CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */ CURLE_OBSOLETE44, /* 44 - NOT USED */ CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */ CURLE_OBSOLETE46, /* 46 - NOT USED */ CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */ CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */ CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */ CURLE_OBSOLETE50, /* 50 - NOT USED */ CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint wasn't verified fine */ CURLE_GOT_NOTHING, /* 52 - when this is a specific error */ CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */ CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as default */ CURLE_SEND_ERROR, /* 55 - failed sending network data */ CURLE_RECV_ERROR, /* 56 - failure in receiving network data */ CURLE_OBSOLETE57, /* 57 - NOT IN USE */ CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */ CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */ CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */ CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */ CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */ CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */ CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */ CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind that failed */ CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */ CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not accepted and we failed to login */ CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */ CURLE_TFTP_PERM, /* 69 - permission problem on server */ CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */ CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */ CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */ CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */ CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */ CURLE_CONV_FAILED, /* 75 - conversion failed */ CURLE_CONV_REQD, /* 76 - caller must register conversion callbacks using curl_easy_setopt options CURLOPT_CONV_FROM_NETWORK_FUNCTION, CURLOPT_CONV_TO_NETWORK_FUNCTION, and CURLOPT_CONV_FROM_UTF8_FUNCTION */ CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing or wrong format */ CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */ CURLE_SSH, /* 79 - error from the SSH layer, somewhat generic so the error message will be of interest when this has happened */ CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL connection */ CURLE_AGAIN, /* 81 - socket is not ready for send/recv, wait till it's ready and try again (Added in 7.18.2) */ CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or wrong format (Added in 7.19.0) */ CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in 7.19.0) */ CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */ CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */ CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */ CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */ CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */ CURLE_NO_CONNECTION_AVAILABLE, /* 89 - No connection available, the session will be queued */ CURL_LAST /* never use! */ } CURLcode; #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all the obsolete stuff removed! */ /* Previously obsolete error code re-used in 7.38.0 */ #define CURLE_OBSOLETE16 CURLE_HTTP2 /* Previously obsolete error codes re-used in 7.24.0 */ #define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED #define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT /* compatibility with older names */ #define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING /* The following were added in 7.21.5, April 2011 */ #define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION /* The following were added in 7.17.1 */ /* These are scheduled to disappear by 2009 */ #define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION /* The following were added in 7.17.0 */ /* These are scheduled to disappear by 2009 */ #define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */ #define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46 #define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44 #define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10 #define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16 #define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32 #define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29 #define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12 #define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20 #define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40 #define CURLE_MALFORMAT_USER CURLE_OBSOLETE24 #define CURLE_SHARE_IN_USE CURLE_OBSOLETE57 #define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN #define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED #define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE #define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR #define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL #define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS #define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR #define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED /* The following were added earlier */ #define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT #define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR #define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED #define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED #define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE #define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME /* This was the error code 50 in 7.7.3 and a few earlier versions, this is no longer used by libcurl but is instead #defined here only to not make programs break */ #define CURLE_ALREADY_COMPLETE 99999 /* Provide defines for really old option names */ #define CURLOPT_FILE CURLOPT_WRITEDATA /* name changed in 7.9.7 */ #define CURLOPT_INFILE CURLOPT_READDATA /* name changed in 7.9.7 */ #define CURLOPT_WRITEHEADER CURLOPT_HEADERDATA /* Since long deprecated options with no code in the lib that does anything with them. */ #define CURLOPT_WRITEINFO CURLOPT_OBSOLETE40 #define CURLOPT_CLOSEPOLICY CURLOPT_OBSOLETE72 #endif /*!CURL_NO_OLDIES*/ /* This prototype applies to all conversion callbacks */ typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length); typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */ void *ssl_ctx, /* actually an OpenSSL SSL_CTX */ void *userptr); typedef enum { CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use CONNECT HTTP/1.1 */ CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT HTTP/1.0 */ CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already in 7.10 */ CURLPROXY_SOCKS5 = 5, /* added in 7.10 */ CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */ CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the host name rather than the IP address. added in 7.18.0 */ } curl_proxytype; /* this enum was added in 7.10 */ /* * Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options: * * CURLAUTH_NONE - No HTTP authentication * CURLAUTH_BASIC - HTTP Basic authentication (default) * CURLAUTH_DIGEST - HTTP Digest authentication * CURLAUTH_NEGOTIATE - HTTP Negotiate (SPNEGO) authentication * CURLAUTH_GSSNEGOTIATE - Alias for CURLAUTH_NEGOTIATE (deprecated) * CURLAUTH_NTLM - HTTP NTLM authentication * CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour * CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper * CURLAUTH_ONLY - Use together with a single other type to force no * authentication or just that single type * CURLAUTH_ANY - All fine types set * CURLAUTH_ANYSAFE - All fine types except Basic */ #define CURLAUTH_NONE ((unsigned long)0) #define CURLAUTH_BASIC (((unsigned long)1)<<0) #define CURLAUTH_DIGEST (((unsigned long)1)<<1) #define CURLAUTH_NEGOTIATE (((unsigned long)1)<<2) /* Deprecated since the advent of CURLAUTH_NEGOTIATE */ #define CURLAUTH_GSSNEGOTIATE CURLAUTH_NEGOTIATE #define CURLAUTH_NTLM (((unsigned long)1)<<3) #define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4) #define CURLAUTH_NTLM_WB (((unsigned long)1)<<5) #define CURLAUTH_ONLY (((unsigned long)1)<<31) #define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) #define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE)) #define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */ #define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */ #define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */ #define CURLSSH_AUTH_PASSWORD (1<<1) /* password */ #define CURLSSH_AUTH_HOST (1<<2) /* host key files */ #define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */ #define CURLSSH_AUTH_AGENT (1<<4) /* agent (ssh-agent, pageant...) */ #define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY #define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */ #define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */ #define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */ #define CURL_ERROR_SIZE 256 enum curl_khtype { CURLKHTYPE_UNKNOWN, CURLKHTYPE_RSA1, CURLKHTYPE_RSA, CURLKHTYPE_DSS }; struct curl_khkey { const char *key; /* points to a zero-terminated string encoded with base64 if len is zero, otherwise to the "raw" data */ size_t len; enum curl_khtype keytype; }; /* this is the set of return values expected from the curl_sshkeycallback callback */ enum curl_khstat { CURLKHSTAT_FINE_ADD_TO_FILE, CURLKHSTAT_FINE, CURLKHSTAT_REJECT, /* reject the connection, return an error */ CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so this causes a CURLE_DEFER error but otherwise the connection will be left intact etc */ CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */ }; /* this is the set of status codes pass in to the callback */ enum curl_khmatch { CURLKHMATCH_OK, /* match */ CURLKHMATCH_MISMATCH, /* host found, key mismatch! */ CURLKHMATCH_MISSING, /* no matching host/key found */ CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */ }; typedef int (*curl_sshkeycallback) (CURL *easy, /* easy handle */ const struct curl_khkey *knownkey, /* known */ const struct curl_khkey *foundkey, /* found */ enum curl_khmatch, /* libcurl's view on the keys */ void *clientp); /* custom pointer passed from app */ /* parameter for the CURLOPT_USE_SSL option */ typedef enum { CURLUSESSL_NONE, /* do not attempt to use SSL */ CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */ CURLUSESSL_CONTROL, /* SSL for the control connection or fail */ CURLUSESSL_ALL, /* SSL for all communication or fail */ CURLUSESSL_LAST /* not an option, never use */ } curl_usessl; /* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */ /* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the name of improving interoperability with older servers. Some SSL libraries have introduced work-arounds for this flaw but those work-arounds sometimes make the SSL communication fail. To regain functionality with those broken servers, a user can this way allow the vulnerability back. */ #define CURLSSLOPT_ALLOW_BEAST (1<<0) #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all the obsolete stuff removed! */ /* Backwards compatibility with older names */ /* These are scheduled to disappear by 2009 */ #define CURLFTPSSL_NONE CURLUSESSL_NONE #define CURLFTPSSL_TRY CURLUSESSL_TRY #define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL #define CURLFTPSSL_ALL CURLUSESSL_ALL #define CURLFTPSSL_LAST CURLUSESSL_LAST #define curl_ftpssl curl_usessl #endif /*!CURL_NO_OLDIES*/ /* parameter for the CURLOPT_FTP_SSL_CCC option */ typedef enum { CURLFTPSSL_CCC_NONE, /* do not send CCC */ CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */ CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */ CURLFTPSSL_CCC_LAST /* not an option, never use */ } curl_ftpccc; /* parameter for the CURLOPT_FTPSSLAUTH option */ typedef enum { CURLFTPAUTH_DEFAULT, /* let libcurl decide */ CURLFTPAUTH_SSL, /* use "AUTH SSL" */ CURLFTPAUTH_TLS, /* use "AUTH TLS" */ CURLFTPAUTH_LAST /* not an option, never use */ } curl_ftpauth; /* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */ typedef enum { CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */ CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD again if MKD succeeded, for SFTP this does similar magic */ CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD again even if MKD failed! */ CURLFTP_CREATE_DIR_LAST /* not an option, never use */ } curl_ftpcreatedir; /* parameter for the CURLOPT_FTP_FILEMETHOD option */ typedef enum { CURLFTPMETHOD_DEFAULT, /* let libcurl pick */ CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */ CURLFTPMETHOD_NOCWD, /* no CWD at all */ CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */ CURLFTPMETHOD_LAST /* not an option, never use */ } curl_ftpmethod; /* bitmask defines for CURLOPT_HEADEROPT */ #define CURLHEADER_UNIFIED 0 #define CURLHEADER_SEPARATE (1<<0) /* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */ #define CURLPROTO_HTTP (1<<0) #define CURLPROTO_HTTPS (1<<1) #define CURLPROTO_FTP (1<<2) #define CURLPROTO_FTPS (1<<3) #define CURLPROTO_SCP (1<<4) #define CURLPROTO_SFTP (1<<5) #define CURLPROTO_TELNET (1<<6) #define CURLPROTO_LDAP (1<<7) #define CURLPROTO_LDAPS (1<<8) #define CURLPROTO_DICT (1<<9) #define CURLPROTO_FILE (1<<10) #define CURLPROTO_TFTP (1<<11) #define CURLPROTO_IMAP (1<<12) #define CURLPROTO_IMAPS (1<<13) #define CURLPROTO_POP3 (1<<14) #define CURLPROTO_POP3S (1<<15) #define CURLPROTO_SMTP (1<<16) #define CURLPROTO_SMTPS (1<<17) #define CURLPROTO_RTSP (1<<18) #define CURLPROTO_RTMP (1<<19) #define CURLPROTO_RTMPT (1<<20) #define CURLPROTO_RTMPE (1<<21) #define CURLPROTO_RTMPTE (1<<22) #define CURLPROTO_RTMPS (1<<23) #define CURLPROTO_RTMPTS (1<<24) #define CURLPROTO_GOPHER (1<<25) #define CURLPROTO_ALL (~0) /* enable everything */ /* long may be 32 or 64 bits, but we should never depend on anything else but 32 */ #define CURLOPTTYPE_LONG 0 #define CURLOPTTYPE_OBJECTPOINT 10000 #define CURLOPTTYPE_FUNCTIONPOINT 20000 #define CURLOPTTYPE_OFF_T 30000 /* name is uppercase CURLOPT_, type is one of the defined CURLOPTTYPE_ number is unique identifier */ #ifdef CINIT #undef CINIT #endif #ifdef CURL_ISOCPP #define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu #else /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ #define LONG CURLOPTTYPE_LONG #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT #define OFF_T CURLOPTTYPE_OFF_T #define CINIT(name,type,number) CURLOPT_/**/name = type + number #endif /* * This macro-mania below setups the CURLOPT_[what] enum, to be used with * curl_easy_setopt(). The first argument in the CINIT() macro is the [what] * word. */ typedef enum { /* This is the FILE * or void * the regular output should be written to. */ CINIT(WRITEDATA, OBJECTPOINT, 1), /* The full URL to get/put */ CINIT(URL, OBJECTPOINT, 2), /* Port number to connect to, if other than default. */ CINIT(PORT, LONG, 3), /* Name of proxy to use. */ CINIT(PROXY, OBJECTPOINT, 4), /* "user:password;options" to use when fetching. */ CINIT(USERPWD, OBJECTPOINT, 5), /* "user:password" to use with proxy. */ CINIT(PROXYUSERPWD, OBJECTPOINT, 6), /* Range to get, specified as an ASCII string. */ CINIT(RANGE, OBJECTPOINT, 7), /* not used */ /* Specified file stream to upload from (use as input): */ CINIT(READDATA, OBJECTPOINT, 9), /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE * bytes big. If this is not used, error messages go to stderr instead: */ CINIT(ERRORBUFFER, OBJECTPOINT, 10), /* Function that will be called to store the output (instead of fwrite). The * parameters will use fwrite() syntax, make sure to follow them. */ CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11), /* Function that will be called to read the input (instead of fread). The * parameters will use fread() syntax, make sure to follow them. */ CINIT(READFUNCTION, FUNCTIONPOINT, 12), /* Time-out the read operation after this amount of seconds */ CINIT(TIMEOUT, LONG, 13), /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about * how large the file being sent really is. That allows better error * checking and better verifies that the upload was successful. -1 means * unknown size. * * For large file support, there is also a _LARGE version of the key * which takes an off_t type, allowing platforms with larger off_t * sizes to handle larger files. See below for INFILESIZE_LARGE. */ CINIT(INFILESIZE, LONG, 14), /* POST static input fields. */ CINIT(POSTFIELDS, OBJECTPOINT, 15), /* Set the referrer page (needed by some CGIs) */ CINIT(REFERER, OBJECTPOINT, 16), /* Set the FTP PORT string (interface name, named or numerical IP address) Use i.e '-' to use default address. */ CINIT(FTPPORT, OBJECTPOINT, 17), /* Set the User-Agent string (examined by some CGIs) */ CINIT(USERAGENT, OBJECTPOINT, 18), /* If the download receives less than "low speed limit" bytes/second * during "low speed time" seconds, the operations is aborted. * You could i.e if you have a pretty high speed connection, abort if * it is less than 2000 bytes/sec during 20 seconds. */ /* Set the "low speed limit" */ CINIT(LOW_SPEED_LIMIT, LONG, 19), /* Set the "low speed time" */ CINIT(LOW_SPEED_TIME, LONG, 20), /* Set the continuation offset. * * Note there is also a _LARGE version of this key which uses * off_t types, allowing for large file offsets on platforms which * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE. */ CINIT(RESUME_FROM, LONG, 21), /* Set cookie in request: */ CINIT(COOKIE, OBJECTPOINT, 22), /* This points to a linked list of headers, struct curl_slist kind. This list is also used for RTSP (in spite of its name) */ CINIT(HTTPHEADER, OBJECTPOINT, 23), /* This points to a linked list of post entries, struct curl_httppost */ CINIT(HTTPPOST, OBJECTPOINT, 24), /* name of the file keeping your private SSL-certificate */ CINIT(SSLCERT, OBJECTPOINT, 25), /* password for the SSL or SSH private key */ CINIT(KEYPASSWD, OBJECTPOINT, 26), /* send TYPE parameter? */ CINIT(CRLF, LONG, 27), /* send linked-list of QUOTE commands */ CINIT(QUOTE, OBJECTPOINT, 28), /* send FILE * or void * to store headers to, if you use a callback it is simply passed to the callback unmodified */ CINIT(HEADERDATA, OBJECTPOINT, 29), /* point to a file to read the initial cookies from, also enables "cookie awareness" */ CINIT(COOKIEFILE, OBJECTPOINT, 31), /* What version to specifically try to use. See CURL_SSLVERSION defines below. */ CINIT(SSLVERSION, LONG, 32), /* What kind of HTTP time condition to use, see defines */ CINIT(TIMECONDITION, LONG, 33), /* Time to use with the above condition. Specified in number of seconds since 1 Jan 1970 */ CINIT(TIMEVALUE, LONG, 34), /* 35 = OBSOLETE */ /* Custom request, for customizing the get command like HTTP: DELETE, TRACE and others FTP: to use a different list command */ CINIT(CUSTOMREQUEST, OBJECTPOINT, 36), /* HTTP request, for odd commands like DELETE, TRACE and others */ CINIT(STDERR, OBJECTPOINT, 37), /* 38 is not used */ /* send linked-list of post-transfer QUOTE commands */ CINIT(POSTQUOTE, OBJECTPOINT, 39), CINIT(OBSOLETE40, OBJECTPOINT, 40), /* OBSOLETE, do not use! */ CINIT(VERBOSE, LONG, 41), /* talk a lot */ CINIT(HEADER, LONG, 42), /* throw the header out too */ CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */ CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */ CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */ CINIT(UPLOAD, LONG, 46), /* this is an upload */ CINIT(POST, LONG, 47), /* HTTP POST method */ CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */ CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */ /* Specify whether to read the user+password from the .netrc or the URL. * This must be one of the CURL_NETRC_* enums below. */ CINIT(NETRC, LONG, 51), CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */ CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */ CINIT(PUT, LONG, 54), /* HTTP PUT */ /* 55 = OBSOLETE */ /* DEPRECATED * Function that will be called instead of the internal progress display * function. This function should be defined as the curl_progress_callback * prototype defines. */ CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56), /* Data passed to the CURLOPT_PROGRESSFUNCTION and CURLOPT_XFERINFOFUNCTION callbacks */ CINIT(PROGRESSDATA, OBJECTPOINT, 57), #define CURLOPT_XFERINFODATA CURLOPT_PROGRESSDATA /* We want the referrer field set automatically when following locations */ CINIT(AUTOREFERER, LONG, 58), /* Port of the proxy, can be set in the proxy string as well with: "[host]:[port]" */ CINIT(PROXYPORT, LONG, 59), /* size of the POST input data, if strlen() is not good to use */ CINIT(POSTFIELDSIZE, LONG, 60), /* tunnel non-http operations through a HTTP proxy */ CINIT(HTTPPROXYTUNNEL, LONG, 61), /* Set the interface string to use as outgoing network interface */ CINIT(INTERFACE, OBJECTPOINT, 62), /* Set the krb4/5 security level, this also enables krb4/5 awareness. This * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string * is set but doesn't match one of these, 'private' will be used. */ CINIT(KRBLEVEL, OBJECTPOINT, 63), /* Set if we should verify the peer in ssl handshake, set 1 to verify. */ CINIT(SSL_VERIFYPEER, LONG, 64), /* The CApath or CAfile used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true */ CINIT(CAINFO, OBJECTPOINT, 65), /* 66 = OBSOLETE */ /* 67 = OBSOLETE */ /* Maximum number of http redirects to follow */ CINIT(MAXREDIRS, LONG, 68), /* Pass a long set to 1 to get the date of the requested document (if possible)! Pass a zero to shut it off. */ CINIT(FILETIME, LONG, 69), /* This points to a linked list of telnet options */ CINIT(TELNETOPTIONS, OBJECTPOINT, 70), /* Max amount of cached alive connections */ CINIT(MAXCONNECTS, LONG, 71), CINIT(OBSOLETE72, LONG, 72), /* OBSOLETE, do not use! */ /* 73 = OBSOLETE */ /* Set to explicitly use a new connection for the upcoming transfer. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CINIT(FRESH_CONNECT, LONG, 74), /* Set to explicitly forbid the upcoming transfer's connection to be re-used when done. Do not use this unless you're absolutely sure of this, as it makes the operation slower and is less friendly for the network. */ CINIT(FORBID_REUSE, LONG, 75), /* Set to a file name that contains random data for libcurl to use to seed the random engine when doing SSL connects. */ CINIT(RANDOM_FILE, OBJECTPOINT, 76), /* Set to the Entropy Gathering Daemon socket pathname */ CINIT(EGDSOCKET, OBJECTPOINT, 77), /* Time-out connect operations after this amount of seconds, if connects are OK within this time, then fine... This only aborts the connect phase. */ CINIT(CONNECTTIMEOUT, LONG, 78), /* Function that will be called to store headers (instead of fwrite). The * parameters will use fwrite() syntax, make sure to follow them. */ CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79), /* Set this to force the HTTP request to get back to GET. Only really usable if POST, PUT or a custom request have been used first. */ CINIT(HTTPGET, LONG, 80), /* Set if we should verify the Common name from the peer certificate in ssl * handshake, set 1 to check existence, 2 to ensure that it matches the * provided hostname. */ CINIT(SSL_VERIFYHOST, LONG, 81), /* Specify which file name to write all known cookies in after completed operation. Set file name to "-" (dash) to make it go to stdout. */ CINIT(COOKIEJAR, OBJECTPOINT, 82), /* Specify which SSL ciphers to use */ CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83), /* Specify which HTTP version to use! This must be set to one of the CURL_HTTP_VERSION* enums set below. */ CINIT(HTTP_VERSION, LONG, 84), /* Specifically switch on or off the FTP engine's use of the EPSV command. By default, that one will always be attempted before the more traditional PASV command. */ CINIT(FTP_USE_EPSV, LONG, 85), /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */ CINIT(SSLCERTTYPE, OBJECTPOINT, 86), /* name of the file keeping your private SSL-key */ CINIT(SSLKEY, OBJECTPOINT, 87), /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */ CINIT(SSLKEYTYPE, OBJECTPOINT, 88), /* crypto engine for the SSL-sub system */ CINIT(SSLENGINE, OBJECTPOINT, 89), /* set the crypto engine for the SSL-sub system as default the param has no meaning... */ CINIT(SSLENGINE_DEFAULT, LONG, 90), /* Non-zero value means to use the global dns cache */ CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */ /* DNS cache timeout */ CINIT(DNS_CACHE_TIMEOUT, LONG, 92), /* send linked-list of pre-transfer QUOTE commands */ CINIT(PREQUOTE, OBJECTPOINT, 93), /* set the debug function */ CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94), /* set the data for the debug function */ CINIT(DEBUGDATA, OBJECTPOINT, 95), /* mark this as start of a cookie session */ CINIT(COOKIESESSION, LONG, 96), /* The CApath directory used to validate the peer certificate this option is used only if SSL_VERIFYPEER is true */ CINIT(CAPATH, OBJECTPOINT, 97), /* Instruct libcurl to use a smaller receive buffer */ CINIT(BUFFERSIZE, LONG, 98), /* Instruct libcurl to not use any signal/alarm handlers, even when using timeouts. This option is useful for multi-threaded applications. See libcurl-the-guide for more background information. */ CINIT(NOSIGNAL, LONG, 99), /* Provide a CURLShare for mutexing non-ts data */ CINIT(SHARE, OBJECTPOINT, 100), /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default), CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */ CINIT(PROXYTYPE, LONG, 101), /* Set the Accept-Encoding string. Use this to tell a server you would like the response to be compressed. Before 7.21.6, this was known as CURLOPT_ENCODING */ CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102), /* Set pointer to private data */ CINIT(PRIVATE, OBJECTPOINT, 103), /* Set aliases for HTTP 200 in the HTTP Response header */ CINIT(HTTP200ALIASES, OBJECTPOINT, 104), /* Continue to send authentication (user+password) when following locations, even when hostname changed. This can potentially send off the name and password to whatever host the server decides. */ CINIT(UNRESTRICTED_AUTH, LONG, 105), /* Specifically switch on or off the FTP engine's use of the EPRT command ( it also disables the LPRT attempt). By default, those ones will always be attempted before the good old traditional PORT command. */ CINIT(FTP_USE_EPRT, LONG, 106), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_USERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(HTTPAUTH, LONG, 107), /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx in second argument. The function must be matching the curl_ssl_ctx_callback proto. */ CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108), /* Set the userdata for the ssl context callback function's third argument */ CINIT(SSL_CTX_DATA, OBJECTPOINT, 109), /* FTP Option that causes missing dirs to be created on the remote server. In 7.19.4 we introduced the convenience enums for this option using the CURLFTP_CREATE_DIR prefix. */ CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110), /* Set this to a bitmask value to enable the particular authentications methods you like. Use this in combination with CURLOPT_PROXYUSERPWD. Note that setting multiple bits may cause extra network round-trips. */ CINIT(PROXYAUTH, LONG, 111), /* FTP option that changes the timeout, in seconds, associated with getting a response. This is different from transfer timeout time and essentially places a demand on the FTP server to acknowledge commands in a timely manner. */ CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112), #define CURLOPT_SERVER_RESPONSE_TIMEOUT CURLOPT_FTP_RESPONSE_TIMEOUT /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to tell libcurl to resolve names to those IP versions only. This only has affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */ CINIT(IPRESOLVE, LONG, 113), /* Set this option to limit the size of a file that will be downloaded from an HTTP or FTP server. Note there is also _LARGE version which adds large file support for platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */ CINIT(MAXFILESIZE, LONG, 114), /* See the comment for INFILESIZE above, but in short, specifies * the size of the file being uploaded. -1 means unknown. */ CINIT(INFILESIZE_LARGE, OFF_T, 115), /* Sets the continuation offset. There is also a LONG version of this; * look above for RESUME_FROM. */ CINIT(RESUME_FROM_LARGE, OFF_T, 116), /* Sets the maximum size of data that will be downloaded from * an HTTP or FTP server. See MAXFILESIZE above for the LONG version. */ CINIT(MAXFILESIZE_LARGE, OFF_T, 117), /* Set this option to the file name of your .netrc file you want libcurl to parse (using the CURLOPT_NETRC option). If not set, libcurl will do a poor attempt to find the user's home directory and check for a .netrc file in there. */ CINIT(NETRC_FILE, OBJECTPOINT, 118), /* Enable SSL/TLS for FTP, pick one of: CURLUSESSL_TRY - try using SSL, proceed anyway otherwise CURLUSESSL_CONTROL - SSL for the control connection or fail CURLUSESSL_ALL - SSL for all communication or fail */ CINIT(USE_SSL, LONG, 119), /* The _LARGE version of the standard POSTFIELDSIZE option */ CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120), /* Enable/disable the TCP Nagle algorithm */ CINIT(TCP_NODELAY, LONG, 121), /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 123 OBSOLETE. Gone in 7.16.0 */ /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */ /* 127 OBSOLETE. Gone in 7.16.0 */ /* 128 OBSOLETE. Gone in 7.16.0 */ /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option can be used to change libcurl's default action which is to first try "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK response has been received. Available parameters are: CURLFTPAUTH_DEFAULT - let libcurl decide CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL */ CINIT(FTPSSLAUTH, LONG, 129), CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130), CINIT(IOCTLDATA, OBJECTPOINT, 131), /* 132 OBSOLETE. Gone in 7.16.0 */ /* 133 OBSOLETE. Gone in 7.16.0 */ /* zero terminated string for pass on to the FTP server when asked for "account" info */ CINIT(FTP_ACCOUNT, OBJECTPOINT, 134), /* feed cookies into cookie engine */ CINIT(COOKIELIST, OBJECTPOINT, 135), /* ignore Content-Length */ CINIT(IGNORE_CONTENT_LENGTH, LONG, 136), /* Set to non-zero to skip the IP address received in a 227 PASV FTP server response. Typically used for FTP-SSL purposes but is not restricted to that. libcurl will then instead use the same IP address it used for the control connection. */ CINIT(FTP_SKIP_PASV_IP, LONG, 137), /* Select "file method" to use when doing FTP, see the curl_ftpmethod above. */ CINIT(FTP_FILEMETHOD, LONG, 138), /* Local port number to bind the socket to */ CINIT(LOCALPORT, LONG, 139), /* Number of ports to try, including the first one set with LOCALPORT. Thus, setting it to 1 will make no additional attempts but the first. */ CINIT(LOCALPORTRANGE, LONG, 140), /* no transfer, set up connection and let application use the socket by extracting it with CURLINFO_LASTSOCKET */ CINIT(CONNECT_ONLY, LONG, 141), /* Function that will be called to convert from the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142), /* Function that will be called to convert to the network encoding (instead of using the iconv calls in libcurl) */ CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143), /* Function that will be called to convert from UTF8 (instead of using the iconv calls in libcurl) Note that this is used only for SSL certificate processing */ CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144), /* if the connection proceeds too quickly then need to slow it down */ /* limit-rate: maximum number of bytes per second to send or receive */ CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145), CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146), /* Pointer to command string to send if USER/PASS fails. */ CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147), /* callback function for setting socket options */ CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148), CINIT(SOCKOPTDATA, OBJECTPOINT, 149), /* set to 0 to disable session ID re-use for this transfer, default is enabled (== 1) */ CINIT(SSL_SESSIONID_CACHE, LONG, 150), /* allowed SSH authentication methods */ CINIT(SSH_AUTH_TYPES, LONG, 151), /* Used by scp/sftp to do public/private key authentication */ CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152), CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153), /* Send CCC (Clear Command Channel) after authentication */ CINIT(FTP_SSL_CCC, LONG, 154), /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */ CINIT(TIMEOUT_MS, LONG, 155), CINIT(CONNECTTIMEOUT_MS, LONG, 156), /* set to zero to disable the libcurl's decoding and thus pass the raw body data to the application even when it is encoded/compressed */ CINIT(HTTP_TRANSFER_DECODING, LONG, 157), CINIT(HTTP_CONTENT_DECODING, LONG, 158), /* Permission used when creating new files and directories on the remote server for protocols that support it, SFTP/SCP/FILE */ CINIT(NEW_FILE_PERMS, LONG, 159), CINIT(NEW_DIRECTORY_PERMS, LONG, 160), /* Set the behaviour of POST when redirecting. Values must be set to one of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */ CINIT(POSTREDIR, LONG, 161), /* used by scp/sftp to verify the host's public key */ CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162), /* Callback function for opening socket (instead of socket(2)). Optionally, callback is able change the address or refuse to connect returning CURL_SOCKET_BAD. The callback should have type curl_opensocket_callback */ CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163), CINIT(OPENSOCKETDATA, OBJECTPOINT, 164), /* POST volatile input fields. */ CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165), /* set transfer mode (;type=) when doing FTP via an HTTP proxy */ CINIT(PROXY_TRANSFER_MODE, LONG, 166), /* Callback function for seeking in the input stream */ CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167), CINIT(SEEKDATA, OBJECTPOINT, 168), /* CRL file */ CINIT(CRLFILE, OBJECTPOINT, 169), /* Issuer certificate */ CINIT(ISSUERCERT, OBJECTPOINT, 170), /* (IPv6) Address scope */ CINIT(ADDRESS_SCOPE, LONG, 171), /* Collect certificate chain info and allow it to get retrievable with CURLINFO_CERTINFO after the transfer is complete. */ CINIT(CERTINFO, LONG, 172), /* "name" and "pwd" to use when fetching. */ CINIT(USERNAME, OBJECTPOINT, 173), CINIT(PASSWORD, OBJECTPOINT, 174), /* "name" and "pwd" to use with Proxy when fetching. */ CINIT(PROXYUSERNAME, OBJECTPOINT, 175), CINIT(PROXYPASSWORD, OBJECTPOINT, 176), /* Comma separated list of hostnames defining no-proxy zones. These should match both hostnames directly, and hostnames within a domain. For example, local.com will match local.com and www.local.com, but NOT notlocal.com or www.notlocal.com. For compatibility with other implementations of this, .local.com will be considered to be the same as local.com. A single * is the only valid wildcard, and effectively disables the use of proxy. */ CINIT(NOPROXY, OBJECTPOINT, 177), /* block size for TFTP transfers */ CINIT(TFTP_BLKSIZE, LONG, 178), /* Socks Service */ CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179), /* Socks Service */ CINIT(SOCKS5_GSSAPI_NEC, LONG, 180), /* set the bitmask for the protocols that are allowed to be used for the transfer, which thus helps the app which takes URLs from users or other external inputs and want to restrict what protocol(s) to deal with. Defaults to CURLPROTO_ALL. */ CINIT(PROTOCOLS, LONG, 181), /* set the bitmask for the protocols that libcurl is allowed to follow to, as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs to be set in both bitmasks to be allowed to get redirected to. Defaults to all protocols except FILE and SCP. */ CINIT(REDIR_PROTOCOLS, LONG, 182), /* set the SSH knownhost file name to use */ CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183), /* set the SSH host key callback, must point to a curl_sshkeycallback function */ CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184), /* set the SSH host key callback custom pointer */ CINIT(SSH_KEYDATA, OBJECTPOINT, 185), /* set the SMTP mail originator */ CINIT(MAIL_FROM, OBJECTPOINT, 186), /* set the SMTP mail receiver(s) */ CINIT(MAIL_RCPT, OBJECTPOINT, 187), /* FTP: send PRET before PASV */ CINIT(FTP_USE_PRET, LONG, 188), /* RTSP request method (OPTIONS, SETUP, PLAY, etc...) */ CINIT(RTSP_REQUEST, LONG, 189), /* The RTSP session identifier */ CINIT(RTSP_SESSION_ID, OBJECTPOINT, 190), /* The RTSP stream URI */ CINIT(RTSP_STREAM_URI, OBJECTPOINT, 191), /* The Transport: header to use in RTSP requests */ CINIT(RTSP_TRANSPORT, OBJECTPOINT, 192), /* Manually initialize the client RTSP CSeq for this handle */ CINIT(RTSP_CLIENT_CSEQ, LONG, 193), /* Manually initialize the server RTSP CSeq for this handle */ CINIT(RTSP_SERVER_CSEQ, LONG, 194), /* The stream to pass to INTERLEAVEFUNCTION. */ CINIT(INTERLEAVEDATA, OBJECTPOINT, 195), /* Let the application define a custom write method for RTP data */ CINIT(INTERLEAVEFUNCTION, FUNCTIONPOINT, 196), /* Turn on wildcard matching */ CINIT(WILDCARDMATCH, LONG, 197), /* Directory matching callback called before downloading of an individual file (chunk) started */ CINIT(CHUNK_BGN_FUNCTION, FUNCTIONPOINT, 198), /* Directory matching callback called after the file (chunk) was downloaded, or skipped */ CINIT(CHUNK_END_FUNCTION, FUNCTIONPOINT, 199), /* Change match (fnmatch-like) callback for wildcard matching */ CINIT(FNMATCH_FUNCTION, FUNCTIONPOINT, 200), /* Let the application define custom chunk data pointer */ CINIT(CHUNK_DATA, OBJECTPOINT, 201), /* FNMATCH_FUNCTION user pointer */ CINIT(FNMATCH_DATA, OBJECTPOINT, 202), /* send linked-list of name:port:address sets */ CINIT(RESOLVE, OBJECTPOINT, 203), /* Set a username for authenticated TLS */ CINIT(TLSAUTH_USERNAME, OBJECTPOINT, 204), /* Set a password for authenticated TLS */ CINIT(TLSAUTH_PASSWORD, OBJECTPOINT, 205), /* Set authentication type for authenticated TLS */ CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206), /* Set to 1 to enable the "TE:" header in HTTP requests to ask for compressed transfer-encoded responses. Set to 0 to disable the use of TE: in outgoing requests. The current default is 0, but it might change in a future libcurl release. libcurl will ask for the compressed methods it knows of, and if that isn't any, it will not ask for transfer-encoding at all even if this option is set to 1. */ CINIT(TRANSFER_ENCODING, LONG, 207), /* Callback function for closing socket (instead of close(2)). The callback should have type curl_closesocket_callback */ CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208), CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209), /* allow GSSAPI credential delegation */ CINIT(GSSAPI_DELEGATION, LONG, 210), /* Set the name servers to use for DNS resolution */ CINIT(DNS_SERVERS, OBJECTPOINT, 211), /* Time-out accept operations (currently for FTP only) after this amount of miliseconds. */ CINIT(ACCEPTTIMEOUT_MS, LONG, 212), /* Set TCP keepalive */ CINIT(TCP_KEEPALIVE, LONG, 213), /* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */ CINIT(TCP_KEEPIDLE, LONG, 214), CINIT(TCP_KEEPINTVL, LONG, 215), /* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */ CINIT(SSL_OPTIONS, LONG, 216), /* Set the SMTP auth originator */ CINIT(MAIL_AUTH, OBJECTPOINT, 217), /* Enable/disable SASL initial response */ CINIT(SASL_IR, LONG, 218), /* Function that will be called instead of the internal progress display * function. This function should be defined as the curl_xferinfo_callback * prototype defines. (Deprecates CURLOPT_PROGRESSFUNCTION) */ CINIT(XFERINFOFUNCTION, FUNCTIONPOINT, 219), /* The XOAUTH2 bearer token */ CINIT(XOAUTH2_BEARER, OBJECTPOINT, 220), /* Set the interface string to use as outgoing network * interface for DNS requests. * Only supported by the c-ares DNS backend */ CINIT(DNS_INTERFACE, OBJECTPOINT, 221), /* Set the local IPv4 address to use for outgoing DNS requests. * Only supported by the c-ares DNS backend */ CINIT(DNS_LOCAL_IP4, OBJECTPOINT, 222), /* Set the local IPv4 address to use for outgoing DNS requests. * Only supported by the c-ares DNS backend */ CINIT(DNS_LOCAL_IP6, OBJECTPOINT, 223), /* Set authentication options directly */ CINIT(LOGIN_OPTIONS, OBJECTPOINT, 224), /* Enable/disable TLS NPN extension (http2 over ssl might fail without) */ CINIT(SSL_ENABLE_NPN, LONG, 225), /* Enable/disable TLS ALPN extension (http2 over ssl might fail without) */ CINIT(SSL_ENABLE_ALPN, LONG, 226), /* Time to wait for a response to a HTTP request containing an * Expect: 100-continue header before sending the data anyway. */ CINIT(EXPECT_100_TIMEOUT_MS, LONG, 227), /* This points to a linked list of headers used for proxy requests only, struct curl_slist kind */ CINIT(PROXYHEADER, OBJECTPOINT, 228), /* Pass in a bitmask of "header options" */ CINIT(HEADEROPT, LONG, 229), CURLOPT_LASTENTRY /* the last unused */ } CURLoption; #ifndef CURL_NO_OLDIES /* define this to test if your app builds with all the obsolete stuff removed! */ /* Backwards compatibility with older names */ /* These are scheduled to disappear by 2011 */ /* This was added in version 7.19.1 */ #define CURLOPT_POST301 CURLOPT_POSTREDIR /* These are scheduled to disappear by 2009 */ /* The following were added in 7.17.0 */ #define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD #define CURLOPT_FTPAPPEND CURLOPT_APPEND #define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY #define CURLOPT_FTP_SSL CURLOPT_USE_SSL /* The following were added earlier */ #define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD #define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL #else /* This is set if CURL_NO_OLDIES is defined at compile-time */ #undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */ #endif /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host name resolves addresses using more than one IP protocol version, this option might be handy to force libcurl to use a specific IP version. */ #define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP versions that your system allows */ #define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */ #define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */ /* three convenient "aliases" that follow the name scheme better */ #define CURLOPT_RTSPHEADER CURLOPT_HTTPHEADER /* These enums are for use with the CURLOPT_HTTP_VERSION option. */ enum { CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd like the library to choose the best possible for us! */ CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */ CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */ CURL_HTTP_VERSION_2_0, /* please use HTTP 2.0 in the request */ CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */ }; /* * Public API enums for RTSP requests */ enum { CURL_RTSPREQ_NONE, /* first in list */ CURL_RTSPREQ_OPTIONS, CURL_RTSPREQ_DESCRIBE, CURL_RTSPREQ_ANNOUNCE, CURL_RTSPREQ_SETUP, CURL_RTSPREQ_PLAY, CURL_RTSPREQ_PAUSE, CURL_RTSPREQ_TEARDOWN, CURL_RTSPREQ_GET_PARAMETER, CURL_RTSPREQ_SET_PARAMETER, CURL_RTSPREQ_RECORD, CURL_RTSPREQ_RECEIVE, CURL_RTSPREQ_LAST /* last in list */ }; /* These enums are for use with the CURLOPT_NETRC option. */ enum CURL_NETRC_OPTION { CURL_NETRC_IGNORED, /* The .netrc will never be read. * This is the default. */ CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred * to one in the .netrc. */ CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored. * Unless one is set programmatically, the .netrc * will be queried. */ CURL_NETRC_LAST }; enum { CURL_SSLVERSION_DEFAULT, CURL_SSLVERSION_TLSv1, /* TLS 1.x */ CURL_SSLVERSION_SSLv2, CURL_SSLVERSION_SSLv3, CURL_SSLVERSION_TLSv1_0, CURL_SSLVERSION_TLSv1_1, CURL_SSLVERSION_TLSv1_2, CURL_SSLVERSION_LAST /* never use, keep last */ }; enum CURL_TLSAUTH { CURL_TLSAUTH_NONE, CURL_TLSAUTH_SRP, CURL_TLSAUTH_LAST /* never use, keep last */ }; /* symbols to use with CURLOPT_POSTREDIR. CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303 can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302 | CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */ #define CURL_REDIR_GET_ALL 0 #define CURL_REDIR_POST_301 1 #define CURL_REDIR_POST_302 2 #define CURL_REDIR_POST_303 4 #define CURL_REDIR_POST_ALL \ (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303) typedef enum { CURL_TIMECOND_NONE, CURL_TIMECOND_IFMODSINCE, CURL_TIMECOND_IFUNMODSINCE, CURL_TIMECOND_LASTMOD, CURL_TIMECOND_LAST } curl_TimeCond; /* curl_strequal() and curl_strnequal() are subject for removal in a future libcurl, see lib/README.curlx for details */ CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2); CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n); /* name is uppercase CURLFORM_ */ #ifdef CFINIT #undef CFINIT #endif #ifdef CURL_ISOCPP #define CFINIT(name) CURLFORM_ ## name #else /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ #define CFINIT(name) CURLFORM_/**/name #endif typedef enum { CFINIT(NOTHING), /********* the first one is unused ************/ /* */ CFINIT(COPYNAME), CFINIT(PTRNAME), CFINIT(NAMELENGTH), CFINIT(COPYCONTENTS), CFINIT(PTRCONTENTS), CFINIT(CONTENTSLENGTH), CFINIT(FILECONTENT), CFINIT(ARRAY), CFINIT(OBSOLETE), CFINIT(FILE), CFINIT(BUFFER), CFINIT(BUFFERPTR), CFINIT(BUFFERLENGTH), CFINIT(CONTENTTYPE), CFINIT(CONTENTHEADER), CFINIT(FILENAME), CFINIT(END), CFINIT(OBSOLETE2), CFINIT(STREAM), CURLFORM_LASTENTRY /* the last unused */ } CURLformoption; #undef CFINIT /* done */ /* structure to be used as parameter for CURLFORM_ARRAY */ struct curl_forms { CURLformoption option; const char *value; }; /* use this for multipart formpost building */ /* Returns code for curl_formadd() * * Returns: * CURL_FORMADD_OK on success * CURL_FORMADD_MEMORY if the FormInfo allocation fails * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form * CURL_FORMADD_NULL if a null pointer was given for a char * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error) * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated * CURL_FORMADD_MEMORY if some allocation for string copying failed. * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array * ***************************************************************************/ typedef enum { CURL_FORMADD_OK, /* first, no error */ CURL_FORMADD_MEMORY, CURL_FORMADD_OPTION_TWICE, CURL_FORMADD_NULL, CURL_FORMADD_UNKNOWN_OPTION, CURL_FORMADD_INCOMPLETE, CURL_FORMADD_ILLEGAL_ARRAY, CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */ CURL_FORMADD_LAST /* last */ } CURLFORMcode; /* * NAME curl_formadd() * * DESCRIPTION * * Pretty advanced function for building multi-part formposts. Each invoke * adds one part that together construct a full post. Then use * CURLOPT_HTTPPOST to send it off to libcurl. */ CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost, struct curl_httppost **last_post, ...); /* * callback function for curl_formget() * The void *arg pointer will be the one passed as second argument to * curl_formget(). * The character buffer passed to it must not be freed. * Should return the buffer length passed to it as the argument "len" on * success. */ typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len); /* * NAME curl_formget() * * DESCRIPTION * * Serialize a curl_httppost struct built with curl_formadd(). * Accepts a void pointer as second argument which will be passed to * the curl_formget_callback function. * Returns 0 on success. */ CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg, curl_formget_callback append); /* * NAME curl_formfree() * * DESCRIPTION * * Free a multipart formpost previously built with curl_formadd(). */ CURL_EXTERN void curl_formfree(struct curl_httppost *form); /* * NAME curl_getenv() * * DESCRIPTION * * Returns a malloc()'ed string that MUST be curl_free()ed after usage is * complete. DEPRECATED - see lib/README.curlx */ CURL_EXTERN char *curl_getenv(const char *variable); /* * NAME curl_version() * * DESCRIPTION * * Returns a static ascii string of the libcurl version. */ CURL_EXTERN char *curl_version(void); /* * NAME curl_easy_escape() * * DESCRIPTION * * Escapes URL strings (converts all letters consider illegal in URLs to their * %XX versions). This function returns a new allocated string or NULL if an * error occurred. */ CURL_EXTERN char *curl_easy_escape(CURL *handle, const char *string, int length); /* the previous version: */ CURL_EXTERN char *curl_escape(const char *string, int length); /* * NAME curl_easy_unescape() * * DESCRIPTION * * Unescapes URL encoding in strings (converts all %XX codes to their 8bit * versions). This function returns a new allocated string or NULL if an error * occurred. * Conversion Note: On non-ASCII platforms the ASCII %XX codes are * converted into the host encoding. */ CURL_EXTERN char *curl_easy_unescape(CURL *handle, const char *string, int length, int *outlength); /* the previous version */ CURL_EXTERN char *curl_unescape(const char *string, int length); /* * NAME curl_free() * * DESCRIPTION * * Provided for de-allocation in the same translation unit that did the * allocation. Added in libcurl 7.10 */ CURL_EXTERN void curl_free(void *p); /* * NAME curl_global_init() * * DESCRIPTION * * curl_global_init() should be invoked exactly once for each application that * uses libcurl and before any call of other libcurl functions. * * This function is not thread-safe! */ CURL_EXTERN CURLcode curl_global_init(long flags); /* * NAME curl_global_init_mem() * * DESCRIPTION * * curl_global_init() or curl_global_init_mem() should be invoked exactly once * for each application that uses libcurl. This function can be used to * initialize libcurl and set user defined memory management callback * functions. Users can implement memory management routines to check for * memory leaks, check for mis-use of the curl library etc. User registered * callback routines with be invoked by this library instead of the system * memory management routines like malloc, free etc. */ CURL_EXTERN CURLcode curl_global_init_mem(long flags, curl_malloc_callback m, curl_free_callback f, curl_realloc_callback r, curl_strdup_callback s, curl_calloc_callback c); /* * NAME curl_global_cleanup() * * DESCRIPTION * * curl_global_cleanup() should be invoked exactly once for each application * that uses libcurl */ CURL_EXTERN void curl_global_cleanup(void); /* linked-list structure for the CURLOPT_QUOTE option (and other) */ struct curl_slist { char *data; struct curl_slist *next; }; /* * NAME curl_slist_append() * * DESCRIPTION * * Appends a string to a linked list. If no list exists, it will be created * first. Returns the new list, after appending. */ CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *, const char *); /* * NAME curl_slist_free_all() * * DESCRIPTION * * free a previously built curl_slist. */ CURL_EXTERN void curl_slist_free_all(struct curl_slist *); /* * NAME curl_getdate() * * DESCRIPTION * * Returns the time, in seconds since 1 Jan 1970 of the time string given in * the first argument. The time argument in the second parameter is unused * and should be set to NULL. */ CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused); /* info about the certificate chain, only for OpenSSL builds. Asked for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */ struct curl_certinfo { int num_of_certs; /* number of certificates with information */ struct curl_slist **certinfo; /* for each index in this array, there's a linked list with textual information in the format "name: value" */ }; /* enum for the different supported SSL backends */ typedef enum { CURLSSLBACKEND_NONE = 0, CURLSSLBACKEND_OPENSSL = 1, CURLSSLBACKEND_GNUTLS = 2, CURLSSLBACKEND_NSS = 3, CURLSSLBACKEND_QSOSSL = 4, CURLSSLBACKEND_GSKIT = 5, CURLSSLBACKEND_POLARSSL = 6, CURLSSLBACKEND_CYASSL = 7, CURLSSLBACKEND_SCHANNEL = 8, CURLSSLBACKEND_DARWINSSL = 9, CURLSSLBACKEND_AXTLS = 10 } curl_sslbackend; /* Information about the SSL library used and the respective internal SSL handle, which can be used to obtain further information regarding the connection. Asked for with CURLINFO_TLS_SESSION. */ struct curl_tlssessioninfo { curl_sslbackend backend; void *internals; }; #define CURLINFO_STRING 0x100000 #define CURLINFO_LONG 0x200000 #define CURLINFO_DOUBLE 0x300000 #define CURLINFO_SLIST 0x400000 #define CURLINFO_MASK 0x0fffff #define CURLINFO_TYPEMASK 0xf00000 typedef enum { CURLINFO_NONE, /* first, never use this */ CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1, CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2, CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3, CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4, CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5, CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6, CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7, CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8, CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9, CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10, CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11, CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12, CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13, CURLINFO_FILETIME = CURLINFO_LONG + 14, CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15, CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16, CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17, CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18, CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19, CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20, CURLINFO_PRIVATE = CURLINFO_STRING + 21, CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22, CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23, CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24, CURLINFO_OS_ERRNO = CURLINFO_LONG + 25, CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26, CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27, CURLINFO_COOKIELIST = CURLINFO_SLIST + 28, CURLINFO_LASTSOCKET = CURLINFO_LONG + 29, CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30, CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31, CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32, CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33, CURLINFO_CERTINFO = CURLINFO_SLIST + 34, CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35, CURLINFO_RTSP_SESSION_ID = CURLINFO_STRING + 36, CURLINFO_RTSP_CLIENT_CSEQ = CURLINFO_LONG + 37, CURLINFO_RTSP_SERVER_CSEQ = CURLINFO_LONG + 38, CURLINFO_RTSP_CSEQ_RECV = CURLINFO_LONG + 39, CURLINFO_PRIMARY_PORT = CURLINFO_LONG + 40, CURLINFO_LOCAL_IP = CURLINFO_STRING + 41, CURLINFO_LOCAL_PORT = CURLINFO_LONG + 42, CURLINFO_TLS_SESSION = CURLINFO_SLIST + 43, /* Fill in new entries below here! */ CURLINFO_LASTONE = 43 } CURLINFO; /* CURLINFO_RESPONSE_CODE is the new name for the option previously known as CURLINFO_HTTP_CODE */ #define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE typedef enum { CURLCLOSEPOLICY_NONE, /* first, never use this */ CURLCLOSEPOLICY_OLDEST, CURLCLOSEPOLICY_LEAST_RECENTLY_USED, CURLCLOSEPOLICY_LEAST_TRAFFIC, CURLCLOSEPOLICY_SLOWEST, CURLCLOSEPOLICY_CALLBACK, CURLCLOSEPOLICY_LAST /* last, never use this */ } curl_closepolicy; #define CURL_GLOBAL_SSL (1<<0) #define CURL_GLOBAL_WIN32 (1<<1) #define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32) #define CURL_GLOBAL_NOTHING 0 #define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL #define CURL_GLOBAL_ACK_EINTR (1<<2) /***************************************************************************** * Setup defines, protos etc for the sharing stuff. */ /* Different data locks for a single share */ typedef enum { CURL_LOCK_DATA_NONE = 0, /* CURL_LOCK_DATA_SHARE is used internally to say that * the locking is just made to change the internal state of the share * itself. */ CURL_LOCK_DATA_SHARE, CURL_LOCK_DATA_COOKIE, CURL_LOCK_DATA_DNS, CURL_LOCK_DATA_SSL_SESSION, CURL_LOCK_DATA_CONNECT, CURL_LOCK_DATA_LAST } curl_lock_data; /* Different lock access types */ typedef enum { CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */ CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */ CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */ CURL_LOCK_ACCESS_LAST /* never use */ } curl_lock_access; typedef void (*curl_lock_function)(CURL *handle, curl_lock_data data, curl_lock_access locktype, void *userptr); typedef void (*curl_unlock_function)(CURL *handle, curl_lock_data data, void *userptr); typedef void CURLSH; typedef enum { CURLSHE_OK, /* all is fine */ CURLSHE_BAD_OPTION, /* 1 */ CURLSHE_IN_USE, /* 2 */ CURLSHE_INVALID, /* 3 */ CURLSHE_NOMEM, /* 4 out of memory */ CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */ CURLSHE_LAST /* never use */ } CURLSHcode; typedef enum { CURLSHOPT_NONE, /* don't use */ CURLSHOPT_SHARE, /* specify a data type to share */ CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */ CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */ CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */ CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock callback functions */ CURLSHOPT_LAST /* never use */ } CURLSHoption; CURL_EXTERN CURLSH *curl_share_init(void); CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...); CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *); /**************************************************************************** * Structures for querying information about the curl library at runtime. */ typedef enum { CURLVERSION_FIRST, CURLVERSION_SECOND, CURLVERSION_THIRD, CURLVERSION_FOURTH, CURLVERSION_LAST /* never actually use this */ } CURLversion; /* The 'CURLVERSION_NOW' is the symbolic name meant to be used by basically all programs ever that want to get version information. It is meant to be a built-in version number for what kind of struct the caller expects. If the struct ever changes, we redefine the NOW to another enum from above. */ #define CURLVERSION_NOW CURLVERSION_FOURTH typedef struct { CURLversion age; /* age of the returned struct */ const char *version; /* LIBCURL_VERSION */ unsigned int version_num; /* LIBCURL_VERSION_NUM */ const char *host; /* OS/host/cpu/machine when configured */ int features; /* bitmask, see defines below */ const char *ssl_version; /* human readable string */ long ssl_version_num; /* not used anymore, always 0 */ const char *libz_version; /* human readable string */ /* protocols is terminated by an entry with a NULL protoname */ const char * const *protocols; /* The fields below this were added in CURLVERSION_SECOND */ const char *ares; int ares_num; /* This field was added in CURLVERSION_THIRD */ const char *libidn; /* These field were added in CURLVERSION_FOURTH */ /* Same as '_libiconv_version' if built with HAVE_ICONV */ int iconv_ver_num; const char *libssh_version; /* human readable string */ } curl_version_info_data; #define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */ #define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */ #define CURL_VERSION_SSL (1<<2) /* SSL options are present */ #define CURL_VERSION_LIBZ (1<<3) /* libz features are present */ #define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */ #define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support (deprecated) */ #define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */ #define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */ #define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth is supported */ #define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */ #define CURL_VERSION_IDN (1<<10) /* International Domain Names support */ #define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */ #define CURL_VERSION_CONV (1<<12) /* character conversions supported */ #define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */ #define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */ #define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */ #define CURL_VERSION_HTTP2 (1<<16) /* HTTP2 support built-in */ #define CURL_VERSION_GSSAPI (1<<17) /* GSS-API is supported */ /* * NAME curl_version_info() * * DESCRIPTION * * This function returns a pointer to a static copy of the version info * struct. See above. */ CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion); /* * NAME curl_easy_strerror() * * DESCRIPTION * * The curl_easy_strerror function may be used to turn a CURLcode value * into the equivalent human readable error string. This is useful * for printing meaningful error messages. */ CURL_EXTERN const char *curl_easy_strerror(CURLcode); /* * NAME curl_share_strerror() * * DESCRIPTION * * The curl_share_strerror function may be used to turn a CURLSHcode value * into the equivalent human readable error string. This is useful * for printing meaningful error messages. */ CURL_EXTERN const char *curl_share_strerror(CURLSHcode); /* * NAME curl_easy_pause() * * DESCRIPTION * * The curl_easy_pause function pauses or unpauses transfers. Select the new * state by setting the bitmask, use the convenience defines below. * */ CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask); #define CURLPAUSE_RECV (1<<0) #define CURLPAUSE_RECV_CONT (0) #define CURLPAUSE_SEND (1<<2) #define CURLPAUSE_SEND_CONT (0) #define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND) #define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT) #ifdef __cplusplus } #endif /* unfortunately, the easy.h and multi.h include files need options and info stuff before they can be included! */ #include "easy.h" /* nothing in curl is fun without the easy stuff */ #include "multi.h" /* the typechecker doesn't work in C++ (yet) */ #if defined(__GNUC__) && defined(__GNUC_MINOR__) && \ ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \ !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK) #include "typecheck-gcc.h" #else #if defined(__STDC__) && (__STDC__ >= 1) /* This preprocessor magic that replaces a call with the exact same call is only done to make sure application authors pass exactly three arguments to these functions. */ #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param) #define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg) #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) #endif /* __STDC__ >= 1 */ #endif /* gcc >= 4.3 && !__cplusplus */ #endif /* __CURL_CURL_H */ ================================================ FILE: Libraries/Core/RPi/Headers/curl/curlbuild.h ================================================ /* include/curl/curlbuild.h. Generated from curlbuild.h.in by configure. */ #ifndef __CURL_CURLBUILD_H #define __CURL_CURLBUILD_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* ================================================================ */ /* NOTES FOR CONFIGURE CAPABLE SYSTEMS */ /* ================================================================ */ /* * NOTE 1: * ------- * * Nothing in this file is intended to be modified or adjusted by the * curl library user nor by the curl library builder. * * If you think that something actually needs to be changed, adjusted * or fixed in this file, then, report it on the libcurl development * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/ * * This header file shall only export symbols which are 'curl' or 'CURL' * prefixed, otherwise public name space would be polluted. * * NOTE 2: * ------- * * Right now you might be staring at file include/curl/curlbuild.h.in or * at file include/curl/curlbuild.h, this is due to the following reason: * * On systems capable of running the configure script, the configure process * will overwrite the distributed include/curl/curlbuild.h file with one that * is suitable and specific to the library being configured and built, which * is generated from the include/curl/curlbuild.h.in template file. * */ /* ================================================================ */ /* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */ /* ================================================================ */ #ifdef CURL_SIZEOF_LONG #error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined #endif #ifdef CURL_TYPEOF_CURL_SOCKLEN_T #error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined #endif #ifdef CURL_SIZEOF_CURL_SOCKLEN_T #error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined #endif #ifdef CURL_TYPEOF_CURL_OFF_T #error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined #endif #ifdef CURL_FORMAT_CURL_OFF_T #error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined #endif #ifdef CURL_FORMAT_CURL_OFF_TU #error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined #endif #ifdef CURL_FORMAT_OFF_T #error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined #endif #ifdef CURL_SIZEOF_CURL_OFF_T #error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined #endif #ifdef CURL_SUFFIX_CURL_OFF_T #error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined #endif #ifdef CURL_SUFFIX_CURL_OFF_TU #error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined #endif /* ================================================================ */ /* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */ /* ================================================================ */ /* Configure process defines this to 1 when it finds out that system */ /* header file ws2tcpip.h must be included by the external interface. */ /* #undef CURL_PULL_WS2TCPIP_H */ #ifdef CURL_PULL_WS2TCPIP_H # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif # include # include # include #endif /* Configure process defines this to 1 when it finds out that system */ /* header file sys/types.h must be included by the external interface. */ #define CURL_PULL_SYS_TYPES_H 1 #ifdef CURL_PULL_SYS_TYPES_H # include #endif /* Configure process defines this to 1 when it finds out that system */ /* header file stdint.h must be included by the external interface. */ #define CURL_PULL_STDINT_H 1 #ifdef CURL_PULL_STDINT_H # include #endif /* Configure process defines this to 1 when it finds out that system */ /* header file inttypes.h must be included by the external interface. */ #define CURL_PULL_INTTYPES_H 1 #ifdef CURL_PULL_INTTYPES_H # include #endif /* Configure process defines this to 1 when it finds out that system */ /* header file sys/socket.h must be included by the external interface. */ #define CURL_PULL_SYS_SOCKET_H 1 #ifdef CURL_PULL_SYS_SOCKET_H # include #endif /* Configure process defines this to 1 when it finds out that system */ /* header file sys/poll.h must be included by the external interface. */ /* #undef CURL_PULL_SYS_POLL_H */ #ifdef CURL_PULL_SYS_POLL_H # include #endif /* The size of `long', as computed by sizeof. */ #define CURL_SIZEOF_LONG 4 /* Integral data type used for curl_socklen_t. */ #define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t /* The size of `curl_socklen_t', as computed by sizeof. */ #define CURL_SIZEOF_CURL_SOCKLEN_T 4 /* Data type definition of curl_socklen_t. */ typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t; /* Signed integral data type used for curl_off_t. */ #define CURL_TYPEOF_CURL_OFF_T int64_t /* Data type definition of curl_off_t. */ typedef CURL_TYPEOF_CURL_OFF_T curl_off_t; /* curl_off_t formatting string directive without "%" conversion specifier. */ #define CURL_FORMAT_CURL_OFF_T "lld" /* unsigned curl_off_t formatting string without "%" conversion specifier. */ #define CURL_FORMAT_CURL_OFF_TU "llu" /* curl_off_t formatting string directive with "%" conversion specifier. */ #define CURL_FORMAT_OFF_T "%lld" /* The size of `curl_off_t', as computed by sizeof. */ #define CURL_SIZEOF_CURL_OFF_T 8 /* curl_off_t constant suffix. */ #define CURL_SUFFIX_CURL_OFF_T LL /* unsigned curl_off_t constant suffix. */ #define CURL_SUFFIX_CURL_OFF_TU ULL #endif /* __CURL_CURLBUILD_H */ ================================================ FILE: Libraries/Core/RPi/Headers/curl/curlrules.h ================================================ #ifndef __CURL_CURLRULES_H #define __CURL_CURLRULES_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* ================================================================ */ /* COMPILE TIME SANITY CHECKS */ /* ================================================================ */ /* * NOTE 1: * ------- * * All checks done in this file are intentionally placed in a public * header file which is pulled by curl/curl.h when an application is * being built using an already built libcurl library. Additionally * this file is also included and used when building the library. * * If compilation fails on this file it is certainly sure that the * problem is elsewhere. It could be a problem in the curlbuild.h * header file, or simply that you are using different compilation * settings than those used to build the library. * * Nothing in this file is intended to be modified or adjusted by the * curl library user nor by the curl library builder. * * Do not deactivate any check, these are done to make sure that the * library is properly built and used. * * You can find further help on the libcurl development mailing list: * http://cool.haxx.se/mailman/listinfo/curl-library/ * * NOTE 2 * ------ * * Some of the following compile time checks are based on the fact * that the dimension of a constant array can not be a negative one. * In this way if the compile time verification fails, the compilation * will fail issuing an error. The error description wording is compiler * dependent but it will be quite similar to one of the following: * * "negative subscript or subscript is too large" * "array must have at least one element" * "-1 is an illegal array size" * "size of array is negative" * * If you are building an application which tries to use an already * built libcurl library and you are getting this kind of errors on * this file, it is a clear indication that there is a mismatch between * how the library was built and how you are trying to use it for your * application. Your already compiled or binary library provider is the * only one who can give you the details you need to properly use it. */ /* * Verify that some macros are actually defined. */ #ifndef CURL_SIZEOF_LONG # error "CURL_SIZEOF_LONG definition is missing!" Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing #endif #ifndef CURL_TYPEOF_CURL_SOCKLEN_T # error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!" Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing #endif #ifndef CURL_SIZEOF_CURL_SOCKLEN_T # error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!" Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing #endif #ifndef CURL_TYPEOF_CURL_OFF_T # error "CURL_TYPEOF_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing #endif #ifndef CURL_FORMAT_CURL_OFF_T # error "CURL_FORMAT_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing #endif #ifndef CURL_FORMAT_CURL_OFF_TU # error "CURL_FORMAT_CURL_OFF_TU definition is missing!" Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing #endif #ifndef CURL_FORMAT_OFF_T # error "CURL_FORMAT_OFF_T definition is missing!" Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing #endif #ifndef CURL_SIZEOF_CURL_OFF_T # error "CURL_SIZEOF_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing #endif #ifndef CURL_SUFFIX_CURL_OFF_T # error "CURL_SUFFIX_CURL_OFF_T definition is missing!" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing #endif #ifndef CURL_SUFFIX_CURL_OFF_TU # error "CURL_SUFFIX_CURL_OFF_TU definition is missing!" Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing #endif /* * Macros private to this header file. */ #define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1 #define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1 /* * Verify that the size previously defined and expected for long * is the same as the one reported by sizeof() at compile time. */ typedef char __curl_rule_01__ [CurlchkszEQ(long, CURL_SIZEOF_LONG)]; /* * Verify that the size previously defined and expected for * curl_off_t is actually the the same as the one reported * by sizeof() at compile time. */ typedef char __curl_rule_02__ [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)]; /* * Verify at compile time that the size of curl_off_t as reported * by sizeof() is greater or equal than the one reported for long * for the current compilation. */ typedef char __curl_rule_03__ [CurlchkszGE(curl_off_t, long)]; /* * Verify that the size previously defined and expected for * curl_socklen_t is actually the the same as the one reported * by sizeof() at compile time. */ typedef char __curl_rule_04__ [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)]; /* * Verify at compile time that the size of curl_socklen_t as reported * by sizeof() is greater or equal than the one reported for int for * the current compilation. */ typedef char __curl_rule_05__ [CurlchkszGE(curl_socklen_t, int)]; /* ================================================================ */ /* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */ /* ================================================================ */ /* * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow * these to be visible and exported by the external libcurl interface API, * while also making them visible to the library internals, simply including * curl_setup.h, without actually needing to include curl.h internally. * If some day this section would grow big enough, all this should be moved * to its own header file. */ /* * Figure out if we can use the ## preprocessor operator, which is supported * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__ * or __cplusplus so we need to carefully check for them too. */ #if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \ defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \ defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \ defined(__ILEC400__) /* This compiler is believed to have an ISO compatible preprocessor */ #define CURL_ISOCPP #else /* This compiler is believed NOT to have an ISO compatible preprocessor */ #undef CURL_ISOCPP #endif /* * Macros for minimum-width signed and unsigned curl_off_t integer constants. */ #if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551) # define __CURL_OFF_T_C_HLPR2(x) x # define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x) # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T) # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \ __CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU) #else # ifdef CURL_ISOCPP # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix # else # define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix # endif # define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix) # define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T) # define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU) #endif /* * Get rid of macros private to this header file. */ #undef CurlchkszEQ #undef CurlchkszGE /* * Get rid of macros not intended to exist beyond this point. */ #undef CURL_PULL_WS2TCPIP_H #undef CURL_PULL_SYS_TYPES_H #undef CURL_PULL_SYS_SOCKET_H #undef CURL_PULL_SYS_POLL_H #undef CURL_PULL_STDINT_H #undef CURL_PULL_INTTYPES_H #undef CURL_TYPEOF_CURL_SOCKLEN_T #undef CURL_TYPEOF_CURL_OFF_T #ifdef CURL_NO_OLDIES #undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */ #endif #endif /* __CURL_CURLRULES_H */ ================================================ FILE: Libraries/Core/RPi/Headers/curl/curlver.h ================================================ #ifndef __CURL_CURLVER_H #define __CURL_CURLVER_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This header file contains nothing but libcurl version info, generated by a script at release-time. This was made its own header file in 7.11.2 */ /* This is the global package copyright */ #define LIBCURL_COPYRIGHT "1996 - 2014 Daniel Stenberg, ." /* This is the version number of the libcurl package from which this header file origins: */ #define LIBCURL_VERSION "7.38.0" /* The numeric version number is also available "in parts" by using these defines: */ #define LIBCURL_VERSION_MAJOR 7 #define LIBCURL_VERSION_MINOR 38 #define LIBCURL_VERSION_PATCH 0 /* This is the numeric version of the libcurl version number, meant for easier parsing and comparions by programs. The LIBCURL_VERSION_NUM define will always follow this syntax: 0xXXYYZZ Where XX, YY and ZZ are the main version, release and patch numbers in hexadecimal (using 8 bits each). All three numbers are always represented using two digits. 1.2 would appear as "0x010200" while version 9.11.7 appears as "0x090b07". This 6-digit (24 bits) hexadecimal number does not show pre-release number, and it is always a greater number in a more recent release. It makes comparisons with greater than and less than work. */ #define LIBCURL_VERSION_NUM 0x072600 /* * This is the date and time when the full source package was created. The * timestamp is not stored in git, as the timestamp is properly set in the * tarballs by the maketgz script. * * The format of the date should follow this template: * * "Mon Feb 12 11:35:33 UTC 2007" */ #define LIBCURL_TIMESTAMP "Wed Sep 10 06:19:50 UTC 2014" #endif /* __CURL_CURLVER_H */ ================================================ FILE: Libraries/Core/RPi/Headers/curl/easy.h ================================================ #ifndef __CURL_EASY_H #define __CURL_EASY_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #ifdef __cplusplus extern "C" { #endif CURL_EXTERN CURL *curl_easy_init(void); CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...); CURL_EXTERN CURLcode curl_easy_perform(CURL *curl); CURL_EXTERN void curl_easy_cleanup(CURL *curl); /* * NAME curl_easy_getinfo() * * DESCRIPTION * * Request internal information from the curl session with this function. The * third argument MUST be a pointer to a long, a pointer to a char * or a * pointer to a double (as the documentation describes elsewhere). The data * pointed to will be filled in accordingly and can be relied upon only if the * function returns CURLE_OK. This function is intended to get used *AFTER* a * performed transfer, all results from this function are undefined until the * transfer is completed. */ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...); /* * NAME curl_easy_duphandle() * * DESCRIPTION * * Creates a new curl session handle with the same options set for the handle * passed in. Duplicating a handle could only be a matter of cloning data and * options, internal state info and things like persistent connections cannot * be transferred. It is useful in multithreaded applications when you can run * curl_easy_duphandle() for each new thread to avoid a series of identical * curl_easy_setopt() invokes in every thread. */ CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl); /* * NAME curl_easy_reset() * * DESCRIPTION * * Re-initializes a CURL handle to the default values. This puts back the * handle to the same state as it was in when it was just created. * * It does keep: live connections, the Session ID cache, the DNS cache and the * cookies. */ CURL_EXTERN void curl_easy_reset(CURL *curl); /* * NAME curl_easy_recv() * * DESCRIPTION * * Receives data from the connected socket. Use after successful * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. */ CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen, size_t *n); /* * NAME curl_easy_send() * * DESCRIPTION * * Sends data over the connected socket. Use after successful * curl_easy_perform() with CURLOPT_CONNECT_ONLY option. */ CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer, size_t buflen, size_t *n); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/curl/mprintf.h ================================================ #ifndef __CURL_MPRINTF_H #define __CURL_MPRINTF_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include #include /* needed for FILE */ #include "curl.h" #ifdef __cplusplus extern "C" { #endif CURL_EXTERN int curl_mprintf(const char *format, ...); CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, const char *format, ...); CURL_EXTERN int curl_mvprintf(const char *format, va_list args); CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args); CURL_EXTERN char *curl_maprintf(const char *format, ...); CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); #ifdef _MPRINTF_REPLACE # undef printf # undef fprintf # undef sprintf # undef vsprintf # undef snprintf # undef vprintf # undef vfprintf # undef vsnprintf # undef aprintf # undef vaprintf # define printf curl_mprintf # define fprintf curl_mfprintf #ifdef CURLDEBUG /* When built with CURLDEBUG we define away the sprintf functions since we don't want internal code to be using them */ # define sprintf sprintf_was_used # define vsprintf vsprintf_was_used #else # define sprintf curl_msprintf # define vsprintf curl_mvsprintf #endif # define snprintf curl_msnprintf # define vprintf curl_mvprintf # define vfprintf curl_mvfprintf # define vsnprintf curl_mvsnprintf # define aprintf curl_maprintf # define vaprintf curl_mvaprintf #endif #ifdef __cplusplus } #endif #endif /* __CURL_MPRINTF_H */ ================================================ FILE: Libraries/Core/RPi/Headers/curl/multi.h ================================================ #ifndef __CURL_MULTI_H #define __CURL_MULTI_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* This is an "external" header file. Don't give away any internals here! GOALS o Enable a "pull" interface. The application that uses libcurl decides where and when to ask libcurl to get/send data. o Enable multiple simultaneous transfers in the same thread without making it complicated for the application. o Enable the application to select() on its own file descriptors and curl's file descriptors simultaneous easily. */ /* * This header file should not really need to include "curl.h" since curl.h * itself includes this file and we expect user applications to do #include * without the need for especially including multi.h. * * For some reason we added this include here at one point, and rather than to * break existing (wrongly written) libcurl applications, we leave it as-is * but with this warning attached. */ #include "curl.h" #ifdef __cplusplus extern "C" { #endif typedef void CURLM; typedef enum { CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or curl_multi_socket*() soon */ CURLM_OK, CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */ CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */ CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */ CURLM_INTERNAL_ERROR, /* this is a libcurl bug */ CURLM_BAD_SOCKET, /* the passed in socket argument did not match */ CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */ CURLM_ADDED_ALREADY, /* an easy handle already added to a multi handle was attempted to get added - again */ CURLM_LAST } CURLMcode; /* just to make code nicer when using curl_multi_socket() you can now check for CURLM_CALL_MULTI_SOCKET too in the same style it works for curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */ #define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM typedef enum { CURLMSG_NONE, /* first, not used */ CURLMSG_DONE, /* This easy handle has completed. 'result' contains the CURLcode of the transfer */ CURLMSG_LAST /* last, not used */ } CURLMSG; struct CURLMsg { CURLMSG msg; /* what this message means */ CURL *easy_handle; /* the handle it concerns */ union { void *whatever; /* message-specific data */ CURLcode result; /* return code for transfer */ } data; }; typedef struct CURLMsg CURLMsg; /* Based on poll(2) structure and values. * We don't use pollfd and POLL* constants explicitly * to cover platforms without poll(). */ #define CURL_WAIT_POLLIN 0x0001 #define CURL_WAIT_POLLPRI 0x0002 #define CURL_WAIT_POLLOUT 0x0004 struct curl_waitfd { curl_socket_t fd; short events; short revents; /* not supported yet */ }; /* * Name: curl_multi_init() * * Desc: inititalize multi-style curl usage * * Returns: a new CURLM handle to use in all 'curl_multi' functions. */ CURL_EXTERN CURLM *curl_multi_init(void); /* * Name: curl_multi_add_handle() * * Desc: add a standard curl handle to the multi stack * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle, CURL *curl_handle); /* * Name: curl_multi_remove_handle() * * Desc: removes a curl handle from the multi stack again * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle, CURL *curl_handle); /* * Name: curl_multi_fdset() * * Desc: Ask curl for its fd_set sets. The app can use these to select() or * poll() on. We want curl_multi_perform() called as soon as one of * them are ready. * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle, fd_set *read_fd_set, fd_set *write_fd_set, fd_set *exc_fd_set, int *max_fd); /* * Name: curl_multi_wait() * * Desc: Poll on all fds within a CURLM set as well as any * additional fds passed to the function. * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_wait(CURLM *multi_handle, struct curl_waitfd extra_fds[], unsigned int extra_nfds, int timeout_ms, int *ret); /* * Name: curl_multi_perform() * * Desc: When the app thinks there's data available for curl it calls this * function to read/write whatever there is right now. This returns * as soon as the reads and writes are done. This function does not * require that there actually is data available for reading or that * data can be written, it can be called just in case. It returns * the number of handles that still transfer data in the second * argument's integer-pointer. * * Returns: CURLMcode type, general multi error code. *NOTE* that this only * returns errors etc regarding the whole multi stack. There might * still have occurred problems on invidual transfers even when this * returns OK. */ CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles); /* * Name: curl_multi_cleanup() * * Desc: Cleans up and removes a whole multi stack. It does not free or * touch any individual easy handles in any way. We need to define * in what state those handles will be if this function is called * in the middle of a transfer. * * Returns: CURLMcode type, general multi error code. */ CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle); /* * Name: curl_multi_info_read() * * Desc: Ask the multi handle if there's any messages/informationals from * the individual transfers. Messages include informationals such as * error code from the transfer or just the fact that a transfer is * completed. More details on these should be written down as well. * * Repeated calls to this function will return a new struct each * time, until a special "end of msgs" struct is returned as a signal * that there is no more to get at this point. * * The data the returned pointer points to will not survive calling * curl_multi_cleanup(). * * The 'CURLMsg' struct is meant to be very simple and only contain * very basic informations. If more involved information is wanted, * we will provide the particular "transfer handle" in that struct * and that should/could/would be used in subsequent * curl_easy_getinfo() calls (or similar). The point being that we * must never expose complex structs to applications, as then we'll * undoubtably get backwards compatibility problems in the future. * * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out * of structs. It also writes the number of messages left in the * queue (after this read) in the integer the second argument points * to. */ CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle, int *msgs_in_queue); /* * Name: curl_multi_strerror() * * Desc: The curl_multi_strerror function may be used to turn a CURLMcode * value into the equivalent human readable error string. This is * useful for printing meaningful error messages. * * Returns: A pointer to a zero-terminated error message. */ CURL_EXTERN const char *curl_multi_strerror(CURLMcode); /* * Name: curl_multi_socket() and * curl_multi_socket_all() * * Desc: An alternative version of curl_multi_perform() that allows the * application to pass in one of the file descriptors that have been * detected to have "action" on them and let libcurl perform. * See man page for details. */ #define CURL_POLL_NONE 0 #define CURL_POLL_IN 1 #define CURL_POLL_OUT 2 #define CURL_POLL_INOUT 3 #define CURL_POLL_REMOVE 4 #define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD #define CURL_CSELECT_IN 0x01 #define CURL_CSELECT_OUT 0x02 #define CURL_CSELECT_ERR 0x04 typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */ curl_socket_t s, /* socket */ int what, /* see above */ void *userp, /* private callback pointer */ void *socketp); /* private socket pointer */ /* * Name: curl_multi_timer_callback * * Desc: Called by libcurl whenever the library detects a change in the * maximum number of milliseconds the app is allowed to wait before * curl_multi_socket() or curl_multi_perform() must be called * (to allow libcurl's timed events to take place). * * Returns: The callback should return zero. */ typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */ long timeout_ms, /* see above */ void *userp); /* private callback pointer */ CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s, int *running_handles); CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle, curl_socket_t s, int ev_bitmask, int *running_handles); CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle, int *running_handles); #ifndef CURL_ALLOW_OLD_MULTI_SOCKET /* This macro below was added in 7.16.3 to push users who recompile to use the new curl_multi_socket_action() instead of the old curl_multi_socket() */ #define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z) #endif /* * Name: curl_multi_timeout() * * Desc: Returns the maximum number of milliseconds the app is allowed to * wait before curl_multi_socket() or curl_multi_perform() must be * called (to allow libcurl's timed events to take place). * * Returns: CURLM error code. */ CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle, long *milliseconds); #undef CINIT /* re-using the same name as in curl.h */ #ifdef CURL_ISOCPP #define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num #else /* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */ #define LONG CURLOPTTYPE_LONG #define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT #define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT #define OFF_T CURLOPTTYPE_OFF_T #define CINIT(name,type,number) CURLMOPT_/**/name = type + number #endif typedef enum { /* This is the socket callback function pointer */ CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1), /* This is the argument passed to the socket callback */ CINIT(SOCKETDATA, OBJECTPOINT, 2), /* set to 1 to enable pipelining for this multi handle */ CINIT(PIPELINING, LONG, 3), /* This is the timer callback function pointer */ CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4), /* This is the argument passed to the timer callback */ CINIT(TIMERDATA, OBJECTPOINT, 5), /* maximum number of entries in the connection cache */ CINIT(MAXCONNECTS, LONG, 6), /* maximum number of (pipelining) connections to one host */ CINIT(MAX_HOST_CONNECTIONS, LONG, 7), /* maximum number of requests in a pipeline */ CINIT(MAX_PIPELINE_LENGTH, LONG, 8), /* a connection with a content-length longer than this will not be considered for pipelining */ CINIT(CONTENT_LENGTH_PENALTY_SIZE, OFF_T, 9), /* a connection with a chunk length longer than this will not be considered for pipelining */ CINIT(CHUNK_LENGTH_PENALTY_SIZE, OFF_T, 10), /* a list of site names(+port) that are blacklisted from pipelining */ CINIT(PIPELINING_SITE_BL, OBJECTPOINT, 11), /* a list of server types that are blacklisted from pipelining */ CINIT(PIPELINING_SERVER_BL, OBJECTPOINT, 12), /* maximum number of open connections in total */ CINIT(MAX_TOTAL_CONNECTIONS, LONG, 13), CURLMOPT_LASTENTRY /* the last unused */ } CURLMoption; /* * Name: curl_multi_setopt() * * Desc: Sets options for the multi handle. * * Returns: CURLM error code. */ CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle, CURLMoption option, ...); /* * Name: curl_multi_assign() * * Desc: This function sets an association in the multi handle between the * given socket and a private pointer of the application. This is * (only) useful for curl_multi_socket uses. * * Returns: CURLM error code. */ CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle, curl_socket_t sockfd, void *sockp); #ifdef __cplusplus } /* end of extern "C" */ #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/curl/stdcheaders.h ================================================ #ifndef __STDC_HEADERS_H #define __STDC_HEADERS_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ #include size_t fread (void *, size_t, size_t, FILE *); size_t fwrite (const void *, size_t, size_t, FILE *); int strcasecmp(const char *, const char *); int strncasecmp(const char *, const char *, size_t); #endif /* __STDC_HEADERS_H */ ================================================ FILE: Libraries/Core/RPi/Headers/curl/typecheck-gcc.h ================================================ #ifndef __CURL_TYPECHECK_GCC_H #define __CURL_TYPECHECK_GCC_H /*************************************************************************** * _ _ ____ _ * Project ___| | | | _ \| | * / __| | | | |_) | | * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ***************************************************************************/ /* wraps curl_easy_setopt() with typechecking */ /* To add a new kind of warning, add an * if(_curl_is_sometype_option(_curl_opt)) * if(!_curl_is_sometype(value)) * _curl_easy_setopt_err_sometype(); * block and define _curl_is_sometype_option, _curl_is_sometype and * _curl_easy_setopt_err_sometype below * * NOTE: We use two nested 'if' statements here instead of the && operator, in * order to work around gcc bug #32061. It affects only gcc 4.3.x/4.4.x * when compiling with -Wlogical-op. * * To add an option that uses the same type as an existing option, you'll just * need to extend the appropriate _curl_*_option macro */ #define curl_easy_setopt(handle, option, value) \ __extension__ ({ \ __typeof__ (option) _curl_opt = option; \ if(__builtin_constant_p(_curl_opt)) { \ if(_curl_is_long_option(_curl_opt)) \ if(!_curl_is_long(value)) \ _curl_easy_setopt_err_long(); \ if(_curl_is_off_t_option(_curl_opt)) \ if(!_curl_is_off_t(value)) \ _curl_easy_setopt_err_curl_off_t(); \ if(_curl_is_string_option(_curl_opt)) \ if(!_curl_is_string(value)) \ _curl_easy_setopt_err_string(); \ if(_curl_is_write_cb_option(_curl_opt)) \ if(!_curl_is_write_cb(value)) \ _curl_easy_setopt_err_write_callback(); \ if((_curl_opt) == CURLOPT_READFUNCTION) \ if(!_curl_is_read_cb(value)) \ _curl_easy_setopt_err_read_cb(); \ if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \ if(!_curl_is_ioctl_cb(value)) \ _curl_easy_setopt_err_ioctl_cb(); \ if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \ if(!_curl_is_sockopt_cb(value)) \ _curl_easy_setopt_err_sockopt_cb(); \ if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \ if(!_curl_is_opensocket_cb(value)) \ _curl_easy_setopt_err_opensocket_cb(); \ if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \ if(!_curl_is_progress_cb(value)) \ _curl_easy_setopt_err_progress_cb(); \ if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \ if(!_curl_is_debug_cb(value)) \ _curl_easy_setopt_err_debug_cb(); \ if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \ if(!_curl_is_ssl_ctx_cb(value)) \ _curl_easy_setopt_err_ssl_ctx_cb(); \ if(_curl_is_conv_cb_option(_curl_opt)) \ if(!_curl_is_conv_cb(value)) \ _curl_easy_setopt_err_conv_cb(); \ if((_curl_opt) == CURLOPT_SEEKFUNCTION) \ if(!_curl_is_seek_cb(value)) \ _curl_easy_setopt_err_seek_cb(); \ if(_curl_is_cb_data_option(_curl_opt)) \ if(!_curl_is_cb_data(value)) \ _curl_easy_setopt_err_cb_data(); \ if((_curl_opt) == CURLOPT_ERRORBUFFER) \ if(!_curl_is_error_buffer(value)) \ _curl_easy_setopt_err_error_buffer(); \ if((_curl_opt) == CURLOPT_STDERR) \ if(!_curl_is_FILE(value)) \ _curl_easy_setopt_err_FILE(); \ if(_curl_is_postfields_option(_curl_opt)) \ if(!_curl_is_postfields(value)) \ _curl_easy_setopt_err_postfields(); \ if((_curl_opt) == CURLOPT_HTTPPOST) \ if(!_curl_is_arr((value), struct curl_httppost)) \ _curl_easy_setopt_err_curl_httpost(); \ if(_curl_is_slist_option(_curl_opt)) \ if(!_curl_is_arr((value), struct curl_slist)) \ _curl_easy_setopt_err_curl_slist(); \ if((_curl_opt) == CURLOPT_SHARE) \ if(!_curl_is_ptr((value), CURLSH)) \ _curl_easy_setopt_err_CURLSH(); \ } \ curl_easy_setopt(handle, _curl_opt, value); \ }) /* wraps curl_easy_getinfo() with typechecking */ /* FIXME: don't allow const pointers */ #define curl_easy_getinfo(handle, info, arg) \ __extension__ ({ \ __typeof__ (info) _curl_info = info; \ if(__builtin_constant_p(_curl_info)) { \ if(_curl_is_string_info(_curl_info)) \ if(!_curl_is_arr((arg), char *)) \ _curl_easy_getinfo_err_string(); \ if(_curl_is_long_info(_curl_info)) \ if(!_curl_is_arr((arg), long)) \ _curl_easy_getinfo_err_long(); \ if(_curl_is_double_info(_curl_info)) \ if(!_curl_is_arr((arg), double)) \ _curl_easy_getinfo_err_double(); \ if(_curl_is_slist_info(_curl_info)) \ if(!_curl_is_arr((arg), struct curl_slist *)) \ _curl_easy_getinfo_err_curl_slist(); \ } \ curl_easy_getinfo(handle, _curl_info, arg); \ }) /* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(), * for now just make sure that the functions are called with three * arguments */ #define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param) #define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param) /* the actual warnings, triggered by calling the _curl_easy_setopt_err* * functions */ /* To define a new warning, use _CURL_WARNING(identifier, "message") */ #define _CURL_WARNING(id, message) \ static void __attribute__((__warning__(message))) \ __attribute__((__unused__)) __attribute__((__noinline__)) \ id(void) { __asm__(""); } _CURL_WARNING(_curl_easy_setopt_err_long, "curl_easy_setopt expects a long argument for this option") _CURL_WARNING(_curl_easy_setopt_err_curl_off_t, "curl_easy_setopt expects a curl_off_t argument for this option") _CURL_WARNING(_curl_easy_setopt_err_string, "curl_easy_setopt expects a " "string (char* or char[]) argument for this option" ) _CURL_WARNING(_curl_easy_setopt_err_write_callback, "curl_easy_setopt expects a curl_write_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_read_cb, "curl_easy_setopt expects a curl_read_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_ioctl_cb, "curl_easy_setopt expects a curl_ioctl_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_sockopt_cb, "curl_easy_setopt expects a curl_sockopt_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_opensocket_cb, "curl_easy_setopt expects a " "curl_opensocket_callback argument for this option" ) _CURL_WARNING(_curl_easy_setopt_err_progress_cb, "curl_easy_setopt expects a curl_progress_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_debug_cb, "curl_easy_setopt expects a curl_debug_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb, "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_conv_cb, "curl_easy_setopt expects a curl_conv_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_seek_cb, "curl_easy_setopt expects a curl_seek_callback argument for this option") _CURL_WARNING(_curl_easy_setopt_err_cb_data, "curl_easy_setopt expects a " "private data pointer as argument for this option") _CURL_WARNING(_curl_easy_setopt_err_error_buffer, "curl_easy_setopt expects a " "char buffer of CURL_ERROR_SIZE as argument for this option") _CURL_WARNING(_curl_easy_setopt_err_FILE, "curl_easy_setopt expects a FILE* argument for this option") _CURL_WARNING(_curl_easy_setopt_err_postfields, "curl_easy_setopt expects a void* or char* argument for this option") _CURL_WARNING(_curl_easy_setopt_err_curl_httpost, "curl_easy_setopt expects a struct curl_httppost* argument for this option") _CURL_WARNING(_curl_easy_setopt_err_curl_slist, "curl_easy_setopt expects a struct curl_slist* argument for this option") _CURL_WARNING(_curl_easy_setopt_err_CURLSH, "curl_easy_setopt expects a CURLSH* argument for this option") _CURL_WARNING(_curl_easy_getinfo_err_string, "curl_easy_getinfo expects a pointer to char * for this info") _CURL_WARNING(_curl_easy_getinfo_err_long, "curl_easy_getinfo expects a pointer to long for this info") _CURL_WARNING(_curl_easy_getinfo_err_double, "curl_easy_getinfo expects a pointer to double for this info") _CURL_WARNING(_curl_easy_getinfo_err_curl_slist, "curl_easy_getinfo expects a pointer to struct curl_slist * for this info") /* groups of curl_easy_setops options that take the same type of argument */ /* To add a new option to one of the groups, just add * (option) == CURLOPT_SOMETHING * to the or-expression. If the option takes a long or curl_off_t, you don't * have to do anything */ /* evaluates to true if option takes a long argument */ #define _curl_is_long_option(option) \ (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT) #define _curl_is_off_t_option(option) \ ((option) > CURLOPTTYPE_OFF_T) /* evaluates to true if option takes a char* argument */ #define _curl_is_string_option(option) \ ((option) == CURLOPT_URL || \ (option) == CURLOPT_PROXY || \ (option) == CURLOPT_INTERFACE || \ (option) == CURLOPT_NETRC_FILE || \ (option) == CURLOPT_USERPWD || \ (option) == CURLOPT_USERNAME || \ (option) == CURLOPT_PASSWORD || \ (option) == CURLOPT_PROXYUSERPWD || \ (option) == CURLOPT_PROXYUSERNAME || \ (option) == CURLOPT_PROXYPASSWORD || \ (option) == CURLOPT_NOPROXY || \ (option) == CURLOPT_ACCEPT_ENCODING || \ (option) == CURLOPT_REFERER || \ (option) == CURLOPT_USERAGENT || \ (option) == CURLOPT_COOKIE || \ (option) == CURLOPT_COOKIEFILE || \ (option) == CURLOPT_COOKIEJAR || \ (option) == CURLOPT_COOKIELIST || \ (option) == CURLOPT_FTPPORT || \ (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \ (option) == CURLOPT_FTP_ACCOUNT || \ (option) == CURLOPT_RANGE || \ (option) == CURLOPT_CUSTOMREQUEST || \ (option) == CURLOPT_SSLCERT || \ (option) == CURLOPT_SSLCERTTYPE || \ (option) == CURLOPT_SSLKEY || \ (option) == CURLOPT_SSLKEYTYPE || \ (option) == CURLOPT_KEYPASSWD || \ (option) == CURLOPT_SSLENGINE || \ (option) == CURLOPT_CAINFO || \ (option) == CURLOPT_CAPATH || \ (option) == CURLOPT_RANDOM_FILE || \ (option) == CURLOPT_EGDSOCKET || \ (option) == CURLOPT_SSL_CIPHER_LIST || \ (option) == CURLOPT_KRBLEVEL || \ (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \ (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \ (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \ (option) == CURLOPT_CRLFILE || \ (option) == CURLOPT_ISSUERCERT || \ (option) == CURLOPT_SOCKS5_GSSAPI_SERVICE || \ (option) == CURLOPT_SSH_KNOWNHOSTS || \ (option) == CURLOPT_MAIL_FROM || \ (option) == CURLOPT_RTSP_SESSION_ID || \ (option) == CURLOPT_RTSP_STREAM_URI || \ (option) == CURLOPT_RTSP_TRANSPORT || \ (option) == CURLOPT_XOAUTH2_BEARER || \ (option) == CURLOPT_DNS_SERVERS || \ (option) == CURLOPT_DNS_INTERFACE || \ (option) == CURLOPT_DNS_LOCAL_IP4 || \ (option) == CURLOPT_DNS_LOCAL_IP6 || \ (option) == CURLOPT_LOGIN_OPTIONS || \ 0) /* evaluates to true if option takes a curl_write_callback argument */ #define _curl_is_write_cb_option(option) \ ((option) == CURLOPT_HEADERFUNCTION || \ (option) == CURLOPT_WRITEFUNCTION) /* evaluates to true if option takes a curl_conv_callback argument */ #define _curl_is_conv_cb_option(option) \ ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \ (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \ (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION) /* evaluates to true if option takes a data argument to pass to a callback */ #define _curl_is_cb_data_option(option) \ ((option) == CURLOPT_WRITEDATA || \ (option) == CURLOPT_READDATA || \ (option) == CURLOPT_IOCTLDATA || \ (option) == CURLOPT_SOCKOPTDATA || \ (option) == CURLOPT_OPENSOCKETDATA || \ (option) == CURLOPT_PROGRESSDATA || \ (option) == CURLOPT_HEADERDATA || \ (option) == CURLOPT_DEBUGDATA || \ (option) == CURLOPT_SSL_CTX_DATA || \ (option) == CURLOPT_SEEKDATA || \ (option) == CURLOPT_PRIVATE || \ (option) == CURLOPT_SSH_KEYDATA || \ (option) == CURLOPT_INTERLEAVEDATA || \ (option) == CURLOPT_CHUNK_DATA || \ (option) == CURLOPT_FNMATCH_DATA || \ 0) /* evaluates to true if option takes a POST data argument (void* or char*) */ #define _curl_is_postfields_option(option) \ ((option) == CURLOPT_POSTFIELDS || \ (option) == CURLOPT_COPYPOSTFIELDS || \ 0) /* evaluates to true if option takes a struct curl_slist * argument */ #define _curl_is_slist_option(option) \ ((option) == CURLOPT_HTTPHEADER || \ (option) == CURLOPT_HTTP200ALIASES || \ (option) == CURLOPT_QUOTE || \ (option) == CURLOPT_POSTQUOTE || \ (option) == CURLOPT_PREQUOTE || \ (option) == CURLOPT_TELNETOPTIONS || \ (option) == CURLOPT_MAIL_RCPT || \ 0) /* groups of curl_easy_getinfo infos that take the same type of argument */ /* evaluates to true if info expects a pointer to char * argument */ #define _curl_is_string_info(info) \ (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG) /* evaluates to true if info expects a pointer to long argument */ #define _curl_is_long_info(info) \ (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE) /* evaluates to true if info expects a pointer to double argument */ #define _curl_is_double_info(info) \ (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST) /* true if info expects a pointer to struct curl_slist * argument */ #define _curl_is_slist_info(info) \ (CURLINFO_SLIST < (info)) /* typecheck helpers -- check whether given expression has requested type*/ /* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros, * otherwise define a new macro. Search for __builtin_types_compatible_p * in the GCC manual. * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is * the actual expression passed to the curl_easy_setopt macro. This * means that you can only apply the sizeof and __typeof__ operators, no * == or whatsoever. */ /* XXX: should evaluate to true iff expr is a pointer */ #define _curl_is_any_ptr(expr) \ (sizeof(expr) == sizeof(void*)) /* evaluates to true if expr is NULL */ /* XXX: must not evaluate expr, so this check is not accurate */ #define _curl_is_NULL(expr) \ (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL))) /* evaluates to true if expr is type*, const type* or NULL */ #define _curl_is_ptr(expr, type) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), type *) || \ __builtin_types_compatible_p(__typeof__(expr), const type *)) /* evaluates to true if expr is one of type[], type*, NULL or const type* */ #define _curl_is_arr(expr, type) \ (_curl_is_ptr((expr), type) || \ __builtin_types_compatible_p(__typeof__(expr), type [])) /* evaluates to true if expr is a string */ #define _curl_is_string(expr) \ (_curl_is_arr((expr), char) || \ _curl_is_arr((expr), signed char) || \ _curl_is_arr((expr), unsigned char)) /* evaluates to true if expr is a long (no matter the signedness) * XXX: for now, int is also accepted (and therefore short and char, which * are promoted to int when passed to a variadic function) */ #define _curl_is_long(expr) \ (__builtin_types_compatible_p(__typeof__(expr), long) || \ __builtin_types_compatible_p(__typeof__(expr), signed long) || \ __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \ __builtin_types_compatible_p(__typeof__(expr), int) || \ __builtin_types_compatible_p(__typeof__(expr), signed int) || \ __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \ __builtin_types_compatible_p(__typeof__(expr), short) || \ __builtin_types_compatible_p(__typeof__(expr), signed short) || \ __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \ __builtin_types_compatible_p(__typeof__(expr), char) || \ __builtin_types_compatible_p(__typeof__(expr), signed char) || \ __builtin_types_compatible_p(__typeof__(expr), unsigned char)) /* evaluates to true if expr is of type curl_off_t */ #define _curl_is_off_t(expr) \ (__builtin_types_compatible_p(__typeof__(expr), curl_off_t)) /* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */ /* XXX: also check size of an char[] array? */ #define _curl_is_error_buffer(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), char *) || \ __builtin_types_compatible_p(__typeof__(expr), char[])) /* evaluates to true if expr is of type (const) void* or (const) FILE* */ #if 0 #define _curl_is_cb_data(expr) \ (_curl_is_ptr((expr), void) || \ _curl_is_ptr((expr), FILE)) #else /* be less strict */ #define _curl_is_cb_data(expr) \ _curl_is_any_ptr(expr) #endif /* evaluates to true if expr is of type FILE* */ #define _curl_is_FILE(expr) \ (__builtin_types_compatible_p(__typeof__(expr), FILE *)) /* evaluates to true if expr can be passed as POST data (void* or char*) */ #define _curl_is_postfields(expr) \ (_curl_is_ptr((expr), void) || \ _curl_is_arr((expr), char)) /* FIXME: the whole callback checking is messy... * The idea is to tolerate char vs. void and const vs. not const * pointers in arguments at least */ /* helper: __builtin_types_compatible_p distinguishes between functions and * function pointers, hide it */ #define _curl_callback_compatible(func, type) \ (__builtin_types_compatible_p(__typeof__(func), type) || \ __builtin_types_compatible_p(__typeof__(func), type*)) /* evaluates to true if expr is of type curl_read_callback or "similar" */ #define _curl_is_read_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \ __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \ _curl_callback_compatible((expr), _curl_read_callback1) || \ _curl_callback_compatible((expr), _curl_read_callback2) || \ _curl_callback_compatible((expr), _curl_read_callback3) || \ _curl_callback_compatible((expr), _curl_read_callback4) || \ _curl_callback_compatible((expr), _curl_read_callback5) || \ _curl_callback_compatible((expr), _curl_read_callback6)) typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*); typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*); typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*); typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*); typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*); typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*); /* evaluates to true if expr is of type curl_write_callback or "similar" */ #define _curl_is_write_cb(expr) \ (_curl_is_read_cb(expr) || \ __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \ __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \ _curl_callback_compatible((expr), _curl_write_callback1) || \ _curl_callback_compatible((expr), _curl_write_callback2) || \ _curl_callback_compatible((expr), _curl_write_callback3) || \ _curl_callback_compatible((expr), _curl_write_callback4) || \ _curl_callback_compatible((expr), _curl_write_callback5) || \ _curl_callback_compatible((expr), _curl_write_callback6)) typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*); typedef size_t (_curl_write_callback2)(const char *, size_t, size_t, const void*); typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*); typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*); typedef size_t (_curl_write_callback5)(const void *, size_t, size_t, const void*); typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*); /* evaluates to true if expr is of type curl_ioctl_callback or "similar" */ #define _curl_is_ioctl_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \ _curl_callback_compatible((expr), _curl_ioctl_callback1) || \ _curl_callback_compatible((expr), _curl_ioctl_callback2) || \ _curl_callback_compatible((expr), _curl_ioctl_callback3) || \ _curl_callback_compatible((expr), _curl_ioctl_callback4)) typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*); typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*); typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*); typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*); /* evaluates to true if expr is of type curl_sockopt_callback or "similar" */ #define _curl_is_sockopt_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \ _curl_callback_compatible((expr), _curl_sockopt_callback1) || \ _curl_callback_compatible((expr), _curl_sockopt_callback2)) typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype); typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t, curlsocktype); /* evaluates to true if expr is of type curl_opensocket_callback or "similar" */ #define _curl_is_opensocket_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\ _curl_callback_compatible((expr), _curl_opensocket_callback1) || \ _curl_callback_compatible((expr), _curl_opensocket_callback2) || \ _curl_callback_compatible((expr), _curl_opensocket_callback3) || \ _curl_callback_compatible((expr), _curl_opensocket_callback4)) typedef curl_socket_t (_curl_opensocket_callback1) (void *, curlsocktype, struct curl_sockaddr *); typedef curl_socket_t (_curl_opensocket_callback2) (void *, curlsocktype, const struct curl_sockaddr *); typedef curl_socket_t (_curl_opensocket_callback3) (const void *, curlsocktype, struct curl_sockaddr *); typedef curl_socket_t (_curl_opensocket_callback4) (const void *, curlsocktype, const struct curl_sockaddr *); /* evaluates to true if expr is of type curl_progress_callback or "similar" */ #define _curl_is_progress_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \ _curl_callback_compatible((expr), _curl_progress_callback1) || \ _curl_callback_compatible((expr), _curl_progress_callback2)) typedef int (_curl_progress_callback1)(void *, double, double, double, double); typedef int (_curl_progress_callback2)(const void *, double, double, double, double); /* evaluates to true if expr is of type curl_debug_callback or "similar" */ #define _curl_is_debug_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \ _curl_callback_compatible((expr), _curl_debug_callback1) || \ _curl_callback_compatible((expr), _curl_debug_callback2) || \ _curl_callback_compatible((expr), _curl_debug_callback3) || \ _curl_callback_compatible((expr), _curl_debug_callback4) || \ _curl_callback_compatible((expr), _curl_debug_callback5) || \ _curl_callback_compatible((expr), _curl_debug_callback6) || \ _curl_callback_compatible((expr), _curl_debug_callback7) || \ _curl_callback_compatible((expr), _curl_debug_callback8)) typedef int (_curl_debug_callback1) (CURL *, curl_infotype, char *, size_t, void *); typedef int (_curl_debug_callback2) (CURL *, curl_infotype, char *, size_t, const void *); typedef int (_curl_debug_callback3) (CURL *, curl_infotype, const char *, size_t, void *); typedef int (_curl_debug_callback4) (CURL *, curl_infotype, const char *, size_t, const void *); typedef int (_curl_debug_callback5) (CURL *, curl_infotype, unsigned char *, size_t, void *); typedef int (_curl_debug_callback6) (CURL *, curl_infotype, unsigned char *, size_t, const void *); typedef int (_curl_debug_callback7) (CURL *, curl_infotype, const unsigned char *, size_t, void *); typedef int (_curl_debug_callback8) (CURL *, curl_infotype, const unsigned char *, size_t, const void *); /* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */ /* this is getting even messier... */ #define _curl_is_ssl_ctx_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \ _curl_callback_compatible((expr), _curl_ssl_ctx_callback8)) typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *); typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *); typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *); typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *); #ifdef HEADER_SSL_H /* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX * this will of course break if we're included before OpenSSL headers... */ typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *); typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *); typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *); typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *); #else typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5; typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6; typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7; typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8; #endif /* evaluates to true if expr is of type curl_conv_callback or "similar" */ #define _curl_is_conv_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \ _curl_callback_compatible((expr), _curl_conv_callback1) || \ _curl_callback_compatible((expr), _curl_conv_callback2) || \ _curl_callback_compatible((expr), _curl_conv_callback3) || \ _curl_callback_compatible((expr), _curl_conv_callback4)) typedef CURLcode (*_curl_conv_callback1)(char *, size_t length); typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length); typedef CURLcode (*_curl_conv_callback3)(void *, size_t length); typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length); /* evaluates to true if expr is of type curl_seek_callback or "similar" */ #define _curl_is_seek_cb(expr) \ (_curl_is_NULL(expr) || \ __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \ _curl_callback_compatible((expr), _curl_seek_callback1) || \ _curl_callback_compatible((expr), _curl_seek_callback2)) typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int); typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int); #endif /* __CURL_TYPECHECK_GCC_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchi/common/endian.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _VCHI_ENDIAN_H_ #define _VCHI_ENDIAN_H_ #include "interface/vcos/vcos.h" int16_t vchi_readbuf_int16 ( const void *ptr ); uint16_t vchi_readbuf_uint16( const void *ptr ); uint32_t vchi_readbuf_uint32( const void *ptr ); vcos_fourcc_t vchi_readbuf_fourcc( const void *ptr ); void vchi_writebuf_uint16( void *ptr, uint16_t value ); void vchi_writebuf_uint32( void *ptr, uint32_t value ); void vchi_writebuf_fourcc( void *ptr, vcos_fourcc_t value ); #endif /* _VCHI_ENDIAN_H_ */ /********************************** End of file ******************************************/ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchi/connections/connection.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * \file * * \brief Contains the protypes for the interface functions. */ #ifndef CONNECTION_H_ #define CONNECTION_H_ #include "interface/vchi/vchi_cfg_internal.h" #include "interface/vchi/vchi_common.h" #include "interface/vchi/message_drivers/message.h" /****************************************************************************** Global defs *****************************************************************************/ // Opaque handle for a connection / service pair typedef struct opaque_vchi_connection_connected_service_handle_t *VCHI_CONNECTION_SERVICE_HANDLE_T; // opaque handle to the connection state information typedef struct opaque_vchi_connection_info_t VCHI_CONNECTION_STATE_T; typedef struct vchi_connection_t VCHI_CONNECTION_T; /****************************************************************************** API *****************************************************************************/ // Routine to init a connection with a particular low level driver typedef VCHI_CONNECTION_STATE_T * (*VCHI_CONNECTION_INIT_T)( struct vchi_connection_t * connection, const VCHI_MESSAGE_DRIVER_T * driver ); // Routine to control CRC enabling at a connection level typedef int32_t (*VCHI_CONNECTION_CRC_CONTROL_T)( VCHI_CONNECTION_STATE_T *state_handle, VCHI_CRC_CONTROL_T control ); // Routine to create a service typedef int32_t (*VCHI_CONNECTION_SERVICE_CONNECT_T)( VCHI_CONNECTION_STATE_T *state_handle, vcos_fourcc_t service_id, uint32_t rx_fifo_size, uint32_t tx_fifo_size, int server, VCHI_CALLBACK_T callback, void *callback_param, vcos_bool_t want_crc, vcos_bool_t want_unaligned_bulk_rx, vcos_bool_t want_unaligned_bulk_tx, VCHI_CONNECTION_SERVICE_HANDLE_T *service_handle ); // Routine to close a service typedef int32_t (*VCHI_CONNECTION_SERVICE_DISCONNECT_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle ); // Routine to queue a message typedef int32_t (*VCHI_CONNECTION_SERVICE_QUEUE_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, const void *data, uint32_t data_size, VCHI_FLAGS_T flags, void *msg_handle ); // scatter-gather (vector) message queueing typedef int32_t (*VCHI_CONNECTION_SERVICE_QUEUE_MESSAGEV_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, VCHI_MSG_VECTOR_T *vector, uint32_t count, VCHI_FLAGS_T flags, void *msg_handle ); // Routine to dequeue a message typedef int32_t (*VCHI_CONNECTION_SERVICE_DEQUEUE_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, void *data, uint32_t max_data_size_to_read, uint32_t *actual_msg_size, VCHI_FLAGS_T flags ); // Routine to peek at a message typedef int32_t (*VCHI_CONNECTION_SERVICE_PEEK_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, void **data, uint32_t *msg_size, VCHI_FLAGS_T flags ); // Routine to hold a message typedef int32_t (*VCHI_CONNECTION_SERVICE_HOLD_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, void **data, uint32_t *msg_size, VCHI_FLAGS_T flags, void **message_handle ); // Routine to initialise a received message iterator typedef int32_t (*VCHI_CONNECTION_SERVICE_LOOKAHEAD_MESSAGE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, VCHI_MSG_ITER_T *iter, VCHI_FLAGS_T flags ); // Routine to release a held message typedef int32_t (*VCHI_CONNECTION_HELD_MSG_RELEASE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, void *message_handle ); // Routine to get info on a held message typedef int32_t (*VCHI_CONNECTION_HELD_MSG_INFO_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, void *message_handle, void **data, int32_t *msg_size, uint32_t *tx_timestamp, uint32_t *rx_timestamp ); // Routine to check whether the iterator has a next message typedef vcos_bool_t (*VCHI_CONNECTION_MSG_ITER_HAS_NEXT_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service, const VCHI_MSG_ITER_T *iter ); // Routine to advance the iterator typedef int32_t (*VCHI_CONNECTION_MSG_ITER_NEXT_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service, VCHI_MSG_ITER_T *iter, void **data, uint32_t *msg_size ); // Routine to remove the last message returned by the iterator typedef int32_t (*VCHI_CONNECTION_MSG_ITER_REMOVE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service, VCHI_MSG_ITER_T *iter ); // Routine to hold the last message returned by the iterator typedef int32_t (*VCHI_CONNECTION_MSG_ITER_HOLD_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service, VCHI_MSG_ITER_T *iter, void **msg_handle ); // Routine to transmit bulk data typedef int32_t (*VCHI_CONNECTION_BULK_QUEUE_TRANSMIT_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, const void *data_src, uint32_t data_size, VCHI_FLAGS_T flags, void *bulk_handle ); // Routine to receive data typedef int32_t (*VCHI_CONNECTION_BULK_QUEUE_RECEIVE_T)( VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, void *data_dst, uint32_t data_size, VCHI_FLAGS_T flags, void *bulk_handle ); // Routine to report if a server is available typedef int32_t (*VCHI_CONNECTION_SERVER_PRESENT)( VCHI_CONNECTION_STATE_T *state, vcos_fourcc_t service_id, int32_t peer_flags ); // Routine to report the number of RX slots available typedef int (*VCHI_CONNECTION_RX_SLOTS_AVAILABLE)( const VCHI_CONNECTION_STATE_T *state ); // Routine to report the RX slot size typedef uint32_t (*VCHI_CONNECTION_RX_SLOT_SIZE)( const VCHI_CONNECTION_STATE_T *state ); // Callback to indicate that the other side has added a buffer to the rx bulk DMA FIFO typedef void (*VCHI_CONNECTION_RX_BULK_BUFFER_ADDED)(VCHI_CONNECTION_STATE_T *state, vcos_fourcc_t service, uint32_t length, MESSAGE_TX_CHANNEL_T channel, uint32_t channel_params, uint32_t data_length, uint32_t data_offset); // Callback to inform a service that a Xon or Xoff message has been received typedef void (*VCHI_CONNECTION_FLOW_CONTROL)(VCHI_CONNECTION_STATE_T *state, vcos_fourcc_t service_id, int32_t xoff); // Callback to inform a service that a server available reply message has been received typedef void (*VCHI_CONNECTION_SERVER_AVAILABLE_REPLY)(VCHI_CONNECTION_STATE_T *state, vcos_fourcc_t service_id, uint32_t flags); // Callback to indicate that bulk auxiliary messages have arrived typedef void (*VCHI_CONNECTION_BULK_AUX_RECEIVED)(VCHI_CONNECTION_STATE_T *state); // Callback to indicate that bulk auxiliary messages have arrived typedef void (*VCHI_CONNECTION_BULK_AUX_TRANSMITTED)(VCHI_CONNECTION_STATE_T *state, void *handle); // Callback with all the connection info you require typedef void (*VCHI_CONNECTION_INFO)(VCHI_CONNECTION_STATE_T *state, uint32_t protocol_version, uint32_t slot_size, uint32_t num_slots, uint32_t min_bulk_size); // Callback to inform of a disconnect typedef void (*VCHI_CONNECTION_DISCONNECT)(VCHI_CONNECTION_STATE_T *state, uint32_t flags); // Callback to inform of a power control request typedef void (*VCHI_CONNECTION_POWER_CONTROL)(VCHI_CONNECTION_STATE_T *state, MESSAGE_TX_CHANNEL_T channel, vcos_bool_t enable); // allocate memory suitably aligned for this connection typedef void * (*VCHI_BUFFER_ALLOCATE)(VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, uint32_t * length); // free memory allocated by buffer_allocate typedef void (*VCHI_BUFFER_FREE)(VCHI_CONNECTION_SERVICE_HANDLE_T service_handle, void * address); /****************************************************************************** System driver struct *****************************************************************************/ struct opaque_vchi_connection_api_t { // Routine to init the connection VCHI_CONNECTION_INIT_T init; // Connection-level CRC control VCHI_CONNECTION_CRC_CONTROL_T crc_control; // Routine to connect to or create service VCHI_CONNECTION_SERVICE_CONNECT_T service_connect; // Routine to disconnect from a service VCHI_CONNECTION_SERVICE_DISCONNECT_T service_disconnect; // Routine to queue a message VCHI_CONNECTION_SERVICE_QUEUE_MESSAGE_T service_queue_msg; // scatter-gather (vector) message queue VCHI_CONNECTION_SERVICE_QUEUE_MESSAGEV_T service_queue_msgv; // Routine to dequeue a message VCHI_CONNECTION_SERVICE_DEQUEUE_MESSAGE_T service_dequeue_msg; // Routine to peek at a message VCHI_CONNECTION_SERVICE_PEEK_MESSAGE_T service_peek_msg; // Routine to hold a message VCHI_CONNECTION_SERVICE_HOLD_MESSAGE_T service_hold_msg; // Routine to initialise a received message iterator VCHI_CONNECTION_SERVICE_LOOKAHEAD_MESSAGE_T service_look_ahead_msg; // Routine to release a message VCHI_CONNECTION_HELD_MSG_RELEASE_T held_msg_release; // Routine to get information on a held message VCHI_CONNECTION_HELD_MSG_INFO_T held_msg_info; // Routine to check for next message on iterator VCHI_CONNECTION_MSG_ITER_HAS_NEXT_T msg_iter_has_next; // Routine to get next message on iterator VCHI_CONNECTION_MSG_ITER_NEXT_T msg_iter_next; // Routine to remove the last message returned by iterator VCHI_CONNECTION_MSG_ITER_REMOVE_T msg_iter_remove; // Routine to hold the last message returned by iterator VCHI_CONNECTION_MSG_ITER_HOLD_T msg_iter_hold; // Routine to transmit bulk data VCHI_CONNECTION_BULK_QUEUE_TRANSMIT_T bulk_queue_transmit; // Routine to receive data VCHI_CONNECTION_BULK_QUEUE_RECEIVE_T bulk_queue_receive; // Routine to report the available servers VCHI_CONNECTION_SERVER_PRESENT server_present; // Routine to report the number of RX slots available VCHI_CONNECTION_RX_SLOTS_AVAILABLE connection_rx_slots_available; // Routine to report the RX slot size VCHI_CONNECTION_RX_SLOT_SIZE connection_rx_slot_size; // Callback to indicate that the other side has added a buffer to the rx bulk DMA FIFO VCHI_CONNECTION_RX_BULK_BUFFER_ADDED rx_bulk_buffer_added; // Callback to inform a service that a Xon or Xoff message has been received VCHI_CONNECTION_FLOW_CONTROL flow_control; // Callback to inform a service that a server available reply message has been received VCHI_CONNECTION_SERVER_AVAILABLE_REPLY server_available_reply; // Callback to indicate that bulk auxiliary messages have arrived VCHI_CONNECTION_BULK_AUX_RECEIVED bulk_aux_received; // Callback to indicate that a bulk auxiliary message has been transmitted VCHI_CONNECTION_BULK_AUX_TRANSMITTED bulk_aux_transmitted; // Callback to provide information about the connection VCHI_CONNECTION_INFO connection_info; // Callback to notify that peer has requested disconnect VCHI_CONNECTION_DISCONNECT disconnect; // Callback to notify that peer has requested power change VCHI_CONNECTION_POWER_CONTROL power_control; // allocate memory suitably aligned for this connection VCHI_BUFFER_ALLOCATE buffer_allocate; // free memory allocated by buffer_allocate VCHI_BUFFER_FREE buffer_free; }; struct vchi_connection_t { const VCHI_CONNECTION_API_T *api; VCHI_CONNECTION_STATE_T *state; #ifdef VCHI_COARSE_LOCKING VCOS_SEMAPHORE_T sem; #endif }; #endif /* CONNECTION_H_ */ /****************************** End of file **********************************/ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchi/message_drivers/message.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // MPHI videocore message driver #ifndef _VCHI_MESSAGE_H_ #define _VCHI_MESSAGE_H_ #include "interface/vchi/vchi_cfg_internal.h" #include "interface/vcos/vcos.h" #include "interface/vchi/vchi_common.h" typedef enum message_event_type { MESSAGE_EVENT_NONE, MESSAGE_EVENT_NOP, MESSAGE_EVENT_MESSAGE, MESSAGE_EVENT_SLOT_COMPLETE, MESSAGE_EVENT_RX_BULK_PAUSED, MESSAGE_EVENT_RX_BULK_COMPLETE, MESSAGE_EVENT_TX_COMPLETE, MESSAGE_EVENT_MSG_DISCARDED } MESSAGE_EVENT_TYPE_T; typedef enum vchi_msg_flags { VCHI_MSG_FLAGS_NONE = 0x0, VCHI_MSG_FLAGS_TERMINATE_DMA = 0x1 } VCHI_MSG_FLAGS_T; typedef enum message_tx_channel { MESSAGE_TX_CHANNEL_MESSAGE = 0, MESSAGE_TX_CHANNEL_BULK = 1 // drivers may provide multiple bulk channels, from 1 upwards } MESSAGE_TX_CHANNEL_T; // Macros used for cycling through bulk channels #define MESSAGE_TX_CHANNEL_BULK_PREV(c) (MESSAGE_TX_CHANNEL_BULK+((c)-MESSAGE_TX_CHANNEL_BULK+VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION-1)%VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION) #define MESSAGE_TX_CHANNEL_BULK_NEXT(c) (MESSAGE_TX_CHANNEL_BULK+((c)-MESSAGE_TX_CHANNEL_BULK+1)%VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION) typedef enum message_rx_channel { MESSAGE_RX_CHANNEL_MESSAGE = 0, MESSAGE_RX_CHANNEL_BULK = 1 // drivers may provide multiple bulk channels, from 1 upwards } MESSAGE_RX_CHANNEL_T; // Message receive slot information typedef struct rx_msg_slot_info { struct rx_msg_slot_info *next; //struct slot_info *prev; #if !defined VCHI_COARSE_LOCKING VCOS_SEMAPHORE_T sem; #endif uint8_t *addr; // base address of slot uint32_t len; // length of slot in bytes uint32_t write_ptr; // hardware causes this to advance uint32_t read_ptr; // this module does the reading int active; // is this slot in the hardware dma fifo? uint32_t msgs_parsed; // count how many messages are in this slot uint32_t msgs_released; // how many messages have been released void *state; // connection state information uint8_t ref_count[VCHI_MAX_SERVICES_PER_CONNECTION]; // reference count for slots held by services } RX_MSG_SLOTINFO_T; // The message driver no longer needs to know about the fields of RX_BULK_SLOTINFO_T - sort this out. // In particular, it mustn't use addr and len - they're the client buffer, but the message // driver will be tasked with sending the aligned core section. typedef struct rx_bulk_slotinfo_t { struct rx_bulk_slotinfo_t *next; VCOS_SEMAPHORE_T *blocking; // needed by DMA void *addr; uint32_t len; // needed for the callback void *service; void *handle; VCHI_FLAGS_T flags; } RX_BULK_SLOTINFO_T; /* ---------------------------------------------------------------------- * each connection driver will have a pool of the following struct. * * the pool will be managed by vchi_qman_* * this means there will be multiple queues (single linked lists) * a given struct message_info will be on exactly one of these queues * at any one time * -------------------------------------------------------------------- */ typedef struct rx_message_info { struct message_info *next; //struct message_info *prev; uint8_t *addr; uint32_t len; RX_MSG_SLOTINFO_T *slot; // points to whichever slot contains this message uint32_t tx_timestamp; uint32_t rx_timestamp; } RX_MESSAGE_INFO_T; typedef struct { MESSAGE_EVENT_TYPE_T type; struct { // for messages void *addr; // address of message uint16_t slot_delta; // whether this message indicated slot delta uint32_t len; // length of message RX_MSG_SLOTINFO_T *slot; // slot this message is in vcos_fourcc_t service; // service id this message is destined for uint32_t tx_timestamp; // timestamp from the header uint32_t rx_timestamp; // timestamp when we parsed it } message; // FIXME: cleanup slot reporting... RX_MSG_SLOTINFO_T *rx_msg; RX_BULK_SLOTINFO_T *rx_bulk; void *tx_handle; MESSAGE_TX_CHANNEL_T tx_channel; } MESSAGE_EVENT_T; // callbacks typedef void VCHI_MESSAGE_DRIVER_EVENT_CALLBACK_T( void *state ); typedef struct { VCHI_MESSAGE_DRIVER_EVENT_CALLBACK_T *event_callback; } VCHI_MESSAGE_DRIVER_OPEN_T; // handle to this instance of message driver (as returned by ->open) typedef struct opaque_mhandle_t *VCHI_MDRIVER_HANDLE_T; struct opaque_vchi_message_driver_t { VCHI_MDRIVER_HANDLE_T *(*open)( VCHI_MESSAGE_DRIVER_OPEN_T *params, void *state ); int32_t (*suspending)( VCHI_MDRIVER_HANDLE_T *handle ); int32_t (*resumed)( VCHI_MDRIVER_HANDLE_T *handle ); int32_t (*power_control)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T, vcos_bool_t enable ); int32_t (*add_msg_rx_slot)( VCHI_MDRIVER_HANDLE_T *handle, RX_MSG_SLOTINFO_T *slot ); // rx message int32_t (*add_bulk_rx)( VCHI_MDRIVER_HANDLE_T *handle, void *data, uint32_t len, RX_BULK_SLOTINFO_T *slot ); // rx data (bulk) int32_t (*send)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel, const void *data, uint32_t len, VCHI_MSG_FLAGS_T flags, void *send_handle ); // tx (message & bulk) void (*next_event)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_EVENT_T *event ); // get the next event from message_driver int32_t (*enable)( VCHI_MDRIVER_HANDLE_T *handle ); int32_t (*form_message)( VCHI_MDRIVER_HANDLE_T *handle, vcos_fourcc_t service_id, VCHI_MSG_VECTOR_T *vector, uint32_t count, void *address, uint32_t length_avail, uint32_t max_total_length, vcos_bool_t pad_to_fill, vcos_bool_t allow_partial ); int32_t (*update_message)( VCHI_MDRIVER_HANDLE_T *handle, void *dest, int16_t *slot_count ); int32_t (*buffer_aligned)( VCHI_MDRIVER_HANDLE_T *handle, int tx, int uncached, const void *address, const uint32_t length ); void * (*allocate_buffer)( VCHI_MDRIVER_HANDLE_T *handle, uint32_t *length ); void (*free_buffer)( VCHI_MDRIVER_HANDLE_T *handle, void *address ); int (*rx_slot_size)( VCHI_MDRIVER_HANDLE_T *handle, int msg_size ); int (*tx_slot_size)( VCHI_MDRIVER_HANDLE_T *handle, int msg_size ); vcos_bool_t (*tx_supports_terminate)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel ); uint32_t (*tx_bulk_chunk_size)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel ); int (*tx_alignment)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel ); int (*rx_alignment)( const VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_RX_CHANNEL_T channel ); void (*form_bulk_aux)( VCHI_MDRIVER_HANDLE_T *handle, MESSAGE_TX_CHANNEL_T channel, const void *data, uint32_t len, uint32_t chunk_size, const void **aux_data, int32_t *aux_len ); void (*debug)( VCHI_MDRIVER_HANDLE_T *handle ); }; #endif // _VCHI_MESSAGE_H_ /****************************** End of file ***********************************/ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchi/vchi.h ================================================ /* Copyright (c) 2012-2014, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Contains the protypes for the vchi functions. #ifndef VCHI_H_ #define VCHI_H_ #include "interface/vcos/vcos.h" #include "interface/vchi/vchi_cfg.h" #include "interface/vchi/vchi_common.h" #include "interface/vchi/connections/connection.h" #include "vchi_mh.h" /****************************************************************************** Global defs *****************************************************************************/ #define VCHI_SERVICE_HANDLE_INVALID 0 #define VCHI_BULK_ROUND_UP(x) ((((unsigned long)(x))+VCHI_BULK_ALIGN-1) & ~(VCHI_BULK_ALIGN-1)) #define VCHI_BULK_ROUND_DOWN(x) (((unsigned long)(x)) & ~(VCHI_BULK_ALIGN-1)) #define VCHI_BULK_ALIGN_NBYTES(x) (VCHI_BULK_ALIGNED(x) ? 0 : (VCHI_BULK_ALIGN - ((unsigned long)(x) & (VCHI_BULK_ALIGN-1)))) #ifdef USE_VCHIQ_ARM #define VCHI_BULK_ALIGNED(x) 1 #else #define VCHI_BULK_ALIGNED(x) (((unsigned long)(x) & (VCHI_BULK_ALIGN-1)) == 0) #endif typedef struct { uint32_t version; uint32_t version_min; } VCHI_VERSION_T; #define VCHI_VERSION(v_) { v_, v_ } #define VCHI_VERSION_EX(v_,m_) { v_, m_ } typedef enum { VCHI_VEC_POINTER, VCHI_VEC_HANDLE, VCHI_VEC_LIST } VCHI_MSG_VECTOR_TYPE_T; typedef struct vchi_msg_vector_ex { VCHI_MSG_VECTOR_TYPE_T type; union { // a memory handle struct { VCHI_MEM_HANDLE_T handle; uint32_t offset; int32_t vec_len; } handle; // an ordinary data pointer struct { const void *vec_base; int32_t vec_len; } ptr; // a nested vector list struct { struct vchi_msg_vector_ex *vec; uint32_t vec_len; } list; } u; } VCHI_MSG_VECTOR_EX_T; // Construct an entry in a msg vector for a pointer (p) of length (l) #define VCHI_VEC_POINTER(p,l) VCHI_VEC_POINTER, { { (VCHI_MEM_HANDLE_T)(p), (l) } } // Construct an entry in a msg vector for a message handle (h), starting at offset (o) of length (l) #define VCHI_VEC_HANDLE(h,o,l) VCHI_VEC_HANDLE, { { (h), (o), (l) } } // Macros to manipulate fourcc_t values #define MAKE_FOURCC(x) ((fourcc_t)( (x[0] << 24) | (x[1] << 16) | (x[2] << 8) | x[3] )) #define FOURCC_TO_CHAR(x) (x >> 24) & 0xFF,(x >> 16) & 0xFF,(x >> 8) & 0xFF, x & 0xFF // Opaque service information struct opaque_vchi_service_t; // Descriptor for a held message. Allocated by client, initialised by vchi_msg_hold, // vchi_msg_iter_hold or vchi_msg_iter_hold_next. Fields are for internal VCHI use only. typedef struct { struct opaque_vchi_service_t *service; void *message; } VCHI_HELD_MSG_T; // structure used to provide the information needed to open a server or a client typedef struct { VCHI_VERSION_T version; vcos_fourcc_t service_id; VCHI_CONNECTION_T *connection; uint32_t rx_fifo_size; uint32_t tx_fifo_size; VCHI_CALLBACK_T callback; void *callback_param; vcos_bool_t want_unaligned_bulk_rx; // client intends to receive bulk transfers of odd lengths or into unaligned buffers vcos_bool_t want_unaligned_bulk_tx; // client intends to transmit bulk transfers of odd lengths or out of unaligned buffers vcos_bool_t want_crc; // client wants to check CRCs on (bulk) transfers. Only needs to be set at 1 end - will do both directions. } SERVICE_CREATION_T; // Opaque handle for a VCHI instance typedef struct opaque_vchi_instance_handle_t *VCHI_INSTANCE_T; // Opaque handle for a server or client typedef unsigned int VCHI_SERVICE_HANDLE_T; // Service registration & startup typedef void (*VCHI_SERVICE_INIT)(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections); typedef struct service_info_tag { const char * const vll_filename; /* VLL to load to start this service. This is an empty string if VLL is "static" */ VCHI_SERVICE_INIT init; /* Service initialisation function */ void *vll_handle; /* VLL handle; NULL when unloaded or a "static VLL" in build */ } SERVICE_INFO_T; /****************************************************************************** Global funcs - implementation is specific to which side you are on (local / remote) *****************************************************************************/ #ifdef __cplusplus extern "C" { #endif extern /*@observer@*/ VCHI_CONNECTION_T * vchi_create_connection( const VCHI_CONNECTION_API_T * function_table, const VCHI_MESSAGE_DRIVER_T * low_level); // Routine used to initialise the vchi on both local + remote connections extern int32_t vchi_initialise( VCHI_INSTANCE_T *instance_handle ); extern int32_t vchi_connect( VCHI_CONNECTION_T **connections, const uint32_t num_connections, VCHI_INSTANCE_T instance_handle ); //When this is called, ensure that all services have no data pending. //Bulk transfers can remain 'queued' extern int32_t vchi_disconnect( VCHI_INSTANCE_T instance_handle ); // Global control over bulk CRC checking extern int32_t vchi_crc_control( VCHI_CONNECTION_T *connection, VCHI_CRC_CONTROL_T control ); // helper functions extern void * vchi_allocate_buffer(VCHI_SERVICE_HANDLE_T handle, uint32_t *length); extern void vchi_free_buffer(VCHI_SERVICE_HANDLE_T handle, void *address); extern uint32_t vchi_current_time(VCHI_INSTANCE_T instance_handle); /****************************************************************************** Global service API *****************************************************************************/ // Routine to create a named service extern int32_t vchi_service_create( VCHI_INSTANCE_T instance_handle, SERVICE_CREATION_T *setup, VCHI_SERVICE_HANDLE_T *handle ); // Routine to destroy a service extern int32_t vchi_service_destroy( const VCHI_SERVICE_HANDLE_T handle ); // Routine to open a named service extern int32_t vchi_service_open( VCHI_INSTANCE_T instance_handle, SERVICE_CREATION_T *setup, VCHI_SERVICE_HANDLE_T *handle); extern int32_t vchi_get_peer_version( const VCHI_SERVICE_HANDLE_T handle, short *peer_version ); // Routine to close a named service extern int32_t vchi_service_close( const VCHI_SERVICE_HANDLE_T handle ); // Routine to increment ref count on a named service extern int32_t vchi_service_use( const VCHI_SERVICE_HANDLE_T handle ); // Routine to decrement ref count on a named service extern int32_t vchi_service_release( const VCHI_SERVICE_HANDLE_T handle ); // Routine to set a control option for a named service extern int32_t vchi_service_set_option( const VCHI_SERVICE_HANDLE_T handle, VCHI_SERVICE_OPTION_T option, int value); // Routine to send a message across a service extern int32_t vchi_msg_queue( VCHI_SERVICE_HANDLE_T handle, const void *data, uint32_t data_size, VCHI_FLAGS_T flags, void *msg_handle ); // scatter-gather (vector) and send message int32_t vchi_msg_queuev_ex( VCHI_SERVICE_HANDLE_T handle, VCHI_MSG_VECTOR_EX_T *vector, uint32_t count, VCHI_FLAGS_T flags, void *msg_handle ); // legacy scatter-gather (vector) and send message, only handles pointers int32_t vchi_msg_queuev( VCHI_SERVICE_HANDLE_T handle, VCHI_MSG_VECTOR_T *vector, uint32_t count, VCHI_FLAGS_T flags, void *msg_handle ); // Routine to receive a msg from a service // Dequeue is equivalent to hold, copy into client buffer, release extern int32_t vchi_msg_dequeue( VCHI_SERVICE_HANDLE_T handle, void *data, uint32_t max_data_size_to_read, uint32_t *actual_msg_size, VCHI_FLAGS_T flags ); // Routine to look at a message in place. // The message is not dequeued, so a subsequent call to peek or dequeue // will return the same message. extern int32_t vchi_msg_peek( VCHI_SERVICE_HANDLE_T handle, void **data, uint32_t *msg_size, VCHI_FLAGS_T flags ); // Routine to remove a message after it has been read in place with peek // The first message on the queue is dequeued. extern int32_t vchi_msg_remove( VCHI_SERVICE_HANDLE_T handle ); // Routine to look at a message in place. // The message is dequeued, so the caller is left holding it; the descriptor is // filled in and must be released when the user has finished with the message. extern int32_t vchi_msg_hold( VCHI_SERVICE_HANDLE_T handle, void **data, // } may be NULL, as info can be uint32_t *msg_size, // } obtained from HELD_MSG_T VCHI_FLAGS_T flags, VCHI_HELD_MSG_T *message_descriptor ); // Initialise an iterator to look through messages in place extern int32_t vchi_msg_look_ahead( VCHI_SERVICE_HANDLE_T handle, VCHI_MSG_ITER_T *iter, VCHI_FLAGS_T flags ); /****************************************************************************** Global service support API - operations on held messages and message iterators *****************************************************************************/ // Routine to get the address of a held message extern void *vchi_held_msg_ptr( const VCHI_HELD_MSG_T *message ); // Routine to get the size of a held message extern int32_t vchi_held_msg_size( const VCHI_HELD_MSG_T *message ); // Routine to get the transmit timestamp as written into the header by the peer extern uint32_t vchi_held_msg_tx_timestamp( const VCHI_HELD_MSG_T *message ); // Routine to get the reception timestamp, written as we parsed the header extern uint32_t vchi_held_msg_rx_timestamp( const VCHI_HELD_MSG_T *message ); // Routine to release a held message after it has been processed extern int32_t vchi_held_msg_release( VCHI_HELD_MSG_T *message ); // Indicates whether the iterator has a next message. extern vcos_bool_t vchi_msg_iter_has_next( const VCHI_MSG_ITER_T *iter ); // Return the pointer and length for the next message and advance the iterator. extern int32_t vchi_msg_iter_next( VCHI_MSG_ITER_T *iter, void **data, uint32_t *msg_size ); // Remove the last message returned by vchi_msg_iter_next. // Can only be called once after each call to vchi_msg_iter_next. extern int32_t vchi_msg_iter_remove( VCHI_MSG_ITER_T *iter ); // Hold the last message returned by vchi_msg_iter_next. // Can only be called once after each call to vchi_msg_iter_next. extern int32_t vchi_msg_iter_hold( VCHI_MSG_ITER_T *iter, VCHI_HELD_MSG_T *message ); // Return information for the next message, and hold it, advancing the iterator. extern int32_t vchi_msg_iter_hold_next( VCHI_MSG_ITER_T *iter, void **data, // } may be NULL uint32_t *msg_size, // } VCHI_HELD_MSG_T *message ); /****************************************************************************** Global bulk API *****************************************************************************/ // Routine to prepare interface for a transfer from the other side extern int32_t vchi_bulk_queue_receive( VCHI_SERVICE_HANDLE_T handle, void *data_dst, uint32_t data_size, VCHI_FLAGS_T flags, void *transfer_handle ); // Prepare interface for a transfer from the other side into relocatable memory. int32_t vchi_bulk_queue_receive_reloc( const VCHI_SERVICE_HANDLE_T handle, VCHI_MEM_HANDLE_T h_dst, uint32_t offset, uint32_t data_size, const VCHI_FLAGS_T flags, void * const bulk_handle ); // Prepare interface for a transfer from the other side into relocatable memory. int32_t vchi_bulk_queue_receive_reloc_func( const VCHI_SERVICE_HANDLE_T handle, VCHI_MEM_HANDLE_T h_dst, uint32_t offset, uint32_t data_size, const VCHI_FLAGS_T flags, void * const bulk_handle, int (*copy_pagelist)() ); // Routine to queue up data ready for transfer to the other (once they have signalled they are ready) extern int32_t vchi_bulk_queue_transmit( VCHI_SERVICE_HANDLE_T handle, const void *data_src, uint32_t data_size, VCHI_FLAGS_T flags, void *transfer_handle ); /****************************************************************************** Configuration plumbing *****************************************************************************/ // function prototypes for the different mid layers (the state info gives the different physical connections) extern const VCHI_CONNECTION_API_T *single_get_func_table( void ); //extern const VCHI_CONNECTION_API_T *local_server_get_func_table( void ); //extern const VCHI_CONNECTION_API_T *local_client_get_func_table( void ); // declare all message drivers here const VCHI_MESSAGE_DRIVER_T *vchi_mphi_message_driver_func_table( void ); #ifdef __cplusplus } #endif extern int32_t vchi_bulk_queue_transmit_reloc( VCHI_SERVICE_HANDLE_T handle, VCHI_MEM_HANDLE_T h_src, uint32_t offset, uint32_t data_size, VCHI_FLAGS_T flags, void *transfer_handle ); #endif /* VCHI_H_ */ /****************************** End of file **********************************/ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchi/vchi_cfg.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Contains the #defines for the number of servers / clients etc, these can be // over-ridden from the platform makefile if needed #ifndef VCHI_CFG_H_ #define VCHI_CFG_H_ /**************************************************************************************** * Defines in this first section are part of the VCHI API and may be examined by VCHI * services. ***************************************************************************************/ /* Required alignment of base addresses for bulk transfer, if unaligned transfers are not enabled */ /* Really determined by the message driver, and should be available from a run-time call. */ #ifndef VCHI_BULK_ALIGN # if __VCCOREVER__ >= 0x04000000 # define VCHI_BULK_ALIGN 32 // Allows for the need to do cache cleans # else # define VCHI_BULK_ALIGN 16 # endif #endif /* Required length multiple for bulk transfers, if unaligned transfers are not enabled */ /* May be less than or greater than VCHI_BULK_ALIGN */ /* Really determined by the message driver, and should be available from a run-time call. */ #ifndef VCHI_BULK_GRANULARITY # if __VCCOREVER__ >= 0x04000000 # define VCHI_BULK_GRANULARITY 32 // Allows for the need to do cache cleans # else # define VCHI_BULK_GRANULARITY 16 # endif #endif /* The largest possible message to be queued with vchi_msg_queue. */ #ifndef VCHI_MAX_MSG_SIZE # if defined VCHI_LOCAL_HOST_PORT # define VCHI_MAX_MSG_SIZE 16384 // makes file transfers fast, but should they be using bulk? # else # define VCHI_MAX_MSG_SIZE 4096 // NOTE: THIS MUST BE LARGER THAN OR EQUAL TO THE SIZE OF THE KHRONOS MERGE BUFFER!! # endif #endif /****************************************************************************************** * Defines below are system configuration options, and should not be used by VCHI services. *****************************************************************************************/ /* How many connections can we support? A localhost implementation uses 2 connections, * 1 for host-app, 1 for VMCS, and these are hooked together by a loopback MPHI VCFW * driver. */ #ifndef VCHI_MAX_NUM_CONNECTIONS # define VCHI_MAX_NUM_CONNECTIONS 3 #endif /* How many services can we open per connection? Extending this doesn't cost processing time, just a small * amount of static memory. */ #ifndef VCHI_MAX_SERVICES_PER_CONNECTION # define VCHI_MAX_SERVICES_PER_CONNECTION 36 #endif /* Adjust if using a message driver that supports more logical TX channels */ #ifndef VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION # define VCHI_MAX_BULK_TX_CHANNELS_PER_CONNECTION 9 // 1 MPHI + 8 CCP2 logical channels #endif /* Adjust if using a message driver that supports more logical RX channels */ #ifndef VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION # define VCHI_MAX_BULK_RX_CHANNELS_PER_CONNECTION 1 // 1 MPHI #endif /* How many receive slots do we use. This times VCHI_MAX_MSG_SIZE gives the effective * receive queue space, less message headers. */ #ifndef VCHI_NUM_READ_SLOTS # if defined(VCHI_LOCAL_HOST_PORT) # define VCHI_NUM_READ_SLOTS 4 # else # define VCHI_NUM_READ_SLOTS 48 # endif #endif /* Do we utilise overrun facility for receive message slots? Can aid peer transmit * performance. Only define on VideoCore end, talking to host. */ //#define VCHI_MSG_RX_OVERRUN /* How many transmit slots do we use. Generally don't need many, as the hardware driver * underneath VCHI will usually have its own buffering. */ #ifndef VCHI_NUM_WRITE_SLOTS # define VCHI_NUM_WRITE_SLOTS 4 #endif /* If a service has held or queued received messages in VCHI_XOFF_THRESHOLD or more slots, * then it's taking up too much buffer space, and the peer service will be told to stop * transmitting with an XOFF message. For this to be effective, the VCHI_NUM_READ_SLOTS * needs to be considerably bigger than VCHI_NUM_WRITE_SLOTS, or the transmit latency * is too high. */ #ifndef VCHI_XOFF_THRESHOLD # define VCHI_XOFF_THRESHOLD (VCHI_NUM_READ_SLOTS / 2) #endif /* After we've sent an XOFF, the peer will be told to resume transmission once the local * service has dequeued/released enough messages that it's now occupying * VCHI_XON_THRESHOLD slots or fewer. */ #ifndef VCHI_XON_THRESHOLD # define VCHI_XON_THRESHOLD (VCHI_NUM_READ_SLOTS / 4) #endif /* A size below which a bulk transfer omits the handshake completely and always goes * via the message channel, if bulk auxiliary is being sent on that service. (The user * can guarantee this by enabling unaligned transmits). * Not API. */ #ifndef VCHI_MIN_BULK_SIZE # define VCHI_MIN_BULK_SIZE ( VCHI_MAX_MSG_SIZE / 2 < 4096 ? VCHI_MAX_MSG_SIZE / 2 : 4096 ) #endif /* Maximum size of bulk transmission chunks, for each interface type. A trade-off between * speed and latency; the smaller the chunk size the better change of messages and other * bulk transmissions getting in when big bulk transfers are happening. Set to 0 to not * break transmissions into chunks. */ #ifndef VCHI_MAX_BULK_CHUNK_SIZE_MPHI # define VCHI_MAX_BULK_CHUNK_SIZE_MPHI (16 * 1024) #endif /* NB Chunked CCP2 transmissions violate the letter of the CCP2 spec by using "JPEG8" mode * with multiple-line frames. Only use if the receiver can cope. */ #ifndef VCHI_MAX_BULK_CHUNK_SIZE_CCP2 # define VCHI_MAX_BULK_CHUNK_SIZE_CCP2 0 #endif /* How many TX messages can we have pending in our transmit slots. Once exhausted, * vchi_msg_queue will be blocked. */ #ifndef VCHI_TX_MSG_QUEUE_SIZE # define VCHI_TX_MSG_QUEUE_SIZE 256 #endif /* How many RX messages can we have parsed in the receive slots. Once exhausted, parsing * will be suspended until older messages are dequeued/released. */ #ifndef VCHI_RX_MSG_QUEUE_SIZE # define VCHI_RX_MSG_QUEUE_SIZE 256 #endif /* Really should be able to cope if we run out of received message descriptors, by * suspending parsing as the comment above says, but we don't. This sweeps the issue * under the carpet. */ #if VCHI_RX_MSG_QUEUE_SIZE < (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS # undef VCHI_RX_MSG_QUEUE_SIZE # define VCHI_RX_MSG_QUEUE_SIZE (VCHI_MAX_MSG_SIZE/16 + 1) * VCHI_NUM_READ_SLOTS #endif /* How many bulk transmits can we have pending. Once exhausted, vchi_bulk_queue_transmit * will be blocked. */ #ifndef VCHI_TX_BULK_QUEUE_SIZE # define VCHI_TX_BULK_QUEUE_SIZE 64 #endif /* How many bulk receives can we have pending. Once exhausted, vchi_bulk_queue_receive * will be blocked. */ #ifndef VCHI_RX_BULK_QUEUE_SIZE # define VCHI_RX_BULK_QUEUE_SIZE 64 #endif /* A limit on how many outstanding bulk requests we expect the peer to give us. If * the peer asks for more than this, VCHI will fail and assert. The number is determined * by the peer's hardware - it's the number of outstanding requests that can be queued * on all bulk channels. VC3's MPHI peripheral allows 16. */ #ifndef VCHI_MAX_PEER_BULK_REQUESTS # define VCHI_MAX_PEER_BULK_REQUESTS 32 #endif /* Define VCHI_CCP2TX_MANUAL_POWER if the host tells us when to turn the CCP2 * transmitter on and off. */ /*#define VCHI_CCP2TX_MANUAL_POWER*/ #ifndef VCHI_CCP2TX_MANUAL_POWER /* Timeout (in milliseconds) for putting the CCP2TX interface into IDLE state. Set * negative for no IDLE. */ # ifndef VCHI_CCP2TX_IDLE_TIMEOUT # define VCHI_CCP2TX_IDLE_TIMEOUT 5 # endif /* Timeout (in milliseconds) for putting the CCP2TX interface into OFF state. Set * negative for no OFF. */ # ifndef VCHI_CCP2TX_OFF_TIMEOUT # define VCHI_CCP2TX_OFF_TIMEOUT 1000 # endif #endif /* VCHI_CCP2TX_MANUAL_POWER */ #endif /* VCHI_CFG_H_ */ /****************************** End of file **********************************/ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchi/vchi_cfg_internal.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHI_CFG_INTERNAL_H_ #define VCHI_CFG_INTERNAL_H_ /**************************************************************************************** * Control optimisation attempts. ***************************************************************************************/ // Don't use lots of short-term locks - use great long ones, reducing the overall locks-per-second #define VCHI_COARSE_LOCKING // Avoid lock then unlock on exit from blocking queue operations (msg tx, bulk rx/tx) // (only relevant if VCHI_COARSE_LOCKING) #define VCHI_ELIDE_BLOCK_EXIT_LOCK // Avoid lock on non-blocking peek // (only relevant if VCHI_COARSE_LOCKING) #define VCHI_AVOID_PEEK_LOCK // Use one slot-handler thread per connection, rather than 1 thread dealing with all connections in rotation. #define VCHI_MULTIPLE_HANDLER_THREADS // Put free descriptors onto the head of the free queue, rather than the tail, so that we don't thrash // our way through the pool of descriptors. #define VCHI_PUSH_FREE_DESCRIPTORS_ONTO_HEAD // Don't issue a MSG_AVAILABLE callback for every single message. Possibly only safe if VCHI_COARSE_LOCKING. #define VCHI_FEWER_MSG_AVAILABLE_CALLBACKS // Don't use message descriptors for TX messages that don't need them #define VCHI_MINIMISE_TX_MSG_DESCRIPTORS // Nano-locks for multiqueue //#define VCHI_MQUEUE_NANOLOCKS // Lock-free(er) dequeuing //#define VCHI_RX_NANOLOCKS #endif /*VCHI_CFG_INTERNAL_H_*/ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchi/vchi_common.h ================================================ /* Copyright (c) 2012-2014, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Contains global defs used by submodules within vchi #ifndef VCHI_COMMON_H_ #define VCHI_COMMON_H_ //flags used when sending messages (must be bitmapped) typedef enum { VCHI_FLAGS_NONE = 0x0, VCHI_FLAGS_BLOCK_UNTIL_OP_COMPLETE = 0x1, // waits for message to be received, or sent (NB. not the same as being seen on other side) VCHI_FLAGS_CALLBACK_WHEN_OP_COMPLETE = 0x2, // run a callback when message sent VCHI_FLAGS_BLOCK_UNTIL_QUEUED = 0x4, // return once the transfer is in a queue ready to go VCHI_FLAGS_ALLOW_PARTIAL = 0x8, VCHI_FLAGS_BLOCK_UNTIL_DATA_READ = 0x10, VCHI_FLAGS_CALLBACK_WHEN_DATA_READ = 0x20, VCHI_FLAGS_ALIGN_SLOT = 0x000080, // internal use only VCHI_FLAGS_BULK_AUX_QUEUED = 0x010000, // internal use only VCHI_FLAGS_BULK_AUX_COMPLETE = 0x020000, // internal use only VCHI_FLAGS_BULK_DATA_QUEUED = 0x040000, // internal use only VCHI_FLAGS_BULK_DATA_COMPLETE = 0x080000, // internal use only VCHI_FLAGS_INTERNAL = 0xFF0000 } VCHI_FLAGS_T; // constants for vchi_crc_control() typedef enum { VCHI_CRC_NOTHING = -1, VCHI_CRC_PER_SERVICE = 0, VCHI_CRC_EVERYTHING = 1, } VCHI_CRC_CONTROL_T; //callback reasons when an event occurs on a service typedef enum { VCHI_CALLBACK_REASON_MIN, //This indicates that there is data available //handle is the msg id that was transmitted with the data // When a message is received and there was no FULL message available previously, send callback // Tasks get kicked by the callback, reset their event and try and read from the fifo until it fails VCHI_CALLBACK_MSG_AVAILABLE, VCHI_CALLBACK_MSG_SENT, VCHI_CALLBACK_MSG_SPACE_AVAILABLE, // XXX not yet implemented // This indicates that a transfer from the other side has completed VCHI_CALLBACK_BULK_RECEIVED, //This indicates that data queued up to be sent has now gone //handle is the msg id that was used when sending the data VCHI_CALLBACK_BULK_SENT, VCHI_CALLBACK_BULK_RX_SPACE_AVAILABLE, // XXX not yet implemented VCHI_CALLBACK_BULK_TX_SPACE_AVAILABLE, // XXX not yet implemented VCHI_CALLBACK_SERVICE_CLOSED, // this side has sent XOFF to peer due to lack of data consumption by service // (suggests the service may need to take some recovery action if it has // been deliberately holding off consuming data) VCHI_CALLBACK_SENT_XOFF, VCHI_CALLBACK_SENT_XON, // indicates that a bulk transfer has finished reading the source buffer VCHI_CALLBACK_BULK_DATA_READ, // power notification events (currently host side only) VCHI_CALLBACK_PEER_OFF, VCHI_CALLBACK_PEER_SUSPENDED, VCHI_CALLBACK_PEER_ON, VCHI_CALLBACK_PEER_RESUMED, VCHI_CALLBACK_FORCED_POWER_OFF, #ifdef USE_VCHIQ_ARM // some extra notifications provided by vchiq_arm VCHI_CALLBACK_SERVICE_OPENED, VCHI_CALLBACK_BULK_RECEIVE_ABORTED, VCHI_CALLBACK_BULK_TRANSMIT_ABORTED, #endif VCHI_CALLBACK_REASON_MAX } VCHI_CALLBACK_REASON_T; // service control options typedef enum { VCHI_SERVICE_OPTION_MIN, VCHI_SERVICE_OPTION_TRACE, VCHI_SERVICE_OPTION_SYNCHRONOUS, VCHI_SERVICE_OPTION_MAX } VCHI_SERVICE_OPTION_T; //Callback used by all services / bulk transfers typedef void (*VCHI_CALLBACK_T)( void *callback_param, //my service local param VCHI_CALLBACK_REASON_T reason, void *handle ); //for transmitting msg's only /* * Define vector struct for scatter-gather (vector) operations * Vectors can be nested - if a vector element has negative length, then * the data pointer is treated as pointing to another vector array, with * '-vec_len' elements. Thus to append a header onto an existing vector, * you can do this: * * void foo(const VCHI_MSG_VECTOR_T *v, int n) * { * VCHI_MSG_VECTOR_T nv[2]; * nv[0].vec_base = my_header; * nv[0].vec_len = sizeof my_header; * nv[1].vec_base = v; * nv[1].vec_len = -n; * ... * */ typedef struct vchi_msg_vector { const void *vec_base; int32_t vec_len; } VCHI_MSG_VECTOR_T; // Opaque type for a connection API typedef struct opaque_vchi_connection_api_t VCHI_CONNECTION_API_T; // Opaque type for a message driver typedef struct opaque_vchi_message_driver_t VCHI_MESSAGE_DRIVER_T; // Iterator structure for reading ahead through received message queue. Allocated by client, // initialised by vchi_msg_look_ahead. Fields are for internal VCHI use only. // Iterates over messages in queue at the instant of the call to vchi_msg_lookahead - // will not proceed to messages received since. Behaviour is undefined if an iterator // is used again after messages for that service are removed/dequeued by any // means other than vchi_msg_iter_... calls on the iterator itself. typedef struct { struct opaque_vchi_service_t *service; void *last; void *next; void *remove; } VCHI_MSG_ITER_T; #endif // VCHI_COMMON_H_ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchi/vchi_mh.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHI_MH_H_ #define VCHI_MH_H_ #include typedef int32_t VCHI_MEM_HANDLE_T; #define VCHI_MEM_HANDLE_INVALID 0 #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchiq_arm/vchiq.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHIQ_VCHIQ_H #define VCHIQ_VCHIQ_H #include "vchiq_if.h" #include "vchiq_util.h" #include "interface/vcos/vcos.h" #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchiq_arm/vchiq_cfg.h ================================================ /* Copyright (c) 2014, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHIQ_CFG_H #define VCHIQ_CFG_H #define VCHIQ_MAGIC VCHIQ_MAKE_FOURCC('V', 'C', 'H', 'I') /* The version of VCHIQ - change with any non-trivial change */ #define VCHIQ_VERSION 8 /* The minimum compatible version - update to match VCHIQ_VERSION with any ** incompatible change */ #define VCHIQ_VERSION_MIN 3 /* The version that introduced the VCHIQ_IOC_LIB_VERSION ioctl */ #define VCHIQ_VERSION_LIB_VERSION 7 /* The version that introduced the VCHIQ_IOC_CLOSE_DELIVERED ioctl */ #define VCHIQ_VERSION_CLOSE_DELIVERED 7 /* The version that made it safe to use SYNCHRONOUS mode */ #define VCHIQ_VERSION_SYNCHRONOUS_MODE 8 #define VCHIQ_MAX_STATES 2 #define VCHIQ_MAX_SERVICES 4096 #define VCHIQ_MAX_SLOTS 128 #define VCHIQ_MAX_SLOTS_PER_SIDE 64 #define VCHIQ_NUM_CURRENT_BULKS 32 #define VCHIQ_NUM_SERVICE_BULKS 4 #ifndef VCHIQ_ENABLE_DEBUG #define VCHIQ_ENABLE_DEBUG 1 #endif #ifndef VCHIQ_ENABLE_STATS #define VCHIQ_ENABLE_STATS 1 #endif #endif /* VCHIQ_CFG_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchiq_arm/vchiq_if.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHIQ_IF_H #define VCHIQ_IF_H #include "interface/vchi/vchi_mh.h" #ifdef __cplusplus extern "C" { #endif #define VCHIQ_SERVICE_HANDLE_INVALID 0 #define VCHIQ_SLOT_SIZE 4096 #define VCHIQ_MAX_MSG_SIZE (VCHIQ_SLOT_SIZE - sizeof(VCHIQ_HEADER_T)) #define VCHIQ_CHANNEL_SIZE VCHIQ_MAX_MSG_SIZE /* For backwards compatibility */ #define VCHIQ_MAKE_FOURCC(x0, x1, x2, x3) (((x0) << 24) | ((x1) << 16) | ((x2) << 8) | (x3)) #define VCHIQ_GET_SERVICE_USERDATA(service) vchiq_get_service_userdata(service) #define VCHIQ_GET_SERVICE_FOURCC(service) vchiq_get_service_fourcc(service) typedef enum { VCHIQ_SERVICE_OPENED, // service, -, - VCHIQ_SERVICE_CLOSED, // service, -, - VCHIQ_MESSAGE_AVAILABLE, // service, header, - VCHIQ_BULK_TRANSMIT_DONE, // service, -, bulk_userdata VCHIQ_BULK_RECEIVE_DONE, // service, -, bulk_userdata VCHIQ_BULK_TRANSMIT_ABORTED, // service, -, bulk_userdata VCHIQ_BULK_RECEIVE_ABORTED // service, -, bulk_userdata } VCHIQ_REASON_T; typedef enum { VCHIQ_ERROR = -1, VCHIQ_SUCCESS = 0, VCHIQ_RETRY = 1 } VCHIQ_STATUS_T; typedef enum { VCHIQ_BULK_MODE_CALLBACK, VCHIQ_BULK_MODE_BLOCKING, VCHIQ_BULK_MODE_NOCALLBACK } VCHIQ_BULK_MODE_T; typedef enum { VCHIQ_SERVICE_OPTION_AUTOCLOSE, VCHIQ_SERVICE_OPTION_SLOT_QUOTA, VCHIQ_SERVICE_OPTION_MESSAGE_QUOTA, VCHIQ_SERVICE_OPTION_SYNCHRONOUS, VCHIQ_SERVICE_OPTION_TRACE } VCHIQ_SERVICE_OPTION_T; #ifdef __HIGHC__ /* Allow zero-sized arrays without warnings */ #pragma warning (push) #pragma warning (disable : 4200) #endif typedef struct vchiq_header_struct { /* The message identifier - opaque to applications. */ int msgid; /* Size of message data. */ unsigned int size; char data[0]; /* message */ } VCHIQ_HEADER_T; #ifdef __HIGHC__ #pragma warning (pop) #endif typedef struct { const void *data; int size; } VCHIQ_ELEMENT_T; typedef unsigned int VCHIQ_SERVICE_HANDLE_T; typedef VCHIQ_STATUS_T (*VCHIQ_CALLBACK_T)(VCHIQ_REASON_T, VCHIQ_HEADER_T *, VCHIQ_SERVICE_HANDLE_T, void *); typedef struct vchiq_service_base_struct { int fourcc; VCHIQ_CALLBACK_T callback; void *userdata; } VCHIQ_SERVICE_BASE_T; typedef struct vchiq_service_params_struct { int fourcc; VCHIQ_CALLBACK_T callback; void *userdata; short version; /* Increment for non-trivial changes */ short version_min; /* Update for incompatible changes */ } VCHIQ_SERVICE_PARAMS_T; typedef struct vchiq_config_struct { int max_msg_size; int bulk_threshold; /* The message size aboce which it is better to use a bulk transfer (<= max_msg_size) */ int max_outstanding_bulks; int max_services; short version; /* The version of VCHIQ */ short version_min; /* The minimum compatible version of VCHIQ */ } VCHIQ_CONFIG_T; typedef struct vchiq_instance_struct *VCHIQ_INSTANCE_T; typedef void (*VCHIQ_REMOTE_USE_CALLBACK_T)(void* cb_arg); extern VCHIQ_STATUS_T vchiq_initialise(VCHIQ_INSTANCE_T *pinstance); extern VCHIQ_STATUS_T vchiq_initialise_fd(VCHIQ_INSTANCE_T *pinstance, int dev_vchiq_fd); extern VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance); extern VCHIQ_STATUS_T vchiq_connect(VCHIQ_INSTANCE_T instance); extern VCHIQ_STATUS_T vchiq_add_service(VCHIQ_INSTANCE_T instance, const VCHIQ_SERVICE_PARAMS_T *params, VCHIQ_SERVICE_HANDLE_T *pservice); extern VCHIQ_STATUS_T vchiq_open_service(VCHIQ_INSTANCE_T instance, const VCHIQ_SERVICE_PARAMS_T *params, VCHIQ_SERVICE_HANDLE_T *pservice); extern VCHIQ_STATUS_T vchiq_close_service(VCHIQ_SERVICE_HANDLE_T service); extern VCHIQ_STATUS_T vchiq_remove_service(VCHIQ_SERVICE_HANDLE_T service); extern VCHIQ_STATUS_T vchiq_use_service(VCHIQ_SERVICE_HANDLE_T service); extern VCHIQ_STATUS_T vchiq_release_service(VCHIQ_SERVICE_HANDLE_T service); extern VCHIQ_STATUS_T vchiq_queue_message(VCHIQ_SERVICE_HANDLE_T service, const VCHIQ_ELEMENT_T *elements, int count); extern void vchiq_release_message(VCHIQ_SERVICE_HANDLE_T service, VCHIQ_HEADER_T *header); extern VCHIQ_STATUS_T vchiq_queue_bulk_transmit(VCHIQ_SERVICE_HANDLE_T service, const void *data, int size, void *userdata); extern VCHIQ_STATUS_T vchiq_queue_bulk_receive(VCHIQ_SERVICE_HANDLE_T service, void *data, int size, void *userdata); extern VCHIQ_STATUS_T vchiq_queue_bulk_transmit_handle( VCHIQ_SERVICE_HANDLE_T service, VCHI_MEM_HANDLE_T handle, const void *offset, int size, void *userdata); extern VCHIQ_STATUS_T vchiq_queue_bulk_receive_handle( VCHIQ_SERVICE_HANDLE_T service, VCHI_MEM_HANDLE_T handle, void *offset, int size, void *userdata); extern VCHIQ_STATUS_T vchiq_bulk_transmit(VCHIQ_SERVICE_HANDLE_T service, const void *data, int size, void *userdata, VCHIQ_BULK_MODE_T mode); extern VCHIQ_STATUS_T vchiq_bulk_receive(VCHIQ_SERVICE_HANDLE_T service, void *data, int size, void *userdata, VCHIQ_BULK_MODE_T mode); extern VCHIQ_STATUS_T vchiq_bulk_transmit_handle(VCHIQ_SERVICE_HANDLE_T service, VCHI_MEM_HANDLE_T handle, const void *offset, int size, void *userdata, VCHIQ_BULK_MODE_T mode); extern VCHIQ_STATUS_T vchiq_bulk_receive_handle(VCHIQ_SERVICE_HANDLE_T service, VCHI_MEM_HANDLE_T handle, void *offset, int size, void *userdata, VCHIQ_BULK_MODE_T mode, int (*copy_pagelist)()); extern int vchiq_get_client_id(VCHIQ_SERVICE_HANDLE_T service); extern void *vchiq_get_service_userdata(VCHIQ_SERVICE_HANDLE_T service); extern int vchiq_get_service_fourcc(VCHIQ_SERVICE_HANDLE_T service); extern VCHIQ_STATUS_T vchiq_get_config(VCHIQ_INSTANCE_T instance, int config_size, VCHIQ_CONFIG_T *pconfig); extern VCHIQ_STATUS_T vchiq_set_service_option(VCHIQ_SERVICE_HANDLE_T service, VCHIQ_SERVICE_OPTION_T option, int value); extern VCHIQ_STATUS_T vchiq_remote_use(VCHIQ_INSTANCE_T instance, VCHIQ_REMOTE_USE_CALLBACK_T callback, void *cb_arg); extern VCHIQ_STATUS_T vchiq_remote_release(VCHIQ_INSTANCE_T instance); extern VCHIQ_STATUS_T vchiq_dump_phys_mem(VCHIQ_SERVICE_HANDLE_T service, void *ptr, size_t num_bytes); extern VCHIQ_STATUS_T vchiq_get_peer_version(VCHIQ_SERVICE_HANDLE_T handle, short *peer_version); #ifdef __cplusplus } #endif #endif /* VCHIQ_IF_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchiq_arm/vchiq_ioctl.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHIQ_IOCTLS_H #define VCHIQ_IOCTLS_H #include #include "vchiq_if.h" #define VCHIQ_IOC_MAGIC 0xc4 #define VCHIQ_INVALID_HANDLE (~0) typedef struct { VCHIQ_SERVICE_PARAMS_T params; int is_open; int is_vchi; unsigned int handle; /* OUT */ } VCHIQ_CREATE_SERVICE_T; typedef struct { unsigned int handle; unsigned int count; const VCHIQ_ELEMENT_T *elements; } VCHIQ_QUEUE_MESSAGE_T; typedef struct { unsigned int handle; void *data; unsigned int size; void *userdata; VCHIQ_BULK_MODE_T mode; } VCHIQ_QUEUE_BULK_TRANSFER_T; typedef struct { VCHIQ_REASON_T reason; VCHIQ_HEADER_T *header; void *service_userdata; void *bulk_userdata; } VCHIQ_COMPLETION_DATA_T; typedef struct { unsigned int count; VCHIQ_COMPLETION_DATA_T *buf; unsigned int msgbufsize; unsigned int msgbufcount; /* IN/OUT */ void **msgbufs; } VCHIQ_AWAIT_COMPLETION_T; typedef struct { unsigned int handle; int blocking; unsigned int bufsize; void *buf; } VCHIQ_DEQUEUE_MESSAGE_T; typedef struct { unsigned int config_size; VCHIQ_CONFIG_T *pconfig; } VCHIQ_GET_CONFIG_T; typedef struct { unsigned int handle; VCHIQ_SERVICE_OPTION_T option; int value; } VCHIQ_SET_SERVICE_OPTION_T; typedef struct { void *virt_addr; size_t num_bytes; } VCHIQ_DUMP_MEM_T; #define VCHIQ_IOC_CONNECT _IO(VCHIQ_IOC_MAGIC, 0) #define VCHIQ_IOC_SHUTDOWN _IO(VCHIQ_IOC_MAGIC, 1) #define VCHIQ_IOC_CREATE_SERVICE _IOWR(VCHIQ_IOC_MAGIC, 2, VCHIQ_CREATE_SERVICE_T) #define VCHIQ_IOC_REMOVE_SERVICE _IO(VCHIQ_IOC_MAGIC, 3) #define VCHIQ_IOC_QUEUE_MESSAGE _IOW(VCHIQ_IOC_MAGIC, 4, VCHIQ_QUEUE_MESSAGE_T) #define VCHIQ_IOC_QUEUE_BULK_TRANSMIT _IOWR(VCHIQ_IOC_MAGIC, 5, VCHIQ_QUEUE_BULK_TRANSFER_T) #define VCHIQ_IOC_QUEUE_BULK_RECEIVE _IOWR(VCHIQ_IOC_MAGIC, 6, VCHIQ_QUEUE_BULK_TRANSFER_T) #define VCHIQ_IOC_AWAIT_COMPLETION _IOWR(VCHIQ_IOC_MAGIC, 7, VCHIQ_AWAIT_COMPLETION_T) #define VCHIQ_IOC_DEQUEUE_MESSAGE _IOWR(VCHIQ_IOC_MAGIC, 8, VCHIQ_DEQUEUE_MESSAGE_T) #define VCHIQ_IOC_GET_CLIENT_ID _IO(VCHIQ_IOC_MAGIC, 9) #define VCHIQ_IOC_GET_CONFIG _IOWR(VCHIQ_IOC_MAGIC, 10, VCHIQ_GET_CONFIG_T) #define VCHIQ_IOC_CLOSE_SERVICE _IO(VCHIQ_IOC_MAGIC, 11) #define VCHIQ_IOC_USE_SERVICE _IO(VCHIQ_IOC_MAGIC, 12) #define VCHIQ_IOC_RELEASE_SERVICE _IO(VCHIQ_IOC_MAGIC, 13) #define VCHIQ_IOC_SET_SERVICE_OPTION _IOW(VCHIQ_IOC_MAGIC, 14, VCHIQ_SET_SERVICE_OPTION_T) #define VCHIQ_IOC_DUMP_PHYS_MEM _IOW(VCHIQ_IOC_MAGIC, 15, VCHIQ_DUMP_MEM_T) #define VCHIQ_IOC_LIB_VERSION _IO(VCHIQ_IOC_MAGIC, 16) #define VCHIQ_IOC_CLOSE_DELIVERED _IO(VCHIQ_IOC_MAGIC, 17) #define VCHIQ_IOC_MAX 17 #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchiq_arm/vchiq_test.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHIQ_TEST_H #define VCHIQ_TEST_H #include "vchiq_test_if.h" #define VCOS_LOG_CATEGORY (&vchiq_test_log_category) #define VERBOSE_TRACE 1 #define FUNC_FOURCC VCHIQ_MAKE_FOURCC('f','u','n','c') #define FUN2_FOURCC VCHIQ_MAKE_FOURCC('f','u','n','2') #define SERVICE1_DATA_SIZE 1024 #define SERVICE2_DATA_SIZE 2048 #define FUN2_MAX_DATA_SIZE 16384 #define FUN2_MAX_ALIGN 4096 #define BULK_ALIGN_SIZE 4096 #define VCHIQ_TEST_VER 3 enum { MSG_ERROR, MSG_ONEWAY, MSG_ASYNC, MSG_SYNC, MSG_CONFIG, MSG_ECHO }; struct test_params { int magic; /* = MSG_CONFIG */ int blocksize; int iters; int verify; int echo; int align_size; int client_align; int server_align; int client_message_quota; int server_message_quota; }; #if VERBOSE_TRACE #define EXPECT(_e, _v) if (_e != _v) { vcos_log_error("%d: " #_e " != " #_v, __LINE__); VCOS_BKPT; goto error_exit; } else { vcos_log_trace("%d: " #_e " == " #_v, __LINE__); } #define START_CALLBACK(_r, _u) \ if (++callback_index == callback_count) { \ if (reason != _r) { \ vcos_log_error("%d: expected callback reason " #_r ", got %d", __LINE__, reason); VCOS_BKPT; goto error_exit; \ } \ else if ((int)VCHIQ_GET_SERVICE_USERDATA(service) != _u) { \ vcos_log_error("%d: expected userdata %d, got %d", __LINE__, _u, (int)VCHIQ_GET_SERVICE_USERDATA(service)); VCOS_BKPT; goto error_exit; \ } \ else \ { \ vcos_log_trace("%d: " #_r ", " #_u, __LINE__); \ } #define START_BULK_CALLBACK(_r, _u, _bu) \ if (++bulk_index == bulk_count) { \ if (reason != _r) { \ vcos_log_error("%d: expected callback reason " #_r ", got %d", __LINE__, reason); VCOS_BKPT; goto error_exit; \ } \ else if ((int)VCHIQ_GET_SERVICE_USERDATA(service) != _u) { \ vcos_log_error("%d: expected userdata %d, got %d", __LINE__, _u, (int)VCHIQ_GET_SERVICE_USERDATA(service)); VCOS_BKPT; goto error_exit; \ } \ else if ((int)bulk_userdata != _bu) { \ vcos_log_error("%d: expected bulk_userdata %d, got %d", __LINE__, _bu, (int)bulk_userdata); VCOS_BKPT; goto error_exit; \ } \ else \ { \ vcos_log_trace("%d: " #_r ", " #_u ", " #_bu, __LINE__); \ } #else #define EXPECT(_e, _v) if (_e != _v) { vcos_log_trace("%d: " #_e " != " #_v, __LINE__); VCOS_BKPT; goto error_exit; } #define START_CALLBACK(_r, _u) \ if (++callback_index == callback_count) { \ if (reason != _r) { \ vcos_log_error("%d: expected callback reason " #_r ", got %d", __LINE__, reason); VCOS_BKPT; goto error_exit; \ } \ else if ((int)VCHIQ_GET_SERVICE_USERDATA(service) != _u) { \ vcos_log_error("%d: expected userdata %d, got %d", __LINE__, _u, (int)VCHIQ_GET_SERVICE_USERDATA(service)); VCOS_BKPT; goto error_exit; \ } #define START_BULK_CALLBACK(_r, _u, _bu) \ if (++bulk_index == bulk_count) { \ if (reason != _r) { \ vcos_log_error("%d: expected callback reason " #_r ", got %d", __LINE__, reason); VCOS_BKPT; goto error_exit; \ } \ else if ((int)VCHIQ_GET_SERVICE_USERDATA(service) != _u) { \ vcos_log_error("%d: expected userdata %d, got %d", __LINE__, _u, (int)VCHIQ_GET_SERVICE_USERDATA(service)); VCOS_BKPT; goto error_exit; \ } \ else if ((int)bulk_userdata != _bu) { \ vcos_log_error("%d: expected bulkuserdata %d, got %d", __LINE__, _bu, (int)bulk_userdata); VCOS_BKPT; goto error_exit; \ } #endif #define END_CALLBACK(_s) \ return _s; \ } #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchiq_arm/vchiq_test_if.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHIQ_TEST_IF_H #define VCHIQ_TEST_IF_H #include "vchiq.h" extern void vchiq_test_start_services(VCHIQ_INSTANCE_T instance); #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vchiq_arm/vchiq_util.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHIQ_UTIL_H #define VCHIQ_UTIL_H #include "vchiq_if.h" #include "interface/vcos/vcos.h" #ifdef __cplusplus extern "C" { #endif typedef struct { int size; int read; int write; VCOS_EVENT_T pop; VCOS_EVENT_T push; VCHIQ_HEADER_T **storage; } VCHIU_QUEUE_T; extern int vchiu_queue_init(VCHIU_QUEUE_T *queue, int size); extern void vchiu_queue_delete(VCHIU_QUEUE_T *queue); extern int vchiu_queue_is_empty(VCHIU_QUEUE_T *queue); extern int vchiu_queue_is_full(VCHIU_QUEUE_T *queue); extern void vchiu_queue_push(VCHIU_QUEUE_T *queue, VCHIQ_HEADER_T *header); extern VCHIQ_HEADER_T *vchiu_queue_peek(VCHIU_QUEUE_T *queue); extern VCHIQ_HEADER_T *vchiu_queue_pop(VCHIU_QUEUE_T *queue); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_common.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - common postamble code =============================================================================*/ /** \file * * Postamble code included by the platform-specific header files */ #define VCOS_THREAD_PRI_DEFAULT VCOS_THREAD_PRI_NORMAL #if !defined(VCOS_THREAD_PRI_INCREASE) #error Which way to thread priorities go? #endif #if VCOS_THREAD_PRI_INCREASE < 0 /* smaller numbers are higher priority */ #define VCOS_THREAD_PRI_LESS(x) ((x)VCOS_THREAD_PRI_MIN?(x)-1:VCOS_THREAD_PRI_MIN) #else /* bigger numbers are lower priority */ #define VCOS_THREAD_PRI_MORE(x) ((x)VCOS_THREAD_PRI_MIN?(x)-1:VCOS_THREAD_PRI_MIN) #endif /* Convenience for Brits: */ #define VCOS_APPLICATION_INITIALISE VCOS_APPLICATION_INITIALIZE /* * Check for constant definitions */ #ifndef VCOS_TICKS_PER_SECOND #error VCOS_TICKS_PER_SECOND not defined #endif #if !defined(VCOS_THREAD_PRI_MIN) || !defined(VCOS_THREAD_PRI_MAX) #error Priority range not defined #endif #if !defined(VCOS_THREAD_PRI_HIGHEST) || !defined(VCOS_THREAD_PRI_LOWEST) || !defined(VCOS_THREAD_PRI_NORMAL) #error Priority ordering not defined #endif #if !defined(VCOS_CAN_SET_STACK_ADDR) #error Can stack addresses be set on this platform? Please set this macro to either 0 or 1. #endif #if (_VCOS_AFFINITY_CPU0|_VCOS_AFFINITY_CPU1) & (~_VCOS_AFFINITY_MASK) #error _VCOS_AFFINITY_CPUxxx values are not consistent with _VCOS_AFFINITY_MASK #endif /** Append to the end of a singly-linked queue, O(1). Works with * any structure where list has members 'head' and 'tail' and * item has a 'next' pointer. */ #define VCOS_QUEUE_APPEND_TAIL(list, item) {\ (item)->next = NULL;\ if (!(list)->head) {\ (list)->head = (list)->tail = (item); \ } else {\ (list)->tail->next = (item); \ (list)->tail = (item); \ } \ } #ifndef VCOS_HAVE_TIMER VCOSPRE_ void VCOSPOST_ vcos_timer_init(void); #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_deprecated.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* The symbol vcos_deprecated_code may be defined at most once, by the inclusion of "vcos_deprecated.h" in vcos_init.c. Any other inclusions of this header will cause the linker to warn about multiple definitions of vcos_deprecated_code, for example: [ldvc] (Warning) "vcos_deprecated_code" is multiply defined in libs/vcos_threadx/vcos_init.c.o and libs/xxxxx/xxxxx.c.o If you see a build message like this then the configuration you are building is using deprecated code. Contact the person named in the accompanying comment for advice - do not remove the inclusion. */ int vcos_deprecated_code; ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_generic_blockpool.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - event flags implemented via a semaphore =============================================================================*/ #ifndef VCOS_GENERIC_BLOCKPOOL_H #define VCOS_GENERIC_BLOCKPOOL_H /** * \file * * This provides a generic, thread safe implementation of a VCOS block pool * fixed size memory allocator. */ #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" /** Bits 0 to (VCOS_BLOCKPOOL_SUBPOOL_BITS - 1) are used to store the * subpool id. */ #define VCOS_BLOCKPOOL_SUBPOOL_BITS 3 #define VCOS_BLOCKPOOL_MAX_SUBPOOLS (1 << VCOS_BLOCKPOOL_SUBPOOL_BITS) /* Make zero an invalid handle at the cost of decreasing the maximum * number of blocks (2^28) by 1. Alternatively, a spare bit could be * used to indicated valid blocks but there are likely to be better * uses for spare bits. e.g. allowing more subpools */ #define INDEX_OFFSET 1 #define VCOS_BLOCKPOOL_HANDLE_GET_INDEX(h) \ (((h) >> VCOS_BLOCKPOOL_SUBPOOL_BITS) - INDEX_OFFSET) #define VCOS_BLOCKPOOL_HANDLE_GET_SUBPOOL(h) \ ((h) & ((1 << VCOS_BLOCKPOOL_SUBPOOL_BITS) - 1)) #define VCOS_BLOCKPOOL_HANDLE_CREATE(i,s) \ ((((i) + INDEX_OFFSET) << VCOS_BLOCKPOOL_SUBPOOL_BITS) | (s)) #define VCOS_BLOCKPOOL_INVALID_HANDLE 0 #define VCOS_BLOCKPOOL_ALIGN_DEFAULT sizeof(unsigned long) #define VCOS_BLOCKPOOL_FLAG_NONE 0 typedef struct VCOS_BLOCKPOOL_HEADER_TAG { /* Blocks either refer to to the pool if they are allocated * or the free list if they are available. */ union { struct VCOS_BLOCKPOOL_HEADER_TAG *next; struct VCOS_BLOCKPOOL_SUBPOOL_TAG* subpool; } owner; } VCOS_BLOCKPOOL_HEADER_T; typedef struct VCOS_BLOCKPOOL_SUBPOOL_TAG { /** VCOS_BLOCKPOOL_SUBPOOL_MAGIC */ uint32_t magic; VCOS_BLOCKPOOL_HEADER_T* free_list; /* The start of the pool memory */ void *mem; /* Address of the first block header */ void *start; /* The end of the subpool */ void *end; /** The number of blocks in this sub-pool */ VCOS_UNSIGNED num_blocks; /** Current number of available blocks in this sub-pool */ VCOS_UNSIGNED available_blocks; /** Pointers to the pool that owns this sub-pool */ struct VCOS_BLOCKPOOL_TAG* owner; /** Define properties such as memory ownership */ uint32_t flags; } VCOS_BLOCKPOOL_SUBPOOL_T; typedef struct VCOS_BLOCKPOOL_TAG { /** VCOS_BLOCKPOOL_MAGIC */ uint32_t magic; /** Thread safety for Alloc, Free, Delete, Stats */ VCOS_MUTEX_T mutex; /** Alignment of block data pointers */ VCOS_UNSIGNED align; /** Flags for future use e.g. cache options */ VCOS_UNSIGNED flags; /** The size of the block data */ size_t block_data_size; /** Block size inc overheads */ size_t block_size; /** Name for debugging */ const char *name; /* The number of subpools that may be used */ VCOS_UNSIGNED num_subpools; /** Number of blocks in each dynamically allocated subpool */ VCOS_UNSIGNED num_extension_blocks; /** Array of subpools. Subpool zero is is not deleted until the pool is * destroed. If the index of the pool is < num_subpools and * subpool[index.mem] is null then the subpool entry is valid but * "not currently allocated" */ VCOS_BLOCKPOOL_SUBPOOL_T subpools[VCOS_BLOCKPOOL_MAX_SUBPOOLS]; } VCOS_BLOCKPOOL_T; #define VCOS_BLOCKPOOL_ROUND_UP(x,s) (((x) + ((s) - 1)) & ~((s) - 1)) /** * Calculates the size in bytes required for a block pool containing * num_blocks of size block_size plus any overheads. * * The block pool header (VCOS_BLOCKPOOL_T) is allocated separately * * Overheads: * block_size + header must be rounded up to meet the required alignment * The start of the first block may need to be up to align bytes * into the given buffer because statically allocated buffers within structures * are not guaranteed to be aligned as required. */ #define VCOS_BLOCKPOOL_SIZE(num_blocks, block_size, align) \ ((VCOS_BLOCKPOOL_ROUND_UP((block_size) + (align >= 4096 ? 32 : 0) + sizeof(VCOS_BLOCKPOOL_HEADER_T), \ (align)) * (num_blocks)) + (align)) /** * Sanity check to verify whether a handle is potentially a blockpool handle * when the pool pointer is not available. * * If the pool pointer is available use vcos_blockpool_elem_to_handle instead. * * @param handle the handle to verify * @param max_blocks the expected maximum number of block in the pool * that the handle belongs to. */ #define VCOS_BLOCKPOOL_IS_VALID_HANDLE_FORMAT(handle, max_blocks) \ ((handle) != VCOS_BLOCKPOOL_INVALID_HANDLE \ && VCOS_BLOCKPOOL_HANDLE_GET_INDEX((handle)) < (max_blocks)) VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_generic_blockpool_init(VCOS_BLOCKPOOL_T *pool, VCOS_UNSIGNED num_blocks, VCOS_UNSIGNED block_size, void *start, VCOS_UNSIGNED pool_size, VCOS_UNSIGNED align, VCOS_UNSIGNED flags, const char *name); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_generic_blockpool_create_on_heap( VCOS_BLOCKPOOL_T *pool, VCOS_UNSIGNED num_blocks, VCOS_UNSIGNED block_size, VCOS_UNSIGNED align, VCOS_UNSIGNED flags, const char *name); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_generic_blockpool_extend(VCOS_BLOCKPOOL_T *pool, VCOS_UNSIGNED num_extensions, VCOS_UNSIGNED num_blocks); VCOSPRE_ void VCOSPOST_ *vcos_generic_blockpool_alloc(VCOS_BLOCKPOOL_T *pool); VCOSPRE_ void VCOSPOST_ *vcos_generic_blockpool_calloc(VCOS_BLOCKPOOL_T *pool); VCOSPRE_ void VCOSPOST_ vcos_generic_blockpool_free(void *block); VCOSPRE_ VCOS_UNSIGNED VCOSPOST_ vcos_generic_blockpool_available_count( VCOS_BLOCKPOOL_T *pool); VCOSPRE_ VCOS_UNSIGNED VCOSPOST_ vcos_generic_blockpool_used_count( VCOS_BLOCKPOOL_T *pool); VCOSPRE_ void VCOSPOST_ vcos_generic_blockpool_delete(VCOS_BLOCKPOOL_T *pool); VCOSPRE_ uint32_t VCOSPOST_ vcos_generic_blockpool_elem_to_handle(void *block); VCOSPRE_ void VCOSPOST_ *vcos_generic_blockpool_elem_from_handle( VCOS_BLOCKPOOL_T *pool, uint32_t handle); VCOSPRE_ uint32_t VCOSPOST_ vcos_generic_blockpool_is_valid_elem( VCOS_BLOCKPOOL_T *pool, const void *block); #if defined(VCOS_INLINE_BODIES) VCOS_INLINE_IMPL VCOS_STATUS_T vcos_blockpool_init(VCOS_BLOCKPOOL_T *pool, VCOS_UNSIGNED num_blocks, VCOS_UNSIGNED block_size, void *start, VCOS_UNSIGNED pool_size, VCOS_UNSIGNED align, VCOS_UNSIGNED flags, const char *name) { return vcos_generic_blockpool_init(pool, num_blocks, block_size, start, pool_size, align, flags, name); } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_blockpool_create_on_heap(VCOS_BLOCKPOOL_T *pool, VCOS_UNSIGNED num_blocks, VCOS_UNSIGNED block_size, VCOS_UNSIGNED align, VCOS_UNSIGNED flags, const char *name) { return vcos_generic_blockpool_create_on_heap( pool, num_blocks, block_size, align, flags, name); } VCOS_INLINE_IMPL VCOS_STATUS_T VCOSPOST_ vcos_blockpool_extend(VCOS_BLOCKPOOL_T *pool, VCOS_UNSIGNED num_extensions, VCOS_UNSIGNED num_blocks) { return vcos_generic_blockpool_extend(pool, num_extensions, num_blocks); } VCOS_INLINE_IMPL void *vcos_blockpool_alloc(VCOS_BLOCKPOOL_T *pool) { return vcos_generic_blockpool_alloc(pool); } VCOS_INLINE_IMPL void *vcos_blockpool_calloc(VCOS_BLOCKPOOL_T *pool) { return vcos_generic_blockpool_calloc(pool); } VCOS_INLINE_IMPL void vcos_blockpool_free(void *block) { vcos_generic_blockpool_free(block); } VCOS_INLINE_IMPL VCOS_UNSIGNED vcos_blockpool_available_count(VCOS_BLOCKPOOL_T *pool) { return vcos_generic_blockpool_available_count(pool); } VCOS_INLINE_IMPL VCOS_UNSIGNED vcos_blockpool_used_count(VCOS_BLOCKPOOL_T *pool) { return vcos_generic_blockpool_used_count(pool); } VCOS_INLINE_IMPL void vcos_blockpool_delete(VCOS_BLOCKPOOL_T *pool) { vcos_generic_blockpool_delete(pool); } VCOS_INLINE_IMPL uint32_t vcos_blockpool_elem_to_handle(void *block) { return vcos_generic_blockpool_elem_to_handle(block); } VCOS_INLINE_IMPL void *vcos_blockpool_elem_from_handle(VCOS_BLOCKPOOL_T *pool, uint32_t handle) { return vcos_generic_blockpool_elem_from_handle(pool, handle); } VCOS_INLINE_IMPL uint32_t vcos_blockpool_is_valid_elem(VCOS_BLOCKPOOL_T *pool, const void *block) { return vcos_generic_blockpool_is_valid_elem(pool, block); } #endif /* VCOS_INLINE_BODIES */ #ifdef __cplusplus } #endif #endif /* VCOS_GENERIC_BLOCKPOOL_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_generic_event_flags.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - event flags implemented via a semaphore =============================================================================*/ #ifndef VCOS_GENERIC_EVENT_FLAGS_H #define VCOS_GENERIC_EVENT_FLAGS_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" /** * \file * * This provides event flags (as per Nucleus Event Groups) based on a * mutex, a semaphore (per waiting thread) and a timer (per waiting * thread). * * The data structure is a 32 bit unsigned int (the current set of * flags) and a linked list of clients waiting to be 'satisfied'. * * The mutex merely locks access to the data structure. If a client * calls vcos_event_flags_get() and the requested bits are not already * present, it then sleeps on its per-thread semaphore after adding * this semaphore to the queue waiting. It also sets up a timer. * * The per-thread semaphore and timer are actually stored in the * thread context (joinable thread). In future it may become necessary * to support non-VCOS threads by using thread local storage to * create these objects and associate them with the thread. */ struct VCOS_EVENT_WAITER_T; typedef struct VCOS_EVENT_FLAGS_T { VCOS_UNSIGNED events; /**< Events currently set */ VCOS_MUTEX_T lock; /**< Serialize access */ struct { struct VCOS_EVENT_WAITER_T *head; /**< List of threads waiting */ struct VCOS_EVENT_WAITER_T *tail; /**< List of threads waiting */ } waiters; } VCOS_EVENT_FLAGS_T; #define VCOS_OR 1 #define VCOS_AND 2 #define VCOS_CONSUME 4 #define VCOS_OR_CONSUME (VCOS_OR | VCOS_CONSUME) #define VCOS_AND_CONSUME (VCOS_AND | VCOS_CONSUME) #define VCOS_EVENT_FLAG_OP_MASK (VCOS_OR|VCOS_AND) VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_generic_event_flags_create(VCOS_EVENT_FLAGS_T *flags, const char *name); VCOSPRE_ void VCOSPOST_ vcos_generic_event_flags_set(VCOS_EVENT_FLAGS_T *flags, VCOS_UNSIGNED events, VCOS_OPTION op); VCOSPRE_ void VCOSPOST_ vcos_generic_event_flags_delete(VCOS_EVENT_FLAGS_T *); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_generic_event_flags_get(VCOS_EVENT_FLAGS_T *flags, VCOS_UNSIGNED requested_events, VCOS_OPTION op, VCOS_UNSIGNED suspend, VCOS_UNSIGNED *retrieved_events); #ifdef VCOS_INLINE_BODIES VCOS_INLINE_IMPL VCOS_STATUS_T vcos_event_flags_create(VCOS_EVENT_FLAGS_T *flags, const char *name) { return vcos_generic_event_flags_create(flags, name); } VCOS_INLINE_IMPL void vcos_event_flags_set(VCOS_EVENT_FLAGS_T *flags, VCOS_UNSIGNED events, VCOS_OPTION op) { vcos_generic_event_flags_set(flags, events, op); } VCOS_INLINE_IMPL void vcos_event_flags_delete(VCOS_EVENT_FLAGS_T *f) { vcos_generic_event_flags_delete(f); } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_event_flags_get(VCOS_EVENT_FLAGS_T *flags, VCOS_UNSIGNED requested_events, VCOS_OPTION op, VCOS_UNSIGNED suspend, VCOS_UNSIGNED *retrieved_events) { return vcos_generic_event_flags_get(flags, requested_events, op, suspend, retrieved_events); } #endif /* VCOS_INLINE_BODIES */ #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_generic_named_sem.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - named semaphores =============================================================================*/ #ifndef VCOS_GENERIC_NAMED_SEM_H #define VCOS_GENERIC_NAMED_SEM_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" /** * \file * * Generic support for named semaphores, using regular ones. This is only * suitable for emulating them on an embedded MMUless system, since there is * no support for opening semaphores across process boundaries. * */ #define VCOS_NAMED_SEMAPHORE_NAMELEN 64 /* In theory we could use the name facility provided within Nucleus. However, this * is hard to do as semaphores are constantly being created and destroyed; we * would need to stop everything while allocating the memory for the semaphore * list and then walking it. So keep our own list. */ typedef struct VCOS_NAMED_SEMAPHORE_T { struct VCOS_NAMED_SEMAPHORE_IMPL_T *actual; /**< There are 'n' named semaphores per 1 actual semaphore */ VCOS_SEMAPHORE_T *sem; /**< Pointer to actual underlying semaphore */ } VCOS_NAMED_SEMAPHORE_T; VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_generic_named_semaphore_create(VCOS_NAMED_SEMAPHORE_T *sem, const char *name, VCOS_UNSIGNED count); VCOSPRE_ void VCOSPOST_ vcos_named_semaphore_delete(VCOS_NAMED_SEMAPHORE_T *sem); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ _vcos_named_semaphore_init(void); VCOSPRE_ void VCOSPOST_ _vcos_named_semaphore_deinit(void); #if defined(VCOS_INLINE_BODIES) VCOS_INLINE_IMPL VCOS_STATUS_T vcos_named_semaphore_create(VCOS_NAMED_SEMAPHORE_T *sem, const char *name, VCOS_UNSIGNED count) { return vcos_generic_named_semaphore_create(sem, name, count); } VCOS_INLINE_IMPL void vcos_named_semaphore_wait(VCOS_NAMED_SEMAPHORE_T *sem) { vcos_semaphore_wait(sem->sem); } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_named_semaphore_trywait(VCOS_NAMED_SEMAPHORE_T *sem) { return vcos_semaphore_trywait(sem->sem); } VCOS_INLINE_IMPL void vcos_named_semaphore_post(VCOS_NAMED_SEMAPHORE_T *sem) { vcos_semaphore_post(sem->sem); } #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_generic_quickslow_mutex.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - reentrant mutexes created from regular ones. =============================================================================*/ #ifndef VCOS_GENERIC_QUICKSLOW_MUTEX_H #define VCOS_GENERIC_QUICKSLOW_MUTEX_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" /** * \file * * Quickslow Mutexes implemented as regular ones (i.e. quick and slow modes are the same). * */ typedef VCOS_MUTEX_T VCOS_QUICKSLOW_MUTEX_T; #if defined(VCOS_INLINE_BODIES) VCOS_INLINE_IMPL VCOS_STATUS_T vcos_quickslow_mutex_create(VCOS_QUICKSLOW_MUTEX_T *m, const char *name) { return vcos_mutex_create(m, name); } VCOS_INLINE_IMPL void vcos_quickslow_mutex_delete(VCOS_QUICKSLOW_MUTEX_T *m) { vcos_mutex_delete(m); } VCOS_INLINE_IMPL void vcos_quickslow_mutex_lock(VCOS_QUICKSLOW_MUTEX_T *m) { while (vcos_mutex_lock(m) == VCOS_EAGAIN); } VCOS_INLINE_IMPL void vcos_quickslow_mutex_unlock(VCOS_QUICKSLOW_MUTEX_T *m) { vcos_mutex_unlock(m); } VCOS_INLINE_IMPL void vcos_quickslow_mutex_lock_quick(VCOS_QUICKSLOW_MUTEX_T *m) { while (vcos_mutex_lock(m) == VCOS_EAGAIN); } VCOS_INLINE_IMPL void vcos_quickslow_mutex_unlock_quick(VCOS_QUICKSLOW_MUTEX_T *m) { vcos_mutex_unlock(m); } #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_generic_reentrant_mtx.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - reentrant mutexes created from regular ones. =============================================================================*/ #ifndef VCOS_GENERIC_REENTRANT_MUTEX_H #define VCOS_GENERIC_REENTRANT_MUTEX_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" /** * \file * * Reentrant Mutexes from regular ones. * */ typedef struct VCOS_REENTRANT_MUTEX_T { VCOS_MUTEX_T mutex; VCOS_THREAD_T *owner; unsigned count; } VCOS_REENTRANT_MUTEX_T; /* Extern definitions of functions that do the actual work */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_generic_reentrant_mutex_create(VCOS_REENTRANT_MUTEX_T *m, const char *name); VCOSPRE_ void VCOSPOST_ vcos_generic_reentrant_mutex_delete(VCOS_REENTRANT_MUTEX_T *m); VCOSPRE_ void VCOSPOST_ vcos_generic_reentrant_mutex_lock(VCOS_REENTRANT_MUTEX_T *m); VCOSPRE_ void VCOSPOST_ vcos_generic_reentrant_mutex_unlock(VCOS_REENTRANT_MUTEX_T *m); /* Inline forwarding functions */ #if defined(VCOS_INLINE_BODIES) VCOS_INLINE_IMPL VCOS_STATUS_T vcos_reentrant_mutex_create(VCOS_REENTRANT_MUTEX_T *m, const char *name) { return vcos_generic_reentrant_mutex_create(m,name); } VCOS_INLINE_IMPL void vcos_reentrant_mutex_delete(VCOS_REENTRANT_MUTEX_T *m) { vcos_generic_reentrant_mutex_delete(m); } VCOS_INLINE_IMPL void vcos_reentrant_mutex_lock(VCOS_REENTRANT_MUTEX_T *m) { vcos_generic_reentrant_mutex_lock(m); } VCOS_INLINE_IMPL void vcos_reentrant_mutex_unlock(VCOS_REENTRANT_MUTEX_T *m) { vcos_generic_reentrant_mutex_unlock(m); } #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_generic_tls.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - generic thread local storage =============================================================================*/ #ifndef VCOS_GENERIC_TLS_H #define VCOS_GENERIC_TLS_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" /** * \file * * Do an emulation of Thread Local Storage. The platform needs to * provide a way to set and get a per-thread pointer which is * where the TLS data itself is stored. * * * Each thread that wants to join in this scheme needs to call * vcos_tls_thread_register(). * * The platform needs to support the macros/functions * _vcos_tls_thread_ptr_set() and _vcos_tls_thread_ptr_get(). */ #ifndef VCOS_WANT_TLS_EMULATION #error Should not be included unless TLS emulation is defined #endif /** Number of slots to reserve per thread. This results in an overhead * of this many words per thread. */ #define VCOS_TLS_MAX_SLOTS 4 /** TLS key. Allocating one of these reserves the client one of the * available slots. */ typedef VCOS_UNSIGNED VCOS_TLS_KEY_T; /** TLS per-thread structure. Each thread gets one of these * if TLS emulation (rather than native TLS support) is * being used. */ typedef struct VCOS_TLS_THREAD_T { void *slots[VCOS_TLS_MAX_SLOTS]; } VCOS_TLS_THREAD_T; /* * Internal APIs */ /** Register this thread's TLS storage area. */ VCOSPRE_ void VCOSPOST_ vcos_tls_thread_register(VCOS_TLS_THREAD_T *); /** Create a new TLS key */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_generic_tls_create(VCOS_TLS_KEY_T *key); /** Delete a TLS key */ VCOSPRE_ void VCOSPOST_ vcos_generic_tls_delete(VCOS_TLS_KEY_T tls); /** Initialise the TLS library */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_tls_init(void); /** Deinitialise the TLS library */ VCOSPRE_ void VCOSPOST_ vcos_tls_deinit(void); #if defined(VCOS_INLINE_BODIES) #undef VCOS_ASSERT_LOGGING_DISABLE #define VCOS_ASSERT_LOGGING_DISABLE 1 /* * Implementations of public API functions */ /** Set the given value. Since everything is per-thread, there is no need * for any locking. */ VCOS_INLINE_IMPL VCOS_STATUS_T vcos_tls_set(VCOS_TLS_KEY_T tls, void *v) { VCOS_TLS_THREAD_T *tlsdata = _vcos_tls_thread_ptr_get(); vcos_assert(tlsdata); /* Fires if this thread has not been registered */ if (tlsslots[tls] = v; return VCOS_SUCCESS; } else { vcos_assert(0); return VCOS_EINVAL; } } /** Get the given value. No locking required. */ VCOS_INLINE_IMPL void *vcos_tls_get(VCOS_TLS_KEY_T tls) { VCOS_TLS_THREAD_T *tlsdata = _vcos_tls_thread_ptr_get(); vcos_assert(tlsdata); /* Fires if this thread has not been registered */ if (tlsslots[tls]; } else { vcos_assert(0); return NULL; } } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_tls_create(VCOS_TLS_KEY_T *key) { return vcos_generic_tls_create(key); } VCOS_INLINE_IMPL void vcos_tls_delete(VCOS_TLS_KEY_T tls) { vcos_generic_tls_delete(tls); } #undef VCOS_ASSERT_LOGGING_DISABLE #define VCOS_ASSERT_LOGGING_DISABLE 0 #endif /* VCOS_INLINE_BODIES */ #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_joinable_thread_from_plain.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - implementation: joinable thread from plain =============================================================================*/ /** \file * * Header file for platforms creating the joinable thread from a lowlevel * thread. * * In addition to the actual thread, the following are also created: * * - a semaphore to wait on when joining the thread * - a semaphore to support counted suspend/resume (used by event group) * - a per-thread timer (used by event group, but could be removed) */ #ifndef VCOS_JOINABLE_THREAD_FROM_PLAIN_H #define VCOS_JOINABLE_THREAD_FROM_PLAIN_H #ifdef __cplusplus extern "C" { #endif #ifndef VCOS_SEMAPHORE_H #include "interface/vcos/vcos_semaphore.h" #endif #ifndef VCOS_LOWLEVEL_THREAD_H #include "interface/vcos/vcos_lowlevel_thread.h" #endif #ifndef VCOS_TIMER_H #include "interface/vcos/vcos_timer.h" #endif #ifdef VCOS_WANT_TLS_EMULATION #include "interface/vcos/generic/vcos_generic_tls.h" #endif #define VCOS_THREAD_MAGIC 0x56436a74 #define VCOS_THREAD_VALID(t) (t->magic == VCOS_THREAD_MAGIC) #define VCOS_HAVE_THREAD_AT_EXIT 1 /** Thread attribute structure. Clients should not manipulate this directly, but * should instead use the provided functions. */ typedef struct VCOS_THREAD_ATTR_T { void *ta_stackaddr; VCOS_UNSIGNED ta_stacksz; VCOS_UNSIGNED ta_priority; VCOS_UNSIGNED ta_affinity; VCOS_UNSIGNED ta_timeslice; VCOS_UNSIGNED legacy; VCOS_UNSIGNED ta_autostart; } VCOS_THREAD_ATTR_T; /** Each thread gets a timer, which is for internal VCOS use. */ typedef struct _VCOS_THREAD_TIMER_T { VCOS_TIMER_T timer; void (*pfn)(void *); void *cxt; } _VCOS_THREAD_TIMER_T; typedef void (*VCOS_THREAD_EXIT_HANDLER_T)(void *); /** Called at thread exit. */ typedef struct VCOS_THREAD_EXIT_T { VCOS_THREAD_EXIT_HANDLER_T pfn; void *cxt; } VCOS_THREAD_EXIT_T; #define VCOS_MAX_EXIT_HANDLERS 8 /* The name field isn't used for anything, so we can just copy the * the pointer. Nucleus makes its own copy. */ typedef const char * VCOS_LLTHREAD_T_NAME; #define _VCOS_LLTHREAD_NAME(dst,src) (dst)=(src) /* * Simulated TLS support */ /** Thread structure. * * \warning Do not access the members of this structure directly! */ typedef struct VCOS_THREAD_T { VCOS_LLTHREAD_T thread; /**< The underlying thread */ char name[16]; /**< The name */ unsigned int magic; /**< For debug */ void *exit_data; /**< Exit data passed out in vcos_joinable_thread_exit() */ void *stack; /**< Stack, if not supplied by caller */ VCOS_SEMAPHORE_T wait; /**< Semaphore to wait on at join */ VCOS_SEMAPHORE_T suspend; /**< Semaphore to wait on for counted suspend */ int16_t joined; /**< Joined yet? For debug. */ VCOS_UNSIGNED legacy; /**< Use (argc,argv) for entry point arguments */ void *(*entry)(void*); /**< Entry point */ void *arg; /**< Argument passed to entry point */ void *(*term)(void*); /**< Termination function, used by reaper */ void *term_arg; /**< Argument passed to termination function */ _VCOS_THREAD_TIMER_T _timer; /**< Internal timer, mainly for event groups */ #ifdef VCOS_WANT_TLS_EMULATION VCOS_TLS_THREAD_T _tls; /**< TLS data when native TLS not available, or NULL */ #endif /** Array of functions to call at thread exit */ VCOS_THREAD_EXIT_T at_exit[VCOS_MAX_EXIT_HANDLERS]; struct VCOS_THREAD_T *next; /**< For linked lists of threads */ } VCOS_THREAD_T; #if defined(VCOS_INLINE_BODIES) VCOS_INLINE_IMPL void vcos_thread_attr_setstack(VCOS_THREAD_ATTR_T *attrs, void *addr, VCOS_UNSIGNED stacksz) { attrs->ta_stackaddr = addr; attrs->ta_stacksz = stacksz; } VCOS_INLINE_IMPL void vcos_thread_attr_setstacksize(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED stacksz) { attrs->ta_stacksz = stacksz; } VCOS_INLINE_IMPL void vcos_thread_attr_setpriority(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED pri) { attrs->ta_priority = pri; } VCOS_INLINE_IMPL void vcos_thread_attr_setaffinity(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED affinity) { attrs->ta_affinity = affinity; } VCOS_INLINE_IMPL void vcos_thread_attr_settimeslice(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED ts) { attrs->ta_timeslice = ts; } VCOS_INLINE_IMPL void _vcos_thread_attr_setlegacyapi(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED legacy) { attrs->legacy = legacy; } VCOS_INLINE_IMPL void vcos_thread_attr_setautostart(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED autostart) { attrs->ta_autostart = autostart; } VCOS_INLINE_IMPL VCOS_THREAD_T *vcos_thread_current(void) { VCOS_THREAD_T *ret = (VCOS_THREAD_T*)vcos_llthread_current(); /*If we're called from a non-vcos thread, this assert will fail. *XXX FIXME why is this commented out? *vcos_assert(ret->magic == VCOS_THREAD_MAGIC); */ return ret; } VCOS_INLINE_IMPL int vcos_thread_running(VCOS_THREAD_T *thread) { return vcos_llthread_running(&thread->thread); } VCOS_INLINE_IMPL void vcos_thread_resume(VCOS_THREAD_T *thread) { vcos_llthread_resume(&thread->thread); } #endif /* VCOS_INLINE_BODIES */ /** * \brief Create a VCOS_THREAD_T for the current thread. This is so we can have * VCOS_THREAD_Ts even for threads not originally created by VCOS (eg the * thread that calls vcos_init) */ extern VCOS_STATUS_T _vcos_thread_create_attach(VCOS_THREAD_T *thread, const char *name); /** * \brief Deletes the VCOS_THREAD_T, but does not wait for the underlying * thread to exit. This will cleanup everything created by * _vcos_thread_create_attach */ extern void _vcos_thread_delete(VCOS_THREAD_T *thread); /** Register a function to be called when the current thread exits. */ extern VCOS_STATUS_T vcos_thread_at_exit(void (*pfn)(void*), void *cxt); /** Deregister a previously registered at-exit function. */ extern void vcos_thread_deregister_at_exit(void (*pfn)(void*), void *cxt); #ifdef __cplusplus } #endif #endif /* VCOS_JOINABLE_THREAD_FROM_PLAIN_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_latch_from_sem.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - Construct a latch from a semaphore =============================================================================*/ /** FIXME: rename to vcos_mutex_from_sem.c */ typedef struct VCOS_MUTEX_T { VCOS_SEMAPHORE_T sem; struct VCOS_THREAD_T *owner; } VCOS_MUTEX_T; extern VCOS_STATUS_T vcos_generic_mutex_create(VCOS_MUTEX_T *latch, const char *name); extern void vcos_generic_mutex_delete(VCOS_MUTEX_T *latch); extern VCOS_STATUS_T vcos_generic_mutex_lock(VCOS_MUTEX_T *latch); extern void vcos_generic_mutex_unlock(VCOS_MUTEX_T *latch); #if defined(VCOS_INLINE_BODIES) VCOS_INLINE_IMPL VCOS_STATUS_T vcos_mutex_create(VCOS_MUTEX_T *latch, const char *name) { return vcos_generic_mutex_create(latch,name); } VCOS_INLINE_IMPL void vcos_mutex_delete(VCOS_MUTEX_T *latch) { vcos_generic_mutex_delete(latch); } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_mutex_lock(VCOS_MUTEX_T *latch) { return vcos_generic_mutex_lock(latch); } VCOS_INLINE_IMPL void vcos_mutex_unlock(VCOS_MUTEX_T *latch) { vcos_generic_mutex_unlock(latch); } #endif /* VCOS_INLINE_BODIES */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_mem_from_malloc.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= Create the vcos_malloc API from the regular system malloc/free =============================================================================*/ /** * \file * * Create the vcos malloc API from a regular system malloc/free library. * * The API lets callers specify an alignment. * * Under VideoCore this is not needed, as we can simply use the rtos_malloc routines. * But on host platforms that won't be the case. * */ VCOSPRE_ void * VCOSPOST_ vcos_generic_mem_alloc(VCOS_UNSIGNED sz, const char *desc); VCOSPRE_ void * VCOSPOST_ vcos_generic_mem_calloc(VCOS_UNSIGNED count, VCOS_UNSIGNED sz, const char *descr); VCOSPRE_ void VCOSPOST_ vcos_generic_mem_free(void *ptr); VCOSPRE_ void * VCOSPOST_ vcos_generic_mem_alloc_aligned(VCOS_UNSIGNED sz, VCOS_UNSIGNED align, const char *desc); #ifdef VCOS_INLINE_BODIES VCOS_INLINE_IMPL void *vcos_malloc(VCOS_UNSIGNED size, const char *description) { return vcos_generic_mem_alloc(size, description); } VCOS_INLINE_IMPL void *vcos_calloc(VCOS_UNSIGNED num, VCOS_UNSIGNED size, const char *description) { return vcos_generic_mem_calloc(num, size, description); } VCOS_INLINE_IMPL void vcos_free(void *ptr) { vcos_generic_mem_free(ptr); } VCOS_INLINE_IMPL void * vcos_malloc_aligned(VCOS_UNSIGNED size, VCOS_UNSIGNED align, const char *description) { return vcos_generic_mem_alloc_aligned(size, align, description); } #endif /* VCOS_INLINE_BODIES */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_mutexes_are_reentrant.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - reentrant mutexes mapped directly to regular ones =============================================================================*/ #ifndef VCOS_GENERIC_REENTRANT_MUTEX_H #define VCOS_GENERIC_REENTRANT_MUTEX_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "interface/vcos/vcos_mutex.h" /** * \file * * Reentrant Mutexes directly using the native re-entrant mutex. * */ typedef VCOS_MUTEX_T VCOS_REENTRANT_MUTEX_T; /* Inline forwarding functions */ #if defined(VCOS_INLINE_BODIES) VCOS_INLINE_IMPL VCOS_STATUS_T vcos_reentrant_mutex_create(VCOS_REENTRANT_MUTEX_T *m, const char *name) { return vcos_mutex_create(m,name); } VCOS_INLINE_IMPL void vcos_reentrant_mutex_delete(VCOS_REENTRANT_MUTEX_T *m) { vcos_mutex_delete(m); } VCOS_INLINE_IMPL void vcos_reentrant_mutex_lock(VCOS_REENTRANT_MUTEX_T *m) { vcos_mutex_lock(m); } VCOS_INLINE_IMPL void vcos_reentrant_mutex_unlock(VCOS_REENTRANT_MUTEX_T *m) { vcos_mutex_unlock(m); } VCOS_INLINE_IMPL int vcos_reentrant_mutex_is_locked(VCOS_REENTRANT_MUTEX_T *m) { return vcos_mutex_is_locked(m); } #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/generic/vcos_thread_reaper.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - thread reaping =============================================================================*/ #ifndef VCOS_THREAD_REAPER_H #define VCOS_THREAD_REAPER_H #define VCOS_HAVE_THREAD_REAPER /** Initialise the thread reaper. */ VCOS_STATUS_T vcos_thread_reaper_init(void); /** Reap a thread. Arranges for the thread to be automatically * joined. * * @sa vcos_thread_join(). * * @param thread the thread to terminate * @param on_terminated called after the thread has exited * @param cxt pass back to the callback * */ void vcos_thread_reap(VCOS_THREAD_T *thread, void (*on_terminated)(void*), void *cxt); #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/pthreads/vcos_futex_mutex.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= FIXME: This code should be moved to 'linux', it is linux-specific and not generic on 'pthreads'. ============================================================================*/ #ifndef VCOS_MUTEX_FROM_FUTEX_H #define VCOS_MUTEX_FROM_FUTEX_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos_platform.h" typedef struct VCOS_FUTEX_T { volatile int value; } VCOS_FUTEX_T; typedef VCOS_FUTEX_T VCOS_MUTEX_T; VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_futex_init(VCOS_FUTEX_T *futex); VCOSPRE_ void VCOSPOST_ vcos_futex_delete(VCOS_FUTEX_T *futex); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_futex_lock(VCOS_FUTEX_T *futex); VCOSPRE_ void VCOSPOST_ vcos_futex_unlock(VCOS_FUTEX_T *futex); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_futex_trylock(VCOS_FUTEX_T *futex); #if defined(VCOS_INLINE_BODIES) VCOS_INLINE_IMPL VCOS_STATUS_T vcos_mutex_create(VCOS_MUTEX_T *latch, const char *name) { vcos_unused(name); return vcos_futex_init(latch); } VCOS_INLINE_IMPL void vcos_mutex_delete(VCOS_MUTEX_T *latch) { vcos_futex_delete(latch); } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_mutex_lock(VCOS_MUTEX_T *latch) { return vcos_futex_lock(latch); } VCOS_INLINE_IMPL void vcos_mutex_unlock(VCOS_MUTEX_T *latch) { vcos_futex_unlock(latch); } VCOS_INLINE_IMPL int vcos_mutex_is_locked(VCOS_MUTEX_T *latch) { int rc = latch->value; if (!rc) { /* it wasn't locked */ return 0; } else { return 1; /* it was locked */ } } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_mutex_trylock(VCOS_MUTEX_T *m) { return vcos_futex_trylock(m); } #endif /* VCOS_INLINE_BODIES */ #ifdef __cplusplus } #endif #endif /* VCOS_MUTEX_FROM_FUTEX_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/pthreads/vcos_platform.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - pthreads types =============================================================================*/ /* DO NOT include this file directly - instead include it via vcos.h */ /** @file * * Pthreads implementation of VCOS. * */ #ifndef VCOS_PLATFORM_H #define VCOS_PLATFORM_H #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define VCOS_HAVE_RTOS 1 #define VCOS_HAVE_SEMAPHORE 1 #define VCOS_HAVE_EVENT 1 #define VCOS_HAVE_QUEUE 0 #define VCOS_HAVE_LEGACY_ISR 0 #define VCOS_HAVE_TIMER 1 #define VCOS_HAVE_CANCELLATION_SAFE_TIMER 1 #define VCOS_HAVE_MEMPOOL 0 #define VCOS_HAVE_ISR 0 #define VCOS_HAVE_ATOMIC_FLAGS 1 #define VCOS_HAVE_THREAD_AT_EXIT 1 #define VCOS_HAVE_ONCE 1 #define VCOS_HAVE_BLOCK_POOL 1 #define VCOS_HAVE_FILE 0 #define VCOS_HAVE_PROC 0 #define VCOS_HAVE_CFG 0 #define VCOS_HAVE_ALIEN_THREADS 1 #define VCOS_HAVE_CMD 1 #define VCOS_HAVE_EVENT_FLAGS 1 #define VCOS_WANT_LOG_CMD 0 /* User apps should do their own thing */ #define VCOS_ALWAYS_WANT_LOGGING #ifdef __linux__ #define VCOS_HAVE_BACKTRACE 1 #endif #define VCOS_SO_EXT ".so" /* Linux/pthreads seems to have different timer characteristics */ #define VCOS_TIMER_MARGIN_EARLY 0 #define VCOS_TIMER_MARGIN_LATE 15 typedef sem_t VCOS_SEMAPHORE_T; typedef uint32_t VCOS_UNSIGNED; typedef uint32_t VCOS_OPTION; typedef pthread_key_t VCOS_TLS_KEY_T; typedef pthread_once_t VCOS_ONCE_T; typedef struct VCOS_LLTHREAD_T { pthread_t thread; // Must be first field. } VCOS_LLTHREAD_T; /* VCOS_CASSERT(offsetof(VCOS_LLTHREAD_T, thread) == 0); */ #ifndef VCOS_USE_VCOS_FUTEX typedef pthread_mutex_t VCOS_MUTEX_T; #else #include "vcos_futex_mutex.h" #endif /* VCOS_USE_VCOS_FUTEX */ typedef struct { VCOS_MUTEX_T mutex; sem_t sem; } VCOS_EVENT_T; #define VCOS_ONCE_INIT PTHREAD_ONCE_INIT typedef struct VCOS_TIMER_T { pthread_t thread; /**< id of the timer thread */ pthread_mutex_t lock; /**< lock protecting all other members of the struct */ pthread_cond_t settings_changed; /**< cond. var. for informing the timer thread about changes*/ int quit; /**< non-zero if the timer thread is requested to quit*/ struct timespec expires; /**< absolute time of next expiration, or 0 if disarmed*/ void (*orig_expiration_routine)(void*);/**< the expiration routine provided by the user of the timer*/ void *orig_context; /**< the context for exp. routine provided by the user*/ } VCOS_TIMER_T; /** Thread attribute structure. Don't use pthread_attr directly, as * the calls can fail, and inits must match deletes. */ typedef struct VCOS_THREAD_ATTR_T { void *ta_stackaddr; VCOS_UNSIGNED ta_stacksz; VCOS_UNSIGNED ta_priority; VCOS_UNSIGNED ta_affinity; VCOS_UNSIGNED ta_timeslice; VCOS_UNSIGNED legacy; } VCOS_THREAD_ATTR_T; /** Called at thread exit. */ typedef struct VCOS_THREAD_EXIT_T { void (*pfn)(void *); void *cxt; } VCOS_THREAD_EXIT_T; #define VCOS_MAX_EXIT_HANDLERS 4 typedef struct VCOS_THREAD_T { pthread_t thread; /**< The thread itself */ VCOS_THREAD_ENTRY_FN_T entry; /**< The thread entry point */ void *arg; /**< The argument to be passed to entry */ VCOS_SEMAPHORE_T suspend; /**< For support event groups and similar - a per thread semaphore */ VCOS_TIMER_T task_timer; int task_timer_created; /**< non-zero if the task timer has already been created*/ void (*orig_task_timer_expiration_routine)(void*); void *orig_task_timer_context; VCOS_UNSIGNED legacy; char name[16]; /**< Record the name of this thread, for diagnostics */ VCOS_UNSIGNED dummy; /**< Dummy thread created for non-vcos created threads */ /** Callback invoked at thread exit time */ VCOS_THREAD_EXIT_T at_exit[VCOS_MAX_EXIT_HANDLERS]; } VCOS_THREAD_T; #ifdef VCOS_PTHREADS_WANT_HISR_EMULATION typedef struct { VCOS_THREAD_T thread; char stack[1024]; VCOS_SEMAPHORE_T waitsem; } VCOS_HISR_T; #endif #define VCOS_SUSPEND -1 #define VCOS_NO_SUSPEND 0 #define VCOS_START 1 #define VCOS_NO_START 0 #define VCOS_THREAD_PRI_MIN (sched_get_priority_min(SCHED_OTHER)) #define VCOS_THREAD_PRI_MAX (sched_get_priority_max(SCHED_OTHER)) #define VCOS_THREAD_PRI_INCREASE (1) #define VCOS_THREAD_PRI_HIGHEST VCOS_THREAD_PRI_MAX #define VCOS_THREAD_PRI_LOWEST VCOS_THREAD_PRI_MIN #define VCOS_THREAD_PRI_NORMAL ((VCOS_THREAD_PRI_MAX+VCOS_THREAD_PRI_MIN)/2) #define VCOS_THREAD_PRI_BELOW_NORMAL (VCOS_THREAD_PRI_NORMAL-VCOS_THREAD_PRI_INCREASE) #define VCOS_THREAD_PRI_ABOVE_NORMAL (VCOS_THREAD_PRI_NORMAL+VCOS_THREAD_PRI_INCREASE) #define VCOS_THREAD_PRI_REALTIME VCOS_THREAD_PRI_MAX #define _VCOS_AFFINITY_DEFAULT 0 #define _VCOS_AFFINITY_CPU0 0x100 #define _VCOS_AFFINITY_CPU1 0x200 #define _VCOS_AFFINITY_MASK 0x300 #define VCOS_CAN_SET_STACK_ADDR 0 #define VCOS_TICKS_PER_SECOND _vcos_get_ticks_per_second() #include "interface/vcos/generic/vcos_generic_event_flags.h" #include "interface/vcos/generic/vcos_generic_blockpool.h" #include "interface/vcos/generic/vcos_mem_from_malloc.h" /** Convert errno values into the values recognized by vcos */ VCOSPRE_ VCOS_STATUS_T vcos_pthreads_map_error(int error); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_pthreads_map_errno(void); /** Register a function to be called when the current thread exits. */ extern VCOS_STATUS_T vcos_thread_at_exit(void (*pfn)(void*), void *cxt); extern uint32_t _vcos_get_ticks_per_second(void); /** * Set to 1 by default when ANDROID is defined. Allows runtime * switching for console apps. */ extern int vcos_use_android_log; typedef struct { VCOS_MUTEX_T mutex; uint32_t flags; } VCOS_ATOMIC_FLAGS_T; #if defined(VCOS_INLINE_BODIES) #undef VCOS_ASSERT_LOGGING_DISABLE #define VCOS_ASSERT_LOGGING_DISABLE 1 /* * Counted Semaphores */ VCOS_INLINE_IMPL VCOS_STATUS_T vcos_semaphore_wait(VCOS_SEMAPHORE_T *sem) { int ret; /* gdb causes sem_wait() to EINTR when a breakpoint is hit, retry here */ while ((ret = sem_wait(sem)) == -1 && errno == EINTR) continue; vcos_assert(ret==0); return VCOS_SUCCESS; } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_semaphore_trywait(VCOS_SEMAPHORE_T *sem) { int ret; while ((ret = sem_trywait(sem)) == -1 && errno == EINTR) continue; if (ret == 0) return VCOS_SUCCESS; else if (errno == EAGAIN) return VCOS_EAGAIN; else { vcos_assert(0); return VCOS_EINVAL; } } /** * \brief Wait on a semaphore with a timeout. * * Note that this function may not be implemented on all * platforms, and may not be efficient on all platforms * (see comment in vcos_semaphore_wait) * * Try to obtain the semaphore. If it is already taken, return * VCOS_EAGAIN. * @param sem Semaphore to wait on * @param timeout Number of milliseconds to wait before * returning if the semaphore can't be acquired. * @return VCOS_SUCCESS - semaphore was taken. * VCOS_EAGAIN - could not take semaphore (i.e. timeout * expired) * VCOS_EINVAL - Some other error (most likely bad * parameters). */ VCOS_INLINE_IMPL VCOS_STATUS_T vcos_semaphore_wait_timeout(VCOS_SEMAPHORE_T *sem, VCOS_UNSIGNED timeout) { struct timespec ts; int ret; if (clock_gettime(CLOCK_REALTIME, &ts) == -1) return VCOS_EINVAL; ts.tv_sec += timeout/1000; ts.tv_nsec += (timeout%1000)*1000*1000; if (ts.tv_nsec > 1000000000) { ts.tv_sec++; ts.tv_nsec -= 1000000000; } while (1) { ret = sem_timedwait( sem, &ts ); if (ret == 0) { return VCOS_SUCCESS; } else { if (errno == EINTR) { continue; } else if (errno == ETIMEDOUT) { return VCOS_EAGAIN; } else { vcos_assert(0); return VCOS_EINVAL; } } } } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_semaphore_create(VCOS_SEMAPHORE_T *sem, const char *name, VCOS_UNSIGNED initial_count) { int rc = sem_init(sem, 0, initial_count); (void)name; if (rc != -1) return VCOS_SUCCESS; else return vcos_pthreads_map_errno(); } VCOS_INLINE_IMPL void vcos_semaphore_delete(VCOS_SEMAPHORE_T *sem) { int rc = sem_destroy(sem); vcos_assert(rc != -1); (void)rc; } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_semaphore_post(VCOS_SEMAPHORE_T *sem) { int rc = sem_post(sem); vcos_assert(rc == 0); (void)rc; return VCOS_SUCCESS; } /*********************************************************** * * Threads * ***********************************************************/ extern VCOS_THREAD_T *vcos_dummy_thread_create(void); extern pthread_key_t _vcos_thread_current_key; extern uint64_t vcos_getmicrosecs64_internal(void); VCOS_INLINE_IMPL uint32_t vcos_getmicrosecs(void) { return (uint32_t)vcos_getmicrosecs64_internal(); } VCOS_INLINE_IMPL uint64_t vcos_getmicrosecs64(void) { return vcos_getmicrosecs64_internal(); } VCOS_INLINE_IMPL VCOS_THREAD_T *vcos_thread_current(void) { void *ret = pthread_getspecific(_vcos_thread_current_key); if (ret == NULL) { ret = vcos_dummy_thread_create(); } #ifdef __cplusplus return static_cast(ret); #else return (VCOS_THREAD_T *)ret; #endif } VCOS_INLINE_IMPL void vcos_sleep(uint32_t ms) { struct timespec ts; ts.tv_sec = ms/1000; ts.tv_nsec = ms % 1000 * (1000000); nanosleep(&ts, NULL); } VCOS_INLINE_IMPL void vcos_thread_attr_setstack(VCOS_THREAD_ATTR_T *attr, void *addr, VCOS_UNSIGNED sz) { attr->ta_stackaddr = addr; attr->ta_stacksz = sz; } VCOS_INLINE_IMPL void vcos_thread_attr_setstacksize(VCOS_THREAD_ATTR_T *attr, VCOS_UNSIGNED sz) { attr->ta_stacksz = sz; } VCOS_INLINE_IMPL void vcos_thread_attr_setpriority(VCOS_THREAD_ATTR_T *attr, VCOS_UNSIGNED pri) { (void)attr; (void)pri; } VCOS_INLINE_IMPL void vcos_thread_set_priority(VCOS_THREAD_T *thread, VCOS_UNSIGNED p) { /* not implemented */ (void)thread; (void)p; } VCOS_INLINE_IMPL VCOS_UNSIGNED vcos_thread_get_priority(VCOS_THREAD_T *thread) { /* not implemented */ (void)thread; return 0; } VCOS_INLINE_IMPL void vcos_thread_set_affinity(VCOS_THREAD_T *thread, VCOS_UNSIGNED affinity) { /* not implemented */ vcos_unused(thread); vcos_unused(affinity); } VCOS_INLINE_IMPL void vcos_thread_attr_setaffinity(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED affinity) { attrs->ta_affinity = affinity; } VCOS_INLINE_IMPL void vcos_thread_attr_settimeslice(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED ts) { attrs->ta_timeslice = ts; } VCOS_INLINE_IMPL void _vcos_thread_attr_setlegacyapi(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED legacy) { attrs->legacy = legacy; } VCOS_INLINE_IMPL void vcos_thread_attr_setautostart(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED autostart) { (void)attrs; (void)autostart; } VCOS_INLINE_IMPL VCOS_LLTHREAD_T *vcos_llthread_current(void) { return (VCOS_LLTHREAD_T *)pthread_self(); } VCOS_INLINE_IMPL VCOS_UNSIGNED vcos_thread_get_affinity(VCOS_THREAD_T *thread) { vcos_unused(thread); return _VCOS_AFFINITY_CPU0; } VCOS_INLINE_IMPL int vcos_thread_running(VCOS_THREAD_T *thread) { vcos_unused(thread); /* Not applicable to pthreads */ return 0; } VCOS_INLINE_IMPL VCOS_UNSIGNED vcos_change_preemption(VCOS_UNSIGNED pe) { vcos_unused(pe); /* Nothing to do */ return 0; } VCOS_INLINE_IMPL void vcos_thread_relinquish(void) { /* Nothing to do */ } VCOS_INLINE_IMPL void vcos_thread_resume(VCOS_THREAD_T *thread) { vcos_unused(thread); /* Nothing to do */ } /* * Mutexes */ #ifndef VCOS_USE_VCOS_FUTEX VCOS_INLINE_IMPL VCOS_STATUS_T vcos_mutex_create(VCOS_MUTEX_T *latch, const char *name) { int rc = pthread_mutex_init(latch, NULL); (void)name; if (rc == 0) return VCOS_SUCCESS; else return vcos_pthreads_map_errno(); } VCOS_INLINE_IMPL void vcos_mutex_delete(VCOS_MUTEX_T *latch) { int rc = pthread_mutex_destroy(latch); (void)rc; vcos_assert(rc==0); } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_mutex_lock(VCOS_MUTEX_T *latch) { int rc = pthread_mutex_lock(latch); vcos_assert(rc==0); (void)rc; return VCOS_SUCCESS; } VCOS_INLINE_IMPL void vcos_mutex_unlock(VCOS_MUTEX_T *latch) { int rc = pthread_mutex_unlock(latch); (void)rc; vcos_assert(rc==0); } VCOS_INLINE_IMPL int vcos_mutex_is_locked(VCOS_MUTEX_T *m) { int rc = pthread_mutex_trylock(m); if (rc == 0) { pthread_mutex_unlock(m); /* it wasn't locked */ return 0; } else { return 1; /* it was locked */ } } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_mutex_trylock(VCOS_MUTEX_T *m) { int rc = pthread_mutex_trylock(m); (void)rc; return (rc == 0) ? VCOS_SUCCESS : VCOS_EAGAIN; } #endif /* VCOS_USE_VCOS_FUTEX */ /* * Events */ VCOS_INLINE_IMPL VCOS_STATUS_T vcos_event_create(VCOS_EVENT_T *event, const char *debug_name) { VCOS_STATUS_T status; int rc = sem_init(&event->sem, 0, 0); if (rc != 0) return vcos_pthreads_map_errno(); status = vcos_mutex_create(&event->mutex, debug_name); if (status != VCOS_SUCCESS) { sem_destroy(&event->sem); return status; } return VCOS_SUCCESS; } VCOS_INLINE_IMPL void vcos_event_signal(VCOS_EVENT_T *event) { int ok = 0; int value; if (vcos_mutex_lock(&event->mutex) != VCOS_SUCCESS) goto fail_mtx; if (sem_getvalue(&event->sem, &value) != 0) goto fail_sem; if (value == 0) if (sem_post(&event->sem) != 0) goto fail_sem; ok = 1; fail_sem: vcos_mutex_unlock(&event->mutex); fail_mtx: if (!ok) vcos_assert(ok); } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_event_wait(VCOS_EVENT_T *event) { int ret; /* gdb causes sem_wait() to EINTR when a breakpoint is hit, retry here */ while ((ret = sem_wait(&event->sem)) == -1 && errno == EINTR) continue; vcos_assert(ret==0); return ret == 0 ? VCOS_SUCCESS : (VCOS_STATUS_T)errno; } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_event_try(VCOS_EVENT_T *event) { int ret; while ((ret = sem_trywait(&event->sem)) == -1 && errno == EINTR) continue; if (ret == -1 && errno == EAGAIN) return VCOS_EAGAIN; else return VCOS_SUCCESS; } VCOS_INLINE_IMPL void vcos_event_delete(VCOS_EVENT_T *event) { int rc = sem_destroy(&event->sem); vcos_assert(rc != -1); (void)rc; vcos_mutex_delete(&event->mutex); } VCOS_INLINE_IMPL VCOS_UNSIGNED vcos_process_id_current(void) { return (VCOS_UNSIGNED) getpid(); } VCOS_INLINE_IMPL int vcos_strcasecmp(const char *s1, const char *s2) { return strcasecmp(s1,s2); } VCOS_INLINE_IMPL int vcos_strncasecmp(const char *s1, const char *s2, size_t n) { return strncasecmp(s1,s2,n); } VCOS_INLINE_IMPL int vcos_in_interrupt(void) { return 0; } /* For support event groups - per thread semaphore */ VCOS_INLINE_IMPL void _vcos_thread_sem_wait(void) { VCOS_THREAD_T *t = vcos_thread_current(); vcos_semaphore_wait(&t->suspend); } VCOS_INLINE_IMPL void _vcos_thread_sem_post(VCOS_THREAD_T *target) { vcos_semaphore_post(&target->suspend); } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_tls_create(VCOS_TLS_KEY_T *key) { int st = pthread_key_create(key, NULL); return st == 0 ? VCOS_SUCCESS: VCOS_ENOMEM; } VCOS_INLINE_IMPL void vcos_tls_delete(VCOS_TLS_KEY_T tls) { pthread_key_delete(tls); } VCOS_INLINE_IMPL VCOS_STATUS_T vcos_tls_set(VCOS_TLS_KEY_T tls, void *v) { pthread_setspecific(tls, v); return VCOS_SUCCESS; } VCOS_INLINE_IMPL void *vcos_tls_get(VCOS_TLS_KEY_T tls) { return pthread_getspecific(tls); } /*********************************************************** * * Timers * ***********************************************************/ //Other platforms can call compatible OS implementations directly //from inline functions with minimal overhead. //Pthreads needs a little bit more, so call functions //in vcos_pthreads.c from the inline functions. VCOS_STATUS_T vcos_pthreads_timer_create(VCOS_TIMER_T *timer, const char *name, void (*expiration_routine)(void *context), void *context); void vcos_pthreads_timer_set(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay_ms); void vcos_pthreads_timer_cancel(VCOS_TIMER_T *timer); void vcos_pthreads_timer_reset(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay_ms); void vcos_pthreads_timer_delete(VCOS_TIMER_T *timer); /** Create a timer. * * Note that we just cast the expiry function - this assumes that UNSIGNED * and VOID* are the same size. */ VCOS_INLINE_IMPL VCOS_STATUS_T vcos_timer_create(VCOS_TIMER_T *timer, const char *name, void (*expiration_routine)(void *context), void *context) { return vcos_pthreads_timer_create(timer, name, expiration_routine, context); } VCOS_INLINE_IMPL void vcos_timer_set(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay_ms) { return vcos_pthreads_timer_set(timer, delay_ms); } VCOS_INLINE_IMPL void vcos_timer_cancel(VCOS_TIMER_T *timer) { return vcos_pthreads_timer_cancel(timer); } VCOS_INLINE_IMPL void vcos_timer_reset(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay) { vcos_timer_set(timer, delay); } VCOS_INLINE_IMPL void vcos_timer_delete(VCOS_TIMER_T *timer) { vcos_pthreads_timer_delete(timer); } #if VCOS_HAVE_ATOMIC_FLAGS /* * Atomic flags */ /* TODO implement properly... */ VCOS_INLINE_IMPL VCOS_STATUS_T vcos_atomic_flags_create(VCOS_ATOMIC_FLAGS_T *atomic_flags) { atomic_flags->flags = 0; return vcos_mutex_create(&atomic_flags->mutex, "VCOS_ATOMIC_FLAGS_T"); } VCOS_INLINE_IMPL void vcos_atomic_flags_or(VCOS_ATOMIC_FLAGS_T *atomic_flags, uint32_t flags) { vcos_mutex_lock(&atomic_flags->mutex); atomic_flags->flags |= flags; vcos_mutex_unlock(&atomic_flags->mutex); } VCOS_INLINE_IMPL uint32_t vcos_atomic_flags_get_and_clear(VCOS_ATOMIC_FLAGS_T *atomic_flags) { uint32_t flags; vcos_mutex_lock(&atomic_flags->mutex); flags = atomic_flags->flags; atomic_flags->flags = 0; vcos_mutex_unlock(&atomic_flags->mutex); return flags; } VCOS_INLINE_IMPL void vcos_atomic_flags_delete(VCOS_ATOMIC_FLAGS_T *atomic_flags) { vcos_mutex_delete(&atomic_flags->mutex); } #endif #if defined(linux) || defined(_HAVE_SBRK) /* Returns invalid result, do not use */ VCOS_INLINE_IMPL unsigned long VCOS_DEPRECATED("returns invalid result") vcos_get_free_mem(void) { return 0; } #endif #ifdef VCOS_PTHREADS_WANT_HISR_EMULATION VCOS_STATUS_T vcos_legacy_hisr_create(VCOS_HISR_T *hisr, const char *name, void (*entry)(void), VCOS_UNSIGNED pri, void *stack, VCOS_UNSIGNED stack_size); void vcos_legacy_hisr_activate(VCOS_HISR_T *hisr); void vcos_legacy_hisr_delete(VCOS_HISR_T *hisr); #endif #undef VCOS_ASSERT_LOGGING_DISABLE #define VCOS_ASSERT_LOGGING_DISABLE 0 #endif /* VCOS_INLINE_BODIES */ #define vcos_log_platform_init() _vcos_log_platform_init() VCOSPRE_ void VCOSPOST_ _vcos_log_platform_init(void); VCOS_INLINE_DECL void _vcos_thread_sem_wait(void); VCOS_INLINE_DECL void _vcos_thread_sem_post(VCOS_THREAD_T *); #define VCOS_APPLICATION_ARGC vcos_get_argc() #define VCOS_APPLICATION_ARGV vcos_get_argv() #include "interface/vcos/generic/vcos_generic_reentrant_mtx.h" #include "interface/vcos/generic/vcos_generic_named_sem.h" #include "interface/vcos/generic/vcos_generic_quickslow_mutex.h" #include "interface/vcos/generic/vcos_common.h" #define _VCOS_LOG_LEVEL() getenv("VC_LOGLEVEL") VCOS_STATIC_INLINE char *vcos_strdup(const char *str) { size_t len = strlen(str) + 1; void *p = malloc(len); if (p == NULL) return NULL; return (char *)memcpy(p, str, len); } typedef void (*VCOS_ISR_HANDLER_T)(VCOS_UNSIGNED vecnum); #define VCOS_DL_LAZY RTLD_LAZY #define VCOS_DL_NOW RTLD_NOW #define VCOS_DL_LOCAL RTLD_LOCAL #define VCOS_DL_GLOBAL RTLD_GLOBAL #ifdef __cplusplus } #endif #endif /* VCOS_PLATFORM_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/pthreads/vcos_platform_types.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - platform-specific types and defines =============================================================================*/ #ifndef VCOS_PLATFORM_TYPES_H #define VCOS_PLATFORM_TYPES_H #include "interface/vcos/vcos_inttypes.h" #ifdef __cplusplus extern "C" { #endif #define VCOSPRE_ extern #define VCOSPOST_ #if defined(__GNUC__) && (( __GNUC__ > 2 ) || (( __GNUC__ == 2 ) && ( __GNUC_MINOR__ >= 3 ))) #define VCOS_FORMAT_ATTR_(ARCHETYPE, STRING_INDEX, FIRST_TO_CHECK) __attribute__ ((format (ARCHETYPE, STRING_INDEX, FIRST_TO_CHECK))) #else #define VCOS_FORMAT_ATTR_(ARCHETYPE, STRING_INDEX, FIRST_TO_CHECK) #endif #if defined(__linux__) && !defined(NDEBUG) && defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #define VCOS_BKPT ({ __asm volatile ("int3":::"memory"); }) #endif /*#define VCOS_BKPT vcos_abort() */ #define VCOS_ASSERT_LOGGING 1 #define VCOS_ASSERT_LOGGING_DISABLE 0 extern void vcos_pthreads_logging_assert(const char *file, const char *func, unsigned int line, const char *fmt, ...); #define VCOS_ASSERT_MSG(...) ((VCOS_ASSERT_LOGGING && !VCOS_ASSERT_LOGGING_DISABLE) ? vcos_pthreads_logging_assert(__FILE__, __func__, __LINE__, __VA_ARGS__) : (void)0) #define VCOS_INLINE_BODIES #define VCOS_INLINE_DECL extern __inline__ #define VCOS_INLINE_IMPL static __inline__ #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/user_nodefs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef USER_NODEFS_H #define USER_NODEFS_H /* * This tells coverity not to expand the assert macro, so it still sees the * asserts in the code, even in release builds (we currently run coverity on * our release builds). Unfortunately MetaWare won't compile it, even though * __COVERITY__ isn't defined, so we put this in its own header. * * FIXME: This belongs in the Coverity config (in a file called * config/user_nodefs.h) */ #nodef assert /* * So we need to declare the function now that it isn't a macro any more. It's * already built into coverity that assert is a "killpath". */ extern void assert(int cond); #endif /* USER_NODEFS_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - public header file =============================================================================*/ /** * \mainpage OS Abstraction Layer * * \section intro Introduction * * This abstraction layer is here to allow the underlying OS to be easily changed (e.g. from * Nucleus to ThreadX) and to aid in porting host applications to new targets. * * \subsection error Error handling * * Wherever possible, VCOS functions assert internally and return void. The only exceptions * are creation functions (which might fail due to lack of resources) and functions that * might timeout or fail due to lack of space. Errors that might be reported by the underlying * OS API (e.g. invalid mutex) are treated as a programming error, and are merely asserted on. * * \section thread_synch Threads and synchronisation * * \subsection thread Threads * * The thread API is somewhat different to that found in Nucleus. In particular, threads * cannot just be destroyed at arbitrary times and nor can they merely exit. This is so * that the same API can be implemented across all interesting platforms without too much * difficulty. See vcos_thread.h for details. Thread attributes are configured via * the VCOS_THREAD_ATTR_T structure, found in vcos_thread_attr.h. * * \subsection sema Semaphores * * Counted semaphores (c.f. Nucleus NU_SEMAPHORE) are created with VCOS_SEMAPHORE_T. * Under ThreadX on VideoCore, semaphores are implemented using VideoCore spinlocks, and * so are quite a lot faster than ordinary ThreadX semaphores. See vcos_semaphore.h. * * \subsection mtx Mutexes * * Mutexes are used for locking. Attempts to take a mutex twice, or to unlock it * in a different thread to the one in which it was locked should be expected to fail. * Mutexes are not re-entrant (see vcos_reentrant_mutex.h for a slightly slower * re-entrant mutex). * * \subsection evflags Event flags * * Event flags (the ThreadX name - also known as event groups under Nucleus) provide * 32 flags which can be waited on by multiple clients, and signalled by multiple clients. * A timeout can be specified. See vcos_event_flags.h. An alternative to this is the * VCOS_EVENT_T (see vcos_event.h) which is akin to the Win32 auto-reset event, or a * saturating counted semaphore. * * \subsection event Events * * A VCOS_EVENT_T is a bit like a saturating semaphore. No matter how many times it * is signalled, the waiter will only wake up once. See vcos_event.h. You might think this * is useful if you suspect that the cost of reading the semaphore count (perhaps via a * system call) is expensive on your platform. * * \subsection tls Thread local storage * * Thread local storage is supported using vcos_tls.h. This is emulated on Nucleus * and ThreadX. * * \section int Interrupts * * The legacy LISR/HISR scheme found in Nucleus is supported via the legacy ISR API, * which is also supported on ThreadX. New code should avoid this, and old code should * be migrated away from it, since it is slow. See vcos_legacy_isr.h. * * Registering an interrupt handler, and disabling/restoring interrupts, is handled * using the functions in vcos_isr.h. * */ /** * \file vcos.h * * This is the top level header file. Clients include this. It pulls in the platform-specific * header file (vcos_platform.h) together with header files defining the expected APIs, such * as vcos_mutex.h, vcos_semaphore.h, etc. It is also possible to include these header files * directly. * */ #ifndef VCOS_H #define VCOS_H #include "interface/vcos/vcos_assert.h" #include "vcos_types.h" #if defined(__unix__) && !defined(__ANDROID__) #include "interface/vcos/pthreads/vcos_platform.h" #else #include "vcos_platform.h" #endif #ifndef VCOS_INIT_H #include "interface/vcos/vcos_init.h" #endif #ifndef VCOS_SEMAPHORE_H #include "interface/vcos/vcos_semaphore.h" #endif #ifndef VCOS_THREAD_H #include "interface/vcos/vcos_thread.h" #endif #ifndef VCOS_MUTEX_H #include "interface/vcos/vcos_mutex.h" #endif #ifndef VCOS_MEM_H #include "interface/vcos/vcos_mem.h" #endif #ifndef VCOS_LOGGING_H #include "interface/vcos/vcos_logging.h" #endif #ifndef VCOS_STRING_H #include "interface/vcos/vcos_string.h" #endif #ifndef VCOS_EVENT_H #include "interface/vcos/vcos_event.h" #endif #ifndef VCOS_THREAD_ATTR_H #include "interface/vcos/vcos_thread_attr.h" #endif #ifndef VCOS_TLS_H #include "interface/vcos/vcos_tls.h" #endif #ifndef VCOS_REENTRANT_MUTEX_H #include "interface/vcos/vcos_reentrant_mutex.h" #endif #ifndef VCOS_NAMED_SEMAPHORE_H #include "interface/vcos/vcos_named_semaphore.h" #endif #ifndef VCOS_QUICKSLOW_MUTEX_H #include "interface/vcos/vcos_quickslow_mutex.h" #endif /* Headers with predicates */ #if VCOS_HAVE_EVENT_FLAGS #include "interface/vcos/vcos_event_flags.h" #endif #if VCOS_HAVE_QUEUE #include "interface/vcos/vcos_queue.h" #endif #if VCOS_HAVE_LEGACY_ISR #include "interface/vcos/vcos_legacy_isr.h" #endif #if VCOS_HAVE_TIMER #include "interface/vcos/vcos_timer.h" #endif #if VCOS_HAVE_MEMPOOL #include "interface/vcos/vcos_mempool.h" #endif #if VCOS_HAVE_ISR #include "interface/vcos/vcos_isr.h" #endif #if VCOS_HAVE_ATOMIC_FLAGS #include "interface/vcos/vcos_atomic_flags.h" #endif #if VCOS_HAVE_ONCE #include "interface/vcos/vcos_once.h" #endif #if VCOS_HAVE_BLOCK_POOL #include "interface/vcos/vcos_blockpool.h" #endif #if VCOS_HAVE_FILE #include "interface/vcos/vcos_file.h" #endif #if VCOS_HAVE_CFG #include "interface/vcos/vcos_cfg.h" #endif #if VCOS_HAVE_CMD #include "interface/vcos/vcos_cmd.h" #endif #endif /* VCOS_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_assert.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - Assertion and error-handling macros. =============================================================================*/ #ifndef VCOS_ASSERT_H #define VCOS_ASSERT_H /* * Macro: * vcos_assert(cond) * vcos_assert_msg(cond, fmt, ...) * Use: * Detecting programming errors by ensuring that assumptions are correct. * On failure: * Performs a platform-dependent "breakpoint", usually with an assert-style * message. The '_msg' variant expects a printf-style format string and * parameters. * If a failure is detected, the code should be fixed and rebuilt. * In release builds: * Generates no code, i.e. does not evaluate 'cond'. * Returns: * Nothing. * * Macro: * vcos_demand(cond) * vcos_demand_msg(cond, fmt, ...) * Use: * Detecting fatal system errors that require a reboot. * On failure: * Performs a platform-dependent "breakpoint", usually with an assert-style * message, then calls vcos_abort (see below). * In release builds: * Calls vcos_abort() if 'cond' is false. * Returns: * Nothing (never, on failure). * * Macro: * vcos_verify(cond) * vcos_verify_msg(cond, fmt, ...) * Use: * Detecting run-time errors and interesting conditions, normally within an * 'if' statement to catch the failures, i.e. * if (!vcos_verify(cond)) handle_error(); * On failure: * Generates a message and optionally stops at a platform-dependent * "breakpoint" (usually disabled). See vcos_verify_bkpts_enable below. * In release builds: * Just evaluates and returns 'cond'. * Returns: * Non-zero if 'cond' is true, otherwise zero. * * Macro: * vcos_static_assert(cond) * Use: * Detecting compile-time errors. * On failure: * Generates a compiler error. * In release builds: * Generates a compiler error. * * Function: * void vcos_abort(void) * Use: * Invokes the fatal error handling mechanism, alerting the host where * applicable. * Returns: * Never. * * Macro: * VCOS_VERIFY_BKPTS * Use: * Define in a module (before including vcos.h) to specify an alternative * flag to control breakpoints on vcos_verify() failures. * Returns: * Non-zero values enable breakpoints. * * Function: * int vcos_verify_bkpts_enable(int enable); * Use: * Sets the global flag controlling breakpoints on vcos_verify failures, * enabling the breakpoints iff 'enable' is non-zero. * Returns: * The previous state of the flag. * * Function: * int vcos_verify_bkpts_enabled(void); * Use: * Queries the state of the global flag enabling breakpoints on vcos_verify * failures. * Returns: * The current state of the flag. * * Examples: * * int my_breakpoint_enable_flag = 1; * * #define VCOS_VERIFY_BKPTS my_breakpoint_enable_flag * * #include "interface/vcos/vcos.h" * * vcos_static_assert((sizeof(object) % 32) == 0); * * // ... * * vcos_assert_msg(postcondition_is_true, "Coding error"); * * if (!vcos_verify_msg(buf, "Buffer allocation failed (%d bytes)", size)) * { * // Tidy up * // ... * return OUT_OF_MEMORY; * } * * vcos_demand(*p++==GUARDWORDHEAP); */ #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #ifdef __COVERITY__ #include "interface/vcos/user_nodefs.h" extern void __coverity_panic__(void); #undef VCOS_ASSERT_BKPT #define VCOS_ASSERT_BKPT __coverity_panic__() #endif /* * ANDROID should NOT be defined for files built for Videocore, but currently it * is. FIXME When that's fixed, remove the __VIDEOCORE__ band-aid. */ #if (defined(ANDROID) && !defined(__VIDEOCORE__)) # include "assert.h" # define vcos_assert assert #endif #ifndef VCOS_VERIFY_BKPTS #define VCOS_VERIFY_BKPTS vcos_verify_bkpts_enabled() #endif #ifndef VCOS_BKPT #if defined(__VIDEOCORE__) && !defined(VCOS_ASSERT_NO_BKPTS) #define VCOS_BKPT _bkpt() #else #define VCOS_BKPT (void )0 #endif #endif #ifndef VCOS_ASSERT_BKPT #define VCOS_ASSERT_BKPT VCOS_BKPT #endif #ifndef VCOS_VERIFY_BKPT #define VCOS_VERIFY_BKPT (VCOS_VERIFY_BKPTS ? VCOS_BKPT : (void)0) #endif VCOSPRE_ int VCOSPOST_ vcos_verify_bkpts_enabled(void); VCOSPRE_ int VCOSPOST_ vcos_verify_bkpts_enable(int enable); VCOSPRE_ void VCOSPOST_ vcos_abort(void); #ifndef VCOS_ASSERT_MSG #ifdef LOGGING extern void logging_assert(const char *file, const char *func, int line, const char *format, ...); extern void logging_assert_dump(void); #define VCOS_ASSERT_MSG(...) ((VCOS_ASSERT_LOGGING && !VCOS_ASSERT_LOGGING_DISABLE) ? logging_assert_dump(), logging_assert(__FILE__, __func__, __LINE__, __VA_ARGS__) : (void)0) #else #define VCOS_ASSERT_MSG(...) ((void)0) #endif #endif #ifndef VCOS_VERIFY_MSG #define VCOS_VERIFY_MSG(...) VCOS_ASSERT_MSG(__VA_ARGS__) #endif #ifndef VCOS_ASSERT_LOGGING #define VCOS_ASSERT_LOGGING 0 #endif #ifndef VCOS_ASSERT_LOGGING_DISABLE #define VCOS_ASSERT_LOGGING_DISABLE 0 #endif #if !defined(NDEBUG) || defined(VCOS_RELEASE_ASSERTS) #define VCOS_ASSERT_ENABLED 1 #define VCOS_VERIFY_ENABLED 1 #else #define VCOS_ASSERT_ENABLED 0 #define VCOS_VERIFY_ENABLED 0 #endif #define VCOS_DEMAND_ENABLED 1 #if VCOS_ASSERT_ENABLED #ifndef vcos_assert #define vcos_assert(cond) \ ( (cond) ? (void)0 : (VCOS_ASSERT_BKPT, VCOS_ASSERT_MSG("%s", #cond)) ) #endif #ifndef vcos_assert_msg #define vcos_assert_msg(cond, ...) \ ( (cond) ? (void)0 : (VCOS_ASSERT_BKPT, VCOS_ASSERT_MSG(__VA_ARGS__)) ) #endif #else /* VCOS_ASSERT_ENABLED */ #ifndef vcos_assert #define vcos_assert(cond) (void)0 #endif #ifndef vcos_assert_msg #define vcos_assert_msg(cond, ...) (void)0 #endif #endif /* VCOS_ASSERT_ENABLED */ #if VCOS_DEMAND_ENABLED #ifndef vcos_demand #define vcos_demand(cond) \ ( (cond) ? (void)0 : (VCOS_ASSERT_BKPT, VCOS_ASSERT_MSG("%s", #cond), vcos_abort()) ) #endif #ifndef vcos_demand_msg #define vcos_demand_msg(cond, ...) \ ( (cond) ? (void)0 : (VCOS_ASSERT_BKPT, VCOS_ASSERT_MSG(__VA_ARGS__), vcos_abort()) ) #endif #else /* VCOS_DEMAND_ENABLED */ #ifndef vcos_demand #define vcos_demand(cond) \ ( (cond) ? (void)0 : vcos_abort() ) #endif #ifndef vcos_demand_msg #define vcos_demand_msg(cond, ...) \ ( (cond) ? (void)0 : vcos_abort() ) #endif #endif /* VCOS_DEMAND_ENABLED */ #if VCOS_VERIFY_ENABLED #ifndef vcos_verify #define vcos_verify(cond) \ ( (cond) ? 1 : (VCOS_VERIFY_MSG("%s", #cond), VCOS_VERIFY_BKPT, 0) ) #endif #ifndef vcos_verify_msg #define vcos_verify_msg(cond, ...) \ ( (cond) ? 1 : (VCOS_VERIFY_MSG(__VA_ARGS__), VCOS_VERIFY_BKPT, 0) ) #endif #else /* VCOS_VERIFY_ENABLED */ #ifndef vcos_verify #define vcos_verify(cond) (cond) #endif #ifndef vcos_verify_msg #define vcos_verify_msg(cond, ...) (cond) #endif #endif /* VCOS_VERIFY_ENABLED */ #ifndef vcos_static_assert #if defined(__GNUC__) #define vcos_static_assert(cond) __attribute__((unused)) extern int vcos_static_assert[(cond)?1:-1] #else #define vcos_static_assert(cond) extern int vcos_static_assert[(cond)?1:-1] #endif #endif #ifndef vc_assert #define vc_assert(cond) vcos_assert(cond) #endif #define vcos_unreachable() vcos_assert(0) #define vcos_not_impl() vcos_assert(0) /** Print out a backtrace, on supported platforms. */ extern void vcos_backtrace_self(void); #ifdef __cplusplus } #endif #endif /* VCOS_ASSERT_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_atomic_flags.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - public header file =============================================================================*/ #ifndef VCOS_ATOMIC_FLAGS_H #define VCOS_ATOMIC_FLAGS_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** * \file vcos_atomic_flags.h * * Defines atomic flags API. * * 32 flags. Atomic "or" and "get and clear" operations */ /** * Create an atomic flags instance. * * @param atomic_flags Pointer to atomic flags instance, filled in on return * * @return VCOS_SUCCESS if succeeded. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_atomic_flags_create(VCOS_ATOMIC_FLAGS_T *atomic_flags); /** * Atomically set the specified flags. * * @param atomic_flags Instance to set flags on * @param flags Mask of flags to set */ VCOS_INLINE_DECL void vcos_atomic_flags_or(VCOS_ATOMIC_FLAGS_T *atomic_flags, uint32_t flags); /** * Retrieve the current flags and then clear them. The entire operation is * atomic. * * @param atomic_flags Instance to get/clear flags from/on * * @return Mask of flags which were set (and we cleared) */ VCOS_INLINE_DECL uint32_t vcos_atomic_flags_get_and_clear(VCOS_ATOMIC_FLAGS_T *atomic_flags); /** * Delete an atomic flags instance. * * @param atomic_flags Instance to delete */ VCOS_INLINE_DECL void vcos_atomic_flags_delete(VCOS_ATOMIC_FLAGS_T *atomic_flags); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_attr.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - compiler-specific attributes =============================================================================*/ #ifndef VCOS_ATTR_H #define VCOS_ATTR_H /** * Type attribute indicating the enum should be stored in as few bytes as * possible. MetaWare does this by default, so the attribute is useful when * structs need to be portable to GCC too. * * MSVC doesn't support VCOS_ENUM_PACKED, so code that needs to be portable * across all platforms but wants the type-safety and debug-info benefits * of enum types when possible, should do: * * typedef enum VCOS_ENUM_PACKED { a = 0, b = 0xffff } EXAMPLE_T; * struct foo { * int bar; * #if VCOS_HAS_ENUM_PACKED * EXAMPLE_T baz; * #else * uint16_t baz; * #endif * }; */ #if defined(__VECTORC__) # define VCOS_ENUM_PACKED # define VCOS_HAS_ENUM_PACKED 0 #elif defined(__GNUC__) # define VCOS_ENUM_PACKED __attribute__ ((packed)) # define VCOS_HAS_ENUM_PACKED 1 #elif defined(__HIGHC__) # define VCOS_ENUM_PACKED /* packed enums are default on Metaware */ # define VCOS_HAS_ENUM_PACKED 1 #else # define VCOS_ENUM_PACKED # define VCOS_HAS_ENUM_PACKED 0 #endif /** Variable attribute indicating the variable must be emitted even if it appears unused. */ #if defined(__GNUC__) || defined(__HIGHC__) # define VCOS_ATTR_USED __attribute__ ((used)) #else # define VCOS_ATTR_USED #endif /** Variable attribute indicating the compiler should not warn if the variable is unused. */ #if defined(__GNUC__) || defined(__HIGHC__) # define VCOS_ATTR_POSSIBLY_UNUSED __attribute__ ((unused)) #else # define VCOS_ATTR_POSSIBLY_UNUSED #endif /** Variable attribute requiring specific alignment. * * Use as: * int VCOS_ATTR_ALIGNED(256) n; * or: * VCOS_ATTR_ALIGNED(256) int n; * or if you don't want to support MSVC: * int n VCOS_ATTR_ALIGNED(256); */ #if defined(__GNUC__) || defined(__HIGHC__) # define VCOS_ATTR_ALIGNED(n) __attribute__ ((aligned(n))) #elif defined(_MSC_VER) # define VCOS_ATTR_ALIGNED(n) __declspec(align(n)) #else /* Force a syntax error if this is used when the compiler doesn't support it, * instead of silently misaligning */ # define VCOS_ATTR_ALIGNED(n) VCOS_ATTR_ALIGNED_NOT_SUPPORTED_ON_THIS_COMPILER #endif /** Variable attribute requiring specific ELF section. * * Use as: * int n VCOS_ATTR_SECTION(".foo") = 1; * * A pointer like &n will have type "VCOS_ATTR_SECTION_QUALIFIER int *". */ #if defined(__HIGHC__) || defined(__VECTORC__) /* hcvc requires 'far' else it'll put small objects in .sdata/.rsdata/.sbss */ # define VCOS_ATTR_SECTION(s) __attribute__ ((far, section(s))) # define VCOS_ATTR_SECTION_QUALIFIER _Far #elif defined(__GNUC__) # define VCOS_ATTR_SECTION(s) __attribute__ ((section(s))) # define VCOS_ATTR_SECTION_QUALIFIER #else /* Force a syntax error if this is used when the compiler doesn't support it */ # define VCOS_ATTR_SECTION(s) VCOS_ATTR_SECTION_NOT_SUPPORTED_ON_THIS_COMPILER # define VCOS_ATTR_SECTION_QUALIFIER #endif /** Define a function as a weak alias to another function. * @param ret_type Function return type. * @param alias_name Name of the alias. * @param param_list Function parameter list, including the parentheses. * @param target_name Target function (bare function name, not a string). */ #if defined(__GNUC__) || defined(__HIGHC__) /* N.B. gcc allows __attribute__ after parameter list, but hcvc seems to silently ignore it. */ # define VCOS_WEAK_ALIAS(ret_type, alias_name, param_list, target_name) \ __attribute__ ((weak, alias(#target_name))) ret_type alias_name param_list #else # define VCOS_WEAK_ALIAS(ret_type, alias, params, target) VCOS_CASSERT(0) #endif /** Define a function as a weak alias to another function, specified as a string. * @param ret_type Function return type. * @param alias_name Name of the alias. * @param param_list Function parameter list, including the parentheses. * @param target_name Target function name as a string. * @note Prefer the use of VCOS_WEAK_ALIAS - it is likely to be more portable. * Only use VCOS_WEAK_ALIAS_STR if you need to do pre-processor mangling of the target * symbol. */ #if defined(__GNUC__) || defined(__HIGHC__) /* N.B. gcc allows __attribute__ after parameter list, but hcvc seems to silently ignore it. */ # define VCOS_WEAK_ALIAS_STR(ret_type, alias_name, param_list, target_name) \ __attribute__ ((weak, alias(target_name))) ret_type alias_name param_list #else # define VCOS_WEAK_ALIAS_STR(ret_type, alias, params, target) VCOS_CASSERT(0) #endif #endif /* VCOS_ATTR_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_blockpool.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - fixed size allocator support =============================================================================*/ #ifndef VCOS_BLOCKPOOL_H #define VCOS_BLOCKPOOL_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** \file * * Thread safe, fixed size allocator API. * */ /** Initialises a block pool to use already allocated (e.g. statically) * allocated memory. * * Different implementations will incur different overheads. Use * VCOS_BLOCKPOOL_SIZE(num_blocks, block_size) to calculate the number * of bytes required including overheads for the desired pools. * * @param pool Pointer to pool object * @param num_blocks The number of blocks required. * @param block_size The size of an individual block. * @param start The address of the start of the pool. * @param pool_size The size of the pool in bytes. * @param align Alignment for block data. Use VCOS_BLOCKPOOL_ALIGN_DEFAULT * for default word alignment. * @param flags Reserved for future use. * @param name Name of the pool. Used for diagnostics. * * @return VCOS_SUCCESS if the pool was created. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_blockpool_init(VCOS_BLOCKPOOL_T *pool, VCOS_UNSIGNED num_blocks, VCOS_UNSIGNED block_size, void *start, VCOS_UNSIGNED pool_size, VCOS_UNSIGNED align, VCOS_UNSIGNED flags, const char *name); /** Creates a pool of blocks of a given size within a buffer allocated on * the heap. * * The heap memory is freed when the block pool is destroyed by * calling vcos_blockpool_delete. * * @param pool Pointer to pool object * @param num_blocks The number of blocks required. * @param block_size The size of an individual block. * @param align Alignment for block data. Use VCOS_BLOCKPOOL_ALIGN_DEFAULT * for default word alignment. * @param flags Reserved for future use. * @param name Name of the pool. Used for diagnostics. * * @return VCOS_SUCCESS if the pool was created. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_blockpool_create_on_heap(VCOS_BLOCKPOOL_T *pool, VCOS_UNSIGNED num_blocks, VCOS_UNSIGNED block_size, VCOS_UNSIGNED align, VCOS_UNSIGNED flags, const char *name); /** Allocate a block from the pool * * @param pool Pointer to the pool to allocate from. * @return a pointer to the newly allocated block or NULL if no blocks were * available. */ VCOS_INLINE_DECL void *vcos_blockpool_alloc(VCOS_BLOCKPOOL_T *pool); /** Allocate a block from the pool and zero it. * * @param pool Pointer to the pool to allocate from. * @return a pointer to the newly allocated block or NULL if no blocks were * available. */ VCOS_INLINE_DECL void *vcos_blockpool_calloc(VCOS_BLOCKPOOL_T *pool); /** Returns a block to the pool. * * @param block The block to free. */ VCOS_INLINE_DECL void vcos_blockpool_free(void *block); /** Queries the number of available blocks in the pool. * @param pool The pool to query. */ VCOS_INLINE_IMPL VCOS_UNSIGNED vcos_blockpool_available_count(VCOS_BLOCKPOOL_T *pool); /** Queries the number of used blocks in the pool. * @param pool The pool to query. */ VCOS_INLINE_IMPL VCOS_UNSIGNED vcos_blockpool_used_count(VCOS_BLOCKPOOL_T *pool); /** Deinitialize a memory pool. * * @param pool The pool to de-initialize. */ VCOS_INLINE_DECL void vcos_blockpool_delete(VCOS_BLOCKPOOL_T *pool); /** Return an integer handle for a given allocated block. */ VCOS_INLINE_DECL uint32_t vcos_blockpool_elem_to_handle(void *block); /** Convert an integer handle back into a pointer. * Returns NULL if invalid. */ VCOS_INLINE_DECL void *vcos_blockpool_elem_from_handle(VCOS_BLOCKPOOL_T *pool, uint32_t handle); /** Checks whether a pointer is an allocated block within the specified pool. * Returns true if the block is valid, otherwise, false is returned. */ VCOS_INLINE_DECL uint32_t vcos_blockpool_is_valid_elem( VCOS_BLOCKPOOL_T *pool, const void *block); /** May be called once to allow the block pool to be extended by dynamically * adding subpools. The block size cannot be altered. * * @param num_extensions The number of extensions that may be created. * The maximum is (VCOS_BLOCKPOOL_MAX_SUBPOOLS - 1) * @param num_blocks The number of blocks to allocate in each in each * dynamically allocated subpool. * @return VCOS_SUCCESS if successful. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_blockpool_extend(VCOS_BLOCKPOOL_T *pool, VCOS_UNSIGNED num_extensions, VCOS_UNSIGNED num_blocks); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_build_info.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ const char *vcos_get_build_hostname( void ); const char *vcos_get_build_version( void ); const char *vcos_get_build_time( void ); const char *vcos_get_build_date( void ); ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_cfg.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if !defined( VCOS_CFG_H ) #define VCOS_CFG_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" typedef struct opaque_vcos_cfg_buf_t *VCOS_CFG_BUF_T; typedef struct opaque_vcos_cfg_entry_t *VCOS_CFG_ENTRY_T; /** \file vcos_file.h * * API for accessing configuration/statistics information. This * is loosely modelled on the linux proc entries. */ typedef void (*VCOS_CFG_SHOW_FPTR)( VCOS_CFG_BUF_T buf, void *data ); typedef void (*VCOS_CFG_PARSE_FPTR)( VCOS_CFG_BUF_T buf, void *data ); /** Create a configuration directory. * * @param entry Place to store the created config entry. * @param parent Parent entry (for directory like config * options). * @param entryName Name of the directory. */ VCOS_STATUS_T vcos_cfg_mkdir( VCOS_CFG_ENTRY_T *entry, VCOS_CFG_ENTRY_T *parent, const char *dirName ); /** Create a configuration entry. * * @param entry Place to store the created config entry. * @param parent Parent entry (for directory like config * options). * @param entryName Name of the configuration entry. * @param showFunc Function pointer to show configuration * data. * @param parseFunc Function pointer to parse new data. */ VCOS_STATUS_T vcos_cfg_create_entry( VCOS_CFG_ENTRY_T *entry, VCOS_CFG_ENTRY_T *parent, const char *entryName, VCOS_CFG_SHOW_FPTR showFunc, VCOS_CFG_PARSE_FPTR parseFunc, void *data ); /** Determines if a configuration entry has been created or not. * * @param entry Configuration entry to query. */ int vcos_cfg_is_entry_created( VCOS_CFG_ENTRY_T entry ); /** Returns the name of a configuration entry. * * @param entry Configuration entry to query. */ const char *vcos_cfg_get_entry_name( VCOS_CFG_ENTRY_T entry ); /** Removes a configuration entry. * * @param entry Configuration entry to remove. */ VCOS_STATUS_T vcos_cfg_remove_entry( VCOS_CFG_ENTRY_T *entry ); /** Writes data into a configuration buffer. Only valid inside * the show function. * * @param buf Buffer to write data into. * @param fmt printf style format string. */ void vcos_cfg_buf_printf( VCOS_CFG_BUF_T buf, const char *fmt, ... ); /** Retrieves a null terminated string of the data associated * with the buffer. Only valid inside the parse function. * * @param buf Buffer to get data from. * @param fmt printf style format string. */ char *vcos_cfg_buf_get_str( VCOS_CFG_BUF_T buf ); void *vcos_cfg_get_proc_entry( VCOS_CFG_ENTRY_T entry ); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_cmd.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if !defined( VCOS_CMD_H ) #define VCOS_CMD_H /* ---- Include Files ----------------------------------------------------- */ #ifndef VCOS_H #include "interface/vcos/vcos.h" #endif #include "interface/vcos/vcos_stdint.h" /* ---- Constants and Types ---------------------------------------------- */ struct VCOS_CMD_S; typedef struct VCOS_CMD_S VCOS_CMD_T; typedef struct { int argc; /* Number of arguments (includes the command/sub-command) */ char **argv; /* Array of arguments */ char **argv_orig; /* Original array of arguments */ VCOS_CMD_T *cmd_entry; VCOS_CMD_T *cmd_parent_entry; int use_log; /* Output being logged? */ size_t result_size; /* Size of result buffer. */ char *result_ptr; /* Next place to put output. */ char *result_buf; /* Start of the buffer. */ } VCOS_CMD_PARAM_T; typedef VCOS_STATUS_T (*VCOS_CMD_FUNC_T)( VCOS_CMD_PARAM_T *param ); struct VCOS_CMD_S { const char *name; const char *args; VCOS_CMD_FUNC_T cmd_fn; VCOS_CMD_T *sub_cmd_entry; const char *descr; }; /* ---- Variable Externs ------------------------------------------------- */ /* ---- Function Prototypes ---------------------------------------------- */ /* * Common printing routine for generating command output. */ VCOSPRE_ void VCOSPOST_ vcos_cmd_error( VCOS_CMD_PARAM_T *param, const char *fmt, ... ) VCOS_FORMAT_ATTR_(printf, 2, 3); VCOSPRE_ void VCOSPOST_ vcos_cmd_printf( VCOS_CMD_PARAM_T *param, const char *fmt, ... ) VCOS_FORMAT_ATTR_(printf, 2, 3); VCOSPRE_ void VCOSPOST_ vcos_cmd_vprintf( VCOS_CMD_PARAM_T *param, const char *fmt, va_list args ) VCOS_FORMAT_ATTR_(printf, 2, 0); /* * Cause vcos_cmd_error, printf and vprintf to always log to the provided * category. When this call is made, the results buffer passed into * vcos_cmd_execute is used as a line buffer and does not need to be * output by the caller. */ struct VCOS_LOG_CAT_T; VCOSPRE_ void VCOSPOST_ vcos_cmd_always_log_output( struct VCOS_LOG_CAT_T *log_category ); /* * Prints command usage for the current command. */ VCOSPRE_ void VCOSPOST_ vcos_cmd_usage( VCOS_CMD_PARAM_T *param ); /* * Register commands to be processed */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_cmd_register( VCOS_CMD_T *cmd_entry ); /* * Registers multiple commands to be processed. The array should * be terminated by an entry with all zeros. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_cmd_register_multiple( VCOS_CMD_T *cmd_entry ); /* * Executes a command based on a command line. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_cmd_execute( int argc, char **argv, size_t result_size, char *result_buf ); /* * Shut down the command system and free all allocated data. * Do not call any other command functions after this. */ VCOSPRE_ void VCOSPOST_ vcos_cmd_shutdown( void ); #endif /* VCOS_CMD_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_ctype.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - public header file =============================================================================*/ #ifndef VCOS_CTYPE_H #define VCOS_CTYPE_H /** * \file * * ctype functions. * */ #ifdef __KERNEL__ #include #else #include #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_dlfcn.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VCOS - abstraction over dynamic library opening =============================================================================*/ #ifndef VCOS_DLFCN_H #define VCOS_DLFCN_H #include "interface/vcos/vcos_types.h" #include "vcos.h" #ifdef __cplusplus extern "C" { #endif /** * \file * * Loading dynamic libraries. See also dlfcn.h. */ /** Open a dynamic library. * * @param name name of the library * @param mode Load lazily or immediately (VCOS_DL_LAZY, VCOS_DL_NOW, VCOS_DL_LOCAL, VCOS_DL_GLOBAL). * * @return A handle for use in subsequent calls. */ VCOSPRE_ void * VCOSPOST_ vcos_dlopen(const char *name, int mode); /** Look up a symbol. * * @param handle Handle to open * @param name Name of function * * @return Function pointer, or NULL. */ VCOSPRE_ void VCOSPOST_ (*vcos_dlsym(void *handle, const char *name))(void); /** Close a library * * @param handle Handle to close */ VCOSPRE_ int VCOSPOST_ vcos_dlclose (void *handle); /** Return error message from library. * * @param err On return, set to non-zero if an error has occurred * @param buf Buffer to write error to * @param len Size of buffer (including terminating NUL). */ VCOSPRE_ int VCOSPOST_ vcos_dlerror(int *err, char *buf, size_t buflen); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_event.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - public header file for events =============================================================================*/ #ifndef VCOS_EVENT_H #define VCOS_EVENT_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** * \file * * An event is akin to the Win32 auto-reset event. * * * Signalling an event will wake up one waiting thread only. Once one * thread has been woken the event atomically returns to the unsignalled * state. * * If no threads are waiting on the event when it is signalled it remains * signalled. * * This is almost, but not quite, completely unlike the "event flags" * object based on Nucleus event groups and ThreadX event flags. * * In particular, it should be similar in speed to a semaphore, unlike * the event flags. */ /** * Create an event instance. * * @param event Filled in with constructed event. * @param name Name of the event (for debugging) * * @return VCOS_SUCCESS on success, or error code. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_event_create(VCOS_EVENT_T *event, const char *name); #ifndef vcos_event_signal /** * Signal the event. The event will return to being unsignalled * after exactly one waiting thread has been woken up. If no * threads are waiting it remains signalled. * * @param event The event to signal */ VCOS_INLINE_DECL void vcos_event_signal(VCOS_EVENT_T *event); /** * Wait for the event. * * @param event The event to wait for * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the wait was interrupted. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_event_wait(VCOS_EVENT_T *event); /** * Try event, but don't block. * * @param event The event to try * @return VCOS_SUCCESS on success, VCOS_EAGAIN if the event is not currently signalled */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_event_try(VCOS_EVENT_T *event); #endif /* * Destroy an event. */ VCOS_INLINE_DECL void vcos_event_delete(VCOS_EVENT_T *event); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_event_flags.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - public header file =============================================================================*/ #ifndef VCOS_EVENT_FLAGS_H #define VCOS_EVENT_FLAGS_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" #define VCOS_EVENT_FLAGS_SUSPEND VCOS_SUSPEND #define VCOS_EVENT_FLAGS_NO_SUSPEND VCOS_NO_SUSPEND typedef VCOS_OPTION VCOS_EVENTGROUP_OPERATION_T; /** * \file vcos_event_flags.h * * Defines event flags API. * * Similar to Nucleus event groups. * * These have the same semantics as Nucleus event groups and ThreadX event * flags. As such, they are quite complex internally; if speed is important * they might not be your best choice. * */ /** * Create an event flags instance. * * @param flags Pointer to event flags instance, filled in on return. * @param name Name for the event flags, used for debug. * * @return VCOS_SUCCESS if succeeded. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_event_flags_create(VCOS_EVENT_FLAGS_T *flags, const char *name); /** * Set some events. * * @param flags Instance to set flags on * @param events Bitmask of the flags to actually set * @param op How the flags should be set. VCOS_OR will OR in the flags; VCOS_AND * will AND them in, possibly clearing existing flags. */ VCOS_INLINE_DECL void vcos_event_flags_set(VCOS_EVENT_FLAGS_T *flags, VCOS_UNSIGNED events, VCOS_OPTION op); /** * Retrieve some events. * * Waits until the specified events have been set. * * @param flags Instance to wait on * @param requested_events The bitmask to wait for * @param op VCOS_OR - get any; VCOS_AND - get all. * @param ms_suspend How long to wait, in milliseconds * @param retrieved_events the events actually retrieved. * * @return VCOS_SUCCESS if events were retrieved. VCOS_EAGAIN if the * timeout expired. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_event_flags_get(VCOS_EVENT_FLAGS_T *flags, VCOS_UNSIGNED requested_events, VCOS_OPTION op, VCOS_UNSIGNED ms_suspend, VCOS_UNSIGNED *retrieved_events); /** * Delete an event flags instance. */ VCOS_INLINE_DECL void vcos_event_flags_delete(VCOS_EVENT_FLAGS_T *); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_init.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - initialization routines =============================================================================*/ #include "interface/vcos/vcos_types.h" #include "vcos.h" #ifdef __cplusplus extern "C" { #endif /** \file * * Some OS support libraries need some initialization. To support this, call * vcos_init() function at the start of day; vcos_deinit() at the end. */ /** * vcos initialization. Call this function before using other vcos functions. * Calls can be nested within the same process; they are reference counted so * that only a call from uninitialized state has any effect. * @note On platforms/toolchains that support it, gcc's constructor attribute or * similar is used to invoke this function before main() or equivalent. * @return Status of initialisation. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_init(void); /** * vcos deinitialization. Call this function when vcos is no longer required, * in order to free resources. * Calls can be nested within the same process; they are reference counted so * that only a call that decrements the reference count to 0 has any effect. * @note On platforms/toolchains that support it, gcc's destructor attribute or * similar is used to invoke this function after exit() or equivalent. * @return Status of initialisation. */ VCOSPRE_ void VCOSPOST_ vcos_deinit(void); /** * Acquire global lock. This must be available independent of vcos_init()/vcos_deinit(). */ VCOSPRE_ void VCOSPOST_ vcos_global_lock(void); /** * Release global lock. This must be available independent of vcos_init()/vcos_deinit(). */ VCOSPRE_ void VCOSPOST_ vcos_global_unlock(void); /** Pass in the argv/argc arguments passed to main() */ VCOSPRE_ void VCOSPOST_ vcos_set_args(int argc, const char **argv); /** Return argc. */ VCOSPRE_ int VCOSPOST_ vcos_get_argc(void); /** Return argv. */ VCOSPRE_ const char ** VCOSPOST_ vcos_get_argv(void); /** * Platform-specific initialisation. * VCOS internal function, not part of public API, do not call from outside * vcos. vcos_init()/vcos_deinit() reference count calls, so this function is * only called from an uninitialized state, i.e. there will not be two * consecutive calls to vcos_platform_init() without an intervening call to * vcos_platform_deinit(). * This function is called with vcos_global_lock held. * @return Status of initialisation. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_platform_init(void); /** * Platform-specific de-initialisation. * VCOS internal function, not part of public API, do not call from outside * vcos. * See vcos_platform_init() re reference counting. * This function is called with vcos_global_lock held. */ VCOSPRE_ void VCOSPOST_ vcos_platform_deinit(void); #ifdef __cplusplus } #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_inttypes.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCOS_INTTYPES_H #define VCOS_INTTYPES_H /** \file * Attempt to provide the support for fixed width integer types as per * inttypes.h. This simply includes inttypes.h, which should find the * system/toolchain version if present, otherwise falling back to the version * in interface/vcos/. The vcos versions initially only provide the * most common printf() macros. */ #ifdef __cplusplus extern "C" { #endif #include #ifdef __cplusplus } #endif #endif /* VCOS_INTTYPES_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_isr.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - IRQ support =============================================================================*/ #ifndef VCOS_ISR_H #define VCOS_ISR_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** * \file vcos_isr.h * * \section isr ISR support * * API for dispatching interrupts. */ /** * * Register an interrupt handler. The old handler (if any) is returned in * old_handler. The old handler should be called if the interrupt was not * for you. * * The handler function will be called in a context with interrupts disabled, * so should be written to be as short as possible. If significant processing * is needed, the handler should delegate to a thread. * * The handler function can call any OS primitive that does not block (e.g. * post a semaphore or set an event flag). Blocking operations (including memory * allocation from the system heap) are not permitted. * * To deregister an ISR, pass in NULL. * * @param vec Vector to register for * @param handler Handler to be called * @param old_handler Updated with the old handler, or NULL. */ VCOS_INLINE_DECL void vcos_register_isr(VCOS_UNSIGNED vec, VCOS_ISR_HANDLER_T handler, VCOS_ISR_HANDLER_T *old_handler); /** Disable interrupts, returning the old value (enabled/disabled) to the caller. */ VCOS_INLINE_DECL VCOS_UNSIGNED vcos_int_disable(void); /** Restore the previous interrupt enable/disable state. */ VCOS_INLINE_DECL void vcos_int_restore(VCOS_UNSIGNED previous); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_legacy_isr.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - legacy (Nucleus) IRQ support =============================================================================*/ #ifndef VCOS_LEGACY_ISR_H #define VCOS_LEGACY_ISR_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** \file vcos_legacy_isr.h * * API for dispatching interrupts the Nucleus way, via a LISR and HISR. * New code should use the single-dispatch scheme - the LISR/HISR * distinction is not necessary. * * Under ThreadX, a HISR is implemented as a high-priority thread which * waits on a counting semaphore to call the HISR function. Although this * provides a good approximation to the Nucleus semantics, it is potentially * slow if all you are trying to do is to wake a thread from LISR context. */ /** Register a LISR. This is identical to the NU_Register_LISR API. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_register_legacy_lisr(VCOS_UNSIGNED vecnum, void (*lisr)(VCOS_INT), void (**old_lisr)(VCOS_INT)); VCOS_INLINE_DECL VCOS_STATUS_T vcos_legacy_hisr_create(VCOS_HISR_T *hisr, const char *name, void (*entry)(void), VCOS_UNSIGNED pri, void *stack, VCOS_UNSIGNED stack_size); /** Activate a HISR. On an OS which has no distinction between a HISR and LISR, * this may use some kind of emulation, which could well be less efficient than * a normal ISR.` * * @param hisr HISR to activate. */ VCOS_INLINE_DECL void vcos_legacy_hisr_activate(VCOS_HISR_T *hisr); /** Delete a HISR. * * @param hisr HISR to delete. */ VCOS_INLINE_DECL void vcos_legacy_hisr_delete(VCOS_HISR_T *hisr); /** Are we in a legacy LISR? * * @return On Nucleus, non-zero if in a LISR. On other platforms, non-zero if * in an interrupt. */ VCOS_INLINE_DECL int vcos_in_legacy_lisr(void); /** Is the current thread actually a fake HISR thread? Only implemented * on platforms that fake up HISRs. */ #ifndef VCOS_LISRS_NEED_HISRS VCOSPRE_ int VCOSPOST_ vcos_current_thread_is_fake_hisr_thread(VCOS_HISR_T *); #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_logging.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - logging support =============================================================================*/ #ifndef VCOS_LOGGING_H #define VCOS_LOGGING_H #ifdef __cplusplus extern "C" { #endif #include #include "interface/vcos/vcos_types.h" #include "vcos.h" #include "vcos_logging_control.h" /** * \file * * Logging support * * This provides categorised logging. Clients register * a category, and then get a number of logging levels for * that category. * * The logging level flag is tested using a flag *before* the * function call, which makes logging very fast when disabled - there * is no function call overhead just to find out that this log * message is disabled. * * \section VCOS_LOG_CATEGORY * * As a convenience, clients define VCOS_LOG_CATEGORY to point to * their category; the various vcos_log_xxx() macros then expand to * use this. * * e.g. * * #define VCOS_LOG_CATEGORY (&my_category) * * #include * * VCOS_LOG_CAT_T my_category; * * .... * * vcos_log_trace("Stuff happened: %d", n_stuff); * */ /** Logging levels */ typedef enum VCOS_LOG_LEVEL_T { VCOS_LOG_UNINITIALIZED = 0, VCOS_LOG_NEVER, VCOS_LOG_ERROR, VCOS_LOG_WARN, VCOS_LOG_INFO, VCOS_LOG_TRACE, } VCOS_LOG_LEVEL_T; /** Initialize a logging category without going through vcos_log_register(). * * This is useful for the case where there is no obvious point to do the * registration (no initialization function for the module). However, it * means that your logging category is not registered, so cannot be easily * changed at run-time. */ #define VCOS_LOG_INIT(n,l) { l, n, 0, {0}, 0, 0 } /** A registered logging category. */ typedef struct VCOS_LOG_CAT_T { VCOS_LOG_LEVEL_T level; /**< Which levels are enabled for this category */ const char *name; /**< Name for this category. */ struct VCOS_LOG_CAT_T *next; struct { unsigned int want_prefix:1; } flags; unsigned int refcount; void *platform_data; /**< platform specific data */ } VCOS_LOG_CAT_T; typedef void (*VCOS_VLOG_IMPL_FUNC_T)(const VCOS_LOG_CAT_T *cat, VCOS_LOG_LEVEL_T _level, const char *fmt, va_list args); /** Convert a VCOS_LOG_LEVEL_T into a printable string. * The platform needs to implement this function. */ VCOSPRE_ const char * VCOSPOST_ vcos_log_level_to_string( VCOS_LOG_LEVEL_T level ); /** Convert a string into a VCOS_LOG_LEVEL_T * The platform needs to implement this function. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_string_to_log_level( const char *str, VCOS_LOG_LEVEL_T *level ); /** Log a message. Basic API. Normal code should not use this. * The platform needs to implement this function. */ VCOSPRE_ void VCOSPOST_ vcos_log_impl(const VCOS_LOG_CAT_T *cat, VCOS_LOG_LEVEL_T _level, const char *fmt, ...) VCOS_FORMAT_ATTR_(printf, 3, 4); /** Log a message using a varargs parameter list. Normal code should * not use this. */ VCOSPRE_ void VCOSPOST_ vcos_vlog_impl(const VCOS_LOG_CAT_T *cat, VCOS_LOG_LEVEL_T _level, const char *fmt, va_list args) VCOS_FORMAT_ATTR_(printf, 3, 0); /** Set the function which does the actual logging output. * Passing in NULL causes the default logging function to be * used. */ VCOSPRE_ void VCOSPOST_ vcos_set_vlog_impl( VCOS_VLOG_IMPL_FUNC_T vlog_impl_func ); /** The default logging function, which is provided by each * platform. */ VCOSPRE_ void VCOSPOST_ vcos_vlog_default_impl(const VCOS_LOG_CAT_T *cat, VCOS_LOG_LEVEL_T _level, const char *fmt, va_list args) VCOS_FORMAT_ATTR_(printf, 3, 0); /* * Initialise the logging subsystem. This is called from * vcos_init() so you don't normally need to call it. */ VCOSPRE_ void VCOSPOST_ vcos_logging_init(void); /** Register a logging category. * * @param name the name of this category. * @param category the category to register. */ VCOSPRE_ void VCOSPOST_ vcos_log_register(const char *name, VCOS_LOG_CAT_T *category); /** Unregister a logging category. */ VCOSPRE_ void VCOSPOST_ vcos_log_unregister(VCOS_LOG_CAT_T *category); /** Return a default logging category, for people too lazy to create their own. * * Using the default category will be slow (there's an extra function * call overhead). Don't do this in normal code. */ VCOSPRE_ const VCOS_LOG_CAT_T * VCOSPOST_ vcos_log_get_default_category(void); VCOSPRE_ void VCOSPOST_ vcos_set_log_options(const char *opt); /** Set the logging level for a category at run time. Without this, the level * will be that set by vcos_log_register from a platform-specific source. * * @param category the category to modify. * @param level the new logging level for this category. */ VCOS_STATIC_INLINE void vcos_log_set_level(VCOS_LOG_CAT_T *category, VCOS_LOG_LEVEL_T level) { category->level = level; } #define vcos_log_dump_mem(cat,label,addr,voidMem,numBytes) do { if (vcos_is_log_enabled(cat,VCOS_LOG_TRACE)) vcos_log_dump_mem_impl(cat,label,addr,voidMem,numBytes); } while (0) void vcos_log_dump_mem_impl( const VCOS_LOG_CAT_T *cat, const char *label, uint32_t addr, const void *voidMem, size_t numBytes ); /* * Platform specific hooks (optional). */ #ifndef vcos_log_platform_init #define vcos_log_platform_init() (void)0 #endif #ifndef vcos_log_platform_register #define vcos_log_platform_register(category) (void)0 #endif #ifndef vcos_log_platform_unregister #define vcos_log_platform_unregister(category) (void)0 #endif /* VCOS_TRACE() - deprecated macro which just outputs in a debug build and * is a no-op in a release build. * * _VCOS_LOG_X() - internal macro which outputs if the current level for the * particular category is higher than the supplied message level. */ #define VCOS_LOG_DFLT_CATEGORY vcos_log_get_default_category() #define _VCOS_LEVEL(x) (x) #define vcos_is_log_enabled(cat,_level) (_VCOS_LEVEL((cat)->level) >= _VCOS_LEVEL(_level)) #if defined(_VCOS_METAWARE) || defined(__GNUC__) # if !defined(AMPUTATE_ALL_VCOS_LOGGING) && (!defined(NDEBUG) || defined(VCOS_ALWAYS_WANT_LOGGING)) # define VCOS_LOGGING_ENABLED # define _VCOS_LOG_X(cat, _level, fmt...) do { if (vcos_is_log_enabled(cat,_level)) vcos_log_impl(cat,_level,fmt); } while (0) # define _VCOS_VLOG_X(cat, _level, fmt, ap) do { if (vcos_is_log_enabled(cat,_level)) vcos_vlog_impl(cat,_level,fmt,ap); } while (0) # else # define _VCOS_LOG_X(cat, _level, fmt...) (void)0 # define _VCOS_VLOG_X(cat, _level, fmt, ap) (void)0 # endif # define vcos_log_error(...) _VCOS_LOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_ERROR, __VA_ARGS__) # define vcos_log_warn(...) _VCOS_LOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_WARN, __VA_ARGS__) # define vcos_log_info(...) _VCOS_LOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_INFO, __VA_ARGS__) # define vcos_log_trace(...) _VCOS_LOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_TRACE, __VA_ARGS__) # define vcos_vlog_error(fmt,ap) _VCOS_VLOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_ERROR, fmt, ap) # define vcos_vlog_warn(fmt,ap) _VCOS_VLOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_WARN, fmt, ap) # define vcos_vlog_info(fmt,ap) _VCOS_VLOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_INFO, fmt, ap) # define vcos_vlog_trace(fmt,ap) _VCOS_VLOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_TRACE, fmt, ap) # define vcos_logc_error(cat,...) _VCOS_LOG_X(cat, VCOS_LOG_ERROR, __VA_ARGS__) # define vcos_logc_warn(cat,...) _VCOS_LOG_X(cat, VCOS_LOG_WARN, __VA_ARGS__) # define vcos_logc_info(cat,...) _VCOS_LOG_X(cat, VCOS_LOG_INFO, __VA_ARGS__) # define vcos_logc_trace(cat,...) _VCOS_LOG_X(cat, VCOS_LOG_TRACE, __VA_ARGS__) # define vcos_vlogc_error(cat,fmt,ap) _VCOS_VLOG_X(cat, VCOS_LOG_ERROR, fmt, ap) # define vcos_vlogc_warn(cat,fmt,ap) _VCOS_VLOG_X(cat, VCOS_LOG_WARN, fmt, ap) # define vcos_vlogc_info(cat,fmt,ap) _VCOS_VLOG_X(cat, VCOS_LOG_INFO, fmt, ap) # define vcos_vlogc_trace(cat,fmt,ap) _VCOS_VLOG_X(cat, VCOS_LOG_TRACE, fmt, ap) # define vcos_log(...) _VCOS_LOG_X(VCOS_LOG_DFLT_CATEGORY, VCOS_LOG_INFO, __VA_ARGS__) # define vcos_vlog(fmt,ap) _VCOS_VLOG_X(VCOS_LOG_DFLT_CATEGORY, VCOS_LOG_INFO, fmt, ap) # define VCOS_ALERT(...) _VCOS_LOG_X(VCOS_LOG_DFLT_CATEGORY, VCOS_LOG_ERROR, __VA_ARGS__) # define VCOS_TRACE(...) _VCOS_LOG_X(VCOS_LOG_DFLT_CATEGORY, VCOS_LOG_INFO, __VA_ARGS__) /* * MS Visual Studio - pre 2005 does not grok variadic macros */ #elif defined(_MSC_VER) # if _MSC_VER >= 1400 # if !defined(AMPUTATE_ALL_VCOS_LOGGING) && (!defined(NDEBUG) || defined(VCOS_ALWAYS_WANT_LOGGING)) # define VCOS_LOGGING_ENABLED # define _VCOS_LOG_X(cat, _level, fmt,...) do { if (vcos_is_log_enabled(cat,_level)) vcos_log_impl(cat, _level, fmt, __VA_ARGS__); } while (0) # else # define _VCOS_LOG_X(cat, _level, fmt,...) (void)0 # endif # define vcos_log_error(fmt,...) _VCOS_LOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_ERROR, fmt, __VA_ARGS__) # define vcos_log_warn(fmt,...) _VCOS_LOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_WARN, fmt, __VA_ARGS__) # define vcos_log_info(fmt,...) _VCOS_LOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_INFO, fmt, __VA_ARGS__) # define vcos_log_trace(fmt,...) _VCOS_LOG_X(VCOS_LOG_CATEGORY, VCOS_LOG_TRACE, fmt, __VA_ARGS__) # define vcos_logc_error(cat,fmt,...) _VCOS_LOG_X(cat, VCOS_LOG_ERROR, fmt, __VA_ARGS__) # define vcos_logc_warn(cat,fmt,...) _VCOS_LOG_X(cat, VCOS_LOG_WARN, fmt, __VA_ARGS__) # define vcos_logc_info(cat,fmt,...) _VCOS_LOG_X(cat, VCOS_LOG_INFO, fmt, __VA_ARGS__) # define vcos_logc_trace(cat,fmt,...) _VCOS_LOG_X(cat, VCOS_LOG_TRACE, fmt, __VA_ARGS__) # define vcos_log(fmt,...) _VCOS_LOG_X(VCOS_LOG_DFLT_CATEGORY, VCOS_LOG_INFO, fmt, __VA_ARGS__) # define VCOS_ALERT(fmt,...) _VCOS_LOG_X(VCOS_LOG_DFLT_CATEGORY, VCOS_LOG_ERROR, fmt, __VA_ARGS__) # define VCOS_TRACE(fmt,...) _VCOS_LOG_X(VCOS_LOG_DFLT_CATEGORY, VCOS_LOG_INFO, fmt, __VA_ARGS__) # else /* _MSC_VER >= 1400 */ /* do not define these */ # endif /* _MSC_VER >= 1400 */ #endif #if VCOS_HAVE_CMD #include "interface/vcos/vcos_cmd.h" /* * These are the log sub-commands. They're exported here for user-mode apps which * may want to call these, since the "log" command isn't registered for user-mode * apps (vcdbg for example, has its own log command). */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_log_assert_cmd( VCOS_CMD_PARAM_T *param ); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_log_set_cmd( VCOS_CMD_PARAM_T *param ); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_log_status_cmd( VCOS_CMD_PARAM_T *param ); VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_log_test_cmd( VCOS_CMD_PARAM_T *param ); #endif #ifdef __cplusplus } #endif #endif /* VCOS_LOGGING_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_logging_control.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_lowlevel_thread.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - low level thread support =============================================================================*/ #ifndef VCOS_LOWLEVEL_THREAD_H #define VCOS_LOWLEVEL_THREAD_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #ifndef VCOS_PLATFORM_H #include "vcos.h" #endif /** * \file * * This defines a low level thread API that is supported by *some* operating systems * and can be used to construct the regular "joinable thread" API on those operating * systems. * * Most clients will not need to use this code. * * \sa vcos_joinable_thread.h */ /** * \brief Create a thread. * * This creates a thread which can be stopped either by returning from the * entry point function or by calling vcos_llthread_exit from within the entry * point function. The thread must be cleaned up by calling * vcos_llthread_delete. vcos_llthread_delete may or may not terminate the * thread. * * The preemptible parameter familiar from Nucleus is removed, as it is unused in * VideoCore code. Affinity is added, since we do use this. * * @param thread Filled in with thread instance * @param name An optional name for the thread. "" may be used (but * a name will aid in debugging). * @param entry Entry point * @param arg A single argument passed to the entry point function * @param stack Pointer to stack address * @param stacksz Size of stack in bytes * @param priority Priority of task, between VCOS_PRI_LOW and VCOS_PRI_HIGH * @param affinity CPU affinity * * @sa vcos_llthread_terminate vcos_llthread_delete */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_llthread_create(VCOS_LLTHREAD_T *thread, const char *name, VCOS_LLTHREAD_ENTRY_FN_T entry, void *arg, void *stack, VCOS_UNSIGNED stacksz, VCOS_UNSIGNED priority, VCOS_UNSIGNED affinity, VCOS_UNSIGNED timeslice, VCOS_UNSIGNED autostart); /** * \brief Exits the current thread. */ VCOSPRE_ void VCOSPOST_ vcos_llthread_exit(void); /** * \brief Delete a thread. This must be called to cleanup after * vcos_llthread_create. This may or may not terminate the thread. * It does not clean up any resources that may have been * allocated by the thread. */ VCOSPRE_ void VCOSPOST_ vcos_llthread_delete(VCOS_LLTHREAD_T *thread); /** * \brief Return current lowlevel thread pointer. */ VCOS_INLINE_DECL VCOS_LLTHREAD_T *vcos_llthread_current(void); /** * Resume a thread. */ VCOS_INLINE_DECL void vcos_llthread_resume(VCOS_LLTHREAD_T *thread); VCOSPRE_ int VCOSPOST_ vcos_llthread_running(VCOS_LLTHREAD_T *thread); /** * \brief Create a VCOS_LLTHREAD_T for the current thread. This is so we can * have VCOS_LLTHREAD_Ts even for threads not originally created by VCOS (eg * the thread that calls vcos_init). */ extern VCOS_STATUS_T _vcos_llthread_create_attach(VCOS_LLTHREAD_T *thread); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_mem.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - memory support =============================================================================*/ #ifndef VCOS_MEM_H #define VCOS_MEM_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** \file * * Memory allocation api (malloc/free equivalents) is for benefit of host * applications. VideoCore code should use rtos_XXX functions. * */ /** Allocate memory * * @param size Size of memory to allocate * @param description Description, to aid in debugging. May be ignored internally on some platforms. */ VCOS_INLINE_DECL void *vcos_malloc(VCOS_UNSIGNED size, const char *description); void *vcos_kmalloc(VCOS_UNSIGNED size, const char *description); void *vcos_kcalloc(VCOS_UNSIGNED num, VCOS_UNSIGNED size, const char *description); /** Allocate cleared memory * * @param num Number of items to allocate. * @param size Size of each item in bytes. * @param description Description, to aid in debugging. May be ignored internally on some platforms. */ VCOS_INLINE_DECL void *vcos_calloc(VCOS_UNSIGNED num, VCOS_UNSIGNED size, const char *description); /** Free memory * * Free memory that has been allocated. */ VCOS_INLINE_DECL void vcos_free(void *ptr); void vcos_kfree(void *ptr); /** Allocate aligned memory * * Allocate memory aligned on the specified boundary. * * @param size Size of memory to allocate * @param description Description, to aid in debugging. May be ignored internally on some platforms. */ VCOS_INLINE_DECL void *vcos_malloc_aligned(VCOS_UNSIGNED size, VCOS_UNSIGNED align, const char *description); /** Return the amount of free heap memory * */ VCOS_INLINE_DECL unsigned long vcos_get_free_mem(void); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_mempool.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - memory pool support =============================================================================*/ #ifndef VCOS_MEMPOOL_H #define VCOS_MEMPOOL_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** \file * * Memory pools - variable sized allocator. * * A very basic memory pool API. * * This interface is deliberately not thread safe - clients should add * their own locking, if required. * * * \fixme: Add fixed-size allocator. * */ /** Initialize a memory pool. The control data is taken from the memory * supplied itself. * * Note: the dmalloc pool uses the memory supplied for its control * area. This is probably a bit broken, as it stops you creating * a pool in some "special" area of memory, while leaving the control * information in normal memory. * * @param pool Pointer to pool object. * * @param name Name for the pool. Used for diagnostics. * * @param start Starting address. Must be at least 8byte aligned. * * @param size Size of pool in bytes. * * @return VCOS_SUCCESS if pool was created. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_mempool_create(VCOS_MEMPOOL_T *pool, const char *name, void *start, VCOS_UNSIGNED size); /** Allocate some memory from a pool. If no memory is available, it * returns NULL. * * @param pool Pool to allocate from * @param len Length of memory to allocate * */ VCOS_INLINE_DECL void *vcos_mempool_alloc(VCOS_MEMPOOL_T *pool, VCOS_UNSIGNED len); /** Free some memory back to a pool. * * @param pool Pool to return to * @param mem Memory to return */ VCOS_INLINE_DECL void vcos_mempool_free(VCOS_MEMPOOL_T *pool, void *mem); /** Deinitialize a memory pool. * * @param pool Pool to return to */ VCOS_INLINE_DECL void vcos_mempool_delete(VCOS_MEMPOOL_T *pool); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_msgqueue.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VCOS - packet-like messages, based loosely on those found in TRIPOS. In the simple case, only the server thread creates a message queue, and clients wait for replies on a semaphore. In more complex cases, clients can also create message queues (not yet implemented). Although it's possible for a thread to create multiple queues and listen on them in turn, if you find yourself doing this it's probably a bug. =============================================================================*/ #ifndef VCOS_MSGQUEUE_H #define VCOS_MSGQUEUE_H #ifdef __cplusplus extern "C" { #endif #include "vcos_types.h" #include "vcos.h" #include "vcos_blockpool.h" /** * \file * * Packet-like messages, based loosely on those found in TRIPOS and * derivatives thereof. * * A task can send a message *pointer* to another task, where it is * queued on a linked list and the task woken up. The receiving task * consumes all of the messages on its input queue, and optionally * sends back replies using the original message memory. * * A caller can wait for the reply to a specific message - any other * messages that arrive in the meantime are queued separately. * * * All messages have a standard common layout, but the payload area can * be used freely to extend this. */ #define VCOS_MSGQ_MAGIC 0x5147534d /** Map the payload portion of a message to a structure pointer. */ #define VCOS_MSG_DATA(_msg) (void*)((_msg)->data) /** Standard message ids - FIXME - these need to be done properly! */ #define VCOS_MSG_N_QUIT 1 #define VCOS_MSG_N_OPEN 2 #define VCOS_MSG_N_CLOSE 3 #define VCOS_MSG_N_PRIVATE (1<<20) #define VCOS_MSG_REPLY_BIT (1<<31) /** Make gnuc compiler be happy about pointer punning */ #ifdef __GNUC__ #define __VCOS_MAY_ALIAS __attribute__((__may_alias__)) #else #define __VCOS_MAY_ALIAS #endif struct VCOS_MSG_T; /* Replies go to one of these objects. */ typedef struct VCOS_MSG_WAITER_T { /* When the reply is sent, this function gets called with the * address of the waiter. */ void (*on_reply)(struct VCOS_MSG_WAITER_T *waiter, struct VCOS_MSG_T *msg); } VCOS_MSG_WAITER_T; /** A single message queue. */ typedef struct VCOS_MSGQUEUE_T { VCOS_MSG_WAITER_T waiter; /**< So we can wait on a queue */ struct VCOS_MSG_T *head; /**< head of linked list of messages waiting on this queue */ struct VCOS_MSG_T *tail; /**< tail of message queue */ VCOS_SEMAPHORE_T sem; /**< thread waits on this for new messages */ VCOS_MUTEX_T lock; /**< locks the messages list */ int attached; /**< Is this attached to a thread? */ } VCOS_MSGQUEUE_T; /** A single message */ typedef struct VCOS_MSG_T { uint32_t magic; /**< Sanity checking */ uint32_t code; /**< message code */ struct VCOS_MSG_T *next; /**< next in queue */ VCOS_THREAD_T *src_thread; /**< for debug */ struct VCOS_MSG_WAITER_T *waiter; /**< client waiter structure */ struct VCOS_MSGQ_POOL_T *pool; /**< Pool allocated from, or NULL */ } VCOS_MSG_T; #define MSG_REPLY_BIT (1<<31) /** Initialize a VCOS_MSG_T. Can also use vcos_msg_init(). */ #define VCOS_MSG_INITIALIZER {VCOS_MSGQ_MAGIC, 0, NULL, NULL, NULL, 0} /** A pool of messages. This contains its own waiter and * semaphore, as well as a blockpool for the actual memory * management. * * When messages are returned to the waiter, it posts the * semaphore. * * When waiting for a message, we just wait on the semaphore. * When allocating without waiting, we just try-wait on the * semaphore. * * If we managed to claim the semaphore, then by definition * there must be at least that many free messages in the * blockpool. */ typedef struct VCOS_MSGQ_POOL_T { VCOS_MSG_WAITER_T waiter; VCOS_BLOCKPOOL_T blockpool; VCOS_SEMAPHORE_T sem; uint32_t magic; } VCOS_MSGQ_POOL_T; /** Initialise the library. Normally called from vcos_init(). */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_msgq_init(void); /** De-initialise the library. Normally called from vcos_deinit(). */ VCOSPRE_ void VCOSPOST_ vcos_msgq_deinit(void); /** Send a message. * * @param dest Destination message queue * @param code Message code. * @param msg Pointer to message to send. Must not go out of scope before * message is received (do not declare on the stack). */ VCOSPRE_ void VCOSPOST_ vcos_msg_send(VCOS_MSGQUEUE_T *dest, uint32_t code, VCOS_MSG_T *msg); /** Send a message and wait for a reply. * * @param dest Destination message queue * @param code Message code. * @param msg Pointer to message to send. May be declared on the stack. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_msg_sendwait(VCOS_MSGQUEUE_T *queue, uint32_t code, VCOS_MSG_T *msg); /** Wait for a message on a queue. */ VCOSPRE_ VCOS_MSG_T * VCOSPOST_ vcos_msg_wait(VCOS_MSGQUEUE_T *queue); /** Peek for a message on this thread's endpoint. If a message is not * available, NULL is returned. If a message is available it will be * removed from the endpoint and returned. */ VCOSPRE_ VCOS_MSG_T * VCOSPOST_ vcos_msg_peek(VCOS_MSGQUEUE_T *queue); /** Send a reply to a message */ VCOSPRE_ void VCOSPOST_ vcos_msg_reply(VCOS_MSG_T *msg); /** Set the reply queue for a message. When the message is replied-to, it * will return to the given queue. * * @param msg Message * @param queue Message queue the message should return to */ VCOSPRE_ void VCOSPOST_ vcos_msg_set_source(VCOS_MSG_T *msg, VCOS_MSGQUEUE_T *queue); /** Initialise a newly allocated message. This only needs to be called * for messages allocated on the stack, heap or statically. It is not * needed for messages allocated from a pool. */ VCOSPRE_ void VCOSPOST_ vcos_msg_init(VCOS_MSG_T *msg); /** Create a message queue to wait on. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_msgq_create(VCOS_MSGQUEUE_T *queue, const char *name); /** Destroy a queue */ VCOSPRE_ void VCOSPOST_ vcos_msgq_delete(VCOS_MSGQUEUE_T *queue); /* * Message pools */ /** Create a pool of messages. Messages can be allocated from the pool and * sent to a message queue. Replying to the message will automatically * free it back to the pool. * * The pool is threadsafe. * * @param count number of messages in the pool * @param payload_size maximum message payload size, not including MSG_T. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_msgq_pool_create( VCOS_MSGQ_POOL_T *pool, size_t count, size_t payload_size, const char *name); /** Destroy a message pool. */ VCOSPRE_ void VCOSPOST_ vcos_msgq_pool_delete(VCOS_MSGQ_POOL_T *pool); /** Allocate a message from a message pool. * * Note: * * If the alloc fails (returns NULL) then your worker thread has stopped * servicing requests or your pool is too small for the latency in * the system. Your best bet to handle this is to fail the call that * needs to send the message. * * The returned message payload area is initialised to zero. * * @param pool Pool to allocate from. * @return Message or NULL if pool exhausted. */ VCOSPRE_ VCOS_MSG_T *VCOSPOST_ vcos_msgq_pool_alloc(VCOS_MSGQ_POOL_T *pool); /** Wait for a message from a message pool. Waits until a * message is available in the pool and then allocates it. If * one is already available, returns immediately. * * This call can never fail. * * The returned message payload area is initialised to zero. * * @param pool Pool to allocate from. * @return Message */ VCOSPRE_ VCOS_MSG_T *VCOSPOST_ vcos_msgq_pool_wait(VCOS_MSGQ_POOL_T *pool); /** Explicitly free a message and return it to its pool. * * @param msg Message to free. No-op if NULL. */ VCOSPRE_ void VCOSPOST_ vcos_msgq_pool_free(VCOS_MSG_T *msg); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_mutex.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - mutex public header file =============================================================================*/ #ifndef VCOS_MUTEX_H #define VCOS_MUTEX_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** * \file vcos_mutex.h * * Mutex API. Mutexes are not re-entrant, as supporting this adds extra code * that slows down clients which have been written sensibly. * * \sa vcos_reentrant_mutex.h * */ /** Create a mutex. * * @param m Filled in with mutex on return * @param name A non-null name for the mutex, used for diagnostics. * * @return VCOS_SUCCESS if mutex was created, or error code. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_mutex_create(VCOS_MUTEX_T *m, const char *name); /** Delete the mutex. */ VCOS_INLINE_DECL void vcos_mutex_delete(VCOS_MUTEX_T *m); /** * \brief Wait to claim the mutex. * * On most platforms this always returns VCOS_SUCCESS, and so would ideally be * a void function, however some platforms allow a wait to be interrupted so * it remains non-void. * * Try to obtain the mutex. * @param m Mutex to wait on * @return VCOS_SUCCESS - mutex was taken. * VCOS_EAGAIN - could not take mutex. */ #ifndef vcos_mutex_lock VCOS_INLINE_DECL VCOS_STATUS_T vcos_mutex_lock(VCOS_MUTEX_T *m); /** Release the mutex. */ VCOS_INLINE_DECL void vcos_mutex_unlock(VCOS_MUTEX_T *m); #endif /** Test if the mutex is already locked. * * @return 1 if mutex is locked, 0 if it is unlocked. */ VCOS_INLINE_DECL int vcos_mutex_is_locked(VCOS_MUTEX_T *m); /** Obtain the mutex if possible. * * @param m the mutex to try to obtain * * @return VCOS_SUCCESS if mutex is successfully obtained, or VCOS_EAGAIN * if it is already in use by another thread. */ #ifndef vcos_mutex_trylock VCOS_INLINE_DECL VCOS_STATUS_T vcos_mutex_trylock(VCOS_MUTEX_T *m); #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_named_semaphore.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - named semaphores =============================================================================*/ #ifndef VCOS_NAMED_SEMAPHORE_H #define VCOS_NAMED_SEMAPHORE_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** * \file * * Create a named semaphore, or open an existing one by name. * */ /** * \brief Create a named semaphore. * * Semaphores are not re-entrant. * * @param sem Pointer to memory to be initialized * @param name A name for this semaphore. * @param count The initial count for the semaphore. * * @return VCOS_SUCCESS if the semaphore was created. * */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_named_semaphore_create(VCOS_NAMED_SEMAPHORE_T *sem, const char *name, VCOS_UNSIGNED count); /** * \brief Wait on a named semaphore. * * There is no timeout option on a semaphore, as adding this will slow down * implementations on some platforms. If you need that kind of behaviour, use * an event group. * * This always returns VCOS_SUCCESS and so should really be a void function. However * too many lines of code would need to be changed in non-trivial ways, so for now * it is non-void. * * @param sem Semaphore to wait on * @return VCOS_SUCCESS - semaphore was taken. * */ VCOS_INLINE_DECL void vcos_named_semaphore_wait(VCOS_NAMED_SEMAPHORE_T *sem); /** * \brief Try to wait for a semaphore. * * Try to obtain the semaphore. If it is already taken, return VCOS_TIMEOUT. * @param sem Semaphore to wait on * @return VCOS_SUCCESS - semaphore was taken. * VCOS_EAGAIN - could not take semaphore */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_named_semaphore_trywait(VCOS_NAMED_SEMAPHORE_T *sem); /** * \brief Post a semaphore. * * @param sem Semaphore to wait on */ VCOS_INLINE_DECL void vcos_named_semaphore_post(VCOS_NAMED_SEMAPHORE_T *sem); /** * \brief Delete a semaphore, releasing any resources consumed by it. * * @param sem Semaphore to wait on */ void vcos_named_semaphore_delete(VCOS_NAMED_SEMAPHORE_T *sem); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_once.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - 'once' =============================================================================*/ #ifndef VCOS_ONCE_H #define VCOS_ONCE_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** * \file vcos_once.h * * Ensure something is called only once. * * Initialize once_control to VCOS_ONCE_INIT. The first * time this is called, the init_routine will be called. Thereafter * it won't. * * \sa pthread_once() * */ VCOS_STATUS_T vcos_once(VCOS_ONCE_T *once_control, void (*init_routine)(void)); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_queue.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - Queue public header file =============================================================================*/ #ifndef VCOS_QUEUE_H #define VCOS_QUEUE_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** \file vcos_queue.h * * API for accessing a fixed length queue. * * Nucleus offers variable length items, but this feature is not used * in the current code base, so is withdrawn to simplify the API. */ /** Create a fixed length queue. * * @param queue Pointer to queue control block * @param name Name of queue * @param message_size Size of each queue message item in words (words are sizeof VCOS_UNSIGNED). * @param queue_start Start address of queue area * @param queue_size Size in words (words are sizeof VCOS_UNSIGNED) of queue * */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_queue_create(VCOS_QUEUE_T *queue, const char *name, VCOS_UNSIGNED message_size, void *queue_start, VCOS_UNSIGNED queue_size); /** Delete a queue. * @param queue The queue to delete */ VCOS_INLINE_DECL void vcos_queue_delete(VCOS_QUEUE_T *queue); /** Send an item to a queue. If there is no space, the call with * either block waiting for space, or return an error, depending * on the value of the wait parameter. * * @param queue The queue to send to * @param src The data to send (length set when queue was created) * @param wait Whether to wait for space (VCOS_SUSPEND) or fail if * no space (VCOS_NO_SUSPEND). * * @return If space available, returns VCOS_SUCCESS. Otherwise returns * VCOS_EAGAIN if no space available before timeout expires. * */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_queue_send(VCOS_QUEUE_T *queue, const void *src, VCOS_UNSIGNED wait); /** Receive an item from a queue. * @param queue The queue to receive from * @param dst Where to write the data to * @param wait Whether to wait (VCOS_SUSPEND) or fail if * empty (VCOS_NO_SUSPEND). * * @return If an item is available, returns VCOS_SUCCESS. Otherwise returns * VCOS_EAGAIN if no item available before timeout expires. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_queue_receive(VCOS_QUEUE_T *queue, void *dst, VCOS_UNSIGNED wait); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_quickslow_mutex.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - mutex public header file =============================================================================*/ #ifndef VCOS_QUICKSLOW_MUTEX_H #define VCOS_QUICKSLOW_MUTEX_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** * \file vcos_quickslow_mutex.h * * "Quick/Slow" Mutex API. This is a mutex which supports an additional "quick" * (spinlock-based) locking mechanism. While in this quick locked state, other * operating system commands will be unavailable and the caller should complete * whatever it has to do in a short, bounded length of time (as the spinlock * completely locks out other system activity). * * \sa vcos_mutex.h * */ /** Create a mutex. * * @param m Filled in with mutex on return * @param name A non-null name for the mutex, used for diagnostics. * * @return VCOS_SUCCESS if mutex was created, or error code. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_quickslow_mutex_create(VCOS_QUICKSLOW_MUTEX_T *m, const char *name); /** Delete the mutex. */ VCOS_INLINE_DECL void vcos_quickslow_mutex_delete(VCOS_QUICKSLOW_MUTEX_T *m); /** * \brief Wait to claim the mutex ("slow" mode). * * Obtain the mutex. */ VCOS_INLINE_DECL void vcos_quickslow_mutex_lock(VCOS_QUICKSLOW_MUTEX_T *m); /** Release the mutex ("slow" mode). */ VCOS_INLINE_DECL void vcos_quickslow_mutex_unlock(VCOS_QUICKSLOW_MUTEX_T *m); /** * \brief Wait to claim the mutex ("quick" mode). * * Obtain the mutex. The caller must not call any OS functions or do anything * "slow" before the corresponding call to vcos_mutex_quickslow_unlock_quick. */ VCOS_INLINE_DECL void vcos_quickslow_mutex_lock_quick(VCOS_QUICKSLOW_MUTEX_T *m); /** Release the mutex ("quick" mode). */ VCOS_INLINE_DECL void vcos_quickslow_mutex_unlock_quick(VCOS_QUICKSLOW_MUTEX_T *m); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_reentrant_mutex.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - reentrant mutex public header file =============================================================================*/ #ifndef VCOS_REENTRANT_MUTEX_H #define VCOS_REENTRANT_MUTEX_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** * \file * * Reentrant Mutex API. You can take one of these mutexes even if you've already * taken it. Just to make sure. * * A re-entrant mutex may be slower on some platforms than a regular one. * * \sa vcos_mutex.h * */ /** Create a mutex. * * @param m Filled in with mutex on return * @param name A non-null name for the mutex, used for diagnostics. * * @return VCOS_SUCCESS if mutex was created, or error code. */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_reentrant_mutex_create(VCOS_REENTRANT_MUTEX_T *m, const char *name); /** Delete the mutex. */ VCOS_INLINE_DECL void vcos_reentrant_mutex_delete(VCOS_REENTRANT_MUTEX_T *m); /** Wait to claim the mutex. Must not have already been claimed by the current thread. */ #ifndef vcos_reentrant_mutexlock VCOS_INLINE_DECL void vcos_reentrant_mutex_lock(VCOS_REENTRANT_MUTEX_T *m); /** Release the mutex. */ VCOS_INLINE_DECL void vcos_reentrant_mutex_unlock(VCOS_REENTRANT_MUTEX_T *m); #endif #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_semaphore.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - public header file =============================================================================*/ #ifndef VCOS_SEMAPHORE_H #define VCOS_SEMAPHORE_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #ifndef VCOS_PLATFORM_H #include "vcos.h" #endif /** * \file vcos_semaphore.h * * \section sem Semaphores * * This provides counting semaphores. Semaphores are not re-entrant. On sensible * operating systems a semaphore can always be posted but can only be taken in * thread (not interrupt) context. Under Nucleus, a LISR cannot post a semaphore, * although it would not be hard to lift this restriction. * * \subsection timeout Timeout * * On both Nucleus and ThreadX a semaphore can be taken with a timeout. This is * not supported by VCOS because it makes the non-timeout code considerably more * complicated (and hence slower). In the unlikely event that you need a timeout * with a semaphore, and you cannot simply redesign your code to avoid it, use * an event flag (vcos_event_flags.h). * * \subsection sem_nucleus Changes from Nucleus: * * Semaphores are always "FIFO" - i.e. sleeping threads are woken in FIFO order. That's * because: * \arg there's no support for NU_PRIORITY in threadx (though it can be emulated, slowly) * \arg we don't appear to actually consciously use it - for example, Dispmanx uses * it, but all threads waiting are the same priority. * */ /** * \brief Create a semaphore. * * Create a semaphore. * * @param sem Pointer to memory to be initialized * @param name A name for this semaphore. The name may be truncated internally. * @param count The initial count for the semaphore. * * @return VCOS_SUCCESS if the semaphore was created. * */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_semaphore_create(VCOS_SEMAPHORE_T *sem, const char *name, VCOS_UNSIGNED count); /** * \brief Wait on a semaphore. * * There is no timeout option on a semaphore, as adding this will slow down * implementations on some platforms. If you need that kind of behaviour, use * an event group. * * On most platforms this always returns VCOS_SUCCESS, and so would ideally be * a void function, however some platforms allow a wait to be interrupted so * it remains non-void. * * @param sem Semaphore to wait on * @return VCOS_SUCCESS - semaphore was taken. * VCOS_EAGAIN - could not take semaphore * */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_semaphore_wait(VCOS_SEMAPHORE_T *sem); /** * \brief Wait on a semaphore with a timeout. * * Note that this function may not be implemented on all * platforms, and may not be efficient on all platforms * (see comment in vcos_semaphore_wait) * * Try to obtain the semaphore. If it is already taken, return * VCOS_EAGAIN. * @param sem Semaphore to wait on * @param timeout Number of milliseconds to wait before * returning if the semaphore can't be acquired. * @return VCOS_SUCCESS - semaphore was taken. * VCOS_EAGAIN - could not take semaphore (i.e. timeout * expired) * VCOS_EINVAL - Some other error (most likely bad * parameters). */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_semaphore_wait_timeout(VCOS_SEMAPHORE_T *sem, VCOS_UNSIGNED timeout); /** * \brief Try to wait for a semaphore. * * Try to obtain the semaphore. If it is already taken, return VCOS_TIMEOUT. * @param sem Semaphore to wait on * @return VCOS_SUCCESS - semaphore was taken. * VCOS_EAGAIN - could not take semaphore */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_semaphore_trywait(VCOS_SEMAPHORE_T *sem); /** * \brief Post a semaphore. * * @param sem Semaphore to wait on */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_semaphore_post(VCOS_SEMAPHORE_T *sem); /** * \brief Delete a semaphore, releasing any resources consumed by it. * * @param sem Semaphore to wait on */ VCOS_INLINE_DECL void vcos_semaphore_delete(VCOS_SEMAPHORE_T *sem); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_stdbool.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCOS_STDBOOL_H #define VCOS_STDBOOL_H #ifndef __cplusplus #if defined(__STDC__) && (__STDC_VERSION__ >= 199901L) #include #else /* sizeof(bool) == 1. hopefully this matches up with c++ (so structures and * such containing bool are binary compatible), but the c++ standard doesn't * require sizeof(bool) == 1, so there's no guarantee */ typedef unsigned char bool; enum { false, true }; #endif #endif /* __cplusplus */ #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_stdint.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCOS_STDINT_H #define VCOS_STDINT_H /** \file * Attempt to provide the types defined in stdint.h. * * Except for use with lcc, this simply includes stdint.h, which should find * the system/toolchain version if present, otherwise falling back to the * version in interface/vcos/. */ #ifdef __cplusplus extern "C" { #endif #if defined (VCMODS_LCC) #include typedef signed char int8_t; typedef unsigned char uint8_t; typedef signed short int16_t; typedef unsigned short uint16_t; typedef signed long int32_t; typedef unsigned long uint32_t; typedef int32_t intptr_t; typedef uint32_t uintptr_t; typedef int32_t intmax_t; typedef uint32_t uintmax_t; typedef int8_t int_least8_t; typedef int16_t int_least16_t; typedef int32_t int_least32_t; typedef uint8_t uint_least8_t; typedef uint16_t uint_least16_t; typedef uint32_t uint_least32_t; #define INT8_MIN SCHAR_MIN #define INT8_MAX SCHAR_MAX #define UINT8_MAX UCHAR_MAX #define INT16_MIN SHRT_MIN #define INT16_MAX SHRT_MAX #define UINT16_MAX USHRT_MAX #define INT32_MIN LONG_MIN #define INT32_MAX LONG_MAX #define UINT32_MAX ULONG_MAX #define INTPTR_MIN INT32_MIN #define INTPTR_MAX INT32_MAX #define UINTPTR_MAX UINT32_MAX #define INTMAX_MIN INT32_MIN #define INTMAX_MAX INT32_MAX #define UINTMAX_MAX UINT32_MAX /* N.B. 64-bit integer types are not currently supported by lcc. * However, these symbols are referenced in header files included by files * compiled by lcc for VCE, so removing them would break the build. * The solution here then is to define them, as the correct size, but in a * way that should make them unusable in normal arithmetic operations. */ typedef struct { uint32_t a; uint32_t b; } int64_t; typedef struct { uint32_t a; uint32_t b; } uint64_t; #else #include #endif #ifdef __cplusplus } #endif #endif /* VCOS_STDINT_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_string.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - public header file =============================================================================*/ #ifndef VCOS_STRING_H #define VCOS_STRING_H /** * \file * * String functions. * */ #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" #ifdef __KERNEL__ #include #else #include #endif /** Case insensitive string comparison. * */ VCOS_INLINE_DECL int vcos_strcasecmp(const char *s1, const char *s2); VCOS_INLINE_DECL int vcos_strncasecmp(const char *s1, const char *s2, size_t n); VCOSPRE_ int VCOSPOST_ vcos_vsnprintf(char *buf, size_t buflen, const char *fmt, va_list ap); VCOSPRE_ int VCOSPOST_ vcos_snprintf(char *buf, size_t buflen, const char *fmt, ...); /** Like vsnprintf, except it places the output at the specified offset. * Output is truncated to fit in buflen bytes, and is guaranteed to be NUL-terminated. * Returns the string length before/without truncation. */ VCOSPRE_ size_t VCOSPOST_ vcos_safe_vsprintf(char *buf, size_t buflen, size_t offset, const char *fmt, va_list ap); #define VCOS_SAFE_VSPRINTF(buf, offset, fmt, ap) \ vcos_safe_vsprintf(buf, sizeof(buf) + ((char (*)[sizeof(buf)])buf - &(buf)), offset, fmt, ap) /** Like snprintf, except it places the output at the specified offset. * Output is truncated to fit in buflen bytes, and is guaranteed to be NUL-terminated. * Returns the string length before/without truncation. */ VCOSPRE_ size_t VCOSPOST_ vcos_safe_sprintf(char *buf, size_t buflen, size_t offset, const char *fmt, ...); /* The Metaware compiler currently has a bug in its variadic macro handling which causes it to append a spurious command to the end of its __VA_ARGS__ data. Do not use until this has been fixed (and this comment has been deleted). */ #define VCOS_SAFE_SPRINTF(buf, offset, ...) \ vcos_safe_sprintf(buf, sizeof(buf) + ((char (*)[sizeof(buf)])buf - &(buf)), offset, __VA_ARGS__) /** Copies string src to dst at the specified offset. * Output is truncated to fit in dstlen bytes, i.e. the string is at most * (buflen - 1) characters long. Unlike strncpy, exactly one NUL is written * to dst, which is always NUL-terminated. * Returns the string length before/without truncation. */ VCOSPRE_ size_t VCOSPOST_ vcos_safe_strcpy(char *dst, const char *src, size_t dstlen, size_t offset); #define VCOS_SAFE_STRCPY(dst, src, offset) \ vcos_safe_strcpy(dst, src, sizeof(dst) + ((char (*)[sizeof(dst)])dst - &(dst)), offset) VCOS_STATIC_INLINE int vcos_strlen(const char *s) { return (int)strlen(s); } VCOS_STATIC_INLINE int vcos_strcmp(const char *s1, const char *s2) { return strcmp(s1,s2); } VCOS_STATIC_INLINE int vcos_strncmp(const char *cs, const char *ct, size_t count) { return strncmp(cs, ct, count); } VCOS_STATIC_INLINE char *vcos_strcpy(char *dst, const char *src) { return strcpy(dst, src); } VCOS_STATIC_INLINE char *vcos_strncpy(char *dst, const char *src, size_t count) { return strncpy(dst, src, count); } VCOS_STATIC_INLINE void *vcos_memcpy(void *dst, const void *src, size_t n) { memcpy(dst, src, n); return dst; } VCOS_STATIC_INLINE void *vcos_memset(void *p, int c, size_t n) { return memset(p, c, n); } VCOS_STATIC_INLINE int vcos_memcmp(const void *ptr1, const void *ptr2, size_t count) { return memcmp(ptr1, ptr2, count); } #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_thread.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - public header file =============================================================================*/ #ifndef VCOS_THREAD_H #define VCOS_THREAD_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** * \file vcos_thread.h * * \section thread Threads * * Under Nucleus, a thread is created by NU_Create_Task, passing in the stack * and various other parameters. To stop the thread, NU_Terminate_Thread() and * NU_Delete_Thread() are called. * * Unfortunately it's not possible to emulate this API under some fairly common * operating systems. Under Windows you can't pass in the stack, and you can't * safely terminate a thread. * * Therefore, an API which is similar to the pthreads API is used instead. This * API can (mostly) be emulated under all interesting operating systems. * * Obviously this makes the code somewhat more complicated on VideoCore than it * would otherwise be - we end up with an extra mutex per thread, and some code * that waits for it. The benefit is that we have a single way of creating * threads that works consistently on all platforms (apart from stack supplying). * * \subsection stack Stack * * It's still not possible to pass in the stack address, but this can be made * much more obvious in the API: the relevant function is missing and the * CPP symbol VCOS_CAN_SET_STACK_ADDR is zero rather than one. * * \subsection thr_create Creating a thread * * The simplest way to create a thread is with vcos_thread_create() passing in a * NULL thread parameter argument. To wait for the thread to exit, call * vcos_thread_join(). * * \subsection back Backward compatibility * * To ease migration, a "classic" thread creation API is provided for code * that used to make use of Nucleus, vcos_thread_create_classic(). The * arguments are not exactly the same, as the PREEMPT parameter is dropped. * */ #define VCOS_AFFINITY_CPU0 _VCOS_AFFINITY_CPU0 #define VCOS_AFFINITY_CPU1 _VCOS_AFFINITY_CPU1 #define VCOS_AFFINITY_MASK _VCOS_AFFINITY_MASK #define VCOS_AFFINITY_DEFAULT _VCOS_AFFINITY_DEFAULT #define VCOS_AFFINITY_THISCPU _VCOS_AFFINITY_THISCPU /** Report whether or not we have an RTOS at all, and hence the ability to * create threads. */ VCOSPRE_ int VCOSPOST_ vcos_have_rtos(void); /** Create a thread. It must be cleaned up by calling vcos_thread_join(). * * @param thread Filled in on return with thread * @param name A name for the thread. May be the empty string. * @param attrs Attributes; default attributes will be used if this is NULL. * @param entry Entry point. * @param arg Argument passed to the entry point. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_thread_create(VCOS_THREAD_T *thread, const char *name, VCOS_THREAD_ATTR_T *attrs, VCOS_THREAD_ENTRY_FN_T entry, void *arg); /** Exit the thread from within the thread function itself. * Resources must still be cleaned up via a call to thread_join(). * * The thread can also be terminated by simply exiting the thread function. * * @param data Data passed to thread_join. May be NULL. */ VCOSPRE_ void VCOSPOST_ vcos_thread_exit(void *data); /** Wait for a thread to terminate and then clean up its resources. * * @param thread Thread to wait for * @param pData Updated to point at data provided in vcos_thread_exit or exit * code of thread function. */ VCOSPRE_ void VCOSPOST_ vcos_thread_join(VCOS_THREAD_T *thread, void **pData); /** * \brief Create a thread using an API similar to the one "traditionally" * used under Nucleus. * * This creates a thread which must be cleaned up by calling vcos_thread_join(). * The thread cannot be simply terminated (as in Nucleus and ThreadX) as thread * termination is not universally supported. * * @param thread Filled in with thread instance * @param name An optional name for the thread. NULL or "" may be used (but * a name will aid in debugging). * @param entry Entry point * @param arg A single argument passed to the entry point function * @param stack Pointer to stack address * @param stacksz Size of stack in bytes * @param priaff Priority of task, between VCOS_PRI_LOW and VCOS_PRI_HIGH, ORed with the CPU affinity * @param autostart If non-zero the thread will start immediately. * @param timeslice Timeslice (system ticks) for this thread. * * @sa vcos_thread_terminate vcos_thread_delete */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_thread_create_classic(VCOS_THREAD_T *thread, const char *name, void *(*entry)(void *arg), void *arg, void *stack, VCOS_UNSIGNED stacksz, VCOS_UNSIGNED priaff, VCOS_UNSIGNED timeslice, VCOS_UNSIGNED autostart); /** * \brief Set a thread's priority * * Set the priority for a thread. * * @param thread The thread * @param pri Thread priority in VCOS_PRI_MASK bits; affinity in VCOS_AFFINITY_MASK bits. */ VCOS_INLINE_DECL void vcos_thread_set_priority(VCOS_THREAD_T *thread, VCOS_UNSIGNED pri); /** * \brief Return the currently executing thread. * */ VCOS_INLINE_DECL VCOS_THREAD_T *vcos_thread_current(void); /** * \brief Return the thread's priority. */ VCOS_INLINE_DECL VCOS_UNSIGNED vcos_thread_get_priority(VCOS_THREAD_T *thread); /** * \brief Return the thread's cpu affinity. */ VCOS_INLINE_DECL VCOS_UNSIGNED vcos_thread_get_affinity(VCOS_THREAD_T *thread); /** * \brief Set the thread's cpu affinity. */ VCOS_INLINE_DECL void vcos_thread_set_affinity(VCOS_THREAD_T *thread, VCOS_UNSIGNED affinity); /** * \brief Query whether we are in an interrupt. * * @return 1 if in interrupt context. */ VCOS_INLINE_DECL int vcos_in_interrupt(void); /** * \brief Sleep a while. * * @param ms Number of milliseconds to sleep for * * This may actually sleep a whole number of ticks. */ VCOS_INLINE_DECL void vcos_sleep(uint32_t ms); /** * \brief Return the value of the hardware microsecond counter. * */ VCOS_INLINE_DECL uint32_t vcos_getmicrosecs(void); VCOS_INLINE_DECL uint64_t vcos_getmicrosecs64(void); #define vcos_get_ms() (vcos_getmicrosecs()/1000) /** * \brief Return a unique identifier for the current process * */ VCOS_INLINE_DECL VCOS_UNSIGNED vcos_process_id_current(void); /** Relinquish this time slice. */ VCOS_INLINE_DECL void vcos_thread_relinquish(void); /** Return the name of the given thread. */ VCOSPRE_ const char * VCOSPOST_ vcos_thread_get_name(const VCOS_THREAD_T *thread); /** Change preemption. This is almost certainly not what you want, as it won't * work reliably in a multicore system: although you can affect the preemption * on *this* core, you won't affect what's happening on the other core(s). * * It's mainly here to ease migration. If you're using it in new code, you * probably need to think again. * * @param pe New preemption, VCOS_PREEMPT or VCOS_NO_PREEMPT * @return Old value of preemption. */ VCOS_INLINE_DECL VCOS_UNSIGNED vcos_change_preemption(VCOS_UNSIGNED pe); /** Is a thread still running, or has it exited? * * Note: this exists for some fairly scary code in the video codec tests. Don't * try to use it for anything else, as it may well not do what you expect. * * @param thread thread to query * @return non-zero if thread is running, or zero if it has exited. */ VCOS_INLINE_DECL int vcos_thread_running(VCOS_THREAD_T *thread); /** Resume a thread. * * @param thread thread to resume */ VCOS_INLINE_DECL void vcos_thread_resume(VCOS_THREAD_T *thread); /* * Internal APIs - may not always be present and should not be used in * client code. */ extern void _vcos_task_timer_set(void (*pfn)(void*), void *, VCOS_UNSIGNED ms); extern void _vcos_task_timer_cancel(void); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_thread_attr.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - thread attributes =============================================================================*/ #ifndef VCOS_THREAD_ATTR_H #define VCOS_THREAD_ATTR_H #ifdef __cplusplus extern "C" { #endif /** * \file * * Attributes for thread creation. * */ /** Initialize thread attribute struct. This call does not allocate memory, * and so cannot fail. * */ VCOSPRE_ void VCOSPOST_ vcos_thread_attr_init(VCOS_THREAD_ATTR_T *attrs); /** Set the stack address and size. If not set, a stack will be allocated automatically. * * This can only be set on some platforms. It will always be possible to set the stack * address on VideoCore, but on host platforms, support may well not be available. */ #if VCOS_CAN_SET_STACK_ADDR VCOS_INLINE_DECL void vcos_thread_attr_setstack(VCOS_THREAD_ATTR_T *attrs, void *addr, VCOS_UNSIGNED sz); #endif /** Set the stack size. If not set, a default size will be used. Attempting to call this after having * set the stack location with vcos_thread_attr_setstack() will result in undefined behaviour. */ VCOS_INLINE_DECL void vcos_thread_attr_setstacksize(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED sz); /** Set the task priority. If not set, a default value will be used. */ VCOS_INLINE_DECL void vcos_thread_attr_setpriority(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED pri); /** Set the task cpu affinity. If not set, the default will be used. */ VCOS_INLINE_DECL void vcos_thread_attr_setaffinity(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED aff); /** Set the timeslice. If not set the default will be used. */ VCOS_INLINE_DECL void vcos_thread_attr_settimeslice(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED ts); /** The thread entry function takes (argc,argv), as per Nucleus, with * argc being 0. This may be withdrawn in a future release and should not * be used in new code. */ VCOS_INLINE_DECL void _vcos_thread_attr_setlegacyapi(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED legacy); VCOS_INLINE_DECL void vcos_thread_attr_setautostart(VCOS_THREAD_ATTR_T *attrs, VCOS_UNSIGNED autostart); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_timer.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - timer support =============================================================================*/ #ifndef VCOS_TIMER_H #define VCOS_TIMER_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #ifndef VCOS_PLATFORM_H #include "vcos.h" #endif /** \file vcos_timer.h * * Timers are single shot. * * Timer times are in milliseconds. * * \note that timer callback functions are called from an arbitrary thread * context. The expiration function should do its work as quickly as possible; * blocking should be avoided. * * \note On Windows, the separate function vcos_timer_init() must be called * as timer initialization from DllMain is not possible. */ /** Perform timer subsystem initialization. This function is not needed * on non-Windows platforms but is still present so that it can be * called. On Windows it is needed because vcos_init() gets called * from DLL initialization where it is not possible to create a * time queue (deadlock occurs if you try). * * @return VCOS_SUCCESS on success. VCOS_EEXIST if this has already been called * once. VCOS_ENOMEM if resource allocation failed. */ VCOSPRE_ VCOS_STATUS_T VCOSPOST_ vcos_timer_init(void); /** Create a timer in a disabled state. * * The timer is initially disabled. * * @param timer timer handle * @param name name for timer * @param expiration_routine function to call when timer expires * @param context context passed to expiration routine * */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_timer_create(VCOS_TIMER_T *timer, const char *name, void (*expiration_routine)(void *context), void *context); /** Start a timer running. * * Timer must be stopped. * * @param timer timer handle * @param delay Delay to wait for, in ms */ VCOS_INLINE_DECL void vcos_timer_set(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay); /** Stop an already running timer. * * @param timer timer handle */ VCOS_INLINE_DECL void vcos_timer_cancel(VCOS_TIMER_T *timer); /** Stop a timer and restart it. * @param timer timer handle * @param delay delay in ms */ VCOS_INLINE_DECL void vcos_timer_reset(VCOS_TIMER_T *timer, VCOS_UNSIGNED delay); VCOS_INLINE_DECL void vcos_timer_delete(VCOS_TIMER_T *timer); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_tls.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - thread local storage =============================================================================*/ #ifndef VCOS_TLS_H #define VCOS_TLS_H #ifdef __cplusplus extern "C" { #endif #include "interface/vcos/vcos_types.h" #include "vcos.h" /** Create a new thread local storage data key visible to all threads in * the current process. * * @param key The key to create */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_tls_create(VCOS_TLS_KEY_T *key); /** Delete an existing TLS data key. */ VCOS_INLINE_DECL void vcos_tls_delete(VCOS_TLS_KEY_T tls); /** Set the value seen by the current thread. * * @param key The key to update * @param v The value to set for the current thread. * * @return VCOS_SUCCESS, or VCOS_ENOMEM if memory for this slot * could not be allocated. * * If TLS is being emulated via VCOS then the memory required * can be preallocated at thread creation time */ VCOS_INLINE_DECL VCOS_STATUS_T vcos_tls_set(VCOS_TLS_KEY_T tls, void *v); /** Get the value for the current thread. * * @param key The key to update * * @return The current value for this thread. */ VCOS_INLINE_DECL void *vcos_tls_get(VCOS_TLS_KEY_T tls); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vcos/vcos_types.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= VideoCore OS Abstraction Layer - basic types =============================================================================*/ #ifndef VCOS_TYPES_H #define VCOS_TYPES_H #define VCOS_VERSION 1 #include #if defined(__unix__) && !defined(__ANDROID__) #include "interface/vcos/pthreads/vcos_platform_types.h" #else #include "vcos_platform_types.h" #endif #include "interface/vcos/vcos_attr.h" #if !defined(VCOSPRE_) || !defined(VCOSPOST_) #error VCOSPRE_ or VCOSPOST_ not defined! #endif /* Redefine these here; this means that existing header files can carry on * using the VCHPOST/VCHPRE macros rather than having huge changes, which * could cause nasty merge problems. */ #ifndef VCHPOST_ #define VCHPOST_ VCOSPOST_ #endif #ifndef VCHPRE_ #define VCHPRE_ VCOSPRE_ #endif /** Entry function for a lowlevel thread. * * Returns void for consistency with Nucleus/ThreadX. */ typedef void (*VCOS_LLTHREAD_ENTRY_FN_T)(void *); /** Thread entry point. Returns a void* for consistency * with pthreads. */ typedef void *(*VCOS_THREAD_ENTRY_FN_T)(void*); /* Error return codes - chosen to be similar to errno values */ typedef enum { VCOS_SUCCESS, VCOS_EAGAIN, VCOS_ENOENT, VCOS_ENOSPC, VCOS_EINVAL, VCOS_EACCESS, VCOS_ENOMEM, VCOS_ENOSYS, VCOS_EEXIST, VCOS_ENXIO, VCOS_EINTR } VCOS_STATUS_T; /* Some compilers (MetaWare) won't inline with -g turned on, which then results * in a lot of code bloat. To overcome this, inline functions are forward declared * with the prefix VCOS_INLINE_DECL, and implemented with the prefix VCOS_INLINE_IMPL. * * That then means that in a release build, "static inline" can be used in the obvious * way, but in a debug build the implementations can be skipped in all but one file, * by using VCOS_INLINE_BODIES. * * VCOS_INLINE_DECL - put this at the start of an inline forward declaration of a VCOS * function. * * VCOS_INLINE_IMPL - put this at the start of an inlined implementation of a VCOS * function. * */ /* VCOS_EXPORT - it turns out that in some circumstances we need the implementation of * a function even if it is usually inlined. * * In particular, if we have a codec that is usually provided in object form, if it * was built for a debug build it will be full of calls to vcos_XXX(). If this is used * in a *release* build, then there won't be any of these calls around in the main image * as they will all have been inlined. The problem also exists for vcos functions called * from assembler. * * VCOS_EXPORT ensures that the named function will be emitted as a regular (not static-inline) * function inside vcos_.c so that it can be linked against. Doing this for every * VCOS function would be a bit code-bloat-tastic, so it is only done for those that need it. * */ #ifdef __cplusplus #define _VCOS_INLINE inline #else #define _VCOS_INLINE __inline #endif #if defined(NDEBUG) #ifdef __GNUC__ # define VCOS_INLINE_DECL extern __inline__ # define VCOS_INLINE_IMPL static __inline__ #else # define VCOS_INLINE_DECL static _VCOS_INLINE /* declare a func */ # define VCOS_INLINE_IMPL static _VCOS_INLINE /* implement a func inline */ #endif # if defined(VCOS_WANT_IMPL) # define VCOS_EXPORT # else # define VCOS_EXPORT VCOS_INLINE_IMPL # endif /* VCOS_WANT_IMPL */ #define VCOS_INLINE_BODIES #else /* NDEBUG */ #if !defined(VCOS_INLINE_DECL) #define VCOS_INLINE_DECL extern #endif #if !defined(VCOS_INLINE_IMPL) #define VCOS_INLINE_IMPL #endif #define VCOS_EXPORT VCOS_INLINE_IMPL #endif #define VCOS_STATIC_INLINE static _VCOS_INLINE #if defined(__HIGHC__) || defined(__HIGHC_ANSI__) #define _VCOS_METAWARE #endif /** It seems that __FUNCTION__ isn't standard! */ #if __STDC_VERSION__ < 199901L # if __GNUC__ >= 2 || defined(__VIDEOCORE__) # define VCOS_FUNCTION __FUNCTION__ # else # define VCOS_FUNCTION "" # endif #else # define VCOS_FUNCTION __func__ #endif #define _VCOS_MS_PER_TICK (1000/VCOS_TICKS_PER_SECOND) /* Convert a number of milliseconds to a tick count. Internal use only - fails to * convert VCOS_SUSPEND correctly. */ #define _VCOS_MS_TO_TICKS(ms) (((ms)+_VCOS_MS_PER_TICK-1)/_VCOS_MS_PER_TICK) #define VCOS_TICKS_TO_MS(ticks) ((ticks) * _VCOS_MS_PER_TICK) /** VCOS version of DATESTR, from pcdisk.h. Used by the hostreq service. */ typedef struct vcos_datestr { uint8_t cmsec; /**< Centesimal mili second */ uint16_t date; /**< Date */ uint16_t time; /**< Time */ } VCOS_DATESTR; /* Compile-time assert - declares invalid array length if condition * not met, or array of length one if OK. */ #define VCOS_CASSERT(e) extern char vcos_compile_time_check[1/(e)] #define vcos_min(x,y) ((x) < (y) ? (x) : (y)) #define vcos_max(x,y) ((x) > (y) ? (x) : (y)) /** Return the count of an array. FIXME: under gcc we could make * this report an error for pointers using __builtin_types_compatible(). */ #define vcos_countof(x) (sizeof((x)) / sizeof((x)[0])) /* for backward compatibility */ #define countof(x) (sizeof((x)) / sizeof((x)[0])) #define VCOS_ALIGN_DOWN(p,n) (((ptrdiff_t)(p)) & ~((n)-1)) #define VCOS_ALIGN_UP(p,n) VCOS_ALIGN_DOWN((ptrdiff_t)(p)+(n)-1,(n)) #ifdef _MSC_VER #define vcos_alignof(T) __alignof(T) #elif defined(__GNUC__) #define vcos_alignof(T) __alignof__(T) #else #define vcos_alignof(T) (sizeof(struct { T t; char ch; }) - sizeof(T)) #endif /** bool_t is not a POSIX type so cannot rely on it. Define it here. * It's not even defined in stdbool.h. */ typedef int32_t vcos_bool_t; typedef int32_t vcos_fourcc_t; #define VCOS_FALSE 0 #define VCOS_TRUE (!VCOS_FALSE) /** Mark unused arguments to keep compilers quiet */ #define vcos_unused(x) (void)(x) /** For backward compatibility */ typedef vcos_fourcc_t fourcc_t; typedef vcos_fourcc_t FOURCC_T; #ifdef __cplusplus #define VCOS_EXTERN_C_BEGIN extern "C" { #define VCOS_EXTERN_C_END } #else #define VCOS_EXTERN_C_BEGIN #define VCOS_EXTERN_C_END #endif /** Variable attribute indicating the variable must be emitted even if it appears unused. */ #if defined(__GNUC__) || defined(_VCOS_METAWARE) # define VCOS_ATTR_USED __attribute__ ((used)) #else # define VCOS_ATTR_USED #endif /** Variable attribute requiring specific alignment. */ #if defined(__GNUC__) || defined(_VCOS_METAWARE) # define VCOS_ATTR_ALIGNED(n) __attribute__ ((aligned(n))) #else # define VCOS_ATTR_ALIGNED(n) #endif /** Define a function as a weak alias to another function. * @param ret_type Function return type. * @param alias_name Name of the alias. * @param param_list Function parameter list, including the parentheses. * @param target_name Target function (bare function name, not a string). */ #if defined(__GNUC__) || defined(_VCOS_METAWARE) /* N.B. gcc allows __attribute__ after parameter list, but hcvc seems to silently ignore it. */ # define VCOS_WEAK_ALIAS(ret_type, alias_name, param_list, target_name) \ __attribute__ ((weak, alias(#target_name))) ret_type alias_name param_list #else # define VCOS_WEAK_ALIAS(ret_type, alias, params, target) VCOS_CASSERT(0) #endif /** Define a function as a weak alias to another function, specified as a string. * @param ret_type Function return type. * @param alias_name Name of the alias. * @param param_list Function parameter list, including the parentheses. * @param target_name Target function name as a string. * @note Prefer the use of VCOS_WEAK_ALIAS - it is likely to be more portable. * Only use VCOS_WEAK_ALIAS_STR if you need to do pre-processor mangling of the target * symbol. */ #if defined(__GNUC__) || defined(_VCOS_METAWARE) /* N.B. gcc allows __attribute__ after parameter list, but hcvc seems to silently ignore it. */ # define VCOS_WEAK_ALIAS_STR(ret_type, alias_name, param_list, target_name) \ __attribute__ ((weak, alias(target_name))) ret_type alias_name param_list #else # define VCOS_WEAK_ALIAS_STR(ret_type, alias, params, target) VCOS_CASSERT(0) #endif #if defined(__GNUC__) #define VCOS_DEPRECATED(msg) __attribute__((deprecated(msg))) #else #define VCOS_DEPRECATED(msg) #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vctypes/vc_display_types.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /*============================================================================= Common image types used by the vc_image library. =============================================================================*/ #ifndef INTERFACE_VC_DISPLAY_TYPES_H #define INTERFACE_VC_DISPLAY_TYPES_H //enums of display input format typedef enum { VCOS_DISPLAY_INPUT_FORMAT_INVALID = 0, VCOS_DISPLAY_INPUT_FORMAT_RGB888, VCOS_DISPLAY_INPUT_FORMAT_RGB565 } VCOS_DISPLAY_INPUT_FORMAT_T; /** For backward compatibility */ #define DISPLAY_INPUT_FORMAT_INVALID VCOS_DISPLAY_INPUT_FORMAT_INVALID #define DISPLAY_INPUT_FORMAT_RGB888 VCOS_DISPLAY_INPUT_FORMAT_RGB888 #define DISPLAY_INPUT_FORMAT_RGB565 VCOS_DISPLAY_INPUT_FORMAT_RGB565 typedef VCOS_DISPLAY_INPUT_FORMAT_T DISPLAY_INPUT_FORMAT_T; // Enum determining how image data for 3D displays has to be supplied typedef enum { DISPLAY_3D_UNSUPPORTED = 0, // default DISPLAY_3D_INTERLEAVED, // For autosteroscopic displays DISPLAY_3D_SBS_FULL_AUTO, // Side-By-Side, Full Width (also used by some autostereoscopic displays) DISPLAY_3D_SBS_HALF_HORIZ, // Side-By-Side, Half Width, Horizontal Subsampling (see HDMI spec) DISPLAY_3D_TB_HALF, // Top-bottom 3D DISPLAY_3D_FRAME_PACKING, // Frame Packed 3D DISPLAY_3D_FRAME_SEQUENTIAL, // Output left on even frames and right on odd frames (typically 120Hz) DISPLAY_3D_FORMAT_MAX } DISPLAY_3D_FORMAT_T; //enums of display types typedef enum { DISPLAY_INTERFACE_MIN, DISPLAY_INTERFACE_SMI, DISPLAY_INTERFACE_DPI, DISPLAY_INTERFACE_DSI, DISPLAY_INTERFACE_LVDS, DISPLAY_INTERFACE_MAX } DISPLAY_INTERFACE_T; /* display dither setting, used on B0 */ typedef enum { DISPLAY_DITHER_NONE = 0, /* default if not set */ DISPLAY_DITHER_RGB666 = 1, DISPLAY_DITHER_RGB565 = 2, DISPLAY_DITHER_RGB555 = 3, DISPLAY_DITHER_MAX } DISPLAY_DITHER_T; //info struct typedef struct { //type DISPLAY_INTERFACE_T type; //width / height uint32_t width; uint32_t height; //output format DISPLAY_INPUT_FORMAT_T input_format; //interlaced? uint32_t interlaced; /* output dither setting (if required) */ DISPLAY_DITHER_T output_dither; /* Pixel frequency */ uint32_t pixel_freq; /* Line rate in lines per second */ uint32_t line_rate; // Format required for image data for 3D displays DISPLAY_3D_FORMAT_T format_3d; // If display requires PV1 (e.g. DSI1), special config is required in HVS uint32_t use_pixelvalve_1; // Set for DSI displays which use video mode. uint32_t dsi_video_mode; // Select HVS channel (usually 0). uint32_t hvs_channel; } DISPLAY_INFO_T; #endif /* __VC_INCLUDE_IMAGE_TYPES_H__ */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vctypes/vc_image_types.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Common image types used by the vc_image library #ifndef INTERFACE_VC_IMAGE_TYPES_H #define INTERFACE_VC_IMAGE_TYPES_H /* This file gets included by the VCE compiler, which gets confused * easily by the VCOS headers. So cannot include vcos.h here. */ #include "interface/vcos/vcos_stdint.h" /* We have so many rectangle types; let's try to introduce a common one. */ typedef struct tag_VC_RECT_T { int32_t x; int32_t y; int32_t width; int32_t height; } VC_RECT_T; struct VC_IMAGE_T; typedef struct VC_IMAGE_T VC_IMAGE_T; /* Types of image supported. */ /* Please add any new types to the *end* of this list. Also update * case_VC_IMAGE_ANY_xxx macros (below), and the vc_image_type_info table in * vc_image/vc_image_helper.c. */ typedef enum { VC_IMAGE_MIN = 0, //bounds for error checking VC_IMAGE_RGB565 = 1, VC_IMAGE_1BPP, VC_IMAGE_YUV420, VC_IMAGE_48BPP, VC_IMAGE_RGB888, VC_IMAGE_8BPP, VC_IMAGE_4BPP, // 4bpp palettised image VC_IMAGE_3D32, /* A separated format of 16 colour/light shorts followed by 16 z values */ VC_IMAGE_3D32B, /* 16 colours followed by 16 z values */ VC_IMAGE_3D32MAT, /* A separated format of 16 material/colour/light shorts followed by 16 z values */ VC_IMAGE_RGB2X9, /* 32 bit format containing 18 bits of 6.6.6 RGB, 9 bits per short */ VC_IMAGE_RGB666, /* 32-bit format holding 18 bits of 6.6.6 RGB */ VC_IMAGE_PAL4_OBSOLETE, // 4bpp palettised image with embedded palette VC_IMAGE_PAL8_OBSOLETE, // 8bpp palettised image with embedded palette VC_IMAGE_RGBA32, /* RGB888 with an alpha byte after each pixel */ /* xxx: isn't it BEFORE each pixel? */ VC_IMAGE_YUV422, /* a line of Y (32-byte padded), a line of U (16-byte padded), and a line of V (16-byte padded) */ VC_IMAGE_RGBA565, /* RGB565 with a transparent patch */ VC_IMAGE_RGBA16, /* Compressed (4444) version of RGBA32 */ VC_IMAGE_YUV_UV, /* VCIII codec format */ VC_IMAGE_TF_RGBA32, /* VCIII T-format RGBA8888 */ VC_IMAGE_TF_RGBX32, /* VCIII T-format RGBx8888 */ VC_IMAGE_TF_FLOAT, /* VCIII T-format float */ VC_IMAGE_TF_RGBA16, /* VCIII T-format RGBA4444 */ VC_IMAGE_TF_RGBA5551, /* VCIII T-format RGB5551 */ VC_IMAGE_TF_RGB565, /* VCIII T-format RGB565 */ VC_IMAGE_TF_YA88, /* VCIII T-format 8-bit luma and 8-bit alpha */ VC_IMAGE_TF_BYTE, /* VCIII T-format 8 bit generic sample */ VC_IMAGE_TF_PAL8, /* VCIII T-format 8-bit palette */ VC_IMAGE_TF_PAL4, /* VCIII T-format 4-bit palette */ VC_IMAGE_TF_ETC1, /* VCIII T-format Ericsson Texture Compressed */ VC_IMAGE_BGR888, /* RGB888 with R & B swapped */ VC_IMAGE_BGR888_NP, /* RGB888 with R & B swapped, but with no pitch, i.e. no padding after each row of pixels */ VC_IMAGE_BAYER, /* Bayer image, extra defines which variant is being used */ VC_IMAGE_CODEC, /* General wrapper for codec images e.g. JPEG from camera */ VC_IMAGE_YUV_UV32, /* VCIII codec format */ VC_IMAGE_TF_Y8, /* VCIII T-format 8-bit luma */ VC_IMAGE_TF_A8, /* VCIII T-format 8-bit alpha */ VC_IMAGE_TF_SHORT,/* VCIII T-format 16-bit generic sample */ VC_IMAGE_TF_1BPP, /* VCIII T-format 1bpp black/white */ VC_IMAGE_OPENGL, VC_IMAGE_YUV444I, /* VCIII-B0 HVS YUV 4:4:4 interleaved samples */ VC_IMAGE_YUV422PLANAR, /* Y, U, & V planes separately (VC_IMAGE_YUV422 has them interleaved on a per line basis) */ VC_IMAGE_ARGB8888, /* 32bpp with 8bit alpha at MS byte, with R, G, B (LS byte) */ VC_IMAGE_XRGB8888, /* 32bpp with 8bit unused at MS byte, with R, G, B (LS byte) */ VC_IMAGE_YUV422YUYV, /* interleaved 8 bit samples of Y, U, Y, V */ VC_IMAGE_YUV422YVYU, /* interleaved 8 bit samples of Y, V, Y, U */ VC_IMAGE_YUV422UYVY, /* interleaved 8 bit samples of U, Y, V, Y */ VC_IMAGE_YUV422VYUY, /* interleaved 8 bit samples of V, Y, U, Y */ VC_IMAGE_RGBX32, /* 32bpp like RGBA32 but with unused alpha */ VC_IMAGE_RGBX8888, /* 32bpp, corresponding to RGBA with unused alpha */ VC_IMAGE_BGRX8888, /* 32bpp, corresponding to BGRA with unused alpha */ VC_IMAGE_YUV420SP, /* Y as a plane, then UV byte interleaved in plane with with same pitch, half height */ VC_IMAGE_YUV444PLANAR, /* Y, U, & V planes separately 4:4:4 */ VC_IMAGE_TF_U8, /* T-format 8-bit U - same as TF_Y8 buf from U plane */ VC_IMAGE_TF_V8, /* T-format 8-bit U - same as TF_Y8 buf from V plane */ VC_IMAGE_MAX, //bounds for error checking VC_IMAGE_FORCE_ENUM_16BIT = 0xffff, } VC_IMAGE_TYPE_T; /* Image transformations (flips and 90 degree rotations). These are made out of 3 primitives (transpose is done first). These must match the DISPMAN and Media Player definitions. */ #define TRANSFORM_HFLIP (1<<0) #define TRANSFORM_VFLIP (1<<1) #define TRANSFORM_TRANSPOSE (1<<2) typedef enum { VC_IMAGE_ROT0 = 0, VC_IMAGE_MIRROR_ROT0 = TRANSFORM_HFLIP, VC_IMAGE_MIRROR_ROT180 = TRANSFORM_VFLIP, VC_IMAGE_ROT180 = TRANSFORM_HFLIP|TRANSFORM_VFLIP, VC_IMAGE_MIRROR_ROT90 = TRANSFORM_TRANSPOSE, VC_IMAGE_ROT270 = TRANSFORM_TRANSPOSE|TRANSFORM_HFLIP, VC_IMAGE_ROT90 = TRANSFORM_TRANSPOSE|TRANSFORM_VFLIP, VC_IMAGE_MIRROR_ROT270 = TRANSFORM_TRANSPOSE|TRANSFORM_HFLIP|TRANSFORM_VFLIP, } VC_IMAGE_TRANSFORM_T; typedef enum { //defined to be identical to register bits VC_IMAGE_BAYER_RGGB = 0, VC_IMAGE_BAYER_GBRG = 1, VC_IMAGE_BAYER_BGGR = 2, VC_IMAGE_BAYER_GRBG = 3 } VC_IMAGE_BAYER_ORDER_T; typedef enum { //defined to be identical to register bits VC_IMAGE_BAYER_RAW6 = 0, VC_IMAGE_BAYER_RAW7 = 1, VC_IMAGE_BAYER_RAW8 = 2, VC_IMAGE_BAYER_RAW10 = 3, VC_IMAGE_BAYER_RAW12 = 4, VC_IMAGE_BAYER_RAW14 = 5, VC_IMAGE_BAYER_RAW16 = 6, VC_IMAGE_BAYER_RAW10_8 = 7, VC_IMAGE_BAYER_RAW12_8 = 8, VC_IMAGE_BAYER_RAW14_8 = 9, VC_IMAGE_BAYER_RAW10L = 11, VC_IMAGE_BAYER_RAW12L = 12, VC_IMAGE_BAYER_RAW14L = 13, VC_IMAGE_BAYER_RAW16_BIG_ENDIAN = 14, VC_IMAGE_BAYER_RAW4 = 15, } VC_IMAGE_BAYER_FORMAT_T; #endif /* __VC_INCLUDE_IMAGE_TYPES_H__ */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/khronos/IL/OMX_Audio.h ================================================ /* * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** @file OMX_Audio.h - OpenMax IL version 1.1.2 * The structures needed by Audio components to exchange * parameters and configuration data with the componenmilts. */ #ifndef OMX_Audio_h #define OMX_Audio_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_Core.h" /** @defgroup midi MIDI * @ingroup audio */ /** @defgroup effects Audio effects * @ingroup audio */ /** @defgroup audio OpenMAX IL Audio Domain * Structures for OpenMAX IL Audio domain * @{ */ /** Enumeration used to define the possible audio codings. * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must * be done in a vendor specific way. Since this is for an audio * processing element this enum is relevant. However, for another * type of component other enums would be in this area. */ typedef enum OMX_AUDIO_CODINGTYPE { OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */ OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */ OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */ OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */ OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */ OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */ OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/ OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */ OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */ OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */ OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */ OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */ OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */ OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */ OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */ OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */ OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */ OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */ OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */ OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */ OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */ OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */ OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */ OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */ OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */ OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */ OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */ OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */ OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ #define OMX_AUDIO_CodingFLAC_Supported 1 OMX_AUDIO_CodingFLAC, /**< Any variant of FLAC */ #define OMX_AUDIO_CodingDDP_Supported 1 OMX_AUDIO_CodingDDP, /**< Any variant of Dolby Digital Plus */ #define OMX_AUDIO_CodingDTS_Supported 1 OMX_AUDIO_CodingDTS, /**< Any variant of DTS */ #define OMX_AUDIO_CodingWMAPRO_Supported 1 OMX_AUDIO_CodingWMAPRO, /**< Any variant of WMA Professional */ #define OMX_AUDIO_CodingATRAC3_Supported 1 OMX_AUDIO_CodingATRAC3, /**< Sony ATRAC-3 variants */ #define OMX_AUDIO_CodingATRACX_Supported 1 OMX_AUDIO_CodingATRACX, /**< Sony ATRAC-X variants */ #define OMX_AUDIO_CodingATRACAAL_Supported 1 OMX_AUDIO_CodingATRACAAL, /**< Sony ATRAC advanced-lossless variants */ OMX_AUDIO_CodingMax = 0x7FFFFFFF } OMX_AUDIO_CODINGTYPE; /** The PortDefinition structure is used to define all of the parameters * necessary for the compliant component to setup an input or an output audio * path. If additional information is needed to define the parameters of the * port (such as frequency), additional structures must be sent such as the * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port. */ typedef struct OMX_AUDIO_PORTDEFINITIONTYPE { OMX_STRING cMIMEType; /**< MIME type of data for the port */ OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference for an output device, otherwise this field is 0 */ OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is supported by the OMX component */ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */ } OMX_AUDIO_PORTDEFINITIONTYPE; /** Port format parameter. This structure is used to enumerate * the various data input/output format supported by the port. */ typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Indicates which port to set */ OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */ } OMX_AUDIO_PARAM_PORTFORMATTYPE; /** PCM mode type */ typedef enum OMX_AUDIO_PCMMODETYPE { OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */ OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */ OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */ OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_PCMModeMax = 0x7FFFFFFF } OMX_AUDIO_PCMMODETYPE; typedef enum OMX_AUDIO_CHANNELTYPE { OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */ OMX_AUDIO_ChannelLF = 0x1, /**< Left front */ OMX_AUDIO_ChannelRF = 0x2, /**< Right front */ OMX_AUDIO_ChannelCF = 0x3, /**< Center front */ OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */ OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */ OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */ OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */ OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */ OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */ OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_ChannelMax = 0x7FFFFFFF } OMX_AUDIO_CHANNELTYPE; #define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */ #define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */ /** PCM format description */ typedef struct OMX_AUDIO_PARAM_PCMMODETYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */ OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */ OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */ OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for non-interleaved data (e.g. block data) */ OMX_U32 nBitPerSample; /**< Bit per sample */ OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */ OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */ } OMX_AUDIO_PARAM_PCMMODETYPE; /** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC. */ typedef enum OMX_AUDIO_CHANNELMODETYPE { OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those two channels changes accordingly to each channel information */ OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between 2 channels for higher compression gain */ OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half the bitrate of the overall bitrate */ OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */ OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF } OMX_AUDIO_CHANNELMODETYPE; typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE { OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */ OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */ OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */ OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF } OMX_AUDIO_MP3STREAMFORMATTYPE; /** MP3 params */ typedef struct OMX_AUDIO_PARAM_MP3TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should limit the audio signal. Use 0 to let encoder decide */ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */ } OMX_AUDIO_PARAM_MP3TYPE; typedef enum OMX_AUDIO_DDPBITSTREAMID { OMX_AUDIO_DDPBitStreamIdAC3 = 8, OMX_AUDIO_DDPBitStreamIdEAC3 = 16, OMX_AUDIO_DDPBitStreamIdKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_DDPBitStreamIdVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_DDPBitStreamIdMax = 0x7FFFFFFF } OMX_AUDIO_DDPBITSTREAMID; typedef enum OMX_AUDIO_DDPBITSTREAMMODE { OMX_AUDIO_DDPBitStreamModeCM = 0, /**< DDP any main audio service: complete main (CM) */ OMX_AUDIO_DDPBitStreamModeME, /**< DDP any main audio service: music and effects (ME) */ OMX_AUDIO_DDPBitStreamModeVI, /**< DDP any associated service: visually impaired (VI) */ OMX_AUDIO_DDPBitStreamModeHI, /**< DDP any associated service: hearing impaired (HI) */ OMX_AUDIO_DDPBitStreamModeD, /**< DDP any associated service: dialogue (D) */ OMX_AUDIO_DDPBitStreamModeC, /**< DDP any associated service: commentary (C) */ OMX_AUDIO_DDPBitStreamModeE, /**< DDP any associated service: emergency (E) */ OMX_AUDIO_DDPBitStreamModeVO, /**< DDP associated service: voice over (VO) */ OMX_AUDIO_DDPBitStreamModeK, /**< DDP main audio service: karaoke */ OMX_AUDIO_DDPBitStreamModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_DDPBitStreamModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_DDPBitStreamModeMax = 0x7FFFFFFF } OMX_AUDIO_DDPBITSTREAMMODE; typedef enum OMX_AUDIO_DDPDOLBYSURROUNDMODE { OMX_AUDIO_DDPDolbySurroundModeNotIndicated = 0, /**< Not indicated */ OMX_AUDIO_DDPDolbySurroundModeNotDolbySurround, /**< Not Dolby Surround */ OMX_AUDIO_DDPDolbySurroundModeDolbySurroundEncoded, /**< Dolby Surround encoded */ OMX_AUDIO_DDPDolbySurroundModeReserverd, /**< Reserved */ OMX_AUDIO_DDPDolbySurroundModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_DDPDolbySurroundModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_DDPDolbySurroundModeMax = 0x7FFFFFFF } OMX_AUDIO_DDPDOLBYSURROUNDMODE; /** DDP params */ typedef struct OMX_AUDIO_PARAM_DDPTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_AUDIO_DDPBITSTREAMID eBitStreamId; OMX_AUDIO_DDPBITSTREAMMODE eBitStreamMode; OMX_AUDIO_DDPDOLBYSURROUNDMODE eDolbySurroundMode; OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMapping[i] */ } OMX_AUDIO_PARAM_DDPTYPE; /** DTS params */ typedef struct OMX_AUDIO_PARAM_DTSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nDtsType; /** DTS type 1, 2, or 3. */ OMX_U32 nFormat; /** DTS stream is either big/little endian and 16/14 bit packing */ OMX_U32 nDtsFrameSizeBytes; /** DTS frame size in bytes */ OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMapping[i] */ } OMX_AUDIO_PARAM_DTSTYPE; typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE { OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */ OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */ OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */ OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */ OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */ OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */ OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */ OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF } OMX_AUDIO_AACSTREAMFORMATTYPE; /** AAC mode type. Note that the term profile is used with the MPEG-2 * standard and the term object type and profile is used with MPEG-4 */ typedef enum OMX_AUDIO_AACPROFILETYPE{ OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */ OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */ OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */ OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */ OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */ OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */ OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */ OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */ OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */ OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */ OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AACObjectMax = 0x7FFFFFFF } OMX_AUDIO_AACPROFILETYPE; /** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE). * Required for encoder configuration and optional as decoder info output. * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */ #define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */ #define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */ #define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */ #define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */ #define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */ #define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */ #define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/ /** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE). * Required for ER encoder configuration and optional as decoder info output */ #define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */ #define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */ #define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */ #define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */ #define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */ /** AAC params */ typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should limit the audio signal. Use 0 to let encoder decide */ OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec. Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD). Use 0 to let encoder decide */ OMX_U32 nAACtools; /**< AAC tool usage */ OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */ OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */ OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ } OMX_AUDIO_PARAM_AACPROFILETYPE; /** VORBIS params */ typedef struct OMX_AUDIO_PARAM_VORBISTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable rate or unknown bit rates. Encoding is set to the bitrate closest to specified value (in bps) */ OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */ OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should limit the audio signal. Use 0 to let encoder decide */ OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high). In the default mode of operation, the quality level is 3. Normal quality range is 0 - 10. */ OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the normal VBR encoding, but allows hard or soft bitrate constraints to be enforced by the encoder. This mode can be slower, and may also be lower quality. It is primarily useful for streaming. */ OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on non-stereo streams). Useful for lower-bitrate encoding. */ } OMX_AUDIO_PARAM_VORBISTYPE; /** WMA Version */ typedef enum OMX_AUDIO_WMAFORMATTYPE { OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */ OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */ OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */ OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */ OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF } OMX_AUDIO_WMAFORMATTYPE; /** WMA Profile */ typedef enum OMX_AUDIO_WMAPROFILETYPE { OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */ OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */ OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */ OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */ OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF } OMX_AUDIO_WMAPROFILETYPE; /** WMA params */ typedef struct OMX_AUDIO_PARAM_WMATYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U16 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */ OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */ OMX_U32 nSamplingRate; /**< Sampling rate of the source data */ OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */ OMX_U16 nEncodeOptions; /**< WMA Type-specific data */ OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */ } OMX_AUDIO_PARAM_WMATYPE; /** * RealAudio format */ typedef enum OMX_AUDIO_RAFORMATTYPE { OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */ OMX_AUDIO_RA8, /**< RealAudio 8 codec */ OMX_AUDIO_RA9, /**< RealAudio 9 codec */ OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */ OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */ OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */ OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */ OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */ OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_RAFormatMax = 0x7FFFFFFF } OMX_AUDIO_RAFORMATTYPE; /** RA (Real Audio) params */ typedef struct OMX_AUDIO_PARAM_RATYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */ OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */ OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */ OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */ OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */ OMX_U32 nNumRegions; /**< is the number of regions value */ OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */ } OMX_AUDIO_PARAM_RATYPE; /** SBC Allocation Method Type */ typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE { OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */ OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */ OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF } OMX_AUDIO_SBCALLOCMETHODTYPE; /** SBC params */ typedef struct OMX_AUDIO_PARAM_SBCTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ OMX_U32 nBlocks; /**< Number of blocks */ OMX_U32 nSubbands; /**< Number of subbands */ OMX_U32 nBitPool; /**< Bitpool value */ OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */ OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */ } OMX_AUDIO_PARAM_SBCTYPE; /** ADPCM stream format parameters */ typedef struct OMX_AUDIO_PARAM_ADPCMTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_U32 nBitsPerSample; /**< Number of bits in each sample */ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for variable or unknown sampling rate. */ } OMX_AUDIO_PARAM_ADPCMTYPE; /** G723 rate */ typedef enum OMX_AUDIO_G723RATE { OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */ OMX_AUDIO_G723ModeLow, /**< 5300 bps */ OMX_AUDIO_G723ModeHigh, /**< 6300 bps */ OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_G723ModeMax = 0x7FFFFFFF } OMX_AUDIO_G723RATE; /** G723 - Sample rate must be 8 KHz */ typedef struct OMX_AUDIO_PARAM_G723TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ OMX_BOOL bPostFilter; /**< Enable Post Filter */ } OMX_AUDIO_PARAM_G723TYPE; /** ITU G726 (ADPCM) rate */ typedef enum OMX_AUDIO_G726MODE { OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */ OMX_AUDIO_G726Mode16, /**< 16 kbps */ OMX_AUDIO_G726Mode24, /**< 24 kbps */ OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */ OMX_AUDIO_G726Mode40, /**< 40 kbps */ OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_G726ModeMax = 0x7FFFFFFF } OMX_AUDIO_G726MODE; /** G.726 stream format parameters - must be at 8KHz */ typedef struct OMX_AUDIO_PARAM_G726TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_AUDIO_G726MODE eG726Mode; } OMX_AUDIO_PARAM_G726TYPE; /** G729 coder type */ typedef enum OMX_AUDIO_G729TYPE { OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */ OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */ OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */ OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */ OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_G729Max = 0x7FFFFFFF } OMX_AUDIO_G729TYPE; /** G729 stream format parameters - fixed 6KHz sample rate */ typedef struct OMX_AUDIO_PARAM_G729TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_AUDIO_G729TYPE eBitType; } OMX_AUDIO_PARAM_G729TYPE; /** AMR Frame format */ typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE { OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance (Standard) Format */ OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface Format 1 */ OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface Format 2*/ OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage Format */ OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time Transport Protocol Payload Format */ OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */ OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF } OMX_AUDIO_AMRFRAMEFORMATTYPE; /** AMR band mode */ typedef enum OMX_AUDIO_AMRBANDMODETYPE { OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */ OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */ OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */ OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */ OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */ OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */ OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */ OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */ OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */ OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */ OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */ OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */ OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */ OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */ OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */ OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */ OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */ OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */ OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF } OMX_AUDIO_AMRBANDMODETYPE; /** AMR Discontinuous Transmission mode */ typedef enum OMX_AUDIO_AMRDTXMODETYPE { OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */ OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using Voice Activity Detector 1 (VAD1) is enabled */ OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using Voice Activity Detector 2 (VAD2) is enabled */ OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between Off, VAD1 or VAD2 modes */ OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */ OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF } OMX_AUDIO_AMRDTXMODETYPE; /** AMR params */ typedef struct OMX_AUDIO_PARAM_AMRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels */ OMX_U32 nBitRate; /**< Bit rate read only field */ OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */ OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */ OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */ } OMX_AUDIO_PARAM_AMRTYPE; /** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */ typedef struct OMX_AUDIO_PARAM_GSMFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_GSMFRTYPE; /** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */ typedef struct OMX_AUDIO_PARAM_GSMHRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_GSMHRTYPE; /** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */ typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_GSMEFRTYPE; /** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_TDMAFRTYPE; /** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_TDMAEFRTYPE; /** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_PDCFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_PDCFRTYPE; /** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_PDCEFRTYPE; /** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_PDCHRTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */ } OMX_AUDIO_PARAM_PDCHRTYPE; /** CDMA Rate types */ typedef enum OMX_AUDIO_CDMARATETYPE { OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */ OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */ OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */ OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */ OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/ OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */ OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_CDMARateMax = 0x7FFFFFFF } OMX_AUDIO_CDMARATETYPE; /** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_QCELP8TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable rate or unknown bit rates */ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ } OMX_AUDIO_PARAM_QCELP8TYPE; /** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_QCELP13TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ } OMX_AUDIO_PARAM_QCELP13TYPE; /** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_EVRCTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */ } OMX_AUDIO_PARAM_EVRCTYPE; /** SMV ( up to 8.55kbps coder) stream format parameters */ typedef struct OMX_AUDIO_PARAM_SMVTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannels; /**< Number of channels in the data stream (not necessarily the same as the number of channels to be rendered. */ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/ } OMX_AUDIO_PARAM_SMVTYPE; /** MIDI Format * @ingroup midi */ typedef enum OMX_AUDIO_MIDIFORMATTYPE { OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */ OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */ OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */ OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */ OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */ OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */ OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */ OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */ OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF } OMX_AUDIO_MIDIFORMATTYPE; /** MIDI params * @ingroup midi */ typedef struct OMX_AUDIO_PARAM_MIDITYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire MIDI file passed in, otherwise if 0x0, the MIDI data is merged and streamed (instead of passed as an entire MIDI file) */ OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic voices. A value of zero indicates that the default polyphony of the device is used */ OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound bank at initialization */ OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */ } OMX_AUDIO_PARAM_MIDITYPE; /** Type of the MIDI sound bank * @ingroup midi */ typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE { OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */ OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */ OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */ OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */ OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */ OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF } OMX_AUDIO_MIDISOUNDBANKTYPE; /** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank * @ingroup midi */ typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE { OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */ OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */ OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */ OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */ OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF } OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE; /** MIDI params to load/unload user soundbank * @ingroup midi */ typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nDLSIndex; /**< DLS file index to be loaded */ OMX_U32 nDLSSize; /**< Size in bytes */ OMX_PTR pDLSData; /**< Pointer to DLS file data */ OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */ OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */ } OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE; /** Structure for Live MIDI events and MIP messages. * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.) * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */ OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an array for the MIP message buffer, where the size is indicated by nMidiEventSize */ } OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE; /** MIDI sound bank/ program pair in a given channel * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */ OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */ OMX_U16 nIDSoundBank; /**< Sound bank ID */ OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks by index if multiple banks are present */ } OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE; /** MIDI control * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10 format based on JAVA MMAPI (JSR-135) requirement */ OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point number based on JSR-135 requirement */ OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10 fixed-point number based on JSR-135 requirement */ OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic voices. A value of zero indicates that the default polyphony of the device is used */ OMX_U32 nNumRepeat; /**< Number of times to repeat playback */ OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback will stop automatically. Set to zero if not used */ OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */ OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */ OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */ OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */ OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */ OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */ } OMX_AUDIO_CONFIG_MIDICONTROLTYPE; /** MIDI Playback States * @ingroup midi */ typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE { OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to other defined states */ OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open. The MIDI engine is currently processing MIDI events. */ OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being primed. The MIDI engine is currently processing MIDI events. */ OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but not playing. The MIDI engine is currently processing MIDI events. The transition to this state is only possible from the OMX_AUDIO_MIDIPlayBackStatePlaying state, when the 'playback head' reaches the end of media data or the playback stops due to stop time set.*/ OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently playing. The MIDI engine is currently processing MIDI events.*/ OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS resource constraints */ OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and SP-MIDI content constraints, there is no audible MIDI content during playback currently. The situation may change if resources are freed later.*/ OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF } OMX_AUDIO_MIDIPLAYBACKSTATETYPE; /** MIDI status * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field. NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_U32 nDuration; /**< The length of the currently open MIDI resource in milliseconds. NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_U32 nPosition; /**< Current Position of the MIDI resource being played in milliseconds */ OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently open MIDI resource. NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing MIDI resource. NOTE: May not return a meaningful value until the entire file is parsed and buffered. */ OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */ } OMX_AUDIO_CONFIG_MIDISTATUSTYPE; /** MIDI Meta Event structure one per Meta Event. * MIDI Meta Events are like audio metadata, except that they are interspersed * with the MIDI content throughout the file and are not localized in the header. * As such, it is necessary to retrieve information about these Meta Events from * the engine, as it encounters these Meta Events within the MIDI content. * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright, * author, default tempo, etc.) scattered throughout the file. * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{ OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nIndex; /**< Index of Meta Event */ OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ OMX_U32 nTrack; /**< track number for the meta event */ OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */ } OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE; /** MIDI Meta Event Data structure - one per Meta Event. * @ingroup midi */ typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{ OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nIndex; /**< Index of Meta Event */ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */ OMX_U8 nData[1]; /**< array of one or more bytes of meta data as indicated by the nMetaEventSize field */ } OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE; /** Audio Volume adjustment for a port */ typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port index indicating which port to set. Select the input port to set just that port's volume. Select the output port to adjust the master volume. */ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or logarithmic scale (mB) */ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR Volume logarithmic setting for this port. The values for volume are in mB (millibels = 1/100 dB) relative to a gain of 1 (e.g. the output is the same as the input level). Values are in mB from nMax (maximum volume) to nMin mB (typically negative). Since the volume is "voltage" and not a "power", it takes a setting of -600 mB to decrease the volume by 1/2. If a component cannot accurately set the volume to the requested value, it must set the volume to the closest value BELOW the requested value. When getting the volume setting, the current actual volume must be returned. */ } OMX_AUDIO_CONFIG_VOLUMETYPE; /** Audio Volume adjustment for a channel */ typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port index indicating which port to set. Select the input port to set just that port's volume. Select the output port to adjust the master volume. */ OMX_U32 nChannel; /**< channel to select from 0 to N-1, using OMX_ALL to apply volume settings to all channels */ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or logarithmic scale (mB) */ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR Volume logarithmic setting for this port. The values for volume are in mB (millibels = 1/100 dB) relative to a gain of 1 (e.g. the output is the same as the input level). Values are in mB from nMax (maximum volume) to nMin mB (typically negative). Since the volume is "voltage" and not a "power", it takes a setting of -600 mB to decrease the volume by 1/2. If a component cannot accurately set the volume to the requested value, it must set the volume to the closest value BELOW the requested value. When getting the volume setting, the current actual volume must be returned. */ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, FALSE otherwise */ } OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE; /** Audio balance setting */ typedef struct OMX_AUDIO_CONFIG_BALANCETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port index indicating which port to set. Select the input port to set just that port's balance. Select the output port to adjust the master balance. */ OMX_S32 nBalance; /**< balance setting for this port (-100 to 100, where -100 indicates all left, and no right */ } OMX_AUDIO_CONFIG_BALANCETYPE; /** Audio Port mute */ typedef struct OMX_AUDIO_CONFIG_MUTETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port index indicating which port to set. Select the input port to set just that port's mute. Select the output port to adjust the master mute. */ OMX_BOOL bMute; /**< Mute setting for this port */ } OMX_AUDIO_CONFIG_MUTETYPE; /** Audio Channel mute */ typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nChannel; /**< channel to select from 0 to N-1, using OMX_ALL to apply mute settings to all channels */ OMX_BOOL bMute; /**< Mute setting for this channel */ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel, FALSE otherwise */ } OMX_AUDIO_CONFIG_CHANNELMUTETYPE; /** Enable / Disable for loudness control, which boosts bass and to a * smaller extent high end frequencies to compensate for hearing * ability at the extreme ends of the audio spectrum */ typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bLoudness; /**< Enable/disable for loudness */ } OMX_AUDIO_CONFIG_LOUDNESSTYPE; /** Enable / Disable for bass, which controls low frequencies */ typedef struct OMX_AUDIO_CONFIG_BASSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for bass control */ OMX_S32 nBass; /**< bass setting for the port, as a continuous value from -100 to 100 (0 means no change in bass level)*/ } OMX_AUDIO_CONFIG_BASSTYPE; /** Enable / Disable for treble, which controls high frequencies tones */ typedef struct OMX_AUDIO_CONFIG_TREBLETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for treble control */ OMX_S32 nTreble; /**< treble setting for the port, as a continuous value from -100 to 100 (0 means no change in treble level) */ } OMX_AUDIO_CONFIG_TREBLETYPE; /** An equalizer is typically used for two reasons: to compensate for an * sub-optimal frequency response of a system to make it sound more natural * or to create intentionally some unnatural coloring to the sound to create * an effect. * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for equalizer */ OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is N-1, where N is the number of bands, lower limit is 0 */ OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a read only element and is used to determine the lower, center and upper frequency of this band. */ OMX_BS32 sBandLevel; /**< band level in millibels */ } OMX_AUDIO_CONFIG_EQUALIZERTYPE; /** Stereo widening mode type * @ingroup effects */ typedef enum OMX_AUDIO_STEREOWIDENINGTYPE { OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */ OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */ OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF } OMX_AUDIO_STEREOWIDENINGTYPE; /** Control for stereo widening, which is a special 2-channel * case of the audio virtualizer effect. For example, for 5.1-channel * output, it translates to virtual surround sound. * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */ OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */ OMX_U32 nStereoWidening; /**< stereo widening setting for the port, as a continuous value from 0 to 100 */ } OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE; /** The chorus effect (or ``choralizer'') is any signal processor which makes * one sound source (such as a voice) sound like many such sources singing * (or playing) in unison. Since performance in unison is never exact, chorus * effects simulate this by making independently modified copies of the input * signal. Modifications may include (1) delay, (2) frequency shift, and * (3) amplitude modulation. * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for chorus */ OMX_BU32 sDelay; /**< average delay in milliseconds */ OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */ OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of delay (i.e. 0 to 100) */ OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */ } OMX_AUDIO_CONFIG_CHORUSTYPE; /** Reverberation is part of the reflected sound that follows the early * reflections. In a typical room, this consists of a dense succession of * echoes whose energy decays exponentially. The reverberation effect structure * as defined here includes both (early) reflections as well as (late) reverberations. * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bEnable; /**< Enable/disable for reverberation control */ OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect (i.e. both early reflections and late reverberation) in millibels */ OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies relative to the intensity at low frequencies in millibels */ OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections (relative to room value), in millibels */ OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative to the direct path, in milliseconds */ OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation relative to room level, in millibels */ OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection to the beginning of the late reverberation section, in milliseconds */ OMX_BU32 sDecayTime; /**< Late reverberation decay time at low frequencies, in milliseconds */ OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative to low frequency decay time in percent */ OMX_U32 nDensity; /**< Modal density in the late reverberation decay, in percent (i.e. 0 - 100) */ OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay, in percent (i.e. 0 - 100) */ OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is the frequency used as the reference for all the high-frequency settings above */ } OMX_AUDIO_CONFIG_REVERBERATIONTYPE; /** Possible settings for the Echo Cancelation structure to use * @ingroup effects */ typedef enum OMX_AUDIO_ECHOCANTYPE { OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */ OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation - echo from plastics and face */ OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for Hands Free operation */ OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for Car Kit (longer echo) */ OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_AUDIO_EchoCanMax = 0x7FFFFFFF } OMX_AUDIO_ECHOCANTYPE; /** Enable / Disable for echo cancelation, which removes undesired echo's * from the audio * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */ } OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE; /** Enable / Disable for noise reduction, which undesired noise from * the audio * @ingroup effects */ typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */ } OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE; /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/khronos/IL/OMX_Broadcom.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // OpenMAX IL - Broadcom specific types #ifndef OMX_Broadcom_h #define OMX_Broadcom_h #include "OMX_Component.h" // for use in buffer headers - marks the contained data // as being a codec header #define OMX_BUFFERFLAG_TIME_UNKNOWN 0x00000100 //for use in buffer headers - marks the buffer as being the //snapshot preview image from a still capture. //Mainly to be used with the DisplayFunction callback from camera. #define OMX_BUFFERFLAG_CAPTURE_PREVIEW 0x00000200 /* Mark the end of a NAL unit produced by a video encoder. */ #define OMX_BUFFERFLAG_ENDOFNAL 0x00000400 /* Marks pBuffer in OMX_BUFFERHEADERTYPE as containing a fragment list instead of the actual buffer */ #define OMX_BUFFERFLAG_FRAGMENTLIST 0x00000800 /* Marks the start of a new sequence of data following any kind of seek operation. */ #define OMX_BUFFERFLAG_DISCONTINUITY 0x00001000 /** Codec side information Flag: * OMX_BUFFERFLAG_CODECSIDEINFO is an optional flag that is set by an * output port when all bytes in the buffer form part or all of a set of * codec specific side information. For example, distortion information * estimated by H.264 encoder can be sent using this flag to signal * the decoder quality */ #define OMX_BUFFERFLAG_CODECSIDEINFO 0x00002000 // for use in buffer headers - indicated the timestamp is a DTS rather than PTS #define OMX_BUFFERFLAG_TIME_IS_DTS 0x000004000 // for use in buffer headers - signals that a video picture is interlaced #define OMX_BUFFERFLAG_INTERLACED 0x000010000 // Signals that the top field of the current interlaced frame should be displayed first #define OMX_BUFFERFLAG_TOP_FIELD_FIRST 0x000020000 /** * Macros to convert to OMX_TICKS from a signed 64 bit value and * vice-versa. These macros don't actually do anything unless OMX_TICKS * is defined as a two-part structure (instead of a native signed 64-bit type). **/ #ifndef OMX_SKIP64BIT #define omx_ticks_from_s64(s) (s) #define omx_ticks_to_s64(t) (t) #else static inline OMX_TICKS omx_ticks_from_s64(signed long long s) { OMX_TICKS t; t.nLowPart = (OMX_U32)s; t.nHighPart = (OMX_U32)(s>>32); return t; } #define omx_ticks_to_s64(t) ((t).nLowPart | ((uint64_t)((t).nHighPart) << 32)) #endif /* OMX_SKIP64BIT */ /* Buffer fragment descriptor */ typedef struct OMX_BUFFERFRAGMENTTYPE { OMX_PTR pBuffer; /**< Pointer to actual block of memory that is acting as the fragment buffer */ OMX_U32 nLen; /**< number of bytes in the buffer */ } OMX_BUFFERFRAGMENTTYPE; /* OMX_IndexParamBrcmEnableIJGTableScaling: JPEG Quality Table Setting. */ typedef struct OMX_PARAM_IJGSCALINGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; } OMX_PARAM_IJGSCALINGTYPE; /* The boolean \code{bEnabled} value determines whether the component uses the standard IJG quality tables when encoding images. */ /* OMX_IndexConfigTimeInvalidStartTime: Invalid Start Times */ /* This allows clock clients to supply a start time notification to the clock whilst indicating that this time is invalid. */ /* OMX_IndexParamBrcmMaxFrameSkips: Frame timestamp jumps */ /* This number represents the number of times a jump in frame timestamps has been observed that is greater than expected. */ /* OMX_IndexConfigAsynchronousFailureURI: Asynchronous Failure Filename */ /* This allows the client to query for the filename that cause an asynchronous output error. */ /* OMX_IndexParamAsynchronousOutput: Asynchronous Output */ /* The allows the client to specify to a component that is writing files that this writing may happen asynchronously, including opening and closing of files. */ /* OMX_IndexConfigClockAdjustment: Clock Adjustment */ /* This allows the client to read from the clock the total time adjustment made to the clock whilst running by the reference clock. If the reference clock sends a time that causes the media time to jump this difference is added to the total, which can be reported via this index. When the stream restarts by setting the clock state to \code{OMX_TIME_ClockStateRunning} or \code{OMX_TIME_ClockStateWaitingForStartTime} this adjustment total is set to zero. */ /* OMX_IndexParamBrcmDataUnit: Data Unit */ /* The data unit is an indication to components connected to this component of the type of data delivery available. \code{OMX_DataUnitCodedPicture} indicates that we are able to give framing information, using the \code{OMX_BUFFERFLAG_ENDOFFRAME} flag to indicate that the data contained finishes a complete frame. \code{OMX_DataUnitArbitraryStreamSection} indicates that no end-of-frame markers will be present, and the decoder should perform the steps necessary to decode the stream. The other enum values are not used. */ /* OMX_IndexConfigPresentationOffset: Presentation Offset */ /* The value of \code{nTimestamp} is added to the offset requested for each new input frame. Takes effect for all new input frames, and has no effect on the offset used for currently-queued frames. A positive value will make the requested port earlier relative to other streams, a negative value will make the requested port later relative to other streams. */ /* OMX_IndexConfigSingleStep: Single Step */ /* When setting this config on a paused clock, where the \code{nU32} value is non-zero and \code{nPortIndex} is OMX_ALL, the media clock will advance through the next \code{nU32} next requested media times. A paused clock is in running state but has a time scale of 0. This will trigger the display of some video frames, so allowing single-stepping functionality. This config can be set multiple times, and will buffer up stepping requests until we have media requests to fulfil, or the clock is stopped or un-paused. This config can also be used on some video output ports and, if \code{nU32} is non-zero, requests that the output port forwards the next \code{nU32} frames appending an EOS marker on the last frame, and then ceases to forward data on this port. If \code{nU32} is zero, any previous request to forward a limited number of frames is cancelled and the default behaviour of this port will resume. */ /* OMX_IndexParamCameraCamplusId: Camera Subsystem Identification */ /* This parameter allows the configuration of the identifier to be used to initialise the Broadcom Camplus subsystem that sits beneath the camera component. If only one instance of the camera component is used, the default value can be used. If more than one instance is required, they must each have their own unique values for this parameter. It is also used to tie the component to the image pool created with \code{OMX_Set upCamPools}. */ /* OMX_IndexConfigAudioRenderingLatency: Audio Rendering Latency */ /* This config allows the client to query the current latency of audio rendering. The latency is returned as the number of samples that an audio rendering component has received but have not been played. */ /* OMX_IndexConfigBrcmPoolMemAllocSize: Pool memory usage values */ /* This config allows the client to query how much memory is being used by the component for any image pools. */ /* OMX_IndexConfigDisplayRegion: Display Region */ typedef enum OMX_DISPLAYTRANSFORMTYPE{ OMX_DISPLAY_ROT0 = 0, OMX_DISPLAY_MIRROR_ROT0 = 1, OMX_DISPLAY_MIRROR_ROT180 = 2, OMX_DISPLAY_ROT180 = 3, OMX_DISPLAY_MIRROR_ROT90 = 4, OMX_DISPLAY_ROT270 = 5, OMX_DISPLAY_ROT90 = 6, OMX_DISPLAY_MIRROR_ROT270 = 7, OMX_DISPLAY_DUMMY = 0x7FFFFFFF } OMX_DISPLAYTRANSFORMTYPE; typedef struct OMX_DISPLAYRECTTYPE { OMX_S16 x_offset; OMX_S16 y_offset; OMX_S16 width; OMX_S16 height; } OMX_DISPLAYRECTTYPE; typedef enum OMX_DISPLAYMODETYPE { OMX_DISPLAY_MODE_FILL = 0, OMX_DISPLAY_MODE_LETTERBOX = 1, // these allow a left eye source->dest to be specified and the right eye mapping will be inferred by symmetry OMX_DISPLAY_MODE_STEREO_LEFT_TO_LEFT = 2, OMX_DISPLAY_MODE_STEREO_TOP_TO_TOP = 3, OMX_DISPLAY_MODE_STEREO_LEFT_TO_TOP = 4, OMX_DISPLAY_MODE_STEREO_TOP_TO_LEFT = 5, OMX_DISPLAY_MODE_DUMMY = 0x7FFFFFFF } OMX_DISPLAYMODETYPE; typedef enum OMX_DISPLAYSETTYPE { OMX_DISPLAY_SET_NONE = 0, OMX_DISPLAY_SET_NUM = 1, OMX_DISPLAY_SET_FULLSCREEN = 2, OMX_DISPLAY_SET_TRANSFORM = 4, OMX_DISPLAY_SET_DEST_RECT = 8, OMX_DISPLAY_SET_SRC_RECT = 0x10, OMX_DISPLAY_SET_MODE = 0x20, OMX_DISPLAY_SET_PIXEL = 0x40, OMX_DISPLAY_SET_NOASPECT = 0x80, OMX_DISPLAY_SET_LAYER = 0x100, OMX_DISPLAY_SET_COPYPROTECT = 0x200, OMX_DISPLAY_SET_ALPHA = 0x400, OMX_DISPLAY_SET_DUMMY = 0x7FFFFFFF } OMX_DISPLAYSETTYPE; typedef struct OMX_CONFIG_DISPLAYREGIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_DISPLAYSETTYPE set; OMX_U32 num; OMX_BOOL fullscreen; OMX_DISPLAYTRANSFORMTYPE transform; OMX_DISPLAYRECTTYPE dest_rect; OMX_DISPLAYRECTTYPE src_rect; OMX_BOOL noaspect; OMX_DISPLAYMODETYPE mode; OMX_U32 pixel_x; OMX_U32 pixel_y; OMX_S32 layer; OMX_BOOL copyprotect_required; OMX_U32 alpha; OMX_U32 wfc_context_width; OMX_U32 wfc_context_height; } OMX_CONFIG_DISPLAYREGIONTYPE; /* This config sets the output display device, as well as the region used on the output display, any display transformation, and some flags to indicate how to scale the image. The structure uses a bitfield, \code{set}, to indicate which fields are set and should be used. All other fields will maintain their current value. \code{num} describes the display output device, with 0 typically being a directly connected LCD display. \code{fullscreen} indicates that we are using the full device screen area, rather than a window of the display. If fullscreen is false, then dest_rect is used to specify a region of the display to use. \code{transform} indicates any rotation or flipping used to map frames onto the natural display orientation. The \code{src_rect} indicates which area of the frame to display. If all values are zero, the whole frame will be used. The \code{noaspect} flag, if set, indicates that any display scaling should disregard the aspect ratio of the frame region being displayed. \code{mode} indicates how the image should be scaled to fit the display. \code{OMX_DISPLAY_MODE_FILL} indicates that the image should fill the screen by potentially cropping the frames. Setting \code{mode} to \code{OMX_DISPLAY_MODE_LETTERBOX} indicates that all the source region should be displayed and black bars added if necessary. The \code{pixel_x} and \code{pixel_y} values, if non-zero, are used to describe the size of a source pixel. If values are zero, then pixels default to being square. Set the \code{layer} that the image will appear on with the \code{layer} field. */ /* OMX_IndexParamSource: Source Image Configuration */ typedef enum OMX_SOURCETYPE { OMX_SOURCE_WHITE = 0, // all white images OMX_SOURCE_BLACK = 1, // all black images OMX_SOURCE_DIAGONAL = 2, // greyscale diagonal stripes OMX_SOURCE_NOISE = 3, // random pixel values OMX_SOURCE_RANDOM = 4, // a shaded random pattern of colours OMX_SOURCE_COLOUR = 5, // a solid colour determined by nParam OMX_SOURCE_BLOCKS = 6, // random coloured blocks of 16x16 size OMX_SOURCE_SWIRLY, // a swirly pattern used for encode testing OMX_SOURCE_DUMMY = 0x7FFFFFFF } OMX_SOURCETYPE; typedef struct OMX_PARAM_SOURCETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_SOURCETYPE eType; OMX_U32 nParam; OMX_U32 nFrameCount; OMX_U32 xFrameRate; } OMX_PARAM_SOURCETYPE; /* The source type determines the kind of image that is produced. Not all combinations of source type and image type are supported. The \code{OMX_SOURCE_SWIRLY} setting can only be used with YUV420 packed planar image formats. When producing RGB565 image format, the \code{OMX_SOURCE_DIAGONAL} and \code{OMX_SOURCE_RANDOM} modes are treated as \code{OMX_SOURCE_NOISE}. The \code{nParam} field is used to specify the colour for the source colour mode, and the offset of the diagonal pattern for diagonal mode. For the blocks mode, \code{nParam} is used as the seed for the random colour generator. The \code{nFrameCount} parameter determines how many frames to send. If it is zero, then frames are sent continuously. For any other value, it counts down until it has sent that many frames, and then stops, sending out an EOS. The \code{xFrameRate} setting is used to determine the timestamp for each frame produced, or can be set to zero if timestamps should all remain at zero. */ /* OMX_IndexParamSourceSeed: Source Random Seed */ typedef struct OMX_PARAM_SOURCESEEDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U16 nData[16]; } OMX_PARAM_SOURCESEEDTYPE; /* This structure sets the current state of the random number generator used for \code{OMX_SOURCE_RANDOM} source type, allowing repeatable random image creation. */ /* OMX_IndexParamResize: Resize Control */ typedef enum OMX_RESIZEMODETYPE { OMX_RESIZE_NONE, OMX_RESIZE_CROP, OMX_RESIZE_BOX, OMX_RESIZE_BYTES, OMX_RESIZE_DUMMY = 0x7FFFFFFF } OMX_RESIZEMODETYPE; typedef struct OMX_PARAM_RESIZETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_RESIZEMODETYPE eMode; OMX_U32 nMaxWidth; OMX_U32 nMaxHeight; OMX_U32 nMaxBytes; OMX_BOOL bPreserveAspectRatio; OMX_BOOL bAllowUpscaling; } OMX_PARAM_RESIZETYPE; /* The mode determines the kind of resize. \code{OMX_RESIZE_BOX} allow the \code{nMaxWidth} and \code{nMaxHeight} to set a bounding box into which the output must fit. \code{OMX_RESIZE_BYTES} allows \code{nMaxBytes} to set the maximum number of bytes into which the full output frame must fit. Two flags aid the setting of the output size. \code{bPreseveAspectRatio} sets whether the resize should preserve the aspect ratio of the incoming image. \code{bAllowUpscaling} sets whether the resize is allowed to increase the size of the output image compared to the size of the input image. */ typedef struct OMX_PARAM_TESTINTERFACETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bTest; OMX_BOOL bSetExtra; OMX_U32 nExtra; OMX_BOOL bSetError; OMX_BOOL stateError[2]; } OMX_PARAM_TESTINTERFACETYPE; /* OMX_IndexConfigVisualisation: Visualisation Mode */ typedef struct OMX_CONFIG_VISUALISATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U8 name[16]; OMX_U8 property[64]; } OMX_CONFIG_VISUALISATIONTYPE; /* \code{name} is a string of characters specifying the type of visualization. The component appends \code{"_vis.vll"} to the name provided, and attempts to load a visualisation library contained in this VLL. \code{property} contains configuration parameters and values, which is interpreted by the visualisation library. Typically all visualisations will accept a property string containing \code{'mode='}, where \code{} may be a random 32 bit integer in decimal format. If provided, this may select a random mode from that visualisation library. */ /* This parameter is used when creating proprietary communication with the display component, and provides the display function for passing images to be displayed, together with a function used to flush all pending image updates and release all images. */ /* OMX_IndexConfigBrcmAudioDestination: Audio Destination */ typedef struct OMX_CONFIG_BRCMAUDIODESTINATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 sName[16]; } OMX_CONFIG_BRCMAUDIODESTINATIONTYPE; /* This config sets the platform-specific audio destination or output device for audio sink components (e.g. audio_render). \code{sName} describes the audio destination, with \code{"local"} typically being directly connected to headphones. */ /* OMX_IndexConfigBrcmAudioSource: Audio Source */ typedef struct OMX_CONFIG_BRCMAUDIOSOURCETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 sName[16]; } OMX_CONFIG_BRCMAUDIOSOURCETYPE; /* This config sets the platform-specific audio source or input device for audio source components (e.g. audio_capture). \code{sName} describes the audio source, with \code{"local"} typically being directly connected to microphone. */ /* OMX_IndexConfigBrcmAudioDownmixCoefficients: Audio Downmix Coefficients */ typedef struct OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 coeff[16]; } OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS; /* This config sets the platform-specific audio downmixing coefficients for the audio mixer component. The coefficients are 16.16 fixed point. The even coefficients contribute to the left channel. The odd coefficients contribute to the right channel. L' = coeff[0] * sample[N] + coeff[2] * sample[N+1] + coeff[4] * sample[N+2] + coeff[6] * sample[N+3] + coeff[8] * sample[N+4] + coeff[10] * sample[N+5] + coeff[12] * sample[N+6] + coeff[14] * sample[N+7] R' = coeff[1] * sample[N] + coeff[3] * sample[N+1] + coeff[5] * sample[N+2] + coeff[7] * sample[N+3] + coeff[9] * sample[N+4] + coeff[11] * sample[N+5] + coeff[13] * sample[N+6] + coeff[15] * sample[N+7] \code{coeff} describes the downmixing coefficients */ /* OMX_IndexConfigBrcmAudioDownmixCoefficients8x8: Audio Downmix Coefficient matrix */ typedef struct OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS8x8 { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 coeff[64]; } OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS8x8; /* This config sets the platform-specific audio downmixing coefficients for the audio mixer component. The coefficients are 16.16 fixed point. The coefficients are a 8*8 mixing matrix from 8 input channels to 8 outputs channels \code{coeff} describes the downmixing coefficients */ /* OMX_IndexConfigBrcmAudioMaxSample: Maximum sample seen */ typedef struct OMX_CONFIG_BRCMAUDIOMAXSAMPLE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nMaxSample; OMX_TICKS nTimeStamp; } OMX_CONFIG_BRCMAUDIOMAXSAMPLE; /* This gets the largest sample produced (after downmixing with OMX_CONFIG_BRCMAUDIODOWNMIXCOEFFICIENTS8x8) since this config was last read. The nTimestamp is the earliest timestamp processed. This can be used for DRC schemes \code{coeff} maximum sample seen in current block */ /* OMX_IndexConfigPlayMode: Play Mode */ typedef enum OMX_PLAYMODETYPE { OMX_PLAYMODE_NORMAL, OMX_PLAYMODE_FF, OMX_PLAYMODE_REW, OMX_PLAYMODE_DUMMY = 0x7FFFFFFF } OMX_PLAYMODETYPE; typedef struct OMX_CONFIG_PLAYMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_PLAYMODETYPE eMode; } OMX_CONFIG_PLAYMODETYPE; /* The playmode affects which frames are extracted from the media file and passed on the output ports. \code{OMX_PLAYMODE_NORMAL} will extract all frames, \code{OMX_PLAYMODE_FF} extracts only IDR frames when video is present, or only occasional packets of audio if no video is present. \code{OMX_PLAYMODE_REW} is similar to \code{OMX_PLAYMODE_FF} but extracts packets in reverse time order. */ typedef enum OMX_DELIVERYFORMATTYPE { OMX_DELIVERYFORMAT_STREAM, // no framing information is known OMX_DELIVERYFORMAT_SINGLE_PACKET, // packetised, at most one frame per buffer OMX_DELIVERYFORMAT_DUMMY = 0x7FFFFFFF } OMX_DELIVERYFORMATTYPE; typedef struct OMX_PARAM_DELIVERYFORMATTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_DELIVERYFORMATTYPE eFormat; } OMX_PARAM_DELIVERYFORMATTYPE; /* OMX_IndexParamCodecConfig: Codec Configuration */ typedef struct OMX_PARAM_CODECCONFIGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 bCodecConfigIsComplete; OMX_U8 nData[1]; } OMX_PARAM_CODECCONFIGTYPE; /* This parameter contains opaque data in a format specified by Broadcom and allows out-of-band information such as cropping rectangles, aspect ratio information, codec-specific header bytes, and other essential information to be passed between connected components. \code{bCodecConfigIsCompete} specifies if the codec config is fully contained in here and there is no need to wait for OMX_BUFFERFLAG_CODECCONFIG buffers */ typedef struct OMX_PARAM_STILLSFUNCTIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bBuffer; OMX_PTR (*pOpenFunc)(void); OMX_PTR (*pCloseFunc)(void); OMX_PTR (*pReadFunc)(void); OMX_PTR (*pSeekFunc)(void); OMX_PTR (*pWriteFunc)(void); } OMX_PARAM_STILLSFUNCTIONTYPE; typedef void* OMX_BUFFERADDRESSHANDLETYPE; typedef struct OMX_PARAM_BUFFERADDRESSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nAllocLen; OMX_BUFFERADDRESSHANDLETYPE handle; } OMX_PARAM_BUFFERADDRESSTYPE; typedef struct OMX_PARAM_TUNNELSETUPTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_TUNNELSETUPTYPE sSetup; } OMX_PARAM_TUNNELSETUPTYPE; /* OMX_IndexParamBrcmPortEGL: Used for querying whether a port is an EGL port or not. */ typedef struct OMX_PARAM_BRCMPORTEGLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bPortIsEGL; } OMX_PARAM_BRCMPORTEGLTYPE; /* */ #define OMX_CONFIG_IMAGEFILTERPARAMS_MAXPARAMS 6 /* OMX_IndexConfigCommonImageFilterParameters: Parameterized Image Filter */ typedef struct OMX_CONFIG_IMAGEFILTERPARAMSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGEFILTERTYPE eImageFilter; OMX_U32 nNumParams; OMX_U32 nParams[OMX_CONFIG_IMAGEFILTERPARAMS_MAXPARAMS]; } OMX_CONFIG_IMAGEFILTERPARAMSTYPE; /* This structure contains optional parameters for some image filters. The following table lists all image filters that support parameters.
FilterParametersNotes
\code{OMX_ImageFilterSolarize} \code{[x0 y0 y1 y2]} Linear mapping of \code{[0,x0]} to \code{[0,y0>]} and \code{[x0,255]} to \code{[y1,y2]}. Default is \code{"128 128 128 0"}.
\code{OMX_ImageFilterSharpen} \code{[sz [str [th]]} \code{sz} size of filter, either 1 or 2. \code{str} strength of filter. \code{th} threshold of filter. Default is \code{"1 40 20"}.
\code{OMX_ImageFilterFilm} \code{[[str] [u v]]} \code{str} strength of effect. \code{u} sets u to constant value. \code{v} sets v to constant value. Default is \code{"24"}.
\code{OMX_ImageFilterBlur} \code{[sz]} \code{sz} size of filter, either 1 or 2. Default is \code{"2"}.
\code{OMX_ImageFilterSaturation} \code{[str]} \code{str} strength of effect, in 8.8 fixed point format. u/v value differences from 128 are multiplied by \code{str}. Default is \code{"272"}.
*/ /* OMX_IndexConfigTransitionControl: Transition Control */ typedef struct OMX_CONFIG_TRANSITIONCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nPosStart; OMX_U32 nPosEnd; OMX_S32 nPosIncrement; OMX_TICKS nFrameIncrement; OMX_BOOL bSwapInputs; OMX_U8 name[16]; OMX_U8 property[64]; } OMX_CONFIG_TRANSITIONCONTROLTYPE; /* This structure represents the internal configuration of the transition. Transitions are generated by a loadable plug-in described by the \code{name} field. The component appends \code{"_tran.vll"} to the name provided, and attempts to load a transition library contained in this VLL. The exact type of transition is configured in a plug-in-dependent manner with the \code{property} field. All plug-ins should accept a \code{property} field equal to \code{"flags="}, where \code{} can be a random 32 bit number. If \code{bSwapInputs} is false, then the start image is on port 210, the stop image on port 211. These are reversed if \code{bSwapInputs} is true. Transition frames are generated from the plug-in by referencing a frame position in [0,65536], where position 0 is the start image, position 65536 is the stop image. The first frame position generated is \code{nPosStart}. The last frame position generated is \code{nPosEnd}. Each frame will increment the position by \code{nPosIncrement}. The timestamp attached to each frame will increment by \code{nFrameIncrement}. */ /* This parameter is used to provide a callback function pointer for release events. It is used for internal clients on VideoCore. */ /* OMX_IndexConfigAudioMonoTrackControl: Dual Mono Control */ typedef enum OMX_AUDIOMONOTRACKOPERATIONSTYPE { OMX_AUDIOMONOTRACKOPERATIONS_NOP, OMX_AUDIOMONOTRACKOPERATIONS_L_TO_R, OMX_AUDIOMONOTRACKOPERATIONS_R_TO_L, OMX_AUDIOMONOTRACKOPERATIONS_DUMMY = 0x7FFFFFFF } OMX_AUDIOMONOTRACKOPERATIONSTYPE ; typedef struct OMX_CONFIG_AUDIOMONOTRACKCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_AUDIOMONOTRACKOPERATIONSTYPE eMode; } OMX_CONFIG_AUDIOMONOTRACKCONTROLTYPE; /* This config controls the options to support dual mono audio streams. The output can be unchanged, or the left channel copied over the right channel, or the right channel copied over the left channel. This config can be applied at any time with stereo 16-bit-per-sample data. Since audio output is typically buffered, any change will not be audible until that buffering has been played out. */ /* OMX_IndexParamCameraImagePool: Camera Image Pools */ typedef enum OMX_CAMERAIMAGEPOOLINPUTMODETYPE { OMX_CAMERAIMAGEPOOLINPUTMODE_ONEPOOL, /*All input images are allocated from one pool Works for simple stills capture use cases Can not be used with parallel stills capture and video encode, as the pool will be sized for capture or viewfinder, not both simultaneously. The pool wouldn't divide sensibly in this mode anyway. */ OMX_CAMERAIMAGEPOOLINPUTMODE_TWOPOOLS, /*All stills & video input images are allocated from two separate pools. This ensures that parallel capture can work, but would consume more memory if used on a simple stills capture use case. */ } OMX_CAMERAIMAGEPOOLINPUTMODETYPE; typedef struct OMX_PARAM_CAMERAIMAGEPOOLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nNumHiResVideoFrames; OMX_U32 nHiResVideoWidth; OMX_U32 nHiResVideoHeight; OMX_COLOR_FORMATTYPE eHiResVideoType; OMX_U32 nNumHiResStillsFrames; OMX_U32 nHiResStillsWidth; OMX_U32 nHiResStillsHeight; OMX_COLOR_FORMATTYPE eHiResStillsType; OMX_U32 nNumLoResFrames; OMX_U32 nLoResWidth; OMX_U32 nLoResHeight; OMX_COLOR_FORMATTYPE eLoResType; OMX_U32 nNumSnapshotFrames; OMX_COLOR_FORMATTYPE eSnapshotType; OMX_CAMERAIMAGEPOOLINPUTMODETYPE eInputPoolMode; OMX_U32 nNumInputVideoFrames; OMX_U32 nInputVideoWidth; OMX_U32 nInputVideoHeight; OMX_COLOR_FORMATTYPE eInputVideoType; OMX_U32 nNumInputStillsFrames; OMX_U32 nInputStillsWidth; OMX_U32 nInputStillsHeight; OMX_COLOR_FORMATTYPE eInputStillsType; } OMX_PARAM_CAMERAIMAGEPOOLTYPE; /* \sloppy This parameter specifies the size, type, and number, of images to allow in the images pools required by Camplus. Supported types are \code{OMX_COLOR_FormatYUV420PackedPlanar}, \code{OMX_COLOR_FormatYUV422PackedPlanar}, \code{OMX_COLOR_FormatRawBayer8bit}, \code{OMX_COLOR_FormatRawBayer10bit}, \code{OMX_COLOR_FormatRawBayer8bitcompressed}, and 0 (reserved for the Broadcom-specific format required by the video encoder). The input pool width, height, and type can be set as 0 to make the component query Camplus for the sensor mode that would correspond to the largest of the viewfinder port definition, the capture port definition, or the high resolution image pool. */ /* OMX_IndexParamImagePoolSize: Specifying Image Pool Properties */ typedef struct OMX_PARAM_IMAGEPOOLSIZETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 width; OMX_U32 height; OMX_U32 num_pages; } OMX_PARAM_IMAGEPOOLSIZETYPE; /* This parameter is used to control the size of pool that the component will allocate in the absence of setting an external pool. The default can be reset by setting this parameter with all three fields set to zero. */ /* OMX_IndexParamImagePoolExternal: Client Allocated Image Pools */ struct opaque_vc_pool_s; typedef struct opaque_vc_pool_s OMX_BRCM_POOL_T; typedef struct OMX_PARAM_IMAGEPOOLEXTERNALTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BRCM_POOL_T *image_pool; OMX_BRCM_POOL_T *image_pool2; OMX_BRCM_POOL_T *image_pool3; OMX_BRCM_POOL_T *image_pool4; OMX_BRCM_POOL_T *image_pool5; } OMX_PARAM_IMAGEPOOLEXTERNALTYPE; /* This config allows the client to pass in handles to pre-allocated image pools for use within the component. */ struct _IL_FIFO_T; typedef struct OMX_PARAM_RUTILFIFOINFOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; struct _IL_FIFO_T *pILFifo; } OMX_PARAM_RUTILFIFOINFOTYPE; /* OMX_IndexParamILFifoConfig: Allows configuration of the FIFO settings. */ typedef struct OMX_PARAM_ILFIFOCONFIG { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nDataSize; /**< The size of the FIFO's data area */ OMX_U32 nHeaderCount; /**< The number of headers allocated */ } OMX_PARAM_ILFIFOCONFIG; /** * Allows configuring the size of the ILFIFO used in a component. */ /* OMX_IndexConfigCameraSensorModes: Camera Sensor Mode */ typedef struct OMX_CONFIG_CAMERASENSORMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nModeIndex; OMX_U32 nNumModes; OMX_U32 nWidth; OMX_U32 nHeight; OMX_U32 nPaddingRight; OMX_U32 nPaddingDown; OMX_COLOR_FORMATTYPE eColorFormat; OMX_U32 nFrameRateMax; OMX_U32 nFrameRateMin; } OMX_CONFIG_CAMERASENSORMODETYPE; /* This parameter is used by clients to determine the sensor mode, and hence the memory usage, of the camera module. This is primarily used for determining the size of the input image pool. It can be used in two ways dependent on \code{nPortIndex}. If \code{nPortIndex} is \code{OMX_ALL}, it returns the sensor mode corresponding to \code{nModeIndex}, and the number of modes in \code{nNumModes}. If \code{nModeIndex} is greater than or equal to \code{nNumModes} only \code{nNumModes} is returned. If \code{nPortIndex} is equal to a camera video output port index, it returns the sensor mode that would be selected for the values currently in \code{OMX_IndexParamPortDefinition} for that port. The \code{nPaddingRight} and \code{nPaddingDown} values determine the extra padding the sensor adds to the image. These values must be added to \code{nWidth} and \code{nHeight} respectively if the client is specifying the input image pool size. */ typedef struct OMX_BRCMBUFFERSTATSTYPE { OMX_U32 nOrdinal; OMX_TICKS nTimeStamp; OMX_U32 nFilledLen; OMX_U32 nFlags; union { OMX_U32 nU32; struct { OMX_U32 nYpart; OMX_U32 nUVpart; } image; } crc; } OMX_BRCMBUFFERSTATSTYPE; /* Ports that gather statistics for debugging and diagnostics might also collect information about buffer header fields and data. Note that: The \code{nOrdinal} field increases monotonically whenever a new buffer is received or emitted and shall not be reset upon a port flush. The \code{nFilledLen} might indicate the size of a data area larger than the data area that actually contributed to the checksums (e.g. when image data is provided with cropping information). */ /* OMX_IndexConfigBrcmPortBufferStats: Query port buffer stats history */ typedef struct OMX_CONFIG_BRCMPORTBUFFERSTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nCount; OMX_BRCMBUFFERSTATSTYPE sData[1]; } OMX_CONFIG_BRCMPORTBUFFERSTATSTYPE; /* Ports that gather statistics for debugging and diagnostics might also collect information about buffer header fields and data. The \code{sStatsData} field is a variable length array and the number of items is denoted by \code{nStatsCount}. */ /* OMX_IndexConfigBrcmPortStats: Query port statistics */ typedef struct OMX_CONFIG_BRCMPORTSTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nImageCount; OMX_U32 nBufferCount; OMX_U32 nFrameCount; OMX_U32 nFrameSkips; OMX_U32 nDiscards; OMX_U32 nEOS; OMX_U32 nMaxFrameSize; OMX_TICKS nByteCount; OMX_TICKS nMaxTimeDelta; OMX_U32 nCorruptMBs; /**< Number of corrupt macroblocks in the stream */ } OMX_CONFIG_BRCMPORTSTATSTYPE; /* Some ports gather various statistics that can be used by clients for debugging purposes. This structure is the set of all statistics that are gathered. The \code{nFrameSkips} field indicates the number of frames that did not have an expected PTS value based on the port frame rate. The \code{nByteCount} field is a 64 bit value, that will either use a 64 bit type or two 32 bit types, similarly to \code{OMX_TICKS}. */ /* OMX_IndexConfigBrcmClockMissCount: Missed clock request accounting */ /* For each port on the clock component, requests for media times may be made. These are typically done one per video frame to allow for scheduling the display of that frame at the correct time. If a request is made after the time has occurred, then that frame will be displayed late, and the clock component keeps a per-port record of the number of times this occurs. This record can be read using this index. */ typedef struct OMX_CONFIG_BRCMCAMERASTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nOutFrameCount; OMX_U32 nDroppedFrameCount; } OMX_CONFIG_BRCMCAMERASTATSTYPE; // for backward compatibility typedef struct OMX_CONFIG_BRCMCAMERASTATSTYPE OMX_CONFIG_BRCMCAMERASTATS; #define OMX_BRCM_MAXIOPERFBANDS 10 typedef struct { OMX_U32 count[OMX_BRCM_MAXIOPERFBANDS]; OMX_U32 num[OMX_BRCM_MAXIOPERFBANDS]; } OMX_BRCM_PERFSTATS; /* OMX_IndexConfigBrcmIOPerfStats: Query I/O performance statistics */ typedef struct OMX_CONFIG_BRCMIOPERFSTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnabled; /**< Enable/disable I/O performance statistics */ OMX_BRCM_PERFSTATS write; /**< count:bytes num:microseconds */ OMX_BRCM_PERFSTATS flush; /**< count:frequency num:microseconds waiting to flush data */ OMX_BRCM_PERFSTATS wait; /**< count:frequency num:microseconds waiting in calling function */ } OMX_CONFIG_BRCMIOPERFSTATSTYPE; /* A sink component can gather various statistics about I/O (eg. file media) performance that can be used by clients for debugging purposes. The \code{bEnabled} field is used to turn the gathering of statistics on/off. */ typedef struct OMX_CONFIG_SHARPNESSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nSharpness; } OMX_CONFIG_SHARPNESSTYPE; /* OMX_IndexConfigCommonFlickerCancellation: Flicker cancellation */ typedef enum OMX_COMMONFLICKERCANCELTYPE { OMX_COMMONFLICKERCANCEL_OFF, OMX_COMMONFLICKERCANCEL_AUTO, OMX_COMMONFLICKERCANCEL_50, OMX_COMMONFLICKERCANCEL_60, OMX_COMMONFLICKERCANCEL_DUMMY = 0x7FFFFFFF } OMX_COMMONFLICKERCANCELTYPE; typedef struct OMX_CONFIG_FLICKERCANCELTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_COMMONFLICKERCANCELTYPE eFlickerCancel; } OMX_CONFIG_FLICKERCANCELTYPE; /* Query / set the flicker cancellation frequency. Values are defined for Off, 50Hz, 60Hz, or auto. The method for auto detecting the flicker frequency is not defined, and currently results in the feature being turned off. */ /* OMX_IndexConfigCommonRedEyeRemoval: Red eye removal/reduction */ typedef enum OMX_REDEYEREMOVALTYPE { OMX_RedEyeRemovalNone, /**< No red eye removal */ OMX_RedEyeRemovalOn, /**< Red eye removal on */ OMX_RedEyeRemovalAuto, /**< Red eye removal will be done automatically when detected */ OMX_RedEyeRemovalKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_RedEyeRemovalVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_RedEyeRemovalSimple, /**< Use simple red eye reduction mechanism if supported by algorithm */ OMX_RedEyeRemovalMax = 0x7FFFFFFF } OMX_REDEYEREMOVALTYPE; typedef struct OMX_CONFIG_REDEYEREMOVALTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_REDEYEREMOVALTYPE eMode; } OMX_CONFIG_REDEYEREMOVALTYPE; /* Configures the red eye reduction algorithm in the camera processing pipeline. The stage is only enabled if the flash mode is not FlashOff. The OMX_RedEyeRemovalSimple mode requests that the algorithm uses a reduced complexity algorithm to reduce the processing time. */ typedef enum OMX_FACEDETECTIONCONTROLTYPE { OMX_FaceDetectionControlNone, /**< Disables face detection */ OMX_FaceDetectionControlOn, /**< Enables face detection */ OMX_FaceDetectionControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_FaceDetectionControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_FaceDetectionControlMax = 0x7FFFFFFF } OMX_FACEDETECTIONCONTROLTYPE; typedef struct OMX_CONFIG_FACEDETECTIONCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_FACEDETECTIONCONTROLTYPE eMode; OMX_U32 nFrames; /**< number of frames to apply this setting for, 0 for unlimited */ OMX_U32 nMaxRegions; /**< maximum number of regions to detect, 0 for unlimited */ OMX_U32 nQuality; /**< hint for algorithmic complexity, range is 0-100. 0 for simplest algorithm, 100 for best quality */ } OMX_CONFIG_FACEDETECTIONCONTROLTYPE; typedef enum OMX_FACEREGIONFLAGSTYPE { OMX_FaceRegionFlagsNone = 0, OMX_FaceRegionFlagsBlink = 1, OMX_FaceRegionFlagsSmile = 2, OMX_FaceRegionFlagsKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_FaceRegionFlagsVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_FaceRegionFlagsMax = 0x7FFFFFFF } OMX_FACEREGIONFLAGSTYPE; typedef struct OMX_FACEREGIONTYPE { OMX_S16 nLeft; /**< X Coordinate of the top left corner of the rectangle */ OMX_S16 nTop; /**< Y Coordinate of the top left corner of the rectangle */ OMX_U16 nWidth; /**< Width of the rectangle */ OMX_U16 nHeight; /**< Height of the rectangle */ OMX_FACEREGIONFLAGSTYPE nFlags; /**< Flags for the region */ #ifndef OMX_SKIP64BIT OMX_U64 nFaceRecognitionId; /**< ID returned by face recognition for this face */ #else struct { OMX_U32 nLowPart; /**< low bits of the signed 64 bit value */ OMX_U32 nHighPart; /**< high bits of the signed 64 bit value */ } nFaceRecognitionId; #endif } OMX_FACEREGIONTYPE; typedef struct OMX_CONFIG_FACEDETECTIONREGIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< index of port with face detection enabled */ OMX_U32 nIndex; /**< first requested region number, allowing retrieval of many regions over several requests */ OMX_U32 nDetectedRegions; /**< total number of detected regions */ OMX_S32 nValidRegions; /**< number of valid regions in sRegion array When getting, the client sets this to the number of regions available. The component writes region data and updates this field with how many regions have been written to. */ OMX_U32 nImageWidth; /**< Width of the image, hence reference for the face coordinates */ OMX_U32 nImageHeight; /**< Height of the image, hence reference for the face coordinates */ OMX_FACEREGIONTYPE sRegion[1]; /**< variable length array of face regions */ } OMX_CONFIG_FACEDETECTIONREGIONTYPE; typedef enum OMX_INTERLACETYPE { OMX_InterlaceProgressive, /**< The data is not interlaced, it is progressive scan */ OMX_InterlaceFieldSingleUpperFirst, /**< The data is interlaced, fields sent separately in temporal order, with upper field first */ OMX_InterlaceFieldSingleLowerFirst, /**< The data is interlaced, fields sent separately in temporal order, with lower field first */ OMX_InterlaceFieldsInterleavedUpperFirst, /**< The data is interlaced, two fields sent together line interleaved, with the upper field temporally earlier */ OMX_InterlaceFieldsInterleavedLowerFirst, /**< The data is interlaced, two fields sent together line interleaved, with the lower field temporally earlier */ OMX_InterlaceMixed, /**< The stream may contain a mixture of progressive and interlaced frames */ OMX_InterlaceKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_InterlaceVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_InterlaceMax = 0x7FFFFFFF } OMX_INTERLACETYPE; typedef struct OMX_CONFIG_INTERLACETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< index of port emitting or accepting the content */ OMX_INTERLACETYPE eMode; /**< The interlace type of the content */ OMX_BOOL bRepeatFirstField; /**< Whether to repeat the first field */ } OMX_CONFIG_INTERLACETYPE; /* OMX_IndexParamIspTuner: Custom ISP tuner */ typedef struct OMX_PARAM_CAMERAISPTUNERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 tuner_name[64]; } OMX_PARAM_CAMERAISPTUNERTYPE; /* This parameter allows a custom ISP tuner to be loaded instead of the default one specified for the camera module. Setting an empty string uses the default value. */ /* OMX_IndexConfigCameraInputFrame: Pointer to the raw input image */ typedef struct OMX_CONFIG_IMAGEPTRTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_PTR pImage; } OMX_CONFIG_IMAGEPTRTYPE; /* This parameter parameter allows the return of a pointer to a VideoCore image resource. */ /* OMX_IndexConfigAFAssistLight: Autofocus assist light mode selection */ typedef enum OMX_AFASSISTTYPE { OMX_AFAssistAuto, OMX_AFAssistOn, OMX_AFAssistOff, OMX_AFAssistTorch, OMX_AFAssistKhronosExtensions = 0x6F000000, OMX_AFAssistVendorStartUnused = 0x7F000000, OMX_AFAssistMax = 0x7FFFFFFF } OMX_AFASSISTTYPE; typedef struct OMX_CONFIG_AFASSISTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_AFASSISTTYPE eMode; } OMX_CONFIG_AFASSISTTYPE; /* Set the mode to adopt for the autofocus assist light. \code{OMX_AFAssistTorch} will turn the AF assist light on permanently, allowing it to be used as a torch. */ /* OMX_IndexConfigInputCropPercentage: Specify input crop as a percentage */ typedef struct OMX_CONFIG_INPUTCROPTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 xLeft; /**< Fraction of the width for the top left corner of the rectangle */ OMX_U32 xTop; /**< Fraction of the height for the top left corner of the rectangle */ OMX_U32 xWidth; /**< Fraction of the image width desired */ OMX_U32 xHeight; /**< Fraction of the image height desired */ } OMX_CONFIG_INPUTCROPTYPE; /* This parameter allows the input cropping to be specified as a percentage of the current width/height. Required for the camera component where the output resolution varies dependent on the port. All percentage values are as 16p16 fixed point numbers (0x10000 = 100\%) */ /* OMX_IndexParamCodecRequirements: Advanced codec requirements */ typedef struct OMX_PARAM_CODECREQUIREMENTSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nCallbackID; OMX_BOOL bTryHWCodec; } OMX_PARAM_CODECREQUIREMENTSTYPE; /* This parameter allows internal users of RIL components controlling video codecs to request that the component loads the component and queries for requirements. The component will perform a callback with the given nCallbackID value passing a pointer to the requirements structure as the data field. */ /* OMX_IndexConfigBrcmEGLImageMemHandle: Mapping from an EGLImage to a VideoCore mem handle */ typedef struct OMX_CONFIG_BRCMEGLIMAGEMEMHANDLETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_PTR eglImage; OMX_PTR memHandle; } OMX_CONFIG_BRCMEGLIMAGEMEMHANDLETYPE; /* This config allows the EGL server to notify a RIL component that an EGLImage is available for rendering into and to provide a mapping from an EGLImage to a mem handle. */ /* OMX_IndexConfigPrivacyIndicator: Privacy indicator control */ typedef enum OMX_PRIVACYINDICATORTYPE { OMX_PrivacyIndicatorOff, OMX_PrivacyIndicatorOn, OMX_PrivacyIndicatorForceOn, OMX_PrivacyIndicatorKhronosExtensions = 0x6F000000, OMX_PrivacyIndicatorVendorStartUnused = 0x7F000000, OMX_PrivacyIndicatorMax = 0x7FFFFFFF } OMX_PRIVACYINDICATORTYPE; typedef struct OMX_CONFIG_PRIVACYINDICATORTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_PRIVACYINDICATORTYPE ePrivacyIndicatorMode; } OMX_CONFIG_PRIVACYINDICATORTYPE; /* This config allows control over the privacy indicator light. This light indicates when a capture is in progress. \code{OMX_PrivacyIndicatorOff} indicator is disabled. \code{OMX_PrivacyIndicatorOn} indicator will be turned on whenever an image is being captured as determined by the capturing bit. Minimum on duration of approx 200ms. \code{OMX_PrivacyIndicatorForceOn} results in turning the indicator on immediately, whether an image is being captured or not. The mode will automatically revert to \code{OMX_PrivacyIndicatorOff} once the indicator has been turned on, so \code{OMX_PrivacyIndicatorForceOn} must be requested at least every 200ms if the indicator is to remain on. */ /* OMX_IndexParamCameraFlashType: Select flash type */ typedef enum OMX_CAMERAFLASHTYPE { OMX_CameraFlashDefault, OMX_CameraFlashXenon, OMX_CameraFlashLED, OMX_CameraFlashNone, OMX_CameraFlashKhronosExtensions = 0x6F000000, OMX_CameraFlashVendorStartUnused = 0x7F000000, OMX_CameraFlashMax = 0x7FFFFFFF } OMX_CAMERAFLASHTYPE; typedef struct OMX_PARAM_CAMERAFLASHTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_CAMERAFLASHTYPE eFlashType; OMX_BOOL bRedEyeUsesTorchMode; } OMX_PARAM_CAMERAFLASHTYPE; /* This parameter allows the selection of xenon or LED flash devices to be used with the currently selected camera. If that device is not available, then the component will revert back to whatever flash device is available for that camera. \code{bRedEyeUsesTorchMode} allows the blinking for red eye reduction to be switched between using the indicator mode, and the torch mode for the flash driver. */ /* OMX_IndexConfigCameraFlashConfig: Flash cycle configuration */ typedef enum OMX_CAMERAFLASHCONFIGSYNCTYPE { OMX_CameraFlashConfigSyncFrontSlow, OMX_CameraFlashConfigSyncRearSlow, OMX_CameraFlashConfigSyncFrontFast, OMX_CameraFlashConfigSyncKhronosExtensions = 0x6F000000, OMX_CameraFlashConfigSyncVendorStartUnused = 0x7F000000, OMX_CameraFlashConfigSyncMax = 0x7FFFFFFF } OMX_CAMERAFLASHCONFIGSYNCTYPE; typedef struct OMX_CONFIG_CAMERAFLASHCONFIGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bUsePreFlash; OMX_BOOL bUseFocusDistanceInfo; OMX_CAMERAFLASHCONFIGSYNCTYPE eFlashSync; OMX_BOOL bIgnoreChargeState; } OMX_CONFIG_CAMERAFLASHCONFIGTYPE; /* This parameter allows the configuration of various parameters relating to the flash cycle. Some of the options are only applicable to xenon flash. \code{bUsePreFlash} uses a low intensity pre-flash to determine flash intensity. This setting is recommended for almost all flash situations. \code{bUseFocusDistanceInfo} uses the distance of the subject, as measured by the AF algorithm to set the intensity of the flash. \code{eFlashSync} configures which edge of the shutter is used to synchronise the flash, and the duration of the exposure. \code{eIgnoreChargeState} will make the flash fire, even if it is not fully charged. */ /* OMX_IndexConfigBrcmAudioTrackGaplessPlayback: Encoder/decoder delay and padding information for gapless playback. */ typedef struct OMX_CONFIG_BRCMAUDIOTRACKGAPLESSPLAYBACKTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nDelay; /**< number of samples delay added by the codec */ OMX_U32 nPadding; /**< number of silent samples added to the end */ } OMX_CONFIG_BRCMAUDIOTRACKGAPLESSPLAYBACKTYPE; /* This config allows communication between components to facilitate gapless playback. */ /* OMX_IndexConfigBrcmAudioTrackChangeControl: Configure gapless/crossfaded audio track change. */ typedef struct OMX_CONFIG_BRCMAUDIOTRACKCHANGECONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nSrcPortIndex; OMX_U32 nDstPortIndex; OMX_U32 nXFade; } OMX_CONFIG_BRCMAUDIOTRACKCHANGECONTROLTYPE; /* This config allows the client to specify the gapless or crossfade parameters to be used on a track change. If \code{nXFade} is 0, then a normal or gapless track change will result, otherwise a crossfade of \code{nXFade} ms is used. */ /* OMX_IndexParamBrcmPixelValueRange: Describing the pixel value range */ typedef enum OMX_BRCMPIXELVALUERANGETYPE { OMX_PixelValueRangeUnspecified = 0, OMX_PixelValueRangeITU_R_BT601, OMX_PixelValueRangeFull8Bit, OMX_PixelValueRangeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_PixelValueRangeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_PixelValueRangeMax = 0x7FFFFFFF } OMX_BRCMPIXELVALUERANGETYPE; typedef struct OMX_PARAM_BRCMPIXELVALUERANGETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BRCMPIXELVALUERANGETYPE ePixelValueRange; } OMX_PARAM_BRCMPIXELVALUERANGETYPE; /* This structure allows a description of the range that pixel values may have. This is typically useful since some standards use the full 8 bit range, whereas others introduce pedastals which reduce the range at the top and bottom end. */ /* OMX_IndexParamCameraDisableAlgorithm: Disabling camera processing stages. */ typedef enum OMX_CAMERADISABLEALGORITHMTYPE { OMX_CameraDisableAlgorithmFacetracking, OMX_CameraDisableAlgorithmRedEyeReduction, OMX_CameraDisableAlgorithmVideoStabilisation, OMX_CameraDisableAlgorithmWriteRaw, OMX_CameraDisableAlgorithmVideoDenoise, OMX_CameraDisableAlgorithmStillsDenoise, OMX_CameraDisableAlgorithmAntiShake, OMX_CameraDisableAlgorithmImageEffects, OMX_CameraDisableAlgorithmDarkSubtract, OMX_CameraDisableAlgorithmDynamicRangeExpansion, OMX_CameraDisableAlgorithmFaceRecognition, OMX_CameraDisableAlgorithmFaceBeautification, OMX_CameraDisableAlgorithmSceneDetection, OMX_CameraDisableAlgorithmHighDynamicRange, OMX_CameraDisableAlgorithmKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_CameraDisableAlgorithmVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_CameraDisableAlgorithmMax = 0x7FFFFFFF } OMX_CAMERADISABLEALGORITHMTYPE; typedef struct OMX_PARAM_CAMERADISABLEALGORITHMTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_CAMERADISABLEALGORITHMTYPE eAlgorithm; OMX_BOOL bDisabled; } OMX_PARAM_CAMERADISABLEALGORITHMTYPE; /* Allows plugin algorithms to be disabled to save memory within the camera component */ /* OMX_IndexConfigBrcmAudioEffectControl: Audio Effect Control */ typedef struct OMX_CONFIG_BRCMAUDIOEFFECTCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnable; OMX_U8 name[16]; OMX_U8 property[256]; } OMX_CONFIG_BRCMAUDIOEFFECTCONTROLTYPE; /* This structure represents the internal configuration of an audio effect. The audio effect is provided by a loadable plug-in described in the \code{name} field and is configured in a plug-in-dependent manner with the \code{property} field. The \code{bEnable} field is used to turn the effect on/off. */ /* OMX_IndexConfigBrcmMinimumProcessingLatency: Processing Latency Bound */ typedef struct OMX_CONFIG_BRCMMINIMUMPROCESSINGLATENCY { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_TICKS nOffset; } OMX_CONFIG_BRCMMINIMUMPROCESSINGLATENCY; /* Query/set the difference between the actual media time and when the component receives request fulfillments for media time requests. This can be used with e.g. splitter/mixer components to control when the component stops waiting for input or output packets from active streams and continues with processing (to maintain a constant processing rate). */ /** Enable or disable Supplemental Enhancment Information (SEI) messages to be inserted in * the H.264 bitstream. */ typedef struct OMX_PARAM_BRCMVIDEOAVCSEIENABLETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnable; } OMX_PARAM_BRCMVIDEOAVCSEIENABLETYPE; /* OMX_IndexParamBrcmAllowMemChange: Allowing changing memory allocation on state transition */ typedef struct OMX_PARAM_BRCMALLOWMEMCHANGETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnable; } OMX_PARAM_BRCMALLOWMEMCHANGETYPE; /* Let the component change the amount of memory it has allocated when going from LOADED to IDLE. By default this is enabled, but if it is disabled the component will fail to transition to IDLE if the component requires more memory than has already been allocated. This might occur if (for example) the component was configured, taken to IDLE, then taken back to LOADED, the profile increased and the component taken back to IDLE. */ typedef enum OMX_CONFIG_CAMERAUSECASE { OMX_CameraUseCaseAuto, OMX_CameraUseCaseVideo, OMX_CameraUseCaseStills, OMX_CameraUseCaseKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_CameraUseCaseVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_CameraUseCaseMax = 0x7FFFFFFF } OMX_CONFIG_CAMERAUSECASE; typedef struct OMX_CONFIG_CAMERAUSECASETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_CONFIG_CAMERAUSECASE eUseCase; } OMX_CONFIG_CAMERAUSECASETYPE; /* OMX_IndexParamBrcmDisableProprietaryTunnels: Disabling proprietary tunnelling */ typedef struct OMX_PARAM_BRCMDISABLEPROPRIETARYTUNNELSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bUseBuffers; } OMX_PARAM_BRCMDISABLEPROPRIETARYTUNNELSTYPE; /* Tell a source component to refuse to support proprietary tunnelling. Buffers will be used instead. */ // // Control for memory allocation and component-internal buffering // /* OMX_IndexParamBrcmRetainMemory: Controlling memory use on state transition */ typedef struct OMX_PARAM_BRCMRETAINMEMORYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnable; } OMX_PARAM_BRCMRETAINMEMORYTYPE; /* Ask a component to retain its memory when going from IDLE to LOADED, if possible. This has the benefit that you are then guaranteed that the transition to IDLE cannot fail due to lack of memory, but has the disadvantage that you cannot leave the component lying around in LOADED, unused, since it is using significant amounts of memory. */ /** Tell write media how large the output buffer should be. This is a hint, and * may be ignored. A good size is bandwidth*, which works out at * around 1Mbyte for up to 16Mbit/s. Sizes may (and probably will) be rounded down * to the nearest power of 2. */ typedef struct OMX_PARAM_BRCMOUTPUTBUFFERSIZETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nBufferSize; } OMX_PARAM_BRCMOUTPUTBUFFERSIZETYPE; /* OMX_IndexConfigCameraInfo: Camera device driver information */ #define OMX_CONFIG_CAMERAINFOTYPE_NAME_LEN 16 typedef struct OMX_CONFIG_LENSCALIBRATIONVALUETYPE { OMX_U16 nShutterDelayTime; OMX_U16 nNdTransparency; OMX_U16 nPwmPulseNearEnd; /**< Num pulses to move lens 1um at near end */ OMX_U16 nPwmPulseFarEnd; /**< Num pulses to move lens 1um at far end */ OMX_U16 nVoltagePIOutNearEnd[3]; OMX_U16 nVoltagePIOut10cm[3]; OMX_U16 nVoltagePIOutInfinity[3]; OMX_U16 nVoltagePIOutFarEnd[3]; OMX_U32 nAdcConversionNearEnd; OMX_U32 nAdcConversionFarEnd; } OMX_CONFIG_LENSCALIBRATIONVALUETYPE; /* Ask the camera component for the driver info on the current camera device */ #define OMX_CONFIG_CAMERAINFOTYPE_NAME_LEN 16 #define OMX_CONFIG_CAMERAINFOTYPE_SERIALNUM_LEN 20 #define OMX_CONFIG_CAMERAINFOTYPE_EPROMVER_LEN 8 typedef struct OMX_CONFIG_CAMERAINFOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 cameraname[OMX_CONFIG_CAMERAINFOTYPE_NAME_LEN]; OMX_U8 lensname[OMX_CONFIG_CAMERAINFOTYPE_NAME_LEN]; OMX_U16 nModelId; OMX_U8 nManufacturerId; OMX_U8 nRevNum; OMX_U8 sSerialNumber[OMX_CONFIG_CAMERAINFOTYPE_SERIALNUM_LEN]; OMX_U8 sEpromVersion[OMX_CONFIG_CAMERAINFOTYPE_EPROMVER_LEN]; OMX_CONFIG_LENSCALIBRATIONVALUETYPE sLensCalibration; OMX_U32 xFNumber; OMX_U32 xFocalLength; } OMX_CONFIG_CAMERAINFOTYPE; typedef enum OMX_CONFIG_CAMERAFEATURESSHUTTER { OMX_CameraFeaturesShutterUnknown, OMX_CameraFeaturesShutterNotPresent, OMX_CameraFeaturesShutterPresent, OMX_CameraFeaturesShutterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_CameraFeaturesShutterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_CameraFeaturesShutterMax = 0x7FFFFFFF } OMX_CONFIG_CAMERAFEATURESSHUTTER; typedef struct OMX_CONFIG_CAMERAFEATURESTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_CONFIG_CAMERAFEATURESSHUTTER eHasMechanicalShutter; OMX_BOOL bHasLens; } OMX_CONFIG_CAMERAFEATURESTYPE; //Should be added to the spec as part of IL416c /* OMX_IndexConfigRequestCallback: Enable config change notifications. */ typedef struct OMX_CONFIG_REQUESTCALLBACKTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_INDEXTYPE nIndex; OMX_BOOL bEnable; } OMX_CONFIG_REQUESTCALLBACKTYPE; /* This config implements IL416c to allow clients to request notification of when a config or parameter is changed. When the parameter specified in \code{nIndex} for port \code{nPortIndex} changes, an \code{OMX_EventParamOrConfigChanged} event is generated for the client. */ /* OMX_IndexConfigCommonFocusRegionXY: Define focus regions */ typedef enum OMX_FOCUSREGIONTYPE { OMX_FocusRegionNormal, OMX_FocusRegionFace, OMX_FocusRegionMax } OMX_FOCUSREGIONTYPE; typedef struct OMX_FOCUSREGIONXY { OMX_U32 xLeft; OMX_U32 xTop; OMX_U32 xWidth; OMX_U32 xHeight; OMX_U32 nWeight; OMX_U32 nMask; OMX_FOCUSREGIONTYPE eType; } OMX_FOCUSREGIONXY; typedef struct OMX_CONFIG_FOCUSREGIONXYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIndex; OMX_U32 nTotalRegions; OMX_S32 nValidRegions; OMX_BOOL bLockToFaces; OMX_U32 xFaceTolerance; OMX_FOCUSREGIONXY sRegion[1]; } OMX_CONFIG_FOCUSREGIONXYTYPE; /* Query / set the focus regions to use as a set of x/y/width/height boxes relative to the overall image. \code{nIndex} - first region number being set/read, allowing retrieval/setting of many regions over several requests. \code{nTotalRegions} - total number of regions currently defined. \code{nValidRegions} - number of valid regions in the \code{sRegion} array. When getting, the client sets this to the number of regions available. The component writes region data and updates this field with how many regions have been written to. When setting, this is the number of regions defined with this structure \code{bLockToFaces} - compare the region(s) given to the latest face tracking results. If a face is found within xFaceTolerance of the defined region, then amend the region to correspond to the face. \code{xFaceTolerance} - 0p16 value to define the max difference between the region centre and face tracking result centre to take the FT results \code{sRegions} - variable length array of focus regions. */ typedef struct OMX_CONFIG_U8TYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U8 nU8; /**< U8 value */ } OMX_PARAM_U8TYPE; typedef struct OMX_CONFIG_CAMERASETTINGSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nExposure; OMX_U32 nAnalogGain; OMX_U32 nDigitalGain; OMX_U32 nLux; OMX_U32 nRedGain; OMX_U32 nBlueGain; OMX_U32 nFocusPosition; } OMX_CONFIG_CAMERASETTINGSTYPE; /* OMX_IndexConfigDrawBoxLineParams: Face box style parameters. */ typedef struct OMX_YUVCOLOUR { OMX_U8 nY; OMX_U8 nU; OMX_U8 nV; } OMX_YUVCOLOUR; typedef struct OMX_CONFIG_DRAWBOXLINEPARAMS { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port to which this config applies */ OMX_U32 xCornerSize; /**< Size of the corners as a fraction of the complete side */ OMX_U32 nPrimaryFaceLineWidth; /**< Width of the box line for the primary face in pixels */ OMX_U32 nOtherFaceLineWidth; /**< Width of the box line for other faces in pixels */ OMX_U32 nFocusRegionLineWidth; /**< Width of the box line for focus regions in pixels */ OMX_YUVCOLOUR sPrimaryFaceColour; /**< YUV colour for the primary face */ OMX_YUVCOLOUR sPrimaryFaceSmileColour; /**< YUV colour for the primary face if smiling */ OMX_YUVCOLOUR sPrimaryFaceBlinkColour; /**< YUV colour for the primary face if blinking */ OMX_YUVCOLOUR sOtherFaceColour; /**< YUV colour for the all other faces */ OMX_YUVCOLOUR sOtherFaceSmileColour; /**< YUV colour for the all other faces if smiling */ OMX_YUVCOLOUR sOtherFaceBlinkColour; /**< YUV colour for the all other faces if blinking */ OMX_BOOL bShowFocusRegionsWhenIdle; /**< Are focus regions displayed when just in viewfinder/AF idle */ OMX_YUVCOLOUR sFocusRegionColour; /**< YUV colour for focus regions */ OMX_BOOL bShowAfState; /**< Change to the colours specified below if AF cycle has run */ OMX_BOOL bShowOnlyPrimaryAfState; /**< Only show the primary face when displaying the AF status */ OMX_BOOL bCombineNonFaceRegions; /**< Combine all regions not defined as faces into one single box covering them all */ OMX_YUVCOLOUR sAfLockPrimaryFaceColour; /**< YUV colour for the primary face */ OMX_YUVCOLOUR sAfLockOtherFaceColour; /**< YUV colour for the all other faces */ OMX_YUVCOLOUR sAfLockFocusRegionColour; /**< YUV colour for focus regions */ OMX_YUVCOLOUR sAfFailPrimaryFaceColour; /**< YUV colour for the primary face */ OMX_YUVCOLOUR sAfFailOtherFaceColour; /**< YUV colour for the all other faces */ OMX_YUVCOLOUR sAfFailFocusRegionColour; /**< YUV colour for focus regions */ } OMX_CONFIG_DRAWBOXLINEPARAMS; /* Query / set the parameters for the box to be drawn around faces/focus regions. */ #define OMX_PARAM_CAMERARMITYPE_RMINAME_LEN 16 //OMX_IndexParamCameraRmiControl typedef struct OMX_PARAM_CAMERARMITYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnabled; OMX_U8 sRmiName[OMX_PARAM_CAMERARMITYPE_RMINAME_LEN]; OMX_U32 nInputBufferHeight; OMX_U32 nRmiBufferSize; OMX_BRCM_POOL_T *pImagePool; } OMX_PARAM_CAMERARMITYPE; /* OMX_IndexConfigBrcmSyncOutput: Forcing a write sync */ typedef struct OMX_CONFIG_BRCMSYNCOUTPUTTYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ } OMX_CONFIG_BRCMSYNCOUTPUTTYPE; /* Setting this config forces a sync of data to the filesystem. */ /* OMX_IndexConfigDrmView: View information for DRM rental files */ typedef struct OMX_CONFIG_DRMVIEWTYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nCurrentView; /**< Current view count */ OMX_U32 nMaxView; /**< Max. no. of view allowed */ } OMX_CONFIG_DRMVIEWTYPE; /* This structure contains information about the number of available views in the selected DRM rental file, which typically have a given maximum view count. It allows the user to explicitly agree to playing the file, which will increment the number of current views the file has had. */ typedef struct OMX_PARAM_BRCMU64TYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nLowPart; /**< low bits of the unsigned 64 bit value */ OMX_U32 nHighPart; /**< high bits of the unsigned 64 bit value */ } OMX_PARAM_BRCMU64TYPE; /* OMX_IndexParamBrcmDisableEXIF: Disable generation of EXIF data */ /* This parameter is used by clients to control the generation of exif data in JPEG images. */ /* OMX_IndexParamBrcmThumbnail: Control generation of thumbnail */ typedef struct OMX_PARAM_BRCMTHUMBNAILTYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_BOOL bEnable; /**< Enable generation of thumbnails during still capture */ OMX_BOOL bUsePreview; /**< Use the preview image (as is) as thumbnail */ OMX_U32 nWidth; /**< Desired width of the thumbnail */ OMX_U32 nHeight; /**< Desired height of the thumbnail */ } OMX_PARAM_BRCMTHUMBNAILTYPE; /* This parameter is used by clients to control how thumbnails are generated when creating still images. Thumbnail generation will be turned on or off depending on the \code{bEnable} field. The \code{bUsePreview} field will let the component know whether it should use the low resolution preview image (if the component has one available) as is for the thumbnail. When this is set to true, it should make the generation of thumbnails faster (if a preview image is available) and should use less memory as well. The \code{nWidth} and \code{nHeight} fields allow the client to specify the dimensions of the thumbnail. If both \code{nWidth} and \code{nHeight} are 0, we will calculate a sensible size for the thumbnail. */ typedef struct OMX_PARAM_BRCMASPECTRATIOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nWidth; OMX_U32 nHeight; } OMX_PARAM_BRCMASPECTRATIOTYPE; /* OMX_IndexParamBrcmVideoDecodeErrorConcealment: Control error concealment for video decode */ typedef struct OMX_PARAM_BRCMVIDEODECODEERRORCONCEALMENTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bStartWithValidFrame; /**< Decoder will only start emitting frames from a non-corrupted frame */ } OMX_PARAM_BRCMVIDEODECODEERRORCONCEALMENTTYPE; /* This parameter is used by clients to control the type of error concealment that will be done by the video decoder. */ #define OMX_CONFIG_FLASHINFOTYPE_NAME_LEN 16 typedef struct OMX_CONFIG_FLASHINFOTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U8 sFlashName[OMX_CONFIG_FLASHINFOTYPE_NAME_LEN]; OMX_CAMERAFLASHTYPE eFlashType; OMX_U8 nDeviceId; OMX_U8 nDeviceVersion; } OMX_CONFIG_FLASHINFOTYPE; /* OMX_IndexParamBrcmInterpolateMissingTimestamps: Configure component to interpolate missing timestamps */ /* Configures a component so that it tries to timestamp all the buffers it outputs. If the timestamp information is missing from the original buffer, the component will try its best to interpolate a value for the missing timestamp. */ /* OMX_IndexParamBrcmSetCodecPerformanceMonitoring: Configure component to output performance statistics */ /* Configures a codec component so that it outputs performance statistics to the given DECODE_PROGRESS_REPORT_T structure (passed as a pointer). This structure can then be read by the client to find out where the codec is at in its processing. */ /* OMX_IndexConfigDynamicRangeExpansion: Configure image dynamic range expansion processing */ typedef enum OMX_DYNAMICRANGEEXPANSIONMODETYPE { OMX_DynRangeExpOff, OMX_DynRangeExpLow, OMX_DynRangeExpMedium, OMX_DynRangeExpHigh, OMX_DynRangeExpKhronosExtensions = 0x6F000000, OMX_DynRangeExpVendorStartUnused = 0x7F000000, OMX_DynRangeExpMax = 0x7FFFFFFF } OMX_DYNAMICRANGEEXPANSIONMODETYPE; typedef struct OMX_CONFIG_DYNAMICRANGEEXPANSIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_DYNAMICRANGEEXPANSIONMODETYPE eMode; } OMX_CONFIG_DYNAMICRANGEEXPANSIONTYPE; /* Configures the intensity of an image dynamic range expansion processing stage */ /* OMX_IndexParamBrcmTransposeBufferCount: Configure the number of pre-allocated transpose buffers */ /* This config allows the client to explicitly set the number of destination buffers pre-allocated for ports that support 90/270 degree rotation (e.g. in video_render). The buffers will be pre-allocated during a state transition from LOADED to IDLE (the transition will fail if there is not enough memory available for the buffers). . */ /* OMX_IndexParamBrcmThreadAffinity: Control the CPU affinity of component thread(s) */ typedef enum OMX_BRCMTHREADAFFINITYTYPE { OMX_BrcmThreadAffinityCPU0, OMX_BrcmThreadAffinityCPU1, OMX_BrcmThreadAffinityMax = 0x7FFFFFFF } OMX_BRCMTHREADAFFINITYTYPE; typedef struct OMX_PARAM_BRCMTHREADAFFINITYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BRCMTHREADAFFINITYTYPE eAffinity; /**< Thread CPU affinity */ } OMX_PARAM_BRCMTHREADAFFINITYTYPE; /* This parameter is used by clients to hint the CPU that a component thread should run on. */ /* OMX_IndexConfigCommonSceneDetected: Reports the scene type detected by a scene detection algorithm. */ typedef enum OMX_SCENEDETECTTYPE { OMX_SceneDetectUnknown, OMX_SceneDetectLandscape, OMX_SceneDetectPortrait, OMX_SceneDetectMacro, OMX_SceneDetectNight, OMX_SceneDetectPortraitNight, OMX_SceneDetectBacklit, OMX_SceneDetectPortraitBacklit, OMX_SceneDetectSunset, OMX_SceneDetectBeach, OMX_SceneDetectSnow, OMX_SceneDetectFireworks, OMX_SceneDetectMax = 0x7FFFFFFF } OMX_SCENEDETECTTYPE; /* OMX_IndexConfigCommonSceneDetected: Reports the scene type detected by a scene detection algorithm. */ typedef struct OMX_CONFIG_SCENEDETECTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_SCENEDETECTTYPE eScene; /**< Scene type detected */ } OMX_CONFIG_SCENEDETECTTYPE; /* This config is used to report to clients the scene type that has been detected. */ /* OMX_IndexParamNalStreamFormat: Control the NAL unit packaging. This is a Khronos extension. */ typedef enum OMX_INDEXEXTTYPE { /* Video parameters and configurations */ OMX_IndexExtVideoStartUnused = OMX_IndexKhronosExtensions + 0x00600000, OMX_IndexParamNalStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */ OMX_IndexParamNalStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */ OMX_IndexParamNalStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */ OMX_IndexExtMax = 0x7FFFFFFF } OMX_INDEXEXTTYPE; /* OMX_IndexParamNalStreamFormat: Control the NAL unit packaging. This is a Khronos extension. */ typedef enum OMX_NALUFORMATSTYPE { OMX_NaluFormatStartCodes = 1, OMX_NaluFormatOneNaluPerBuffer = 2, OMX_NaluFormatOneByteInterleaveLength = 4, OMX_NaluFormatTwoByteInterleaveLength = 8, OMX_NaluFormatFourByteInterleaveLength = 16, OMX_NaluFormatCodingMax = 0x7FFFFFFF } OMX_NALUFORMATSTYPE; /* OMX_IndexParamNalStreamFormat: Control the NAL unit packaging. This is a Khronos extension. */ typedef struct OMX_NALSTREAMFORMATTYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_NALUFORMATSTYPE eNaluFormat; } OMX_NALSTREAMFORMATTYPE; /* This parameter is used to control the NAL unit packaging of an H264 video port. */ /* OMX_IndexParamVideoMvc: MVC codec parameters */ typedef struct OMX_VIDEO_PARAM_AVCTYPE OMX_VIDEO_PARAM_MVCTYPE; /* This parameter is currently identical to the AVC parameter type. */ /* OMX_IndexConfigBrcmDrawStaticBox: Define static box to be drawn */ typedef enum OMX_STATICBOXTYPE { OMX_StaticBoxNormal, OMX_StaticBoxPrimaryFaceAfIdle, OMX_StaticBoxNonPrimaryFaceAfIdle, OMX_StaticBoxFocusRegionAfIdle, OMX_StaticBoxPrimaryFaceAfSuccess, OMX_StaticBoxNonPrimaryFaceAfSuccess, OMX_StaticBoxFocusRegionAfSuccess, OMX_StaticBoxPrimaryFaceAfFail, OMX_StaticBoxNonPrimaryFaceAfFail, OMX_StaticBoxFocusRegionAfFail, OMX_StaticBoxMax } OMX_STATICBOXTYPE; typedef struct OMX_STATICBOX { OMX_U32 xLeft; OMX_U32 xTop; OMX_U32 xWidth; OMX_U32 xHeight; OMX_STATICBOXTYPE eType; } OMX_STATICBOX; typedef struct OMX_CONFIG_STATICBOXTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIndex; OMX_U32 nTotalBoxes; OMX_S32 nValidBoxes; OMX_BOOL bDrawOtherBoxes; OMX_STATICBOX sBoxes[1]; } OMX_CONFIG_STATICBOXTYPE; /* Query / set the parameters for a box to always be drawn on viewfinder images The x/y/width/height values for the boxes are relative to the overall image. \code{nIndex} - first box number being set/read, allowing retrieval/setting of many boxes over several requests. \code{nValidBoxes} - total number of boxes currently defined. \code{nValidBoxes} - number of valid boxes in the \code{sBoxes} array. When getting, the client sets this to the number of boxes available. The component writes box data and updates this field with how many boxes have been written to. When setting, this is the number of boxes defined with this structure \code{sBoxes} - variable length array of static boxes. */ /* OMX_IndexConfigPortCapturing: Per-port capturing state */ typedef struct OMX_CONFIG_PORTBOOLEANTYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; } OMX_CONFIG_PORTBOOLEANTYPE; /* This is proposed in IL533f for controlling which ports of a multi-port camera component are capturing frames. */ /* OMX_IndexConfigCaptureMode: Capturing mode type */ typedef enum OMX_CAMERACAPTUREMODETYPE { OMX_CameraCaptureModeWaitForCaptureEnd, OMX_CameraCaptureModeWaitForCaptureEndAndUsePreviousInputImage, OMX_CameraCaptureModeResumeViewfinderImmediately, OMX_CameraCaptureModeMax, } OMX_CAMERACAPTUREMODETYPE; typedef struct OMX_PARAM_CAMERACAPTUREMODETYPE{ OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_CAMERACAPTUREMODETYPE eMode; } OMX_PARAM_CAMERACAPTUREMODETYPE; /* This controls the mode of operation for still image capture in the camera component. */ /* OMX_IndexParamBrcmDrmEncryption: Set DRM encryption scheme */ typedef enum OMX_BRCMDRMENCRYPTIONTYPE { OMX_DrmEncryptionNone = 0, OMX_DrmEncryptionHdcp2, OMX_DrmEncryptionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_DrmEncryptionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_DrmEncryptionRangeMax = 0x7FFFFFFF } OMX_BRCMDRMENCRYPTIONTYPE; typedef struct OMX_PARAM_BRCMDRMENCRYPTIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BRCMDRMENCRYPTIONTYPE eEncryption; OMX_U32 nConfigDataLen; OMX_U8 configData[1]; } OMX_PARAM_BRCMDRMENCRYPTIONTYPE; /* Query/set the DRM encryption scheme used by a port writing out data. */ /* OMX_IndexConfigBufferStall: Advertise buffer stall state */ typedef struct OMX_CONFIG_BUFFERSTALLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bStalled; /**< Whether we are stalled */ OMX_U32 nDelay; /**< Delay in real time (us) from last buffer to current time */ } OMX_CONFIG_BUFFERSTALLTYPE; /* Query/set the buffer stall threashold. When set the \code{nDelay} parameter specifies a time to class whether buffer output is stalled. When get, the \code{nDelay} parameter indicates the current buffer delay, and the {bStalled} parameter indicates whether this time is over a previously set threashold. When \code{OMX_IndexConfigRequestCallback} is used with this index, a notification is given when \code{bStalled} changes. */ /* OMX_IndexConfigLatencyTarget: Maintain target latency by adjusting clock speed */ typedef struct OMX_CONFIG_LATENCYTARGETTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; /**< whether this mode is enabled */ OMX_U32 nFilter; /**< number of latency samples to filter on, good value: 1 */ OMX_U32 nTarget; /**< target latency, us */ OMX_U32 nShift; /**< shift for storing latency values, good value: 7 */ OMX_S32 nSpeedFactor; /**< multiplier for speed changes, in 24.8 format, good value: 256-512 */ OMX_S32 nInterFactor; /**< divider for comparing latency versus gradiant, good value: 300 */ OMX_S32 nAdjCap; /**< limit for speed change before nSpeedFactor is applied, good value: 100 */ } OMX_CONFIG_LATENCYTARGETTYPE; /* Query/set parameters used when adjusting clock speed to match the measured latency to a specified value. */ /* OMX_IndexConfigBrcmUseProprietaryCallback: Force use of proprietary callback */ typedef struct OMX_CONFIG_BRCMUSEPROPRIETARYCALLBACKTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnable; } OMX_CONFIG_BRCMUSEPROPRIETARYCALLBACKTYPE; /* Disable/enable the use of proprietary callbacks rather than OpenMAX IL buffer handling. */ /* OMX_IndexParamCommonUseStcTimestamps: Select timestamp mode */ typedef enum OMX_TIMESTAMPMODETYPE { OMX_TimestampModeZero = 0, /**< Use a timestamp of 0 */ OMX_TimestampModeRawStc, /**< Use the raw STC as the timestamp */ OMX_TimestampModeResetStc, /**< Store the STC when video capture port goes active, and subtract that from STC for the timestamp */ OMX_TimestampModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_TimestampModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_TimestampModeMax = 0x7FFFFFFF } OMX_TIMESTAMPMODETYPE; typedef struct OMX_PARAM_TIMESTAMPMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_TIMESTAMPMODETYPE eTimestampMode; } OMX_PARAM_TIMESTAMPMODETYPE; /* Specifies what to use as timestamps in the absence of a clock component. */ /* EGL image buffer for passing to video port. * Used when port color format is OMX_COLOR_FormatBRCMEGL. */ typedef struct OMX_BRCMVEGLIMAGETYPE { /* Passed between ARM + VC; use fixed width types. */ OMX_U32 nWidth; OMX_U32 nHeight; OMX_U32 nStride; OMX_U32 nUmemHandle; OMX_U32 nUmemOffset; OMX_U32 nFlipped; /* Non-zero -> vertically flipped image */ } OMX_BRCMVEGLIMAGETYPE; /* Provides field of view */ typedef struct OMX_CONFIG_BRCMFOVTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 xFieldOfViewHorizontal; /**< Horizontal field of view in degrees. 16p16 value */ OMX_U32 xFieldOfViewVertical; /**< Vertical field of view in degrees. 16p16 value */ } OMX_CONFIG_BRCMFOVTYPE; /* OMX_IndexConfigBrcmDecoderPassThrough: Enabling Audio Passthrough */ /* This allows an audio decoder to disable decoding the stream and pass through correctly framed data to enable playback of compressed audio to supported output devices. */ /* OMX_IndexConfigBrcmClockReferenceSource: Select Clock Reference Source */ /* This control allows communicating directly to an audio renderer component whether it should act as a clock reference source or act as a slave. */ /* OMX_IndexConfigEncLevelExtension: AVC Override encode capabilities */ typedef struct OMX_VIDEO_CONFIG_LEVEL_EXTEND { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nCustomMaxMBPS; /**< Specifies maximum macro-blocks per second */ OMX_U32 nCustomMaxFS; /**< Specifies maximum frame size (macro-blocks per frame) */ OMX_U32 nCustomMaxBRandCPB; /**< Specifies maximum bitrate in units of 1000 bits/s and Codec Picture Buffer (CPB derived from bitrate) */ } OMX_VIDEO_CONFIG_LEVEL_EXTEND; /* This allows finer control of the H264 encode internal parameters. */ /* OMX_IndexParamBrcmEEDEEnable: Enable/Disable end to end distortion estimator */ typedef struct OMX_VIDEO_EEDE_ENABLE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 enable; } OMX_VIDEO_EEDE_ENABLE; /* This enables or disables the use of end to end distortion estimation. */ /* OMX_IndexParamBrcmEEDELossRate: Loss rate configuration for end to end distortion */ typedef struct OMX_VIDEO_EEDE_LOSSRATE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 loss_rate; /**< loss rate, 5 means 5% */ } OMX_VIDEO_EEDE_LOSSRATE; /* Set the packet loss rate used by the end to end distortion estimator. */ /* OMX_IndexParamColorSpace: Colour space information */ typedef enum OMX_COLORSPACETYPE { OMX_COLORSPACE_UNKNOWN, OMX_COLORSPACE_JPEG_JFIF, OMX_COLORSPACE_ITU_R_BT601, OMX_COLORSPACE_ITU_R_BT709, OMX_COLORSPACE_FCC, OMX_COLORSPACE_SMPTE240M, OMX_COLORSPACE_BT470_2_M, OMX_COLORSPACE_BT470_2_BG, OMX_COLORSPACE_JFIF_Y16_255, OMX_COLORSPACE_MAX = 0x7FFFFFFF } OMX_COLORSPACETYPE; typedef struct OMX_PARAM_COLORSPACETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_COLORSPACETYPE eColorSpace; } OMX_PARAM_COLORSPACETYPE; /* Sets the colourspace with which pixel buffers should be generated / interpreted. */ typedef enum OMX_CAPTURESTATETYPE { OMX_NotCapturing, OMX_CaptureStarted, OMX_CaptureComplete, OMX_CaptureMax = 0x7FFFFFFF } OMX_CAPTURESTATETYPE; typedef struct OMX_PARAM_CAPTURESTATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_CAPTURESTATETYPE eCaptureState; } OMX_PARAM_CAPTURESTATETYPE; /* Provides information on the colour space that's in use during image/video processing. */ /* OMX_IndexConfigMinimiseFragmentation: Minimising Fragmentation */ /* This control can be supported to enable the client to request that the component works to minimise fragmentation of output buffers. */ /* OMX_IndexConfigBrcmBufferFlagFilter: Filter buffers based on flags */ /* This control can be set to request that buffers are conditionally forwarded on output ports based on matching flags set on that buffer. */ /* OMX_IndexParamPortMaxFrameSize: Specifying maximum frame size */ /* This control can be used to control the maximum frame size allowed on an output port. */ /* OMX_IndexConfigBrcmCameraRnDPreprocess: Enable use of development ISP software stage */ /* This control can be used to enable a developmental software stage to be inserted into the preprocessor stage of the ISP. */ /* OMX_IndexConfigBrcmCameraRnDPostprocess: Enable use of development ISP software stage */ /* This control can be used to enable a developmental software stage to be inserted into the postprocessor stage of the ISP. */ /* OMX_IndexParamDisableVllPool: Controlling use of memory for loadable modules */ /* This control can be used to control whether loadable modules used a dedicated memory pool or use heap allocated memory. */ /* OMX_IndexParamBrcmVideoPrecodeForQP: Pre-code 1st frame for QP.*/ /* This control selects a pre-encode of the first frame to set up a better initial QP value. */ /* OMX_IndexParamBrcmVideoTimestampFifo: Video timestamp FIFO mode. */ /* When enabled, the timestamp fifo mode will change the way incoming timestamps are associated with output images so the incoming timestamps get used without re-ordering on output images. */ /* OMX_IndexParamCameraCustomSensorConfig: Custom camera sensor configuration. */ /* This parameter is passed down to the camera sensor driver to be interpreted as a request for a different configuration to normal. How the configuration varies is sensor specific. */ /* OMX_IndexParamCameraDeviceNumber: Camera device selection .*/ /* Controls which camera driver, or camera peripheral, to use. */ /* OMX_IndexParamBrcmMaxNumCallbacks: Codec callback limit. */ /* The codec can queue up a significant number of frames internally if the sink is not consuming the output fast enough. This control limits the number of frames that can be queued up. */ typedef struct OMX_PARAM_BRCMCONFIGFILETYPE { OMX_U32 nSize; /**< size of the structure in bytes, including actual URI name */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 fileSize; /**< Size of complete file data */ } OMX_PARAM_BRCMCONFIGFILETYPE; typedef struct OMX_PARAM_BRCMCONFIGFILECHUNKTYPE { OMX_U32 nSize; /**< size of the structure in bytes, including actual chunk data */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 size; /**< Number of bytes being transferred in this chunk */ OMX_U32 offset; /**< Offset of this chunk in the file */ OMX_U8 data[1]; /**< Chunk data */ } OMX_PARAM_BRCMCONFIGFILECHUNKTYPE; typedef struct OMX_PARAM_BRCMFRAMERATERANGETYPE { OMX_U32 nSize; /**< size of the structure in bytes, including actual chunk data */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; OMX_U32 xFramerateLow; /**< Low end of framerate range. Q16 format */ OMX_U32 xFramerateHigh; /**< High end of framerate range. Q16 format */ } OMX_PARAM_BRCMFRAMERATERANGETYPE; typedef struct OMX_PARAM_S32TYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_S32 nS32; /**< S32 value */ } OMX_PARAM_S32TYPE; typedef struct OMX_PARAM_BRCMVIDEODRMPROTECTBUFFERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 size_wanted; /**< Input. Zero size means internal video decoder buffer, mem_handle and phys_addr not returned in this case */ OMX_U32 protect; /**< Input. 1 = protect, 0 = unprotect */ OMX_U32 mem_handle; /**< Output. Handle for protected buffer */ OMX_PTR phys_addr; /**< Output. Physical memory address of protected buffer */ } OMX_PARAM_BRCMVIDEODRMPROTECTBUFFERTYPE; typedef struct OMX_CONFIG_ZEROSHUTTERLAGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 bZeroShutterMode; /**< Select ZSL mode from the camera. */ OMX_U32 bConcurrentCapture; /**< Perform concurrent captures for full ZSL. */ } OMX_CONFIG_ZEROSHUTTERLAGTYPE; /* OMX_IndexParamBrcmVideoDecodeConfigVD3: VDec3 configuration. */ typedef struct OMX_PARAM_BRCMVIDEODECODECONFIGVD3TYPE { OMX_U32 nSize; /**< size of the structure in bytes, including configuration data */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U8 config[1]; /**< Configuration data (a VD3_CONFIGURE_T) */ } OMX_PARAM_BRCMVIDEODECODECONFIGVD3TYPE; /* Codec specific configuration block to set up internal state in a non-standard manner. */ typedef struct OMX_CONFIG_CUSTOMAWBGAINSTYPE { OMX_U32 nSize; /**< size of the structure in bytes, including configuration data */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 xGainR; /**< Red gain - 16p16 */ OMX_U32 xGainB; /**< Blue gain - 16p16 */ } OMX_CONFIG_CUSTOMAWBGAINSTYPE; /* OMX_IndexConfigBrcmRenderStats: Render port statistics */ typedef struct OMX_CONFIG_BRCMRENDERSTATSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL nValid; OMX_U32 nMatch; OMX_U32 nPeriod; OMX_U32 nPhase; OMX_U32 nPixelClockNominal; OMX_U32 nPixelClock; OMX_U32 nHvsStatus; OMX_U32 dummy0[2]; } OMX_CONFIG_BRCMRENDERSTATSTYPE; /* This provides statistics from the renderer to allow more accurate synchronisation between the scheduler and display VSYNC. */ #define OMX_BRCM_MAXANNOTATETEXTLEN 256 typedef struct OMX_CONFIG_BRCMANNOTATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnable; OMX_BOOL bShowShutter; OMX_BOOL bShowAnalogGain; OMX_BOOL bShowLens; OMX_BOOL bShowCaf; OMX_BOOL bShowMotion; OMX_BOOL bShowFrameNum; OMX_BOOL bEnableBackground; OMX_BOOL bCustomBackgroundColour; OMX_U8 nBackgroundY; OMX_U8 nBackgroundU; OMX_U8 nBackgroundV; OMX_U8 dummy1; OMX_BOOL bCustomTextColour; OMX_U8 nTextY; OMX_U8 nTextU; OMX_U8 nTextV; OMX_U8 nTextSize; /**< Text size: 6-150 pixels */ OMX_U8 sText[OMX_BRCM_MAXANNOTATETEXTLEN]; } OMX_CONFIG_BRCMANNOTATETYPE; /* OMX_IndexParamBrcmStereoscopicMode: Stereoscopic camera support */ typedef enum OMX_BRCMSTEREOSCOPICMODETYPE { OMX_STEREOSCOPIC_NONE = 0, OMX_STEREOSCOPIC_SIDEBYSIDE = 1, OMX_STEREOSCOPIC_TOPBOTTOM = 2, OMX_STEREOSCOPIC_MAX = 0x7FFFFFFF, } OMX_BRCMSTEREOSCOPICMODETYPE; typedef struct OMX_CONFIG_BRCMSTEREOSCOPICMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BRCMSTEREOSCOPICMODETYPE eMode; /**< Packing mode */ OMX_BOOL bDecimate; /**< Half/half mode (pixel aspect ratio = 1:2 or 2:1 if set. 1:1 if not set) */ OMX_BOOL bSwapEyes; /**< False = left eye first. True = right eye first. */ } OMX_CONFIG_BRCMSTEREOSCOPICMODETYPE; /* This control sets up how stereoscopic images should be generated. */ /* OMX_IndexParamCameraInterface: Camera interface type. */ typedef enum OMX_CAMERAINTERFACETYPE { OMX_CAMERAINTERFACE_CSI = 0, OMX_CAMERAINTERFACE_CCP2 = 1, OMX_CAMERAINTERFACE_CPI = 2, OMX_CAMERAINTERFACE_MAX = 0x7FFFFFFF, } OMX_CAMERAINTERFACETYPE; typedef struct OMX_PARAM_CAMERAINTERFACETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_CAMERAINTERFACETYPE eMode; /**< Interface mode */ } OMX_PARAM_CAMERAINTERFACETYPE; /* This configures the physical camera interface type. */ typedef enum OMX_CAMERACLOCKINGMODETYPE { OMX_CAMERACLOCKINGMODE_STROBE = 0, OMX_CAMERACLOCKINGMODE_CLOCK = 1, OMX_CAMERACLOCKINGMODE_MAX = 0x7FFFFFFF, } OMX_CAMERACLOCKINGMODETYPE; typedef struct OMX_PARAM_CAMERACLOCKINGMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_CAMERACLOCKINGMODETYPE eMode; /**< Clocking mode */ } OMX_PARAM_CAMERACLOCKINGMODETYPE; /* OMX_IndexParamCameraRxConfig: Camera receiver configuration */ typedef enum OMX_CAMERARXDECODETYPE { OMX_CAMERARXDECODE_NONE = 0, OMX_CAMERARXDECODE_DPCM8TO10 = 1, OMX_CAMERARXDECODE_DPCM7TO10 = 2, OMX_CAMERARXDECODE_DPCM6TO10 = 3, OMX_CAMERARXDECODE_DPCM8TO12 = 4, OMX_CAMERARXDECODE_DPCM7TO12 = 5, OMX_CAMERARXDECODE_DPCM6TO12 = 6, OMX_CAMERARXDECODE_DPCM10TO14 = 7, OMX_CAMERARXDECODE_DPCM8TO14 = 8, OMX_CAMERARXDECODE_DPCM12TO16 = 9, OMX_CAMERARXDECODE_DPCM10TO16 = 10, OMX_CAMERARXDECODE_DPCM8TO16 = 11, OMX_CAMERARXDECODE_MAX = 0x7FFFFFFF } OMX_CAMERARXDECODETYPE; typedef enum OMX_CAMERARXENCODETYPE { OMX_CAMERARXENCODE_NONE = 0, OMX_CAMERARXENCODE_DPCM10TO8 = 1, OMX_CAMERARXENCODE_DPCM12TO8 = 2, OMX_CAMERARXENCODE_DPCM14TO8 = 3, OMX_CAMERARXENCODE_MAX = 0x7FFFFFFF } OMX_CAMERARXENCODETYPE; typedef enum OMX_CAMERARXUNPACKTYPE { OMX_CAMERARXUNPACK_NONE = 0, OMX_CAMERARXUNPACK_6 = 1, OMX_CAMERARXUNPACK_7 = 2, OMX_CAMERARXUNPACK_8 = 3, OMX_CAMERARXUNPACK_10 = 4, OMX_CAMERARXUNPACK_12 = 5, OMX_CAMERARXUNPACK_14 = 6, OMX_CAMERARXUNPACK_16 = 7, OMX_CAMERARXUNPACK_MAX = 0x7FFFFFFF } OMX_CAMERARXUNPACKYPE; typedef enum OMX_CAMERARXPACKTYPE { OMX_CAMERARXPACK_NONE = 0, OMX_CAMERARXPACK_8 = 1, OMX_CAMERARXPACK_10 = 2, OMX_CAMERARXPACK_12 = 3, OMX_CAMERARXPACK_14 = 4, OMX_CAMERARXPACK_16 = 5, OMX_CAMERARXPACK_RAW10 = 6, OMX_CAMERARXPACK_RAW12 = 7, OMX_CAMERARXPACK_MAX = 0x7FFFFFFF } OMX_CAMERARXPACKTYPE; typedef struct OMX_PARAM_CAMERARXCONFIG_TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_CAMERARXDECODETYPE eDecode; OMX_CAMERARXENCODETYPE eEncode; OMX_CAMERARXUNPACKYPE eUnpack; OMX_CAMERARXPACKTYPE ePack; OMX_U32 nDataLanes; OMX_U32 nEncodeBlockLength; OMX_U32 nEmbeddedDataLines; OMX_U32 nImageId; } OMX_PARAM_CAMERARXCONFIG_TYPE; /* Configures the setup and processing options of the camera receiver peripheral. */ typedef struct OMX_PARAM_CAMERARXTIMING_TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nTiming1; OMX_U32 nTiming2; OMX_U32 nTiming3; OMX_U32 nTiming4; OMX_U32 nTiming5; OMX_U32 nTerm1; OMX_U32 nTerm2; OMX_U32 nCpiTiming1; OMX_U32 nCpiTiming2; } OMX_PARAM_CAMERARXTIMING_TYPE; /* OMX_IndexParamBrcmBayerOrder: Bayer order */ typedef enum OMX_BAYERORDERTYPE { OMX_BayerOrderRGGB = 0, OMX_BayerOrderGBRG = 1, OMX_BayerOrderBGGR = 2, OMX_BayerOrderGRBG = 3, OMX_BayerOrderMax = 0x7FFFFFFF } OMX_BAYERORDERTYPE; typedef struct OMX_PARAM_BAYERORDERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BAYERORDERTYPE eBayerOrder; } OMX_PARAM_BAYERORDERTYPE; /* The IL standard does not support a way to specify the Bayer order of Bayer images. This control adds that missing functionality. */ /* OMX_IndexConfigBrcmPowerMonitor: Deprecated.*/ /* Deprecated. Do not use. */ /* OMX_IndexParamBrcmZeroCopy: Deprecated */ /* Deprecated. Do not use. */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/khronos/IL/OMX_Component.h ================================================ /* * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** OMX_Component.h - OpenMax IL version 1.1.2 * The OMX_Component header file contains the definitions used to define * the public interface of a component. This header file is intended to * be used by both the application and the component. */ #ifndef OMX_Component_h #define OMX_Component_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_Audio.h" #include "OMX_Video.h" #include "OMX_Image.h" #include "OMX_Other.h" /** @ingroup comp */ typedef enum OMX_PORTDOMAINTYPE { OMX_PortDomainAudio, OMX_PortDomainVideo, OMX_PortDomainImage, OMX_PortDomainOther, OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_PortDomainMax = 0x7ffffff } OMX_PORTDOMAINTYPE; /** @ingroup comp */ typedef struct OMX_PARAM_PORTDEFINITIONTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port number the structure applies to */ OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */ OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */ OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */ OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */ OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by OMX_CommandPortEnable/OMX_CommandPortDisable. When disabled a port is unpopulated. A disabled port is not populated with buffers on a transition to IDLE. */ OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by nBufferCountActual. A disabled port is always unpopulated. An enabled port is populated on a transition to OMX_StateIdle and unpopulated on a transition to loaded. */ OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */ union { OMX_AUDIO_PORTDEFINITIONTYPE audio; OMX_VIDEO_PORTDEFINITIONTYPE video; OMX_IMAGE_PORTDEFINITIONTYPE image; OMX_OTHER_PORTDEFINITIONTYPE other; } format; OMX_BOOL bBuffersContiguous; OMX_U32 nBufferAlignment; } OMX_PARAM_PORTDEFINITIONTYPE; /** @ingroup comp */ typedef struct OMX_PARAM_U32TYPE { OMX_U32 nSize; /**< Size of this structure, in Bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_U32 nU32; /**< U32 value */ } OMX_PARAM_U32TYPE; /** @ingroup rpm */ typedef enum OMX_SUSPENSIONPOLICYTYPE { OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */ OMX_SuspensionEnabled, /**< Suspension allowed */ OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_SuspensionPolicyMax = 0x7fffffff } OMX_SUSPENSIONPOLICYTYPE; /** @ingroup rpm */ typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_SUSPENSIONPOLICYTYPE ePolicy; } OMX_PARAM_SUSPENSIONPOLICYTYPE; /** @ingroup rpm */ typedef enum OMX_SUSPENSIONTYPE { OMX_NotSuspended, /**< component is not suspended */ OMX_Suspended, /**< component is suspended */ OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_SuspendMax = 0x7FFFFFFF } OMX_SUSPENSIONTYPE; /** @ingroup rpm */ typedef struct OMX_PARAM_SUSPENSIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_SUSPENSIONTYPE eType; } OMX_PARAM_SUSPENSIONTYPE ; typedef struct OMX_CONFIG_BOOLEANTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bEnabled; } OMX_CONFIG_BOOLEANTYPE; /* Parameter specifying the content uri to use. */ /** @ingroup cp */ typedef struct OMX_PARAM_CONTENTURITYPE { OMX_U32 nSize; /**< size of the structure in bytes, including actual URI name */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U8 contentURI[1]; /**< The URI name */ } OMX_PARAM_CONTENTURITYPE; /* Parameter specifying the pipe to use. */ /** @ingroup cp */ typedef struct OMX_PARAM_CONTENTPIPETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_HANDLETYPE hPipe; /**< The pipe handle*/ } OMX_PARAM_CONTENTPIPETYPE; /** @ingroup rpm */ typedef struct OMX_RESOURCECONCEALMENTTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment methods (like degrading algorithm quality to lower resource consumption or functional bypass) on a component as a resolution to resource conflicts. */ } OMX_RESOURCECONCEALMENTTYPE; /** @ingroup metadata */ typedef enum OMX_METADATACHARSETTYPE { OMX_MetadataCharsetUnknown = 0, OMX_MetadataCharsetASCII, OMX_MetadataCharsetBinary, OMX_MetadataCharsetCodePage1252, OMX_MetadataCharsetUTF8, OMX_MetadataCharsetJavaConformantUTF8, OMX_MetadataCharsetUTF7, OMX_MetadataCharsetImapUTF7, OMX_MetadataCharsetUTF16LE, OMX_MetadataCharsetUTF16BE, OMX_MetadataCharsetGB12345, OMX_MetadataCharsetHZGB2312, OMX_MetadataCharsetGB2312, OMX_MetadataCharsetGB18030, OMX_MetadataCharsetGBK, OMX_MetadataCharsetBig5, OMX_MetadataCharsetISO88591, OMX_MetadataCharsetISO88592, OMX_MetadataCharsetISO88593, OMX_MetadataCharsetISO88594, OMX_MetadataCharsetISO88595, OMX_MetadataCharsetISO88596, OMX_MetadataCharsetISO88597, OMX_MetadataCharsetISO88598, OMX_MetadataCharsetISO88599, OMX_MetadataCharsetISO885910, OMX_MetadataCharsetISO885913, OMX_MetadataCharsetISO885914, OMX_MetadataCharsetISO885915, OMX_MetadataCharsetShiftJIS, OMX_MetadataCharsetISO2022JP, OMX_MetadataCharsetISO2022JP1, OMX_MetadataCharsetISOEUCJP, OMX_MetadataCharsetSMS7Bit, OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MetadataCharsetTypeMax= 0x7FFFFFFF } OMX_METADATACHARSETTYPE; /** @ingroup metadata */ typedef enum OMX_METADATASCOPETYPE { OMX_MetadataScopeAllLevels, OMX_MetadataScopeTopLevel, OMX_MetadataScopePortLevel, OMX_MetadataScopeNodeLevel, OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MetadataScopeTypeMax = 0x7fffffff } OMX_METADATASCOPETYPE; /** @ingroup metadata */ typedef enum OMX_METADATASEARCHMODETYPE { OMX_MetadataSearchValueSizeByIndex, OMX_MetadataSearchItemByIndex, OMX_MetadataSearchNextItemByKey, OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MetadataSearchTypeMax = 0x7fffffff } OMX_METADATASEARCHMODETYPE; /** @ingroup metadata */ typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_METADATASCOPETYPE eScopeMode; OMX_U32 nScopeSpecifier; OMX_U32 nMetadataItemCount; } OMX_CONFIG_METADATAITEMCOUNTTYPE; /** @ingroup metadata */ typedef struct OMX_CONFIG_METADATAITEMTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_METADATASCOPETYPE eScopeMode; OMX_U32 nScopeSpecifier; OMX_U32 nMetadataItemIndex; OMX_METADATASEARCHMODETYPE eSearchMode; OMX_METADATACHARSETTYPE eKeyCharset; OMX_U8 nKeySizeUsed; OMX_U8 nKey[128]; OMX_METADATACHARSETTYPE eValueCharset; OMX_STRING sLanguageCountry; OMX_U32 nValueMaxSize; OMX_U32 nValueSizeUsed; OMX_U8 nValue[1]; } OMX_CONFIG_METADATAITEMTYPE; /* @ingroup metadata */ typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bAllKeys; OMX_U32 nParentNodeID; OMX_U32 nNumNodes; } OMX_CONFIG_CONTAINERNODECOUNTTYPE; /** @ingroup metadata */ typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bAllKeys; OMX_U32 nParentNodeID; OMX_U32 nNodeIndex; OMX_U32 nNodeID; OMX_STRING cNodeName; OMX_BOOL bIsLeafType; } OMX_CONFIG_CONTAINERNODEIDTYPE; /** @ingroup metadata */ typedef struct OMX_PARAM_METADATAFILTERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and * the three key fields below are ignored */ OMX_METADATACHARSETTYPE eKeyCharset; OMX_U32 nKeySizeUsed; OMX_U8 nKey [128]; OMX_U32 nLanguageCountrySizeUsed; OMX_U8 nLanguageCountry[128]; OMX_BOOL bEnabled; /* if true then key is part of filter (e.g. * retained for query later). If false then * key is not part of filter */ } OMX_PARAM_METADATAFILTERTYPE; /** The OMX_HANDLETYPE structure defines the component handle. The component * handle is used to access all of the component's public methods and also * contains pointers to the component's private data area. The component * handle is initialized by the OMX core (with help from the component) * during the process of loading the component. After the component is * successfully loaded, the application can safely access any of the * component's public functions (although some may return an error because * the state is inappropriate for the access). * * @ingroup comp */ typedef struct OMX_COMPONENTTYPE { /** The size of this structure, in bytes. It is the responsibility of the allocator of this structure to fill in this value. Since this structure is allocated by the GetHandle function, this function will fill in this value. */ OMX_U32 nSize; /** nVersion is the version of the OMX specification that the structure is built against. It is the responsibility of the creator of this structure to initialize this value and every user of this structure should verify that it knows how to use the exact version of this structure found herein. */ OMX_VERSIONTYPE nVersion; /** pComponentPrivate is a pointer to the component private data area. This member is allocated and initialized by the component when the component is first loaded. The application should not access this data area. */ OMX_PTR pComponentPrivate; /** pApplicationPrivate is a pointer that is a parameter to the OMX_GetHandle method, and contains an application private value provided by the IL client. This application private data is returned to the IL Client by OMX in all callbacks */ OMX_PTR pApplicationPrivate; /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL specification for details on the GetComponentVersion method. */ OMX_ERRORTYPE (*GetComponentVersion)( OMX_IN OMX_HANDLETYPE hComponent, OMX_OUT OMX_STRING pComponentName, OMX_OUT OMX_VERSIONTYPE* pComponentVersion, OMX_OUT OMX_VERSIONTYPE* pSpecVersion, OMX_OUT OMX_UUIDTYPE* pComponentUUID); /** refer to OMX_SendCommand in OMX_core.h or the OMX IL specification for details on the SendCommand method. */ OMX_ERRORTYPE (*SendCommand)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_COMMANDTYPE Cmd, OMX_IN OMX_U32 nParam1, OMX_IN OMX_PTR pCmdData); /** refer to OMX_GetParameter in OMX_core.h or the OMX IL specification for details on the GetParameter method. */ OMX_ERRORTYPE (*GetParameter)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pComponentParameterStructure); /** refer to OMX_SetParameter in OMX_core.h or the OMX IL specification for details on the SetParameter method. */ OMX_ERRORTYPE (*SetParameter)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_IN OMX_PTR pComponentParameterStructure); /** refer to OMX_GetConfig in OMX_core.h or the OMX IL specification for details on the GetConfig method. */ OMX_ERRORTYPE (*GetConfig)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_INOUT OMX_PTR pComponentConfigStructure); /** refer to OMX_SetConfig in OMX_core.h or the OMX IL specification for details on the SetConfig method. */ OMX_ERRORTYPE (*SetConfig)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_INDEXTYPE nIndex, OMX_IN OMX_PTR pComponentConfigStructure); /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL specification for details on the GetExtensionIndex method. */ OMX_ERRORTYPE (*GetExtensionIndex)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE* pIndexType); /** refer to OMX_GetState in OMX_core.h or the OMX IL specification for details on the GetState method. */ OMX_ERRORTYPE (*GetState)( OMX_IN OMX_HANDLETYPE hComponent, OMX_OUT OMX_STATETYPE* pState); /** The ComponentTunnelRequest method will interact with another OMX component to determine if tunneling is possible and to setup the tunneling. The return codes for this method can be used to determine if tunneling is not possible, or if tunneling is not supported. Base profile components (i.e. non-interop) do not support this method and should return OMX_ErrorNotImplemented The interop profile component MUST support tunneling to another interop profile component with a compatible port parameters. A component may also support proprietary communication. If proprietary communication is supported the negotiation of proprietary communication is done outside of OMX in a vendor specific way. It is only required that the proper result be returned and the details of how the setup is done is left to the component implementation. When this method is invoked when nPort in an output port, the component will: 1. Populate the pTunnelSetup structure with the output port's requirements and constraints for the tunnel. When this method is invoked when nPort in an input port, the component will: 1. Query the necessary parameters from the output port to determine if the ports are compatible for tunneling 2. If the ports are compatible, the component should store the tunnel step provided by the output port 3. Determine which port (either input or output) is the buffer supplier, and call OMX_SetParameter on the output port to indicate this selection. The component will return from this call within 5 msec. @param [in] hComp Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle method. @param [in] nPort nPort is used to select the port on the component to be used for tunneling. @param [in] hTunneledComp Handle of the component to tunnel with. This is the component handle returned by the call to the OMX_GetHandle method. When this parameter is 0x0 the component should setup the port for communication with the application / IL Client. @param [in] nPortOutput nPortOutput is used indicate the port the component should tunnel with. @param [in] pTunnelSetup Pointer to the tunnel setup structure. When nPort is an output port the component should populate the fields of this structure. When When nPort is an input port the component should review the setup provided by the component with the output port. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup tun */ OMX_ERRORTYPE (*ComponentTunnelRequest)( OMX_IN OMX_HANDLETYPE hComp, OMX_IN OMX_U32 nPort, OMX_IN OMX_HANDLETYPE hTunneledComp, OMX_IN OMX_U32 nTunneledPort, OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup); /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL specification for details on the UseBuffer method. @ingroup buf */ OMX_ERRORTYPE (*UseBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes, OMX_IN OMX_U8* pBuffer); /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL specification for details on the AllocateBuffer method. @ingroup buf */ OMX_ERRORTYPE (*AllocateBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes); /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL specification for details on the FreeBuffer method. @ingroup buf */ OMX_ERRORTYPE (*FreeBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL specification for details on the EmptyThisBuffer method. @ingroup buf */ OMX_ERRORTYPE (*EmptyThisBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL specification for details on the FillThisBuffer method. @ingroup buf */ OMX_ERRORTYPE (*FillThisBuffer)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); /** The SetCallbacks method is used by the core to specify the callback structure from the application to the component. This is a blocking call. The component will return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the GetHandle function. @param [in] pCallbacks pointer to an OMX_CALLBACKTYPE structure used to provide the callback information to the component @param [in] pAppData pointer to an application defined value. It is anticipated that the application will pass a pointer to a data structure or a "this pointer" in this area to allow the callback (in the application) to determine the context of the call @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. */ OMX_ERRORTYPE (*SetCallbacks)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_CALLBACKTYPE* pCallbacks, OMX_IN OMX_PTR pAppData); /** ComponentDeInit method is used to deinitialize the component providing a means to free any resources allocated at component initialization. NOTE: After this call the component handle is not valid for further use. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the GetHandle function. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. */ OMX_ERRORTYPE (*ComponentDeInit)( OMX_IN OMX_HANDLETYPE hComponent); /** @ingroup buf */ OMX_ERRORTYPE (*UseEGLImage)( OMX_IN OMX_HANDLETYPE hComponent, OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr, OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_PTR pAppPrivate, OMX_IN void* eglImage); OMX_ERRORTYPE (*ComponentRoleEnum)( OMX_IN OMX_HANDLETYPE hComponent, OMX_OUT OMX_U8 *cRole, OMX_IN OMX_U32 nIndex); } OMX_COMPONENTTYPE; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/khronos/IL/OMX_Core.h ================================================ /* * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** OMX_Core.h - OpenMax IL version 1.1.2 * The OMX_Core header file contains the definitions used by both the * application and the component to access common items. */ #ifndef OMX_Core_h #define OMX_Core_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #if !defined(OMX_SKIP64BIT) && !defined(_VIDEOCORE) /* The Videocore compiler doesn't enforce 64 bit alignment on 64 bit variables, * which is almost equivalent to OMX_SKIP64BIT. * Annoyingly struct OMX_BUFFERHEADERTYPE doesn't do the sensible thing * and add padding fields or similar to make it the same for all compilers, * so all clients need to define this. * Warn if this isn't set, as the GPU will not interpret your buffers correctly, * or vice versa. */ #warning OMX_SKIP64BIT is not defined - this will be incompatible with the VC GPU code. #endif /* Each OMX header shall include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_Index.h" /** The OMX_COMMANDTYPE enumeration is used to specify the action in the * OMX_SendCommand macro. * @ingroup core */ typedef enum OMX_COMMANDTYPE { OMX_CommandStateSet, /**< Change the component state */ OMX_CommandFlush, /**< Flush the data queue(s) of a component */ OMX_CommandPortDisable, /**< Disable a port on a component. */ OMX_CommandPortEnable, /**< Enable a port on a component. */ OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */ OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_CommandMax = 0X7FFFFFFF } OMX_COMMANDTYPE; /** The OMX_STATETYPE enumeration is used to indicate or change the component * state. This enumeration reflects the current state of the component when * used with the OMX_GetState macro or becomes the parameter in a state change * command when used with the OMX_SendCommand macro. * * The component will be in the Loaded state after the component is initially * loaded into memory. In the Loaded state, the component is not allowed to * allocate or hold resources other than to build it's internal parameter * and configuration tables. The application will send one or more * SetParameters/GetParameters and SetConfig/GetConfig commands to the * component and the component will record each of these parameter and * configuration changes for use later. When the application sends the * Idle command, the component will acquire the resources needed for the * specified configuration and will transition to the idle state if the * allocation is successful. If the component cannot successfully * transition to the idle state for any reason, the state of the component * shall be fully rolled back to the Loaded state (e.g. all allocated * resources shall be released). When the component receives the command * to go to the Executing state, it shall begin processing buffers by * sending all input buffers it holds to the application. While * the component is in the Idle state, the application may also send the * Pause command. If the component receives the pause command while in the * Idle state, the component shall send all input buffers it holds to the * application, but shall not begin processing buffers. This will allow the * application to prefill buffers. * * @ingroup comp */ typedef enum OMX_STATETYPE { OMX_StateInvalid, /**< component has detected that it's internal data structures are corrupted to the point that it cannot determine it's state properly */ OMX_StateLoaded, /**< component has been loaded but has not completed initialization. The OMX_SetParameter macro and the OMX_GetParameter macro are the only valid macros allowed to be sent to the component in this state. */ OMX_StateIdle, /**< component initialization has been completed successfully and the component is ready to to start. */ OMX_StateExecuting, /**< component has accepted the start command and is processing data (if data is available) */ OMX_StatePause, /**< component has received pause command */ OMX_StateWaitForResources, /**< component is waiting for resources, either after preemption or before it gets the resources requested. See specification for complete details. */ OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_StateMax = 0X7FFFFFFF } OMX_STATETYPE; /** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These * errors should cover most of the common failure cases. However, * vendors are free to add additional error messages of their own as * long as they follow these rules: * 1. Vendor error messages shall be in the range of 0x90000000 to * 0x9000FFFF. * 2. Vendor error messages shall be defined in a header file provided * with the component. No error messages are allowed that are * not defined. */ typedef enum OMX_ERRORTYPE { OMX_ErrorNone = 0, /** There were insufficient resources to perform the requested operation */ OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000, /** There was an error, but the cause of the error could not be determined */ OMX_ErrorUndefined = (OMX_S32) 0x80001001, /** The component name string was not valid */ OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002, /** No component with the specified name string was found */ OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003, /** The component specified did not have a "OMX_ComponentInit" or "OMX_ComponentDeInit entry point */ OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004, /** One or more parameters were not valid */ OMX_ErrorBadParameter = (OMX_S32) 0x80001005, /** The requested function is not implemented */ OMX_ErrorNotImplemented = (OMX_S32) 0x80001006, /** The buffer was emptied before the next buffer was ready */ OMX_ErrorUnderflow = (OMX_S32) 0x80001007, /** The buffer was not available when it was needed */ OMX_ErrorOverflow = (OMX_S32) 0x80001008, /** The hardware failed to respond as expected */ OMX_ErrorHardware = (OMX_S32) 0x80001009, /** The component is in the state OMX_StateInvalid */ OMX_ErrorInvalidState = (OMX_S32) 0x8000100A, /** Stream is found to be corrupt */ OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B, /** Ports being connected are not compatible */ OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C, /** Resources allocated to an idle component have been lost resulting in the component returning to the loaded state */ OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D, /** No more indicies can be enumerated */ OMX_ErrorNoMore = (OMX_S32) 0x8000100E, /** The component detected a version mismatch */ OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F, /** The component is not ready to return data at this time */ OMX_ErrorNotReady = (OMX_S32) 0x80001010, /** There was a timeout that occurred */ OMX_ErrorTimeout = (OMX_S32) 0x80001011, /** This error occurs when trying to transition into the state you are already in */ OMX_ErrorSameState = (OMX_S32) 0x80001012, /** Resources allocated to an executing or paused component have been preempted, causing the component to return to the idle state */ OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013, /** A non-supplier port sends this error to the IL client (via the EventHandler callback) during the allocation of buffers (on a transition from the LOADED to the IDLE state or on a port restart) when it deems that it has waited an unusually long time for the supplier to send it an allocated buffer via a UseBuffer call. */ OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014, /** A non-supplier port sends this error to the IL client (via the EventHandler callback) during the deallocation of buffers (on a transition from the IDLE to LOADED state or on a port stop) when it deems that it has waited an unusually long time for the supplier to request the deallocation of a buffer header via a FreeBuffer call. */ OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015, /** A supplier port sends this error to the IL client (via the EventHandler callback) during the stopping of a port (either on a transition from the IDLE to LOADED state or a port stop) when it deems that it has waited an unusually long time for the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */ OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016, /** Attempting a state transtion that is not allowed */ OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017, /* Attempting a command that is not allowed during the present state. */ OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018, /** The values encapsulated in the parameter or config structure are not supported. */ OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019, /** The parameter or config indicated by the given index is not supported. */ OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A, /** The port index supplied is incorrect. */ OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B, /** The port has lost one or more of its buffers and it thus unpopulated. */ OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C, /** Component suspended due to temporary loss of resources */ OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D, /** Component suspended due to an inability to acquire dynamic resources */ OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E, /** When the macroblock error reporting is enabled the component returns new error for every frame that has errors */ OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F, /** A component reports this error when it cannot parse or determine the format of an input stream. */ OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020, /** The content open operation failed. */ OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021, /** The content creation operation failed. */ OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022, /** Separate table information is being used */ OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023, /** Tunneling is unsupported by the component*/ OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024, OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */ /** Disk Full error */ OMX_ErrorDiskFull = (OMX_S32) 0x90000001, /** Max file size is reached */ OMX_ErrorMaxFileSize = (OMX_S32) 0x90000002, /** Unauthorised to play a DRM protected file */ OMX_ErrorDrmUnauthorised = (OMX_S32) 0x90000003, /** The DRM protected file has expired */ OMX_ErrorDrmExpired = (OMX_S32) 0x90000004, /** Some other DRM library error */ OMX_ErrorDrmGeneral = (OMX_S32) 0x90000005, OMX_ErrorMax = 0x7FFFFFFF } OMX_ERRORTYPE; /** @ingroup core */ typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent); /** @ingroup core */ typedef struct OMX_COMPONENTREGISTERTYPE { const char * pName; /* Component name, 128 byte limit (including '\0') applies */ OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */ } OMX_COMPONENTREGISTERTYPE; /** @ingroup core */ extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[]; /** @ingroup rpm */ typedef struct OMX_PRIORITYMGMTTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nGroupPriority; /**< Priority of the component group */ OMX_U32 nGroupID; /**< ID of the component group */ } OMX_PRIORITYMGMTTYPE; /* Component name and Role names are limited to 128 characters including the terminating '\0'. */ #define OMX_MAX_STRINGNAME_SIZE 128 /** @ingroup comp */ typedef struct OMX_PARAM_COMPONENTROLETYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */ } OMX_PARAM_COMPONENTROLETYPE; /** End of Stream Buffer Flag: * * A component sets EOS when it has no more data to emit on a particular * output port. Thus an output port shall set EOS on the last buffer it * emits. A component's determination of when an output port should * cease sending data is implemenation specific. * @ingroup buf */ #define OMX_BUFFERFLAG_EOS 0x00000001 /** Start Time Buffer Flag: * * The source of a stream (e.g. a demux component) sets the STARTTIME * flag on the buffer that contains the starting timestamp for the * stream. The starting timestamp corresponds to the first data that * should be displayed at startup or after a seek. * The first timestamp of the stream is not necessarily the start time. * For instance, in the case of a seek to a particular video frame, * the target frame may be an interframe. Thus the first buffer of * the stream will be the intra-frame preceding the target frame and * the starttime will occur with the target frame (with any other * required frames required to reconstruct the target intervening). * * The STARTTIME flag is directly associated with the buffer's * timestamp ' thus its association to buffer data and its * propagation is identical to the timestamp's. * * When a Sync Component client receives a buffer with the * STARTTIME flag it shall perform a SetConfig on its sync port * using OMX_ConfigTimeClientStartTime and passing the buffer's * timestamp. * * @ingroup buf */ #define OMX_BUFFERFLAG_STARTTIME 0x00000002 /** Decode Only Buffer Flag: * * The source of a stream (e.g. a demux component) sets the DECODEONLY * flag on any buffer that should shall be decoded but should not be * displayed. This flag is used, for instance, when a source seeks to * a target interframe that requires the decode of frames preceding the * target to facilitate the target's reconstruction. In this case the * source would emit the frames preceding the target downstream * but mark them as decode only. * * The DECODEONLY is associated with buffer data and propagated in a * manner identical to the buffer timestamp. * * A component that renders data should ignore all buffers with * the DECODEONLY flag set. * * @ingroup buf */ #define OMX_BUFFERFLAG_DECODEONLY 0x00000004 /* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt * @ingroup buf */ #define OMX_BUFFERFLAG_DATACORRUPT 0x00000008 /* End of Frame: The buffer contains exactly one end of frame and no data * occurs after the end of frame. This flag is an optional hint. The absence * of this flag does not imply the absence of an end of frame within the buffer. * @ingroup buf */ #define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010 /* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame ' * a frame that has no dependency on any other frame information * @ingroup buf */ #define OMX_BUFFERFLAG_SYNCFRAME 0x00000020 /* Extra data present flag: there is extra data appended to the data stream * residing in the buffer * @ingroup buf */ #define OMX_BUFFERFLAG_EXTRADATA 0x00000040 /** Codec Config Buffer Flag: * OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an * output port when all bytes in the buffer form part or all of a set of * codec specific configuration data. Examples include SPS/PPS nal units * for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for * OMX_AUDIO_CodingAAC. Any component that for a given stream sets * OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes * with frame data in the same buffer, and shall send all buffers * containing codec configuration bytes before any buffers containing * frame data that those configurations bytes describe. * If the stream format for a particular codec has a frame specific * header at the start of each frame, for example OMX_AUDIO_CodingMP3 or * OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as * normal without setting OMX_BUFFERFLAG_CODECCONFIG. * @ingroup buf */ #define OMX_BUFFERFLAG_CODECCONFIG 0x00000080 /** @ingroup buf */ typedef struct OMX_BUFFERHEADERTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U8* pBuffer; /**< Pointer to actual block of memory that is acting as the buffer */ OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */ OMX_U32 nFilledLen; /**< number of bytes currently in the buffer */ OMX_U32 nOffset; /**< start offset of valid data in bytes from the start of the buffer */ OMX_PTR pAppPrivate; /**< pointer to any data the application wants to associate with this buffer */ OMX_PTR pPlatformPrivate; /**< pointer to any data the platform wants to associate with this buffer */ OMX_PTR pInputPortPrivate; /**< pointer to any data the input port wants to associate with this buffer */ OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port wants to associate with this buffer */ OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a mark event upon processing this buffer. */ OMX_PTR pMarkData; /**< Application specific data associated with the mark sent on a mark event to disambiguate this mark from others. */ OMX_U32 nTickCount; /**< Optional entry that the component and application can update with a tick count when they access the component. This value should be in microseconds. Since this is a value relative to an arbitrary starting point, this value cannot be used to determine absolute time. This is an optional entry and not all components will update it.*/ OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample starting at the first logical sample boundary in the buffer. Timestamps of successive samples within the buffer may be inferred by adding the duration of the of the preceding buffer to the timestamp of the preceding buffer.*/ OMX_U32 nFlags; /**< buffer specific flags */ OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using this buffer */ OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using this buffer */ } OMX_BUFFERHEADERTYPE; /** The OMX_EXTRADATATYPE enumeration is used to define the * possible extra data payload types. * NB: this enum is binary backwards compatible with the previous * OMX_EXTRADATA_QUANT define. This should be replaced with * OMX_ExtraDataQuantization. */ typedef enum OMX_EXTRADATATYPE { OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */ OMX_ExtraDataQuantization, /**< The data payload contains quantization data */ OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_ExtraDataSequenceGap, /**< Indicates a gap in sequence numbers, data is uint32_t saying how many frames were lost */ OMX_ExtraDataDecodeOnlyUntil, /**< Indicates a timestamp until which all data should be decoded only, and the first packets after should generate a client start time flag. data is int32_t of seek time in milliseconds */ OMX_ExtraDataMax = 0x7FFFFFFF } OMX_EXTRADATATYPE; typedef struct OMX_OTHER_EXTRADATATYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_EXTRADATATYPE eType; /* Extra Data type */ OMX_U32 nDataSize; /* Size of the supporting data to follow */ OMX_U8 data[1]; /* Supporting data hint */ } OMX_OTHER_EXTRADATATYPE; /** @ingroup comp */ typedef struct OMX_PORT_PARAM_TYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPorts; /**< The number of ports for this component */ OMX_U32 nStartPortNumber; /** first port number for this type of port */ } OMX_PORT_PARAM_TYPE; /** @ingroup comp */ typedef enum OMX_EVENTTYPE { OMX_EventCmdComplete, /**< component has sucessfully completed a command */ OMX_EventError, /**< component has detected an error condition */ OMX_EventMark, /**< component has detected a buffer mark */ OMX_EventPortSettingsChanged, /**< component is reported a port settings change */ OMX_EventBufferFlag, /**< component has detected an EOS */ OMX_EventResourcesAcquired, /**< component has been granted resources and is automatically starting the state change from OMX_StateWaitForResources to OMX_StateIdle. */ OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */ OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */ OMX_EventPortFormatDetected, /**< Component has detected a supported format. */ OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_EventParamOrConfigChanged, /* Should be added to the main spec as part of IL416c */ OMX_EventMax = 0x7FFFFFFF } OMX_EVENTTYPE; typedef struct OMX_CALLBACKTYPE { /** The EventHandler method is used to notify the application when an event of interest occurs. Events are defined in the OMX_EVENTTYPE enumeration. Please see that enumeration for details of what will be returned for each type of event. Callbacks should not return an error to the component, so if an error occurs, the application shall handle it internally. This is a blocking call. The application should return from this call within 5 msec to avoid blocking the component for an excessively long period of time. @param hComponent handle of the component to access. This is the component handle returned by the call to the GetHandle function. @param pAppData pointer to an application defined value that was provided in the pAppData parameter to the OMX_GetHandle method for the component. This application defined value is provided so that the application can have a component specific context when receiving the callback. @param eEvent Event that the component wants to notify the application about. @param nData1 nData will be the OMX_ERRORTYPE for an error event and will be an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event. @param nData2 nData2 will hold further information related to the event. Can be OMX_STATETYPE for a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event. Default value is 0 if not used. ) @param pEventData Pointer to additional event-specific data (see spec for meaning). */ OMX_ERRORTYPE (*EventHandler)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_EVENTTYPE eEvent, OMX_IN OMX_U32 nData1, OMX_IN OMX_U32 nData2, OMX_IN OMX_PTR pEventData); /** The EmptyBufferDone method is used to return emptied buffers from an input port back to the application for reuse. This is a blocking call so the application should not attempt to refill the buffers during this call, but should queue them and refill them in another thread. There is no error return, so the application shall handle any errors generated internally. The application should return from this call within 5 msec. @param hComponent handle of the component to access. This is the component handle returned by the call to the GetHandle function. @param pAppData pointer to an application defined value that was provided in the pAppData parameter to the OMX_GetHandle method for the component. This application defined value is provided so that the application can have a component specific context when receiving the callback. @param pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer indicating the buffer that was emptied. @ingroup buf */ OMX_ERRORTYPE (*EmptyBufferDone)( OMX_IN OMX_HANDLETYPE hComponent, OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE* pBuffer); /** The FillBufferDone method is used to return filled buffers from an output port back to the application for emptying and then reuse. This is a blocking call so the application should not attempt to empty the buffers during this call, but should queue the buffers and empty them in another thread. There is no error return, so the application shall handle any errors generated internally. The application shall also update the buffer header to indicate the number of bytes placed into the buffer. The application should return from this call within 5 msec. @param hComponent handle of the component to access. This is the component handle returned by the call to the GetHandle function. @param pAppData pointer to an application defined value that was provided in the pAppData parameter to the OMX_GetHandle method for the component. This application defined value is provided so that the application can have a component specific context when receiving the callback. @param pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer indicating the buffer that was filled. @ingroup buf */ OMX_ERRORTYPE (*FillBufferDone)( OMX_OUT OMX_HANDLETYPE hComponent, OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer); } OMX_CALLBACKTYPE; /** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier preference when tunneling between two ports. @ingroup tun buf */ typedef enum OMX_BUFFERSUPPLIERTYPE { OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified, or don't care */ OMX_BufferSupplyInput, /**< input port supplies the buffers */ OMX_BufferSupplyOutput, /**< output port supplies the buffers */ OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_BufferSupplyMax = 0x7FFFFFFF } OMX_BUFFERSUPPLIERTYPE; /** buffer supplier parameter * @ingroup tun */ typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE { OMX_U32 nSize; /**< size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< port that this structure applies to */ OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */ } OMX_PARAM_BUFFERSUPPLIERTYPE; /**< indicates that buffers received by an input port of a tunnel may not modify the data in the buffers @ingroup tun */ #define OMX_PORTTUNNELFLAG_READONLY 0x00000001 /** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output port to an input port as part the two ComponentTunnelRequest calls resulting from a OMX_SetupTunnel call from the IL Client. @ingroup tun */ typedef struct OMX_TUNNELSETUPTYPE { OMX_U32 nTunnelFlags; /**< bit flags for tunneling */ OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */ } OMX_TUNNELSETUPTYPE; /* OMX Component headers is included to enable the core to use macros for functions into the component for OMX release 1.0. Developers should not access any structures or data from within the component header directly */ /* TO BE REMOVED - #include */ /** GetComponentVersion will return information about the component. This is a blocking call. This macro will go directly from the application to the component (via a core macro). The component will return from this call within 5 msec. @param [in] hComponent handle of component to execute the command @param [out] pComponentName pointer to an empty string of length 128 bytes. The component will write its name into this string. The name will be terminated by a single zero byte. The name of a component will be 127 bytes or less to leave room for the trailing zero byte. An example of a valid component name is "OMX.ABC.ChannelMixer\0". @param [out] pComponentVersion pointer to an OMX Version structure that the component will fill in. The component will fill in a value that indicates the component version. NOTE: the component version is NOT the same as the OMX Specification version (found in all structures). The component version is defined by the vendor of the component and its value is entirely up to the component vendor. @param [out] pSpecVersion pointer to an OMX Version structure that the component will fill in. The SpecVersion is the version of the specification that the component was built against. Please note that this value may or may not match the structure's version. For example, if the component was built against the 2.0 specification, but the application (which creates the structure is built against the 1.0 specification the versions would be different. @param [out] pComponentUUID pointer to the UUID of the component which will be filled in by the component. The UUID is a unique identifier that is set at RUN time for the component and is unique to each instantion of the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetComponentVersion( \ hComponent, \ pComponentName, \ pComponentVersion, \ pSpecVersion, \ pComponentUUID) \ ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \ hComponent, \ pComponentName, \ pComponentVersion, \ pSpecVersion, \ pComponentUUID) /* Macro End */ /** Send a command to the component. This call is a non-blocking call. The component should check the parameters and then queue the command to the component thread to be executed. The component thread shall send the EventHandler() callback at the conclusion of the command. This macro will go directly from the application to the component (via a core macro). The component will return from this call within 5 msec. When the command is "OMX_CommandStateSet" the component will queue a state transition to the new state idenfied in nParam. When the command is "OMX_CommandFlush", to flush a port's buffer queues, the command will force the component to return all buffers NOT CURRENTLY BEING PROCESSED to the application, in the order in which the buffers were received. When the command is "OMX_CommandPortDisable" or "OMX_CommandPortEnable", the component's port (given by the value of nParam) will be stopped or restarted. When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the pCmdData will point to a OMX_MARKTYPE structure containing the component handle of the component to examine the buffer chain for the mark. nParam1 contains the index of the port on which the buffer mark is applied. Specification text for more details. @param [in] hComponent handle of component to execute the command @param [in] Cmd Command for the component to execute @param [in] nParam Parameter for the command to be executed. When Cmd has the value OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has the value OMX_CommandFlush, value of nParam indicates which port(s) to flush. -1 is used to flush all ports a single port index will only flush that port. When Cmd has the value "OMX_CommandPortDisable" or "OMX_CommandPortEnable", the component's port is given by the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer" the components pot is given by the value of nParam. @param [in] pCmdData Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value "OMX_CommandMarkBuffer". @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_SendCommand( \ hComponent, \ Cmd, \ nParam, \ pCmdData) \ ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \ hComponent, \ Cmd, \ nParam, \ pCmdData) /* Macro End */ /** The OMX_GetParameter macro will get one of the current parameter settings from the component. This macro cannot only be invoked when the component is in the OMX_StateInvalid state. The nParamIndex parameter is used to indicate which structure is being requested from the component. The application shall allocate the correct structure and shall fill in the structure size and version information before invoking this macro. When the parameter applies to a port, the caller shall fill in the appropriate nPortIndex value indicating the port on which the parameter applies. If the component has not had any settings changed, then the component should return a set of valid DEFAULT parameters for the component. This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nParamIndex Index of the structure to be filled. This value is from the OMX_INDEXTYPE enumeration. @param [in,out] pComponentParameterStructure Pointer to application allocated structure to be filled by the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetParameter( \ hComponent, \ nParamIndex, \ pComponentParameterStructure) \ ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \ hComponent, \ nParamIndex, \ pComponentParameterStructure) /* Macro End */ /** The OMX_SetParameter macro will send an initialization parameter structure to a component. Each structure shall be sent one at a time, in a separate invocation of the macro. This macro can only be invoked when the component is in the OMX_StateLoaded state, or the port is disabled (when the parameter applies to a port). The nParamIndex parameter is used to indicate which structure is being passed to the component. The application shall allocate the correct structure and shall fill in the structure size and version information (as well as the actual data) before invoking this macro. The application is free to dispose of this structure after the call as the component is required to copy any data it shall retain. This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nIndex Index of the structure to be sent. This value is from the OMX_INDEXTYPE enumeration. @param [in] pComponentParameterStructure pointer to application allocated structure to be used for initialization by the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_SetParameter( \ hComponent, \ nParamIndex, \ pComponentParameterStructure) \ ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \ hComponent, \ nParamIndex, \ pComponentParameterStructure) /* Macro End */ /** The OMX_GetConfig macro will get one of the configuration structures from a component. This macro can be invoked anytime after the component has been loaded. The nParamIndex call parameter is used to indicate which structure is being requested from the component. The application shall allocate the correct structure and shall fill in the structure size and version information before invoking this macro. If the component has not had this configuration parameter sent before, then the component should return a set of valid DEFAULT values for the component. This is a blocking call. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nIndex Index of the structure to be filled. This value is from the OMX_INDEXTYPE enumeration. @param [in,out] pComponentConfigStructure pointer to application allocated structure to be filled by the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetConfig( \ hComponent, \ nConfigIndex, \ pComponentConfigStructure) \ ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \ hComponent, \ nConfigIndex, \ pComponentConfigStructure) /* Macro End */ /** The OMX_SetConfig macro will send one of the configuration structures to a component. Each structure shall be sent one at a time, each in a separate invocation of the macro. This macro can be invoked anytime after the component has been loaded. The application shall allocate the correct structure and shall fill in the structure size and version information (as well as the actual data) before invoking this macro. The application is free to dispose of this structure after the call as the component is required to copy any data it shall retain. This is a blocking call. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nConfigIndex Index of the structure to be sent. This value is from the OMX_INDEXTYPE enumeration above. @param [in] pComponentConfigStructure pointer to application allocated structure to be used for initialization by the component. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_SetConfig( \ hComponent, \ nConfigIndex, \ pComponentConfigStructure) \ ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \ hComponent, \ nConfigIndex, \ pComponentConfigStructure) /* Macro End */ /** The OMX_GetExtensionIndex macro will invoke a component to translate a vendor specific configuration or parameter string into an OMX structure index. There is no requirement for the vendor to support this command for the indexes already found in the OMX_INDEXTYPE enumeration (this is done to save space in small components). The component shall support all vendor supplied extension indexes not found in the master OMX_INDEXTYPE enumeration. This is a blocking call. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the GetHandle function. @param [in] cParameterName OMX_STRING that shall be less than 128 characters long including the trailing null byte. This is the string that will get translated by the component into a configuration index. @param [out] pIndexType a pointer to a OMX_INDEXTYPE to receive the index value. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetExtensionIndex( \ hComponent, \ cParameterName, \ pIndexType) \ ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \ hComponent, \ cParameterName, \ pIndexType) /* Macro End */ /** The OMX_GetState macro will invoke the component to get the current state of the component and place the state value into the location pointed to by pState. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [out] pState pointer to the location to receive the state. The value returned is one of the OMX_STATETYPE members @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp */ #define OMX_GetState( \ hComponent, \ pState) \ ((OMX_COMPONENTTYPE*)hComponent)->GetState( \ hComponent, \ pState) /* Macro End */ /** The OMX_UseBuffer macro will request that the component use a buffer (and allocate its own buffer header) already allocated by another component, or by the IL Client. This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [out] ppBuffer pointer to an OMX_BUFFERHEADERTYPE structure used to receive the pointer to the buffer header @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_UseBuffer( \ hComponent, \ ppBufferHdr, \ nPortIndex, \ pAppPrivate, \ nSizeBytes, \ pBuffer) \ ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \ hComponent, \ ppBufferHdr, \ nPortIndex, \ pAppPrivate, \ nSizeBytes, \ pBuffer) /** The OMX_AllocateBuffer macro will request that the component allocate a new buffer and buffer header. The component will allocate the buffer and the buffer header and return a pointer to the buffer header. This is a blocking call. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [out] ppBuffer pointer to an OMX_BUFFERHEADERTYPE structure used to receive the pointer to the buffer header @param [in] nPortIndex nPortIndex is used to select the port on the component the buffer will be used with. The port can be found by using the nPortIndex value as an index into the Port Definition array of the component. @param [in] pAppPrivate pAppPrivate is used to initialize the pAppPrivate member of the buffer header structure. @param [in] nSizeBytes size of the buffer to allocate. Used when bAllocateNew is true. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_AllocateBuffer( \ hComponent, \ ppBuffer, \ nPortIndex, \ pAppPrivate, \ nSizeBytes) \ ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \ hComponent, \ ppBuffer, \ nPortIndex, \ pAppPrivate, \ nSizeBytes) /* Macro End */ /** The OMX_FreeBuffer macro will release a buffer header from the component which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If the component allocated the buffer (see the OMX_UseBuffer macro) then the component shall free the buffer and buffer header. This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] nPortIndex nPortIndex is used to select the port on the component the buffer will be used with. @param [in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_FreeBuffer( \ hComponent, \ nPortIndex, \ pBuffer) \ ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \ hComponent, \ nPortIndex, \ pBuffer) /* Macro End */ /** The OMX_EmptyThisBuffer macro will send a buffer full of data to an input port of a component. The buffer will be emptied by the component and returned to the application via the EmptyBufferDone call back. This is a non-blocking call in that the component will record the buffer and return immediately and then empty the buffer, later, at the proper time. As expected, this macro may be invoked only while the component is in the OMX_StateExecuting. If nPortIndex does not specify an input port, the component shall return an error. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_EmptyThisBuffer( \ hComponent, \ pBuffer) \ ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \ hComponent, \ pBuffer) /* Macro End */ /** The OMX_FillThisBuffer macro will send an empty buffer to an output port of a component. The buffer will be filled by the component and returned to the application via the FillBufferDone call back. This is a non-blocking call in that the component will record the buffer and return immediately and then fill the buffer, later, at the proper time. As expected, this macro may be invoked only while the component is in the OMX_ExecutingState. If nPortIndex does not specify an output port, the component shall return an error. The component should return from this call within 5 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_FillThisBuffer( \ hComponent, \ pBuffer) \ ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \ hComponent, \ pBuffer) /* Macro End */ /** The OMX_UseEGLImage macro will request that the component use a EGLImage provided by EGL (and allocate its own buffer header) This is a blocking call. The component should return from this call within 20 msec. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function. @param [out] ppBuffer pointer to an OMX_BUFFERHEADERTYPE structure used to receive the pointer to the buffer header. Note that the memory location used for this buffer is NOT visible to the IL Client. @param [in] nPortIndex nPortIndex is used to select the port on the component the buffer will be used with. The port can be found by using the nPortIndex value as an index into the Port Definition array of the component. @param [in] pAppPrivate pAppPrivate is used to initialize the pAppPrivate member of the buffer header structure. @param [in] eglImage eglImage contains the handle of the EGLImage to use as a buffer on the specified port. The component is expected to validate properties of the EGLImage against the configuration of the port to ensure the component can use the EGLImage as a buffer. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup comp buf */ #define OMX_UseEGLImage( \ hComponent, \ ppBufferHdr, \ nPortIndex, \ pAppPrivate, \ eglImage) \ ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \ hComponent, \ ppBufferHdr, \ nPortIndex, \ pAppPrivate, \ eglImage) /** The OMX_Init method is used to initialize the OMX core. It shall be the first call made into OMX and it should only be executed one time without an interviening OMX_Deinit call. The core should return from this call within 20 msec. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void); /** The OMX_Deinit method is used to deinitialize the OMX core. It shall be the last call made into OMX. In the event that the core determines that thare are components loaded when this call is made, the core may return with an error rather than try to unload the components. The core should return from this call within 20 msec. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void); /** The OMX_ComponentNameEnum method will enumerate through all the names of recognised valid components in the system. This function is provided as a means to detect all the components in the system run-time. There is no strict ordering to the enumeration order of component names, although each name will only be enumerated once. If the OMX core supports run-time installation of new components, it is only requried to detect newly installed components when the first call to enumerate component names is made (i.e. when nIndex is 0x0). The core should return from this call in 20 msec. @param [out] cComponentName pointer to a null terminated string with the component name. The names of the components are strings less than 127 bytes in length plus the trailing null for a maximum size of 128 bytes. An example of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are assigned by the vendor, but shall start with "OMX." and then have the Vendor designation next. @param [in] nNameLength number of characters in the cComponentName string. With all component name strings restricted to less than 128 characters (including the trailing null) it is recomended that the caller provide a input string for the cComponentName of 128 characters. @param [in] nIndex number containing the enumeration index for the component. Multiple calls to OMX_ComponentNameEnum with increasing values of nIndex will enumerate through the component names in the system until OMX_ErrorNoMore is returned. The value of nIndex is 0 to (N-1), where N is the number of valid installed components in the system. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. When the value of nIndex exceeds the number of components in the system minus 1, OMX_ErrorNoMore will be returned. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum( OMX_OUT OMX_STRING cComponentName, OMX_IN OMX_U32 nNameLength, OMX_IN OMX_U32 nIndex); /** The OMX_GetHandle method will locate the component specified by the component name given, load that component into memory and then invoke the component's methods to create an instance of the component. The core should return from this call within 20 msec. @param [out] pHandle pointer to an OMX_HANDLETYPE pointer to be filled in by this method. @param [in] cComponentName pointer to a null terminated string with the component name. The names of the components are strings less than 127 bytes in length plus the trailing null for a maximum size of 128 bytes. An example of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are assigned by the vendor, but shall start with "OMX." and then have the Vendor designation next. @param [in] pAppData pointer to an application defined value that will be returned during callbacks so that the application can identify the source of the callback. @param [in] pCallBacks pointer to a OMX_CALLBACKTYPE structure that will be passed to the component to initialize it with. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle( OMX_OUT OMX_HANDLETYPE* pHandle, OMX_IN OMX_STRING cComponentName, OMX_IN OMX_PTR pAppData, OMX_IN OMX_CALLBACKTYPE* pCallBacks); /** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle method. If the component reference count goes to zero, the component will be unloaded from memory. The core should return from this call within 20 msec when the component is in the OMX_StateLoaded state. @param [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the GetHandle function. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle( OMX_IN OMX_HANDLETYPE hComponent); /** The OMX_SetupTunnel method will handle the necessary calls to the components to setup the specified tunnel the two components. NOTE: This is an actual method (not a #define macro). This method will make calls into the component ComponentTunnelRequest method to do the actual tunnel connection. The ComponentTunnelRequest method on both components will be called. This method shall not be called unless the component is in the OMX_StateLoaded state except when the ports used for the tunnel are disabled. In this case, the component may be in the OMX_StateExecuting, OMX_StatePause, or OMX_StateIdle states. The core should return from this call within 20 msec. @param [in] hOutput Handle of the component to be accessed. Also this is the handle of the component whose port, specified in the nPortOutput parameter will be used the source for the tunnel. This is the component handle returned by the call to the OMX_GetHandle function. There is a requirement that hOutput be the source for the data when tunelling (i.e. nPortOutput is an output port). If 0x0, the component specified in hInput will have it's port specified in nPortInput setup for communication with the application / IL client. @param [in] nPortOutput nPortOutput is used to select the source port on component to be used in the tunnel. @param [in] hInput This is the component to setup the tunnel with. This is the handle of the component whose port, specified in the nPortInput parameter will be used the destination for the tunnel. This is the component handle returned by the call to the OMX_GetHandle function. There is a requirement that hInput be the destination for the data when tunelling (i.e. nPortInut is an input port). If 0x0, the component specified in hOutput will have it's port specified in nPortPOutput setup for communication with the application / IL client. @param [in] nPortInput nPortInput is used to select the destination port on component to be used in the tunnel. @return OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned. When OMX_ErrorNotImplemented is returned, one or both components is a non-interop component and does not support tunneling. On failure, the ports of both components are setup for communication with the application / IL Client. @ingroup core tun */ OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel( OMX_IN OMX_HANDLETYPE hOutput, OMX_IN OMX_U32 nPortOutput, OMX_IN OMX_HANDLETYPE hInput, OMX_IN OMX_U32 nPortInput); /** @ingroup cp */ OMX_API OMX_ERRORTYPE OMX_GetContentPipe( OMX_OUT OMX_HANDLETYPE *hPipe, OMX_IN OMX_STRING szURI); /** The OMX_GetComponentsOfRole method will return the number of components that support the given role and (if the compNames field is non-NULL) the names of those components. The call will fail if an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the client should: * first call this function with the compNames field NULL to determine the number of component names * second call this function with the compNames field pointing to an array of names allocated according to the number returned by the first call. The core should return from this call within 5 msec. @param [in] role This is generic standard component name consisting only of component class name and the type within that class (e.g. 'audio_decoder.aac'). @param [inout] pNumComps This is used both as input and output. If compNames is NULL, the input is ignored and the output specifies how many components support the given role. If compNames is not NULL, on input it bounds the size of the input structure and on output, it specifies the number of components string names listed within the compNames parameter. @param [inout] compNames If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts a list of the names of all physical components that implement the specified standard component name. Each name is NULL terminated. numComps indicates the number of names. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole ( OMX_IN OMX_STRING role, OMX_INOUT OMX_U32 *pNumComps, OMX_INOUT OMX_U8 **compNames); /** The OMX_GetRolesOfComponent method will return the number of roles supported by the given component and (if the roles field is non-NULL) the names of those roles. The call will fail if an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the client should: * first call this function with the roles field NULL to determine the number of role names * second call this function with the roles field pointing to an array of names allocated according to the number returned by the first call. The core should return from this call within 5 msec. @param [in] compName This is the name of the component being queried about. @param [inout] pNumRoles This is used both as input and output. If roles is NULL, the input is ignored and the output specifies how many roles the component supports. If compNames is not NULL, on input it bounds the size of the input structure and on output, it specifies the number of roles string names listed within the roles parameter. @param [out] roles If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts a list of the names of all standard components roles implemented on the specified component name. numComps indicates the number of names. @ingroup core */ OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent ( OMX_IN OMX_STRING compName, OMX_INOUT OMX_U32 *pNumRoles, OMX_OUT OMX_U8 **roles); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/khronos/IL/OMX_ILCS.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // OpenMAX IL - ILCS specific types #ifndef OMX_ILCS_h #define OMX_ILCS_h typedef struct OMX_PARAM_PORTSUMMARYTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nNumPorts; /**< Total number of ports */ OMX_U32 reqSet; /**< Which set of ports is details below, portIndex[0] is port reqSet*32 */ OMX_U32 portDir; /**< Bitfield, 1 if output port, 0 if input port, max 256 ports */ OMX_U32 portIndex[32]; /**< Port Indexes */ } OMX_PARAM_PORTSUMMARYTYPE; typedef struct OMX_PARAM_MARKCOMPARISONTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_PTR mark; /**< Pointer to be used for mark comparisons */ } OMX_PARAM_MARKCOMPARISONTYPE; typedef struct OMX_PARAM_BRCMRECURSIONUNSAFETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_S32 (*pRecursionUnsafe)(OMX_PTR param); OMX_PTR param; } OMX_PARAM_BRCMRECURSIONUNSAFETYPE; typedef struct OMX_PARAM_TUNNELSTATUSTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port being queried */ OMX_U32 nIndex; /**< Query the nIndex'th port and fill in nPortIndex */ OMX_BOOL bUseIndex; /**< If OMX_TRUE read nIndex, otherwise read nPortIndex */ OMX_PTR hTunneledComponent; /**< Component currently tunnelling with */ OMX_U32 nTunneledPort; /**< Port on tunnelled component */ } OMX_PARAM_TUNNELSTATUSTYPE; #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/khronos/IL/OMX_IVCommon.h ================================================ /** * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** * @file OMX_IVCommon.h - OpenMax IL version 1.1.2 * The structures needed by Video and Image components to exchange * parameters and configuration data with the components. */ #ifndef OMX_IVCommon_h #define OMX_IVCommon_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Each OMX header must include all required header files to allow the header * to compile without errors. The includes below are required for this header * file to compile successfully */ #include "OMX_Core.h" /** @defgroup iv OpenMAX IL Imaging and Video Domain * Common structures for OpenMAX IL Imaging and Video domains * @{ */ /** * Enumeration defining possible uncompressed image/video formats. * * ENUMS: * Unused : Placeholder value when format is N/A * Monochrome : black and white * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0 * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0 * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0 * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0 * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0 * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0 * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0 * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0 * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0 * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0 * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0 * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0 * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0 * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0 * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0 * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally * YUV411PackedPlanar : packed per payload in planar slices * YUV420Planar : Three arrays Y,U,V. * YUV420PackedPlanar : packed per payload in planar slices * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V * YUV422Planar : Three arrays Y,U,V. * YUV422PackedPlanar : packed per payload in planar slices * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr) * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb) * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY) * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY) * YUV444Interleaved : Each pixel contains equal parts YUV * RawBayer8bit : SMIA camera output format * RawBayer10bit : SMIA camera output format * RawBayer8bitcompressed : SMIA camera output format Vendor extensions * 32bitABGR888 : Alpha 31:24, Blue 23:16, Green 15:8, Red 7:0 */ typedef enum OMX_COLOR_FORMATTYPE { OMX_COLOR_FormatUnused, OMX_COLOR_FormatMonochrome, OMX_COLOR_Format8bitRGB332, OMX_COLOR_Format12bitRGB444, OMX_COLOR_Format16bitARGB4444, OMX_COLOR_Format16bitARGB1555, OMX_COLOR_Format16bitRGB565, OMX_COLOR_Format16bitBGR565, OMX_COLOR_Format18bitRGB666, OMX_COLOR_Format18bitARGB1665, OMX_COLOR_Format19bitARGB1666, OMX_COLOR_Format24bitRGB888, OMX_COLOR_Format24bitBGR888, OMX_COLOR_Format24bitARGB1887, OMX_COLOR_Format25bitARGB1888, OMX_COLOR_Format32bitBGRA8888, OMX_COLOR_Format32bitARGB8888, OMX_COLOR_FormatYUV411Planar, OMX_COLOR_FormatYUV411PackedPlanar, OMX_COLOR_FormatYUV420Planar, OMX_COLOR_FormatYUV420PackedPlanar, OMX_COLOR_FormatYUV420SemiPlanar, OMX_COLOR_FormatYUV422Planar, OMX_COLOR_FormatYUV422PackedPlanar, OMX_COLOR_FormatYUV422SemiPlanar, OMX_COLOR_FormatYCbYCr, OMX_COLOR_FormatYCrYCb, OMX_COLOR_FormatCbYCrY, OMX_COLOR_FormatCrYCbY, OMX_COLOR_FormatYUV444Interleaved, OMX_COLOR_FormatRawBayer8bit, OMX_COLOR_FormatRawBayer10bit, OMX_COLOR_FormatRawBayer8bitcompressed, OMX_COLOR_FormatL2, OMX_COLOR_FormatL4, OMX_COLOR_FormatL8, OMX_COLOR_FormatL16, OMX_COLOR_FormatL24, OMX_COLOR_FormatL32, OMX_COLOR_FormatYUV420PackedSemiPlanar, OMX_COLOR_FormatYUV422PackedSemiPlanar, OMX_COLOR_Format18BitBGR666, OMX_COLOR_Format24BitARGB6666, OMX_COLOR_Format24BitABGR6666, OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_COLOR_Format32bitABGR8888, OMX_COLOR_Format8bitPalette, OMX_COLOR_FormatYUVUV128, OMX_COLOR_FormatRawBayer12bit, OMX_COLOR_FormatBRCMEGL, OMX_COLOR_FormatBRCMOpaque, OMX_COLOR_FormatYVU420PackedPlanar, OMX_COLOR_FormatYVU420PackedSemiPlanar, OMX_COLOR_FormatRawBayer16bit, OMX_COLOR_FormatMax = 0x7FFFFFFF } OMX_COLOR_FORMATTYPE; /** * Defines the matrix for conversion from RGB to YUV or vice versa. * iColorMatrix should be initialized with the fixed point values * used in converting between formats. */ typedef struct OMX_CONFIG_COLORCONVERSIONTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */ OMX_U32 nPortIndex; /**< Port that this struct applies to */ OMX_S32 xColorMatrix[3][3]; /**< Stored in signed Q16 format */ OMX_S32 xColorOffset[4]; /**< Stored in signed Q16 format */ }OMX_CONFIG_COLORCONVERSIONTYPE; /** * Structure defining percent to scale each frame dimension. For example: * To make the width 50% larger, use fWidth = 1.5 and to make the width * 1/2 the original size, use fWidth = 0.5 */ typedef struct OMX_CONFIG_SCALEFACTORTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */ OMX_U32 nPortIndex; /**< Port that this struct applies to */ OMX_S32 xWidth; /**< Fixed point value stored as Q16 */ OMX_S32 xHeight; /**< Fixed point value stored as Q16 */ }OMX_CONFIG_SCALEFACTORTYPE; /** * Enumeration of possible image filter types */ typedef enum OMX_IMAGEFILTERTYPE { OMX_ImageFilterNone, OMX_ImageFilterNoise, OMX_ImageFilterEmboss, OMX_ImageFilterNegative, OMX_ImageFilterSketch, OMX_ImageFilterOilPaint, OMX_ImageFilterHatch, OMX_ImageFilterGpen, OMX_ImageFilterAntialias, OMX_ImageFilterDeRing, OMX_ImageFilterSolarize, OMX_ImageFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ImageFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ /* Broadcom specific image filters */ OMX_ImageFilterWatercolor, OMX_ImageFilterPastel, OMX_ImageFilterSharpen, OMX_ImageFilterFilm, OMX_ImageFilterBlur, OMX_ImageFilterSaturation, OMX_ImageFilterDeInterlaceLineDouble, OMX_ImageFilterDeInterlaceAdvanced, OMX_ImageFilterColourSwap, OMX_ImageFilterWashedOut, OMX_ImageFilterColourPoint, OMX_ImageFilterPosterise, OMX_ImageFilterColourBalance, OMX_ImageFilterCartoon, OMX_ImageFilterAnaglyph, OMX_ImageFilterDeInterlaceFast, OMX_ImageFilterMax = 0x7FFFFFFF } OMX_IMAGEFILTERTYPE; typedef enum OMX_IMAGEFILTERANAGLYPHTYPE { OMX_ImageFilterAnaglyphNone, OMX_ImageFilterAnaglyphSBStoRedCyan, OMX_ImageFilterAnaglyphSBStoCyanRed, OMX_ImageFilterAnaglyphSBStoGreenMagenta, OMX_ImageFilterAnaglyphSBStoMagentaGreen, OMX_ImageFilterAnaglyphTABtoRedCyan, OMX_ImageFilterAnaglyphTABtoCyanRed, OMX_ImageFilterAnaglyphTABtoGreenMagenta, OMX_ImageFilterAnaglyphTABtoMagentaGreen, } OMX_IMAGEFILTERANAGLYPHTYPE; /** * Image filter configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eImageFilter : Image filter type enumeration */ typedef struct OMX_CONFIG_IMAGEFILTERTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGEFILTERTYPE eImageFilter; } OMX_CONFIG_IMAGEFILTERTYPE; /** * Customized U and V for color enhancement * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bColorEnhancement : Enable/disable color enhancement * nCustomizedU : Practical values: 16-240, range: 0-255, value set for * U component * nCustomizedV : Practical values: 16-240, range: 0-255, value set for * V component */ typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bColorEnhancement; OMX_U8 nCustomizedU; OMX_U8 nCustomizedV; } OMX_CONFIG_COLORENHANCEMENTTYPE; /** * Define color key and color key mask * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nARGBColor : 32bit Alpha, Red, Green, Blue Color * nARGBMask : 32bit Mask for Alpha, Red, Green, Blue channels */ typedef struct OMX_CONFIG_COLORKEYTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nARGBColor; OMX_U32 nARGBMask; } OMX_CONFIG_COLORKEYTYPE; /** * List of color blend types for pre/post processing * * ENUMS: * None : No color blending present * AlphaConstant : Function is (alpha_constant * src) + * (1 - alpha_constant) * dst) * AlphaPerPixel : Function is (alpha * src) + (1 - alpha) * dst) * Alternate : Function is alternating pixels from src and dst * And : Function is (src & dst) * Or : Function is (src | dst) * Invert : Function is ~src */ typedef enum OMX_COLORBLENDTYPE { OMX_ColorBlendNone, OMX_ColorBlendAlphaConstant, OMX_ColorBlendAlphaPerPixel, OMX_ColorBlendAlternate, OMX_ColorBlendAnd, OMX_ColorBlendOr, OMX_ColorBlendInvert, OMX_ColorBlendKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ColorBlendVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_ColorBlendMax = 0x7FFFFFFF } OMX_COLORBLENDTYPE; /** * Color blend configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nRGBAlphaConstant : Constant global alpha values when global alpha is used * eColorBlend : Color blend type enumeration */ typedef struct OMX_CONFIG_COLORBLENDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nRGBAlphaConstant; OMX_COLORBLENDTYPE eColorBlend; } OMX_CONFIG_COLORBLENDTYPE; /** * Hold frame dimension * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nWidth : Frame width in pixels * nHeight : Frame height in pixels */ typedef struct OMX_FRAMESIZETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nWidth; OMX_U32 nHeight; } OMX_FRAMESIZETYPE; /** * Rotation configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nRotation : +/- integer rotation value */ typedef struct OMX_CONFIG_ROTATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nRotation; } OMX_CONFIG_ROTATIONTYPE; /** * Possible mirroring directions for pre/post processing * * ENUMS: * None : No mirroring * Vertical : Vertical mirroring, flip on X axis * Horizontal : Horizontal mirroring, flip on Y axis * Both : Both vertical and horizontal mirroring */ typedef enum OMX_MIRRORTYPE { OMX_MirrorNone = 0, OMX_MirrorVertical, OMX_MirrorHorizontal, OMX_MirrorBoth, OMX_MirrorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MirrorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MirrorMax = 0x7FFFFFFF } OMX_MIRRORTYPE; /** * Mirroring configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eMirror : Mirror type enumeration */ typedef struct OMX_CONFIG_MIRRORTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_MIRRORTYPE eMirror; } OMX_CONFIG_MIRRORTYPE; /** * Position information only * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nX : X coordinate for the point * nY : Y coordinate for the point */ typedef struct OMX_CONFIG_POINTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nX; OMX_S32 nY; } OMX_CONFIG_POINTTYPE; /** * Frame size plus position * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nLeft : X Coordinate of the top left corner of the rectangle * nTop : Y Coordinate of the top left corner of the rectangle * nWidth : Width of the rectangle * nHeight : Height of the rectangle */ typedef struct OMX_CONFIG_RECTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nLeft; OMX_S32 nTop; OMX_U32 nWidth; OMX_U32 nHeight; } OMX_CONFIG_RECTTYPE; /** * Deblocking state; it is required to be set up before starting the codec * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bDeblocking : Enable/disable deblocking mode */ typedef struct OMX_PARAM_DEBLOCKINGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bDeblocking; } OMX_PARAM_DEBLOCKINGTYPE; /** * Stabilization state * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bStab : Enable/disable frame stabilization state */ typedef struct OMX_CONFIG_FRAMESTABTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bStab; } OMX_CONFIG_FRAMESTABTYPE; /** * White Balance control type * * STRUCT MEMBERS: * SunLight : Referenced in JSR-234 * Flash : Optimal for device's integrated flash */ typedef enum OMX_WHITEBALCONTROLTYPE { OMX_WhiteBalControlOff = 0, OMX_WhiteBalControlAuto, OMX_WhiteBalControlSunLight, OMX_WhiteBalControlCloudy, OMX_WhiteBalControlShade, OMX_WhiteBalControlTungsten, OMX_WhiteBalControlFluorescent, OMX_WhiteBalControlIncandescent, OMX_WhiteBalControlFlash, OMX_WhiteBalControlHorizon, OMX_WhiteBalControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_WhiteBalControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_WhiteBalControlMax = 0x7FFFFFFF } OMX_WHITEBALCONTROLTYPE; /** * White Balance control configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eWhiteBalControl : White balance enumeration */ typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_WHITEBALCONTROLTYPE eWhiteBalControl; } OMX_CONFIG_WHITEBALCONTROLTYPE; /** * Exposure control type */ typedef enum OMX_EXPOSURECONTROLTYPE { OMX_ExposureControlOff = 0, OMX_ExposureControlAuto, OMX_ExposureControlNight, OMX_ExposureControlBackLight, OMX_ExposureControlSpotLight, OMX_ExposureControlSports, OMX_ExposureControlSnow, OMX_ExposureControlBeach, OMX_ExposureControlLargeAperture, OMX_ExposureControlSmallAperture, OMX_ExposureControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_ExposureControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_ExposureControlVeryLong, OMX_ExposureControlFixedFps, OMX_ExposureControlNightWithPreview, OMX_ExposureControlAntishake, OMX_ExposureControlFireworks, OMX_ExposureControlMax = 0x7FFFFFFF } OMX_EXPOSURECONTROLTYPE; /** * White Balance control configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eExposureControl : Exposure control enumeration */ typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_EXPOSURECONTROLTYPE eExposureControl; } OMX_CONFIG_EXPOSURECONTROLTYPE; /** * Defines sensor supported mode. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nFrameRate : Single shot mode is indicated by a 0 * bOneShot : Enable for single shot, disable for streaming * sFrameSize : Framesize */ typedef struct OMX_PARAM_SENSORMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nFrameRate; OMX_BOOL bOneShot; OMX_FRAMESIZETYPE sFrameSize; } OMX_PARAM_SENSORMODETYPE; /** * Defines contrast level * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nContrast : Values allowed for contrast -100 to 100, zero means no change */ typedef struct OMX_CONFIG_CONTRASTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nContrast; } OMX_CONFIG_CONTRASTTYPE; /** * Defines brightness level * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nBrightness : 0-100% */ typedef struct OMX_CONFIG_BRIGHTNESSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nBrightness; } OMX_CONFIG_BRIGHTNESSTYPE; /** * Defines backlight level configuration for a video sink, e.g. LCD panel * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nBacklight : Values allowed for backlight 0-100% * nTimeout : Number of milliseconds before backlight automatically turns * off. A value of 0x0 disables backight timeout */ typedef struct OMX_CONFIG_BACKLIGHTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nBacklight; OMX_U32 nTimeout; } OMX_CONFIG_BACKLIGHTTYPE; /** * Defines setting for Gamma * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nGamma : Values allowed for gamma -100 to 100, zero means no change */ typedef struct OMX_CONFIG_GAMMATYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nGamma; } OMX_CONFIG_GAMMATYPE; /** * Define for setting saturation * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nSaturation : Values allowed for saturation -100 to 100, zero means * no change */ typedef struct OMX_CONFIG_SATURATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nSaturation; } OMX_CONFIG_SATURATIONTYPE; /** * Define for setting Lightness * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nLightness : Values allowed for lightness -100 to 100, zero means no * change */ typedef struct OMX_CONFIG_LIGHTNESSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_S32 nLightness; } OMX_CONFIG_LIGHTNESSTYPE; /** * Plane blend configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Index of input port associated with the plane. * nDepth : Depth of the plane in relation to the screen. Higher * numbered depths are "behind" lower number depths. * This number defaults to the Port Index number. * nAlpha : Transparency blending component for the entire plane. * See blending modes for more detail. */ typedef struct OMX_CONFIG_PLANEBLENDTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nDepth; OMX_U32 nAlpha; } OMX_CONFIG_PLANEBLENDTYPE; /** * Define interlace type * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bEnable : Enable control variable for this functionality * (see below) * nInterleavePortIndex : Index of input or output port associated with * the interleaved plane. * pPlanarPortIndexes[4] : Index of input or output planar ports. */ typedef struct OMX_PARAM_INTERLEAVETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnable; OMX_U32 nInterleavePortIndex; } OMX_PARAM_INTERLEAVETYPE; /** * Defines the picture effect used for an input picture */ typedef enum OMX_TRANSITIONEFFECTTYPE { OMX_EffectNone, OMX_EffectFadeFromBlack, OMX_EffectFadeToBlack, OMX_EffectUnspecifiedThroughConstantColor, OMX_EffectDissolve, OMX_EffectWipe, OMX_EffectUnspecifiedMixOfTwoScenes, OMX_EffectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_EffectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_EffectReverseUnspecifiedMixOfTwoScenes, #ifndef __VIDEOCORE4__ OMX_EffectDiagonalWipe, OMX_EffectDiagonalWipeRotate, OMX_EffectEllipticalWipe, OMX_EffectEllipticalWipeRotate, OMX_EffectInverseEllipticalWipe, OMX_EffectInverseEllipticalWipeRotate, OMX_EffectGlassWipe, OMX_EffectGlassWipeRotate, OMX_EffectWavyWipe, OMX_EffectWavyWipeRotate, OMX_EffectMunchingSquares, OMX_EffectStripeWipe, OMX_EffectStripeWipeRotate, OMX_EffectRotozoomUnmatched, OMX_EffectRotozoomMatched, OMX_EffectRotozoomGentle, #endif OMX_EffectMunchRandom, OMX_EffectMunchVRandom, OMX_EffectMunchHRandom, OMX_EffectMunchWipe, OMX_EffectMunchMunch, OMX_EffectMunchStripe, OMX_EffectFadeRandom, OMX_EffectFadeVRandom, OMX_EffectFadeHRandom, OMX_EffectFadeWipe, OMX_EffectFadeMunch, OMX_EffectFadeStripe, OMX_EffectColourBlockRandom, OMX_EffectColourBlockVRandom, OMX_EffectColourBlockHRandom, OMX_EffectColourBlockWipe, OMX_EffectColourBlockMunch, OMX_EffectColourBlockStripe, OMX_EffectColourBlock2Random, OMX_EffectColourBlock2VRandom, OMX_EffectColourBlock2HRandom, OMX_EffectColourBlock2Wipe, OMX_EffectColourBlock2Munch, OMX_EffectColourBlock2Stripe, OMX_EffectShadeRandom, OMX_EffectShadeVRandom, OMX_EffectShadeHRandom, OMX_EffectShadeWipe, OMX_EffectShadeMunch, OMX_EffectShadeStripe, OMX_EffectBitmaskRandom, OMX_EffectBitmaskVRandom, OMX_EffectBitmaskHRandom, OMX_EffectBitmaskWipe, OMX_EffectBitmaskMunch, OMX_EffectBitmaskStripe, OMX_EffectBitmask2Random, OMX_EffectBitmask2VRandom, OMX_EffectBitmask2HRandom, OMX_EffectBitmask2Wipe, OMX_EffectBitmask2Munch, OMX_EffectBitmask2Stripe, OMX_EffectBitmask2ColourRandom, OMX_EffectBitmask2ColourVRandom, OMX_EffectBitmask2ColourHRandom, OMX_EffectBitmask2ColourWipe, OMX_EffectBitmask2ColourMunch, OMX_EffectBitmask2ColourStripe, OMX_EffectPushRight, OMX_EffectPushLeft, OMX_EffectPushDown, OMX_EffectPushUp, OMX_EffectCoverRight, OMX_EffectCoverLeft, OMX_EffectCoverDown, OMX_EffectCoverUp, OMX_EffectRevealRight, OMX_EffectRevealLeft, OMX_EffectRevealDown, OMX_EffectRevealUp, OMX_EffectWipeRight, OMX_EffectWipeLeft, OMX_EffectWipeDown, OMX_EffectWipeUp, OMX_EffectSpeckle, OMX_EffectCircle, OMX_EffectSpiral, OMX_EffectDiamond, OMX_EffectVert, OMX_EffectPlus, OMX_EffectClock, OMX_EffectPlasma, OMX_EffectDisplace, OMX_EffectGenie, OMX_EffectSide, OMX_EffectMaze, OMX_EffectRipple, OMX_EffectStar, OMX_EffectAlpha, OMX_EffectIntense, OMX_EffectIntenseU, OMX_EffectIntenseV, OMX_EffectInverseIntense, OMX_EffectInverseIntenseU, OMX_EffectInverseIntenseV, OMX_EffectPageTurn, OMX_EffectFlipPlaneDown, OMX_EffectFlipPlaneDownMid, OMX_EffectFlipPlaneDownHigh, OMX_EffectFlipPlaneLeft, OMX_EffectFlipPlaneLeftMid, OMX_EffectFlipPlaneLeftHigh, OMX_EffectFlipCubeDown, OMX_EffectFlipCubeDownMid, OMX_EffectFlipCubeDownHigh, OMX_EffectFlipCubeLeft, OMX_EffectFlipCubeLeftMid, OMX_EffectFlipCubeLeftHigh, OMX_EffectMax = 0x7FFFFFFF } OMX_TRANSITIONEFFECTTYPE; /** * Structure used to configure current transition effect * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eEffect : Effect to enable */ typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_TRANSITIONEFFECTTYPE eEffect; } OMX_CONFIG_TRANSITIONEFFECTTYPE; /** * Defines possible data unit types for encoded video data. The data unit * types are used both for encoded video input for playback as well as * encoded video output from recording. */ typedef enum OMX_DATAUNITTYPE { OMX_DataUnitCodedPicture, OMX_DataUnitVideoSegment, OMX_DataUnitSeveralSegments, OMX_DataUnitArbitraryStreamSection, OMX_DataUnitKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_DataUnitVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_DataUnitMax = 0x7FFFFFFF } OMX_DATAUNITTYPE; /** * Defines possible encapsulation types for coded video data unit. The * encapsulation information is used both for encoded video input for * playback as well as encoded video output from recording. */ typedef enum OMX_DATAUNITENCAPSULATIONTYPE { OMX_DataEncapsulationElementaryStream, OMX_DataEncapsulationGenericPayload, OMX_DataEncapsulationRtpPayload, OMX_DataEncapsulationKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_DataEncapsulationVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_DataEncapsulationMax = 0x7FFFFFFF } OMX_DATAUNITENCAPSULATIONTYPE; /** * Structure used to configure the type of being decoded/encoded */ typedef struct OMX_PARAM_DATAUNITTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_DATAUNITTYPE eUnitType; OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType; } OMX_PARAM_DATAUNITTYPE; /** * Defines dither types */ typedef enum OMX_DITHERTYPE { OMX_DitherNone, OMX_DitherOrdered, OMX_DitherErrorDiffusion, OMX_DitherOther, OMX_DitherKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_DitherVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_DitherMax = 0x7FFFFFFF } OMX_DITHERTYPE; /** * Structure used to configure current type of dithering */ typedef struct OMX_CONFIG_DITHERTYPE { OMX_U32 nSize; /**< Size of the structure in bytes */ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */ OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_DITHERTYPE eDither; /**< Type of dithering to use */ } OMX_CONFIG_DITHERTYPE; typedef struct OMX_CONFIG_CAPTUREMODETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; /**< Port that this structure applies to */ OMX_BOOL bContinuous; /**< If true then ignore frame rate and emit capture * data as fast as possible (otherwise obey port's frame rate). */ OMX_BOOL bFrameLimited; /**< If true then terminate capture after the port emits the * specified number of frames (otherwise the port does not * terminate the capture until instructed to do so by the client). * Even if set, the client may manually terminate the capture prior * to reaching the limit. */ OMX_U32 nFrameLimit; /**< Limit on number of frames emitted during a capture (only * valid if bFrameLimited is set). */ } OMX_CONFIG_CAPTUREMODETYPE; typedef enum OMX_METERINGTYPE { OMX_MeteringModeAverage, /**< Center-weighted average metering. */ OMX_MeteringModeSpot, /**< Spot (partial) metering. */ OMX_MeteringModeMatrix, /**< Matrix or evaluative metering. */ OMX_MeteringKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_MeteringVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_MeteringModeBacklit, OMX_EVModeMax = 0x7fffffff } OMX_METERINGTYPE; typedef struct OMX_CONFIG_EXPOSUREVALUETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_METERINGTYPE eMetering; OMX_S32 xEVCompensation; /**< Fixed point value stored as Q16 */ OMX_U32 nApertureFNumber; /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */ OMX_BOOL bAutoAperture; /**< Whether aperture number is defined automatically */ OMX_U32 nShutterSpeedMsec; /**< Shutterspeed in milliseconds */ OMX_BOOL bAutoShutterSpeed; /**< Whether shutter speed is defined automatically */ OMX_U32 nSensitivity; /**< e.g. nSensitivity = 100 implies "ISO 100" */ OMX_BOOL bAutoSensitivity; /**< Whether sensitivity is defined automatically */ } OMX_CONFIG_EXPOSUREVALUETYPE; /** * Focus region configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bCenter : Use center region as focus region of interest * bLeft : Use left region as focus region of interest * bRight : Use right region as focus region of interest * bTop : Use top region as focus region of interest * bBottom : Use bottom region as focus region of interest * bTopLeft : Use top left region as focus region of interest * bTopRight : Use top right region as focus region of interest * bBottomLeft : Use bottom left region as focus region of interest * bBottomRight : Use bottom right region as focus region of interest */ typedef struct OMX_CONFIG_FOCUSREGIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bCenter; OMX_BOOL bLeft; OMX_BOOL bRight; OMX_BOOL bTop; OMX_BOOL bBottom; OMX_BOOL bTopLeft; OMX_BOOL bTopRight; OMX_BOOL bBottomLeft; OMX_BOOL bBottomRight; } OMX_CONFIG_FOCUSREGIONTYPE; /** * Focus Status type */ typedef enum OMX_FOCUSSTATUSTYPE { OMX_FocusStatusOff = 0, OMX_FocusStatusRequest, OMX_FocusStatusReached, OMX_FocusStatusUnableToReach, OMX_FocusStatusLost, OMX_FocusStatusKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_FocusStatusVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_FocusStatusCafWatching, OMX_FocusStatusCafSceneChanged, OMX_FocusStatusMax = 0x7FFFFFFF } OMX_FOCUSSTATUSTYPE; /** * Focus status configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFocusStatus : Specifies the focus status * bCenterStatus : Use center region as focus region of interest * bLeftStatus : Use left region as focus region of interest * bRightStatus : Use right region as focus region of interest * bTopStatus : Use top region as focus region of interest * bBottomStatus : Use bottom region as focus region of interest * bTopLeftStatus : Use top left region as focus region of interest * bTopRightStatus : Use top right region as focus region of interest * bBottomLeftStatus : Use bottom left region as focus region of interest * bBottomRightStatus : Use bottom right region as focus region of interest */ typedef struct OMX_PARAM_FOCUSSTATUSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_FOCUSSTATUSTYPE eFocusStatus; OMX_BOOL bCenterStatus; OMX_BOOL bLeftStatus; OMX_BOOL bRightStatus; OMX_BOOL bTopStatus; OMX_BOOL bBottomStatus; OMX_BOOL bTopLeftStatus; OMX_BOOL bTopRightStatus; OMX_BOOL bBottomLeftStatus; OMX_BOOL bBottomRightStatus; } OMX_PARAM_FOCUSSTATUSTYPE; /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/khronos/IL/OMX_Image.h ================================================ /** * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * @file OMX_Image.h - OpenMax IL version 1.1.2 * The structures needed by Image components to exchange parameters and * configuration data with the components. */ #ifndef OMX_Image_h #define OMX_Image_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_IVCommon.h" /** @defgroup imaging OpenMAX IL Imaging Domain * @ingroup iv * Structures for OpenMAX IL Imaging domain * @{ */ /** * Enumeration used to define the possible image compression coding. */ typedef enum OMX_IMAGE_CODINGTYPE { OMX_IMAGE_CodingUnused, /**< Value when format is N/A */ OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */ OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */ OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */ OMX_IMAGE_CodingEXIF, /**< EXIF image format */ OMX_IMAGE_CodingTIFF, /**< TIFF image format */ OMX_IMAGE_CodingGIF, /**< Graphics image format */ OMX_IMAGE_CodingPNG, /**< PNG image format */ OMX_IMAGE_CodingLZW, /**< LZW image format */ OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */ OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_CodingTGA, OMX_IMAGE_CodingPPM, OMX_IMAGE_CodingMax = 0x7FFFFFFF } OMX_IMAGE_CODINGTYPE; /** * Data structure used to define an image path. The number of image paths * for input and output will vary by type of the image component. * * Input (aka Source) : Zero Inputs, one Output, * Splitter : One Input, 2 or more Outputs, * Processing Element : One Input, one output, * Mixer : 2 or more inputs, one output, * Output (aka Sink) : One Input, zero outputs. * * The PortDefinition structure is used to define all of the parameters * necessary for the compliant component to setup an input or an output * image path. If additional vendor specific data is required, it should * be transmitted to the component using the CustomCommand function. * Compliant components will prepopulate this structure with optimal * values during the OMX_GetParameter() command. * * STRUCT MEMBERS: * cMIMEType : MIME type of data for the port * pNativeRender : Platform specific reference for a display if a * sync, otherwise this field is 0 * nFrameWidth : Width of frame to be used on port if * uncompressed format is used. Use 0 for * unknown, don't care or variable * nFrameHeight : Height of frame to be used on port if * uncompressed format is used. Use 0 for * unknown, don't care or variable * nStride : Number of bytes per span of an image (i.e. * indicates the number of bytes to get from * span N to span N+1, where negative stride * indicates the image is bottom up * nSliceHeight : Height used when encoding in slices * bFlagErrorConcealment : Turns on error concealment if it is supported by * the OMX component * eCompressionFormat : Compression format used in this instance of * the component. When OMX_IMAGE_CodingUnused is * specified, eColorFormat is valid * eColorFormat : Decompressed format used by this component * pNativeWindow : Platform specific reference for a window object if a * display sink , otherwise this field is 0x0. */ typedef struct OMX_IMAGE_PORTDEFINITIONTYPE { OMX_STRING cMIMEType; OMX_NATIVE_DEVICETYPE pNativeRender; OMX_U32 nFrameWidth; OMX_U32 nFrameHeight; OMX_S32 nStride; OMX_U32 nSliceHeight; OMX_BOOL bFlagErrorConcealment; OMX_IMAGE_CODINGTYPE eCompressionFormat; OMX_COLOR_FORMATTYPE eColorFormat; OMX_NATIVE_WINDOWTYPE pNativeWindow; } OMX_IMAGE_PORTDEFINITIONTYPE; /** * Port format parameter. This structure is used to enumerate the various * data input/output format supported by the port. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Indicates which port to set * nIndex : Indicates the enumeration index for the format from * 0x0 to N-1 * eCompressionFormat : Compression format used in this instance of the * component. When OMX_IMAGE_CodingUnused is specified, * eColorFormat is valid * eColorFormat : Decompressed format used by this component */ typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIndex; OMX_IMAGE_CODINGTYPE eCompressionFormat; OMX_COLOR_FORMATTYPE eColorFormat; } OMX_IMAGE_PARAM_PORTFORMATTYPE; /** * Flash control type * * ENUMS * Torch : Flash forced constantly on */ typedef enum OMX_IMAGE_FLASHCONTROLTYPE { OMX_IMAGE_FlashControlOn = 0, OMX_IMAGE_FlashControlOff, OMX_IMAGE_FlashControlAuto, OMX_IMAGE_FlashControlRedEyeReduction, OMX_IMAGE_FlashControlFillin, OMX_IMAGE_FlashControlTorch, OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_FlashControlMax = 0x7FFFFFFF } OMX_IMAGE_FLASHCONTROLTYPE; /** * Flash control configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFlashControl : Flash control type */ typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGE_FLASHCONTROLTYPE eFlashControl; } OMX_IMAGE_PARAM_FLASHCONTROLTYPE; /** * Focus control type */ typedef enum OMX_IMAGE_FOCUSCONTROLTYPE { OMX_IMAGE_FocusControlOn = 0, OMX_IMAGE_FocusControlOff, OMX_IMAGE_FocusControlAuto, OMX_IMAGE_FocusControlAutoLock, OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_FocusControlHyperfocal, /* Focus at the hyperfocal point of the lens. */ OMX_IMAGE_FocusControlAutoMacro, /* CF over a macro range (eg 0-50cm) */ OMX_IMAGE_FocusControlAutoInfinity, /* CF over distant range (eg 50cm to infinity) */ OMX_IMAGE_FocusControlAutoLockMacro, /* AF over a macro range (eg 0-50cm) */ OMX_IMAGE_FocusControlAutoLockInfinity, /* AF over distant range (eg 50cm to infinity) */ OMX_IMAGE_FocusControlNearFixed, /* Focus at a fixed near focus point - (50cm-1m) */ OMX_IMAGE_FocusControlAutoNear, /* CF over a near range (eg 0-200cm) */ OMX_IMAGE_FocusControlAutoLockNear, /* AF over a near range (eg 0-200cm) */ OMX_IMAGE_FocusControlInfinityFixed, /* Focus at infinity */ OMX_IMAGE_FocusControlMacroFixed, /* Focus at a macro distance */ OMX_IMAGE_FocusControlAutoFast, /* CF over a full range with fast response */ OMX_IMAGE_FocusControlAutoMacroFast, /* CF over a macro range (eg 0-50cm) with fast response */ OMX_IMAGE_FocusControlAutoNearFast, /* CF over a near range (eg 0-200cm) */ OMX_IMAGE_FocusControlAutoInfinityFast, /* CF over distant range (eg 50cm to infinity) with fast response */ OMX_IMAGE_FocusControlCurrentFixed, /* Stop the lens at the current position */ OMX_IMAGE_FocusControlMax = 0x7FFFFFFF } OMX_IMAGE_FOCUSCONTROLTYPE; /** * Focus control configuration * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFocusControl : Focus control * nFocusSteps : Focus can take on values from 0 mm to infinity. * Interest is only in number of steps over this range. * nFocusStepIndex : Current focus step index */ typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl; OMX_U32 nFocusSteps; OMX_U32 nFocusStepIndex; } OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE; /** * Q Factor for JPEG compression, which controls the tradeoff between image * quality and size. Q Factor provides a more simple means of controlling * JPEG compression quality, without directly programming Quantization * tables for chroma and luma * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1 * produces the smallest, worst quality images, and a factor * of 100 produces the largest, best quality images. A * typical default is 75 for small good quality images */ typedef struct OMX_IMAGE_PARAM_QFACTORTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nQFactor; } OMX_IMAGE_PARAM_QFACTORTYPE; /** * Quantization table type */ typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE { OMX_IMAGE_QuantizationTableLuma = 0, OMX_IMAGE_QuantizationTableChroma, OMX_IMAGE_QuantizationTableChromaCb, OMX_IMAGE_QuantizationTableChromaCr, OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF } OMX_IMAGE_QUANTIZATIONTABLETYPE; /** * JPEG quantization tables are used to determine DCT compression for * YUV data, as an alternative to specifying Q factor, providing exact * control of compression * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eQuantizationTable : Quantization table type * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored * in increasing columns then by rows of data (i.e. * row 1, ... row 8). Quantization values are in * the range 0-255 and stored in linear order * (i.e. the component will zig-zag the * quantization table data if required internally) */ typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable; OMX_U8 nQuantizationMatrix[64]; } OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE; /** * Huffman table type, the same Huffman table is applied for chroma and * luma component */ typedef enum OMX_IMAGE_HUFFMANTABLETYPE { OMX_IMAGE_HuffmanTableAC = 0, OMX_IMAGE_HuffmanTableDC, OMX_IMAGE_HuffmanTableACLuma, OMX_IMAGE_HuffmanTableACChroma, OMX_IMAGE_HuffmanTableDCLuma, OMX_IMAGE_HuffmanTableDCChroma, OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF } OMX_IMAGE_HUFFMANTABLETYPE; /** * JPEG Huffman table * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eHuffmanTable : Huffman table type * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each * possible length * nHuffmanTable[256] : 0-255, the size used for AC and DC * HuffmanTable are 16 and 162 */ typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable; OMX_U8 nNumberOfHuffmanCodeOfLength[16]; OMX_U8 nHuffmanTable[256]; }OMX_IMAGE_PARAM_HUFFMANTTABLETYPE; /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/khronos/IL/OMX_Index.h ================================================ /* * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** @file OMX_Index.h - OpenMax IL version 1.1.2 * The OMX_Index header file contains the definitions for both applications * and components . */ #ifndef OMX_Index_h #define OMX_Index_h #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_Types.h" /** The OMX_INDEXTYPE enumeration is used to select a structure when either * getting or setting parameters and/or configuration data. Each entry in * this enumeration maps to an OMX specified structure. When the * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods * are used, the second parameter will always be an entry from this enumeration * and the third entry will be the structure shown in the comments for the entry. * For example, if the application is initializing a cropping function, the * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter * and would send a pointer to an initialized OMX_RECTTYPE structure as the * third parameter. * * The enumeration entries named with the OMX_Config prefix are sent using * the OMX_SetConfig command and the enumeration entries named with the * OMX_PARAM_ prefix are sent using the OMX_SetParameter command. */ typedef enum OMX_INDEXTYPE { OMX_IndexComponentStartUnused = 0x01000000, OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */ OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */ OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */ OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */ OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */ OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */ OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */ OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */ OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */ OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */ OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */ OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */ OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */ OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */ OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */ OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */ OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */ OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */ OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */ OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */ OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */ OMX_IndexPortStartUnused = 0x02000000, OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */ OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */ OMX_IndexReservedStartUnused = 0x03000000, /* Audio parameters and configurations */ OMX_IndexAudioStartUnused = 0x04000000, OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */ OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */ OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */ OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */ OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */ OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */ OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */ OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */ OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */ OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */ OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */ OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */ OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */ OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */ OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */ OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */ OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */ OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */ OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */ OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */ OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */ OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */ OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */ OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */ OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */ OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */ OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */ OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */ OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */ OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */ OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */ OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */ OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */ OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */ OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */ OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */ OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */ OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */ OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */ OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */ OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */ OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */ OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */ OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */ OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */ OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */ OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */ /* Image specific parameters and configurations */ OMX_IndexImageStartUnused = 0x05000000, OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */ OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */ OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */ OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */ OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */ OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */ /* Video specific parameters and configurations */ OMX_IndexVideoStartUnused = 0x06000000, OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */ OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */ OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */ OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */ OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */ OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */ OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */ OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */ OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */ OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */ OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */ OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */ OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */ OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */ OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */ OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */ OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */ OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */ OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */ OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */ OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */ OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */ OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */ OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */ /* Image & Video common Configurations */ OMX_IndexCommonStartUnused = 0x07000000, OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */ OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */ OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */ OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */ OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */ OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */ OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */ OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */ OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */ OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */ OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */ OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */ OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */ OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */ OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/ OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */ OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */ OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */ OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */ OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */ OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */ OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */ OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */ OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */ OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */ OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */ OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */ OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */ OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */ OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */ OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */ OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */ /* Reserved Configuration range */ OMX_IndexOtherStartUnused = 0x08000000, OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */ OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */ OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */ /* Reserved Time range */ OMX_IndexTimeStartUnused = 0x09000000, OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */ OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */ OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */ OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */ OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */ OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */ OMX_IndexConfigTimeClientStartTime, /** #define STDINT_H_AVAILABLE #endif /** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */ typedef unsigned char OMX_U8; /** OMX_S8 is an 8 bit signed quantity that is byte aligned */ typedef signed char OMX_S8; /** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */ typedef unsigned short OMX_U16; /** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */ typedef signed short OMX_S16; /** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */ #ifdef STDINT_H_AVAILABLE typedef uint32_t OMX_U32; #else typedef unsigned long OMX_U32; #endif /** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */ #ifdef STDINT_H_AVAILABLE typedef int32_t OMX_S32; #else typedef signed long OMX_S32; #endif /* Users with compilers that cannot accept the "long long" designation should define the OMX_SKIP64BIT macro. It should be noted that this may cause some components to fail to compile if the component was written to require 64 bit integral types. However, these components would NOT compile anyway since the compiler does not support the way the component was written. */ #ifndef OMX_SKIP64BIT #ifdef __SYMBIAN32__ /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ typedef unsigned long long OMX_U64; /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ typedef signed long long OMX_S64; #elif defined(WIN32) /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ typedef unsigned __int64 OMX_U64; /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ typedef signed __int64 OMX_S64; #else /* WIN32 */ /** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */ typedef unsigned long long OMX_U64; /** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */ typedef signed long long OMX_S64; #endif /* WIN32 */ #endif /** The OMX_BOOL type is intended to be used to represent a true or a false value when passing parameters to and from the OMX core and components. The OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary. */ typedef enum OMX_BOOL { OMX_FALSE = 0, OMX_TRUE = !OMX_FALSE, OMX_BOOL_MAX = 0x7FFFFFFF } OMX_BOOL; /** The OMX_PTR type is intended to be used to pass pointers between the OMX applications and the OMX Core and components. This is a 32 bit pointer and is aligned on a 32 bit boundary. */ typedef void* OMX_PTR; /** The OMX_STRING type is intended to be used to pass "C" type strings between the application and the core and component. The OMX_STRING type is a 32 bit pointer to a zero terminated string. The pointer is word aligned and the string is byte aligned. */ typedef char* OMX_STRING; /** The OMX_BYTE type is intended to be used to pass arrays of bytes such as buffers between the application and the component and core. The OMX_BYTE type is a 32 bit pointer to a zero terminated string. The pointer is word aligned and the string is byte aligned. */ typedef unsigned char* OMX_BYTE; /** OMX_UUIDTYPE is a very long unique identifier to uniquely identify at runtime. This identifier should be generated by a component in a way that guarantees that every instance of the identifier running on the system is unique. */ typedef unsigned char OMX_UUIDTYPE[128]; /** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or an output port. This enumeration is common across all component types. */ typedef enum OMX_DIRTYPE { OMX_DirInput, /**< Port is an input port */ OMX_DirOutput, /**< Port is an output port */ OMX_DirMax = 0x7FFFFFFF } OMX_DIRTYPE; /** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering for numerical data (i.e. big endian, or little endian). */ typedef enum OMX_ENDIANTYPE { OMX_EndianBig, /**< big endian */ OMX_EndianLittle, /**< little endian */ OMX_EndianMax = 0x7FFFFFFF } OMX_ENDIANTYPE; /** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data is signed or unsigned */ typedef enum OMX_NUMERICALDATATYPE { OMX_NumericalDataSigned, /**< signed data */ OMX_NumericalDataUnsigned, /**< unsigned data */ OMX_NumercialDataMax = 0x7FFFFFFF } OMX_NUMERICALDATATYPE; /** Unsigned bounded value type */ typedef struct OMX_BU32 { OMX_U32 nValue; /**< actual value */ OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ } OMX_BU32; /** Signed bounded value type */ typedef struct OMX_BS32 { OMX_S32 nValue; /**< actual value */ OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */ OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */ } OMX_BS32; /** Structure representing some time or duration in microseconds. This structure * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate * negative deltas and preroll scenarios. The quantity is represented in microseconds * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g. * individual audio samples delivered at 192 kHz). The quantity is 64 bit to * accommodate a large dynamic range (signed 32 bit values would allow only for plus * or minus 35 minutes). * * Implementations with limited precision may convert the signed 64 bit value to * a signed 32 bit value internally but risk loss of precision. */ #ifndef OMX_SKIP64BIT typedef OMX_S64 OMX_TICKS; #else typedef struct OMX_TICKS { OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */ OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */ } OMX_TICKS; #endif #define OMX_TICKS_PER_SECOND 1000000 /** Define the public interface for the OMX Handle. The core will not use this value internally, but the application should only use this value. */ typedef void* OMX_HANDLETYPE; typedef struct OMX_MARKTYPE { OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a mark event upon processing the mark. */ OMX_PTR pMarkData; /**< Application specific data associated with the mark sent on a mark event to disambiguate this mark from others. */ } OMX_MARKTYPE; /** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the * platform & operating specific object used to reference the display * or can be used by a audio port for native audio rendering */ typedef void* OMX_NATIVE_DEVICETYPE; /** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the * platform & operating specific object used to reference the window */ typedef void* OMX_NATIVE_WINDOWTYPE; /** Define the OMX IL version that corresponds to this set of header files. * We also define a combined version that can be used to write or compare * values of the 32bit nVersion field, assuming a little endian architecture */ #define OMX_VERSION_MAJOR 1 #define OMX_VERSION_MINOR 1 #define OMX_VERSION_REVISION 2 #define OMX_VERSION_STEP 0 #define OMX_VERSION ((OMX_VERSION_STEP<<24) | (OMX_VERSION_REVISION<<16) | (OMX_VERSION_MINOR<<8) | OMX_VERSION_MAJOR) /** The OMX_VERSIONTYPE union is used to specify the version for a structure or component. For a component, the version is entirely specified by the component vendor. Components doing the same function from different vendors may or may not have the same version. For structures, the version shall be set by the entity that allocates the structure. For structures specified in the OMX 1.1 specification, the value of the version shall be set to 1.1.0.0 in all cases. Access to the OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or by accessing one of the structure elements to, for example, check only the Major revision. */ typedef union OMX_VERSIONTYPE { struct { OMX_U8 nVersionMajor; /**< Major version accessor element */ OMX_U8 nVersionMinor; /**< Minor version accessor element */ OMX_U8 nRevision; /**< Revision version accessor element */ OMX_U8 nStep; /**< Step version accessor element */ } s; OMX_U32 nVersion; /**< 32 bit value to make accessing the version easily done in a single word size copy/compare operation */ } OMX_VERSIONTYPE; #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/khronos/IL/OMX_Video.h ================================================ /** * Copyright (c) 2008 The Khronos Group Inc. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ /** * @file OMX_Video.h - OpenMax IL version 1.1.2 * The structures is needed by Video components to exchange parameters * and configuration data with OMX components. */ #ifndef OMX_Video_h #define OMX_Video_h /** @defgroup video OpenMAX IL Video Domain * @ingroup iv * Structures for OpenMAX IL Video domain * @{ */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /** * Each OMX header must include all required header files to allow the * header to compile without errors. The includes below are required * for this header file to compile successfully */ #include "OMX_IVCommon.h" /** * Enumeration used to define the possible video compression codings. * NOTE: This essentially refers to file extensions. If the coding is * being used to specify the ENCODE type, then additional work * must be done to configure the exact flavor of the compression * to be used. For decode cases where the user application can * not differentiate between MPEG-4 and H.264 bit streams, it is * up to the codec to handle this. */ typedef enum OMX_VIDEO_CODINGTYPE { OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */ OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */ OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */ OMX_VIDEO_CodingH263, /**< H.263 */ OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */ OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */ OMX_VIDEO_CodingRV, /**< all versions of Real Video */ OMX_VIDEO_CodingAVC, /**< H.264/AVC */ OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */ OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ #define OMX_AUDIO_CodingVP6_Supported 1 OMX_VIDEO_CodingVP6, /**< On2 VP6 */ #define OMX_AUDIO_CodingVP7_Supported 1 OMX_VIDEO_CodingVP7, /**< On2 VP7 */ #define OMX_AUDIO_CodingVP8_Supported 1 OMX_VIDEO_CodingVP8, /**< On2 VP8 */ #define OMX_AUDIO_CodingYUV_Supported 1 OMX_VIDEO_CodingYUV, /* raw YUV video */ #define OMX_AUDIO_CodingSorenson_Supported 1 OMX_VIDEO_CodingSorenson, /**< Sorenson */ #define OMX_AUDIO_CodingTheora_Supported 1 OMX_VIDEO_CodingTheora, /**< Theora */ #define OMX_AUDIO_CodingMVC_Supported 1 OMX_VIDEO_CodingMVC, /**< H.264/MVC */ OMX_VIDEO_CodingMax = 0x7FFFFFFF } OMX_VIDEO_CODINGTYPE; /** * Data structure used to define a video path. The number of Video paths for * input and output will vary by type of the Video component. * * Input (aka Source) : zero Inputs, one Output, * Splitter : one Input, 2 or more Outputs, * Processing Element : one Input, one output, * Mixer : 2 or more inputs, one output, * Output (aka Sink) : one Input, zero outputs. * * The PortDefinition structure is used to define all of the parameters * necessary for the compliant component to setup an input or an output video * path. If additional vendor specific data is required, it should be * transmitted to the component using the CustomCommand function. Compliant * components will prepopulate this structure with optimal values during the * GetDefaultInitParams command. * * STRUCT MEMBERS: * cMIMEType : MIME type of data for the port * pNativeRender : Platform specific reference for a display if a * sync, otherwise this field is 0 * nFrameWidth : Width of frame to be used on channel if * uncompressed format is used. Use 0 for unknown, * don't care or variable * nFrameHeight : Height of frame to be used on channel if * uncompressed format is used. Use 0 for unknown, * don't care or variable * nStride : Number of bytes per span of an image * (i.e. indicates the number of bytes to get * from span N to span N+1, where negative stride * indicates the image is bottom up * nSliceHeight : Height used when encoding in slices * nBitrate : Bit rate of frame to be used on channel if * compressed format is used. Use 0 for unknown, * don't care or variable * xFramerate : Frame rate to be used on channel if uncompressed * format is used. Use 0 for unknown, don't care or * variable. Units are Q16 frames per second. * bFlagErrorConcealment : Turns on error concealment if it is supported by * the OMX component * eCompressionFormat : Compression format used in this instance of the * component. When OMX_VIDEO_CodingUnused is * specified, eColorFormat is used * eColorFormat : Decompressed format used by this component * pNativeWindow : Platform specific reference for a window object if a * display sink , otherwise this field is 0x0. */ typedef struct OMX_VIDEO_PORTDEFINITIONTYPE { OMX_STRING cMIMEType; OMX_NATIVE_DEVICETYPE pNativeRender; OMX_U32 nFrameWidth; OMX_U32 nFrameHeight; OMX_S32 nStride; OMX_U32 nSliceHeight; OMX_U32 nBitrate; OMX_U32 xFramerate; OMX_BOOL bFlagErrorConcealment; OMX_VIDEO_CODINGTYPE eCompressionFormat; OMX_COLOR_FORMATTYPE eColorFormat; OMX_NATIVE_WINDOWTYPE pNativeWindow; } OMX_VIDEO_PORTDEFINITIONTYPE; /** * Port format parameter. This structure is used to enumerate the various * data input/output format supported by the port. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Indicates which port to set * nIndex : Indicates the enumeration index for the format from * 0x0 to N-1 * eCompressionFormat : Compression format used in this instance of the * component. When OMX_VIDEO_CodingUnused is specified, * eColorFormat is used * eColorFormat : Decompressed format used by this component * xFrameRate : Indicates the video frame rate in Q16 format */ typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIndex; OMX_VIDEO_CODINGTYPE eCompressionFormat; OMX_COLOR_FORMATTYPE eColorFormat; OMX_U32 xFramerate; } OMX_VIDEO_PARAM_PORTFORMATTYPE; /** * This is a structure for configuring video compression quantization * parameter values. Codecs may support different QP values for different * frame types. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version info * nPortIndex : Port that this structure applies to * nQpI : QP value to use for index frames * nQpP : QP value to use for P frames * nQpB : QP values to use for bidirectional frames */ typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nQpI; OMX_U32 nQpP; OMX_U32 nQpB; } OMX_VIDEO_PARAM_QUANTIZATIONTYPE; /** * Structure for configuration of video fast update parameters. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version info * nPortIndex : Port that this structure applies to * bEnableVFU : Enable/Disable video fast update * nFirstGOB : Specifies the number of the first macroblock row * nFirstMB : specifies the first MB relative to the specified first GOB * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB * and nFirstMB */ typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnableVFU; OMX_U32 nFirstGOB; OMX_U32 nFirstMB; OMX_U32 nNumMBs; } OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE; /** * Enumeration of possible bitrate control types */ typedef enum OMX_VIDEO_CONTROLRATETYPE { OMX_Video_ControlRateDisable, OMX_Video_ControlRateVariable, OMX_Video_ControlRateConstant, OMX_Video_ControlRateVariableSkipFrames, OMX_Video_ControlRateConstantSkipFrames, OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_Video_ControlRateMax = 0x7FFFFFFF } OMX_VIDEO_CONTROLRATETYPE; /** * Structure for configuring bitrate mode of a codec. * * STRUCT MEMBERS: * nSize : Size of the struct in bytes * nVersion : OMX spec version info * nPortIndex : Port that this struct applies to * eControlRate : Control rate type enum * nTargetBitrate : Target bitrate to encode with */ typedef struct OMX_VIDEO_PARAM_BITRATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_CONTROLRATETYPE eControlRate; OMX_U32 nTargetBitrate; } OMX_VIDEO_PARAM_BITRATETYPE; /** * Enumeration of possible motion vector (MV) types */ typedef enum OMX_VIDEO_MOTIONVECTORTYPE { OMX_Video_MotionVectorPixel, OMX_Video_MotionVectorHalfPel, OMX_Video_MotionVectorQuarterPel, OMX_Video_MotionVectorEighthPel, OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_Video_MotionVectorMax = 0x7FFFFFFF } OMX_VIDEO_MOTIONVECTORTYPE; /** * Structure for configuring the number of motion vectors used as well * as their accuracy. * * STRUCT MEMBERS: * nSize : Size of the struct in bytes * nVersion : OMX spec version info * nPortIndex : port that this structure applies to * eAccuracy : Enumerated MV accuracy * bUnrestrictedMVs : Allow unrestricted MVs * bFourMV : Allow use of 4 MVs * sXSearchRange : Search range in horizontal direction for MVs * sYSearchRange : Search range in vertical direction for MVs */ typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_MOTIONVECTORTYPE eAccuracy; OMX_BOOL bUnrestrictedMVs; OMX_BOOL bFourMV; OMX_S32 sXSearchRange; OMX_S32 sYSearchRange; } OMX_VIDEO_PARAM_MOTIONVECTORTYPE; /** * Enumeration of possible methods to use for Intra Refresh */ typedef enum OMX_VIDEO_INTRAREFRESHTYPE { OMX_VIDEO_IntraRefreshCyclic, /**< Cyclic intra refresh, bit 0 is set*/ OMX_VIDEO_IntraRefreshAdaptive, /**< Adaptive intra refresh, bit 1 is set*/ OMX_VIDEO_IntraRefreshBoth, /**< Cyclic + Adaptive intra refresh (no mrows since bit 2 is off)*/ OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_IntraRefreshCyclicMrows, /**< Cyclic intra refresh, multiple rows at a time bits 0 and 2 are set*/ OMX_VIDEO_IntraRefreshPseudoRand, /**< Pseudo random intra refresh, uses bit 3*/ OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF } OMX_VIDEO_INTRAREFRESHTYPE; /** * Structure for configuring intra refresh mode * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eRefreshMode : Cyclic, Adaptive, or Both * nAirMBs : Number of intra macroblocks to refresh in a frame when * AIR is enabled * nAirRef : Number of times a motion marked macroblock has to be * intra coded * nCirMBs : Number of consecutive macroblocks to be coded as "intra" * when CIR is enabled */ typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode; OMX_U32 nAirMBs; OMX_U32 nAirRef; OMX_U32 nCirMBs; OMX_U32 nPirMBs; } OMX_VIDEO_PARAM_INTRAREFRESHTYPE; /** * Structure for enabling various error correction methods for video * compression. * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * bEnableHEC : Enable/disable header extension codes (HEC) * bEnableResync : Enable/disable resynchronization markers * nResynchMarkerSpacing : Resynch markers interval (in bits) to be * applied in the stream * bEnableDataPartitioning : Enable/disable data partitioning * bEnableRVLC : Enable/disable reversible variable length * coding */ typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnableHEC; OMX_BOOL bEnableResync; OMX_U32 nResynchMarkerSpacing; OMX_BOOL bEnableDataPartitioning; OMX_BOOL bEnableRVLC; } OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE; /** * Configuration of variable block-size motion compensation (VBSMC) * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * b16x16 : Enable inter block search 16x16 * b16x8 : Enable inter block search 16x8 * b8x16 : Enable inter block search 8x16 * b8x8 : Enable inter block search 8x8 * b8x4 : Enable inter block search 8x4 * b4x8 : Enable inter block search 4x8 * b4x4 : Enable inter block search 4x4 */ typedef struct OMX_VIDEO_PARAM_VBSMCTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL b16x16; OMX_BOOL b16x8; OMX_BOOL b8x16; OMX_BOOL b8x8; OMX_BOOL b8x4; OMX_BOOL b4x8; OMX_BOOL b4x4; } OMX_VIDEO_PARAM_VBSMCTYPE; /** * H.263 profile types, each profile indicates support for various * performance bounds and different annexes. * * ENUMS: * Baseline : Baseline Profile: H.263 (V1), no optional modes * H320 Coding : H.320 Coding Efficiency Backward Compatibility * Profile: H.263+ (V2), includes annexes I, J, L.4 * and T * BackwardCompatible : Backward Compatibility Profile: H.263 (V1), * includes annex F * ISWV2 : Interactive Streaming Wireless Profile: H.263+ * (V2), includes annexes I, J, K and T * ISWV3 : Interactive Streaming Wireless Profile: H.263++ * (V3), includes profile 3 and annexes V and W.6.3.8 * HighCompression : Conversational High Compression Profile: H.263++ * (V3), includes profiles 1 & 2 and annexes D and U * Internet : Conversational Internet Profile: H.263++ (V3), * includes profile 5 and annex K * Interlace : Conversational Interlace Profile: H.263++ (V3), * includes profile 5 and annex W.6.3.11 * HighLatency : High Latency Profile: H.263++ (V3), includes * profile 6 and annexes O.1 and P.5 */ typedef enum OMX_VIDEO_H263PROFILETYPE { OMX_VIDEO_H263ProfileBaseline = 0x01, OMX_VIDEO_H263ProfileH320Coding = 0x02, OMX_VIDEO_H263ProfileBackwardCompatible = 0x04, OMX_VIDEO_H263ProfileISWV2 = 0x08, OMX_VIDEO_H263ProfileISWV3 = 0x10, OMX_VIDEO_H263ProfileHighCompression = 0x20, OMX_VIDEO_H263ProfileInternet = 0x40, OMX_VIDEO_H263ProfileInterlace = 0x80, OMX_VIDEO_H263ProfileHighLatency = 0x100, OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF } OMX_VIDEO_H263PROFILETYPE; /** * H.263 level types, each level indicates support for various frame sizes, * bit rates, decoder frame rates. */ typedef enum OMX_VIDEO_H263LEVELTYPE { OMX_VIDEO_H263Level10 = 0x01, OMX_VIDEO_H263Level20 = 0x02, OMX_VIDEO_H263Level30 = 0x04, OMX_VIDEO_H263Level40 = 0x08, OMX_VIDEO_H263Level45 = 0x10, OMX_VIDEO_H263Level50 = 0x20, OMX_VIDEO_H263Level60 = 0x40, OMX_VIDEO_H263Level70 = 0x80, OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_H263LevelMax = 0x7FFFFFFF } OMX_VIDEO_H263LEVELTYPE; /** * Specifies the picture type. These values should be OR'd to signal all * pictures types which are allowed. * * ENUMS: * Generic Picture Types: I, P and B * H.263 Specific Picture Types: SI and SP * H.264 Specific Picture Types: EI and EP * MPEG-4 Specific Picture Types: S */ typedef enum OMX_VIDEO_PICTURETYPE { OMX_VIDEO_PictureTypeI = 0x01, OMX_VIDEO_PictureTypeP = 0x02, OMX_VIDEO_PictureTypeB = 0x04, OMX_VIDEO_PictureTypeSI = 0x08, OMX_VIDEO_PictureTypeSP = 0x10, OMX_VIDEO_PictureTypeEI = 0x11, OMX_VIDEO_PictureTypeEP = 0x12, OMX_VIDEO_PictureTypeS = 0x14, OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF } OMX_VIDEO_PICTURETYPE; /** * H.263 Params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nPFrames : Number of P frames between each I frame * nBFrames : Number of B frames between each I frame * eProfile : H.263 profile(s) to use * eLevel : H.263 level(s) to use * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE * (specified in the 1998 version of H.263) to * indicate custom picture sizes or clock * frequencies * nAllowedPictureTypes : Specifies the picture types allowed in the * bitstream * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is * not constrained. It is recommended to change * the value of the RTYPE bit for each reference * picture in error-free communication * nPictureHeaderRepetition : Specifies the frequency of picture header * repetition * nGOBHeaderInterval : Specifies the interval of non-empty GOB * headers in units of GOBs */ typedef struct OMX_VIDEO_PARAM_H263TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nPFrames; OMX_U32 nBFrames; OMX_VIDEO_H263PROFILETYPE eProfile; OMX_VIDEO_H263LEVELTYPE eLevel; OMX_BOOL bPLUSPTYPEAllowed; OMX_U32 nAllowedPictureTypes; OMX_BOOL bForceRoundingTypeToZero; OMX_U32 nPictureHeaderRepetition; OMX_U32 nGOBHeaderInterval; } OMX_VIDEO_PARAM_H263TYPE; /** * MPEG-2 profile types, each profile indicates support for various * performance bounds and different annexes. */ typedef enum OMX_VIDEO_MPEG2PROFILETYPE { OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */ OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */ OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */ OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */ OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */ OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */ OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF } OMX_VIDEO_MPEG2PROFILETYPE; /** * MPEG-2 level types, each level indicates support for various frame * sizes, bit rates, decoder frame rates. No need */ typedef enum OMX_VIDEO_MPEG2LEVELTYPE { OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */ OMX_VIDEO_MPEG2LevelML, /**< Main Level */ OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */ OMX_VIDEO_MPEG2LevelHL, /**< High Level */ OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF } OMX_VIDEO_MPEG2LEVELTYPE; /** * MPEG-2 params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nPFrames : Number of P frames between each I frame * nBFrames : Number of B frames between each I frame * eProfile : MPEG-2 profile(s) to use * eLevel : MPEG-2 levels(s) to use */ typedef struct OMX_VIDEO_PARAM_MPEG2TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nPFrames; OMX_U32 nBFrames; OMX_VIDEO_MPEG2PROFILETYPE eProfile; OMX_VIDEO_MPEG2LEVELTYPE eLevel; } OMX_VIDEO_PARAM_MPEG2TYPE; /** * MPEG-4 profile types, each profile indicates support for various * performance bounds and different annexes. * * ENUMS: * - Simple Profile, Levels 1-3 * - Simple Scalable Profile, Levels 1-2 * - Core Profile, Levels 1-2 * - Main Profile, Levels 2-4 * - N-bit Profile, Level 2 * - Scalable Texture Profile, Level 1 * - Simple Face Animation Profile, Levels 1-2 * - Simple Face and Body Animation (FBA) Profile, Levels 1-2 * - Basic Animated Texture Profile, Levels 1-2 * - Hybrid Profile, Levels 1-2 * - Advanced Real Time Simple Profiles, Levels 1-4 * - Core Scalable Profile, Levels 1-3 * - Advanced Coding Efficiency Profile, Levels 1-4 * - Advanced Core Profile, Levels 1-2 * - Advanced Scalable Texture, Levels 2-3 */ typedef enum OMX_VIDEO_MPEG4PROFILETYPE { OMX_VIDEO_MPEG4ProfileSimple = 0x01, OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02, OMX_VIDEO_MPEG4ProfileCore = 0x04, OMX_VIDEO_MPEG4ProfileMain = 0x08, OMX_VIDEO_MPEG4ProfileNbit = 0x10, OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20, OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40, OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80, OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100, OMX_VIDEO_MPEG4ProfileHybrid = 0x200, OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400, OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800, OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000, OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000, OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000, OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000, OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF } OMX_VIDEO_MPEG4PROFILETYPE; /** * MPEG-4 level types, each level indicates support for various frame * sizes, bit rates, decoder frame rates. No need */ typedef enum OMX_VIDEO_MPEG4LEVELTYPE { OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */ OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */ OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */ OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */ OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */ OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */ OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */ OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */ OMX_VIDEO_MPEG4Level6 = 0x100, /**< Level 5 */ OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF } OMX_VIDEO_MPEG4LEVELTYPE; /** * MPEG-4 configuration. This structure handles configuration options * which are specific to MPEG4 algorithms * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+ * Annex K). Put zero if not used * bSVH : Enable Short Video Header mode * bGov : Flag to enable GOV * nPFrames : Number of P frames between each I frame (also called * GOV period) * nBFrames : Number of B frames between each I frame * nIDCVLCThreshold : Value of intra DC VLC threshold * bACPred : Flag to use ac prediction * nMaxPacketSize : Maximum size of packet in bytes. * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4. * Interpreted as described in MPEG4 standard. * eProfile : MPEG-4 profile(s) to use. * eLevel : MPEG-4 level(s) to use. * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream * nHeaderExtension : Specifies the number of consecutive video packet * headers within a VOP * bReversibleVLC : Specifies whether reversible variable length coding * is in use */ typedef struct OMX_VIDEO_PARAM_MPEG4TYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nSliceHeaderSpacing; OMX_BOOL bSVH; OMX_BOOL bGov; OMX_U32 nPFrames; OMX_U32 nBFrames; OMX_U32 nIDCVLCThreshold; OMX_BOOL bACPred; OMX_U32 nMaxPacketSize; OMX_U32 nTimeIncRes; OMX_VIDEO_MPEG4PROFILETYPE eProfile; OMX_VIDEO_MPEG4LEVELTYPE eLevel; OMX_U32 nAllowedPictureTypes; OMX_U32 nHeaderExtension; OMX_BOOL bReversibleVLC; } OMX_VIDEO_PARAM_MPEG4TYPE; /** * WMV Versions */ typedef enum OMX_VIDEO_WMVFORMATTYPE { OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */ OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */ OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */ OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */ OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF } OMX_VIDEO_WMVFORMATTYPE; /** * WMV Params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFormat : Version of WMV stream / data */ typedef struct OMX_VIDEO_PARAM_WMVTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_WMVFORMATTYPE eFormat; } OMX_VIDEO_PARAM_WMVTYPE; /** * Real Video Version */ typedef enum OMX_VIDEO_RVFORMATTYPE { OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */ OMX_VIDEO_RVFormat8, /**< Real Video format 8 */ OMX_VIDEO_RVFormat9, /**< Real Video format 9 */ OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */ OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_RVFormatMax = 0x7FFFFFFF } OMX_VIDEO_RVFORMATTYPE; /** * Real Video Params * * STUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * eFormat : Version of RV stream / data * nBitsPerPixel : Bits per pixel coded in the frame * nPaddedWidth : Padded width in pixel of a video frame * nPaddedHeight : Padded Height in pixels of a video frame * nFrameRate : Rate of video in frames per second * nBitstreamFlags : Flags which internal information about the bitstream * nBitstreamVersion : Bitstream version * nMaxEncodeFrameSize: Max encoded frame size * bEnablePostFilter : Turn on/off post filter * bEnableTemporalInterpolation : Turn on/off temporal interpolation * bEnableLatencyMode : When enabled, the decoder does not display a decoded * frame until it has detected that no enhancement layer * frames or dependent B frames will be coming. This * detection usually occurs when a subsequent non-B * frame is encountered */ typedef struct OMX_VIDEO_PARAM_RVTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_VIDEO_RVFORMATTYPE eFormat; OMX_U16 nBitsPerPixel; OMX_U16 nPaddedWidth; OMX_U16 nPaddedHeight; OMX_U32 nFrameRate; OMX_U32 nBitstreamFlags; OMX_U32 nBitstreamVersion; OMX_U32 nMaxEncodeFrameSize; OMX_BOOL bEnablePostFilter; OMX_BOOL bEnableTemporalInterpolation; OMX_BOOL bEnableLatencyMode; } OMX_VIDEO_PARAM_RVTYPE; /** * AVC profile types, each profile indicates support for various * performance bounds and different annexes. */ typedef enum OMX_VIDEO_AVCPROFILETYPE { OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */ OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */ OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */ OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */ OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */ OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */ OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */ OMX_VIDEO_AVCProfileConstrainedBaseline = 0x80, /**< Constrained Baseline Profile */ OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF } OMX_VIDEO_AVCPROFILETYPE; /** * AVC level types, each level indicates support for various frame sizes, * bit rates, decoder frame rates. No need */ typedef enum OMX_VIDEO_AVCLEVELTYPE { OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */ OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */ OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */ OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */ OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */ OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */ OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */ OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */ OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */ OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */ OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */ OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */ OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */ OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */ OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */ OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */ OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF } OMX_VIDEO_AVCLEVELTYPE; /** * AVC loop filter modes * * OMX_VIDEO_AVCLoopFilterEnable : Enable * OMX_VIDEO_AVCLoopFilterDisable : Disable * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries */ typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE { OMX_VIDEO_AVCLoopFilterEnable = 0, OMX_VIDEO_AVCLoopFilterDisable, OMX_VIDEO_AVCLoopFilterDisableSliceBoundary, OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF } OMX_VIDEO_AVCLOOPFILTERTYPE; /** * AVC params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nSliceHeaderSpacing : Number of macroblocks between slice header, put * zero if not used * nPFrames : Number of P frames between each I frame * nBFrames : Number of B frames between each I frame * bUseHadamard : Enable/disable Hadamard transform * nRefFrames : Max number of reference frames to use for inter * motion search (1-16) * nRefIdxTrailing : Pic param set ref frame index (index into ref * frame buffer of trailing frames list), B frame * support * nRefIdxForward : Pic param set ref frame index (index into ref * frame buffer of forward frames list), B frame * support * bEnableUEP : Enable/disable unequal error protection. This * is only valid of data partitioning is enabled. * bEnableFMO : Enable/disable flexible macroblock ordering * bEnableASO : Enable/disable arbitrary slice ordering * bEnableRS : Enable/disable sending of redundant slices * eProfile : AVC profile(s) to use * eLevel : AVC level(s) to use * nAllowedPictureTypes : Specifies the picture types allowed in the * bitstream * bFrameMBsOnly : specifies that every coded picture of the * coded video sequence is a coded frame * containing only frame macroblocks * bMBAFF : Enable/disable switching between frame and * field macroblocks within a picture * bEntropyCodingCABAC : Entropy decoding method to be applied for the * syntax elements for which two descriptors appear * in the syntax tables * bWeightedPPrediction : Enable/disable weighted prediction shall not * be applied to P and SP slices * nWeightedBipredicitonMode : Default weighted prediction is applied to B * slices * bconstIpred : Enable/disable intra prediction * bDirect8x8Inference : Specifies the method used in the derivation * process for luma motion vectors for B_Skip, * B_Direct_16x16 and B_Direct_8x8 as specified * in subclause 8.4.1.2 of the AVC spec * bDirectSpatialTemporal : Flag indicating spatial or temporal direct * mode used in B slice coding (related to * bDirect8x8Inference) . Spatial direct mode is * more common and should be the default. * nCabacInitIdx : Index used to init CABAC contexts * eLoopFilterMode : Enable/disable loop filter */ typedef struct OMX_VIDEO_PARAM_AVCTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nSliceHeaderSpacing; OMX_U32 nPFrames; OMX_U32 nBFrames; OMX_BOOL bUseHadamard; OMX_U32 nRefFrames; OMX_U32 nRefIdx10ActiveMinus1; OMX_U32 nRefIdx11ActiveMinus1; OMX_BOOL bEnableUEP; OMX_BOOL bEnableFMO; OMX_BOOL bEnableASO; OMX_BOOL bEnableRS; OMX_VIDEO_AVCPROFILETYPE eProfile; OMX_VIDEO_AVCLEVELTYPE eLevel; OMX_U32 nAllowedPictureTypes; OMX_BOOL bFrameMBsOnly; OMX_BOOL bMBAFF; OMX_BOOL bEntropyCodingCABAC; OMX_BOOL bWeightedPPrediction; OMX_U32 nWeightedBipredicitonMode; OMX_BOOL bconstIpred ; OMX_BOOL bDirect8x8Inference; OMX_BOOL bDirectSpatialTemporal; OMX_U32 nCabacInitIdc; OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode; } OMX_VIDEO_PARAM_AVCTYPE; typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE, or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE, or OMX_VIDEO_MPEG4PROFILETYPE depending on context */ OMX_U32 nProfileIndex; /**< Used to query for individual profile support information, This parameter is valid only for OMX_IndexParamVideoProfileLevelQuerySupported index, For all other indices this parameter is to be ignored. */ } OMX_VIDEO_PARAM_PROFILELEVELTYPE; /** * Structure for dynamically configuring bitrate mode of a codec. * * STRUCT MEMBERS: * nSize : Size of the struct in bytes * nVersion : OMX spec version info * nPortIndex : Port that this struct applies to * nEncodeBitrate : Target average bitrate to be generated in bps */ typedef struct OMX_VIDEO_CONFIG_BITRATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nEncodeBitrate; } OMX_VIDEO_CONFIG_BITRATETYPE; /** * Defines Encoder Frame Rate setting * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * xEncodeFramerate : Encoding framerate represented in Q16 format */ typedef struct OMX_CONFIG_FRAMERATETYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 xEncodeFramerate; /* Q16 format */ } OMX_CONFIG_FRAMERATETYPE; typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL IntraRefreshVOP; } OMX_CONFIG_INTRAREFRESHVOPTYPE; typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */ OMX_U8 ErrMap[1]; /* Error map hint */ } OMX_CONFIG_MACROBLOCKERRORMAPTYPE; typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_BOOL bEnabled; } OMX_CONFIG_MBERRORREPORTINGTYPE; typedef struct OMX_PARAM_MACROBLOCKSTYPE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nMacroblocks; } OMX_PARAM_MACROBLOCKSTYPE; /** * AVC Slice Mode modes * * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame */ typedef enum OMX_VIDEO_AVCSLICEMODETYPE { OMX_VIDEO_SLICEMODE_AVCDefault = 0, OMX_VIDEO_SLICEMODE_AVCMBSlice, OMX_VIDEO_SLICEMODE_AVCByteSlice, OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */ OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */ OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF } OMX_VIDEO_AVCSLICEMODETYPE; /** * AVC FMO Slice Mode Params * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nNumSliceGroups : Specifies the number of slice groups * nSliceGroupMapType : Specifies the type of slice groups * eSliceMode : Specifies the type of slice */ typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U8 nNumSliceGroups; OMX_U8 nSliceGroupMapType; OMX_VIDEO_AVCSLICEMODETYPE eSliceMode; } OMX_VIDEO_PARAM_AVCSLICEFMO; /** * AVC IDR Period Configs * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nIDRPeriod : Specifies periodicity of IDR frames * nPFrames : Specifies internal of coding Intra frames */ typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nIDRPeriod; OMX_U32 nPFrames; } OMX_VIDEO_CONFIG_AVCINTRAPERIOD; /** * AVC NAL Size Configs * * STRUCT MEMBERS: * nSize : Size of the structure in bytes * nVersion : OMX specification version information * nPortIndex : Port that this structure applies to * nNaluBytes : Specifies the NAL unit size */ typedef struct OMX_VIDEO_CONFIG_NALSIZE { OMX_U32 nSize; OMX_VERSIONTYPE nVersion; OMX_U32 nPortIndex; OMX_U32 nNaluBytes; } OMX_VIDEO_CONFIG_NALSIZE; /** @} */ #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* File EOF */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/linux/vcfiled/vcfiled_check.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCFILED_CHECK_H #define VCFILED_CHECK_H #ifdef ANDROID #define VCFILED_LOCKDIR "/tmp/vcfiled/vcfiled.pid" #define VCFILED_LOCKFILE "/tmp/vcfiled" #endif #ifndef VCFILED_LOCKFILE #define VCFILED_LOCKDIR "/var/run/vcfiled" #define VCFILED_LOCKFILE VCFILED_LOCKDIR "/vcfiled" #endif typedef void (*VCFILED_LOGMSG_T)(int level, const char *fmt, ...); int vcfiled_lock(const char *filename, VCFILED_LOGMSG_T logmsg); extern int vcfiled_is_running(const char *lockfile); #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/linux/vchost_config.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHOST_CONFIG_H #define VCHOST_CONFIG_H #include "interface/vcos/vcos.h" #if 0 /* Types that map onto VideoCore's types of the same name. */ typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef short int16_t; typedef long int32_t; typedef unsigned long uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; #ifndef vc_assert #define vc_assert(cond) vcos_assert(cond) #endif #endif /* On this platform we need to be able to release the host-side software resources. */ extern void vc_os_close(void); #ifndef VCHPRE_ #define VCHPRE_ extern #endif #ifndef VCHPOST_ #define VCHPOST_ #endif #ifndef VCCPRE_ #define VCCPRE_ #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_cec.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * CEC related constants - shared by both host and vc. */ #ifndef _VC_CEC_H_ #define _VC_CEC_H_ #ifndef STRINGIFY #define STRINGIFY(x) #x #define TOSTRING(x) STRINGIFY(x) #endif //Broadcast address and TV logical address #define CEC_BROADCAST_ADDR 0x0F #define CEC_TV_ADDRESS 0x00 //Maximum transmit length excluding the header byte */ #define CEC_MAX_XMIT_LENGTH 15 /* +1 for CEC Header Length */ //Invalid physical address #define CEC_CLEAR_ADDR 0xFFFF /* packed 16 bits of F.F.F.F */ /* ---------------------------------------------------------------------- * general CEC defines * -------------------------------------------------------------------- */ //Maximum transmission length and invalid physical address are now in vc_cec.h #define CEC_VERSION 0x04 /* HDMI 1.3a */ //This OUI ID is registered at the current HQ address in Irvine #define CEC_VENDOR_ID_BROADCOM (0x18C086L) // 24 bit OUI company id from IEEE. = Broadcom //These three OUI IDs are registered with the old address of Irvine office in case you need them //#define CEC_VENDOR_ID_BROADCOM (0x000AF7L) //#define CEC_VENDOR_ID_BROADCOM (0x001018L) //#define CEC_VENDOR_ID_BROADCOM (0x001BE9L) #define CEC_VENDOR_ID_ONKYO (0x0009B0L) #define CEC_VENDOR_ID_PANASONIC_EUROPE (0x000F12L) //If we want to "pretend" to be somebody else use a different company id #define CEC_VENDOR_ID (0x000000L) //We should set the vendor id #define CEC_BLOCKING 1 #define CEC_NONBLOCKING 0 /** * These are the logical addresses for all possible attached devices */ typedef enum CEC_AllDevices { CEC_AllDevices_eTV = 0, /** */ typedef enum CEC_DeviceTypes{ CEC_DeviceType_TV = 0, /** */ typedef enum { CEC_Abort_Reason_Unrecognised_Opcode = 0, CEC_Abort_Reason_Wrong_Mode = 1, CEC_Abort_Reason_Cannot_Provide_Source = 2, CEC_Abort_Reason_Invalid_Operand = 3, CEC_Abort_Reason_Refused = 4, CEC_Abort_Reason_Undetermined = 5 } CEC_ABORT_REASON_T; /** * Display control parameter for */ typedef enum { CEC_DISPLAY_CONTROL_DEFAULT_TIME = 0, CEC_DISPLAY_CONTROL_UNTIL_CLEARED = (1<<6), CEC_DISPLAY_CONTROL_CLEAR_PREV_MSG = (1<<7) } CEC_DISPLAY_CONTROL_T; /** * Power status parameter for */ typedef enum { CEC_POWER_STATUS_ON = 0, CEC_POWER_STATUS_STANDBY = 1, CEC_POWER_STATUS_ON_PENDING = 2, CEC_POWER_STATUS_STANDBY_PENDING = 3 } CEC_POWER_STATUS_T; /** * Menu state parameter for */ typedef enum { CEC_MENU_STATE_ACTIVATED = 0, CEC_MENU_STATE_DEACTIVATED = 1, CEC_MENU_STATE_QUERY = 2 } CEC_MENU_STATE_T; /** * Deck status parameter for */ typedef enum { CEC_DECK_INFO_PLAY = 0x11, CEC_DECK_INFO_RECORD = 0x12, CEC_DECK_INFO_PLAY_REVERSE = 0x13, CEC_DECK_INFO_STILL = 0x14, CEC_DECK_INFO_SLOW = 0x15, CEC_DECK_INFO_SLOW_REVERSE = 0x16, CEC_DECK_INFO_SEARCH_FORWARD = 0x17, CEC_DECK_INFO_SEARCH_REVERSE = 0x18, CEC_DECK_INFO_NO_MEDIA = 0x19, CEC_DECK_INFO_STOP = 0x1A, CEC_DECK_INFO_WIND = 0x1B, CEC_DECK_INFO_REWIND = 0x1C, CEC_DECK_IDX_SEARCH_FORWARD = 0x1D, CEC_DECK_IDX_SEARCH_REVERSE = 0x1E, CEC_DECK_OTHER_STATUS = 0x1F } CEC_DECK_INFO_T; /** * Deck control mode for */ typedef enum { CEC_DECK_CTRL_FORWARD = 1, CEC_DECK_CTRL_BACKWARD = 2, CEC_DECK_CTRL_STOP = 3, CEC_DECK_CTRL_EJECT = 4 } CEC_DECK_CTRL_MODE_T; /** * Play mode for */ typedef enum { CEC_PLAY_FORWARD = 0x24, CEC_PLAY_REVERSE = 0x20, CEC_PLAY_STILL = 0x25, CEC_PLAY_SCAN_FORWARD_MIN_SPEED = 0x05, CEC_PLAY_SCAN_FORWARD_MED_SPEED = 0x06, CEC_PLAY_SCAN_FORWARD_MAX_SPEED = 0x07, CEC_PLAY_SCAN_REVERSE_MIN_SPEED = 0x09, CEC_PLAY_SCAN_REVERSE_MED_SPEED = 0x0A, CEC_PLAY_SCAN_REVERSE_MAX_SPEED = 0x0B, CEC_PLAY_SLOW_FORWARD_MIN_SPEED = 0x15, CEC_PLAY_SLOW_FORWARD_MED_SPEED = 0x16, CEC_PLAY_SLOW_FORWARD_MAX_SPEED = 0x17, CEC_PLAY_SLOW_REVERSE_MIN_SPEED = 0x19, CEC_PLAY_SLOW_REVERSE_MED_SPEED = 0x1A, CEC_PLAY_SLOW_REVERSE_MAX_SPEED = 0x1B } CEC_PLAY_MODE_T; /** * Status request for */ typedef enum { CEC_DECK_STATUS_ON = 1, CEC_DECK_STATUS_OFF = 2, CEC_DECK_STATUS_ONCE = 3 } CEC_DECK_STATUS_REQUEST_T; /** * Button code for */ typedef enum { CEC_User_Control_Select = 0x00, CEC_User_Control_Up = 0x01, CEC_User_Control_Down = 0x02, CEC_User_Control_Left = 0x03, CEC_User_Control_Right = 0x04, CEC_User_Control_RightUp = 0x05, CEC_User_Control_RightDown = 0x06, CEC_User_Control_LeftUp = 0x07, CEC_User_Control_LeftDown = 0x08, CEC_User_Control_RootMenu = 0x09, CEC_User_Control_SetupMenu = 0x0A, CEC_User_Control_ContentsMenu = 0x0B, CEC_User_Control_FavoriteMenu = 0x0C, CEC_User_Control_Exit = 0x0D, CEC_User_Control_Number0 = 0x20, CEC_User_Control_Number1 = 0x21, CEC_User_Control_Number2 = 0x22, CEC_User_Control_Number3 = 0x23, CEC_User_Control_Number4 = 0x24, CEC_User_Control_Number5 = 0x25, CEC_User_Control_Number6 = 0x26, CEC_User_Control_Number7 = 0x27, CEC_User_Control_Number8 = 0x28, CEC_User_Control_Number9 = 0x29, CEC_User_Control_Dot = 0x2A, CEC_User_Control_Enter = 0x2B, CEC_User_Control_Clear = 0x2C, CEC_User_Control_ChannelUp = 0x30, CEC_User_Control_ChannelDown = 0x31, CEC_User_Control_PreviousChannel = 0x32, CEC_User_Control_SoundSelect = 0x33, CEC_User_Control_InputSelect = 0x34, CEC_User_Control_DisplayInformation = 0x35, CEC_User_Control_Help = 0x36, CEC_User_Control_PageUp = 0x37, CEC_User_Control_PageDown = 0x38, CEC_User_Control_Power = 0x40, CEC_User_Control_VolumeUp = 0x41, CEC_User_Control_VolumeDown = 0x42, CEC_User_Control_Mute = 0x43, CEC_User_Control_Play = 0x44, CEC_User_Control_Stop = 0x45, CEC_User_Control_Pause = 0x46, CEC_User_Control_Record = 0x47, CEC_User_Control_Rewind = 0x48, CEC_User_Control_FastForward = 0x49, CEC_User_Control_Eject = 0x4A, CEC_User_Control_Forward = 0x4B, CEC_User_Control_Backward = 0x4C, CEC_User_Control_Angle = 0x50, CEC_User_Control_Subpicture = 0x51, CEC_User_Control_VideoOnDemand = 0x52, CEC_User_Control_EPG = 0x53, CEC_User_Control_TimerProgramming = 0x54, CEC_User_Control_InitialConfig = 0x55, CEC_User_Control_PlayFunction = 0x60, CEC_User_Control_PausePlayFunction = 0x61, CEC_User_Control_RecordFunction = 0x62, CEC_User_Control_PauseRecordFunction = 0x63, CEC_User_Control_StopFunction = 0x64, CEC_User_Control_MuteFunction = 0x65, CEC_User_Control_RestoreVolumeFunction = 0x66, CEC_User_Control_TuneFunction = 0x67, CEC_User_Control_SelectDiskFunction = 0x68, CEC_User_Control_SelectAVInputFunction = 0x69, CEC_User_Control_SelectAudioInputFunction = 0x6A, CEC_User_Control_F1Blue = 0x71, CEC_User_Control_F2Red = 0x72, CEC_User_Control_F3Green = 0x73, CEC_User_Control_F4Yellow = 0x74, CEC_User_Control_F5 = 0x75 } CEC_USER_CONTROL_T; /** *CEC topology struct (now deprecated) * * Meaning of device_attr is as follows (one per active logical device) * bit 3-0 logical address (see CEC_AllDevices_T above) * bit 7-4 device type (see CEC_DEVICE_TYPE_T above) * bit 11-8 index to upstream device * bit 15-12 number of downstream device * bit 31-16 index of first 4 downstream devices * * To keep life simple we only show the first 4 connected downstream devices * */ typedef struct { uint16_t active_mask; /** */ VC_CEC_BUTTON_RELEASE = (1 << 3), /**< */ VC_CEC_REMOTE_PRESSED = (1 << 4), /**< */ VC_CEC_REMOTE_RELEASE = (1 << 5), /**< */ VC_CEC_LOGICAL_ADDR = (1 << 6), /** and messages respectively) * returns the code from the most recent respectively. * The host application will need to find out the vendor ID of the initiator * separately in the case if / commands were received. * will not be longer than 6 bytes (including header) * * VC_CEC_LOGICAL_ADDR returns 0xF in param1 whenever no logical address is in used. If physical address is 0xFFFF, * this means CEC is being disabled. Otherwise physical address is the one read from EDID (and no suitable logical address * is avaiable to be allocated). Host application should only attempt to send message if both param1 is not 0xF AND param2 * is not 0xFFFF. * * VC_CEC_TOPOLOGY returns a 16-bit mask in param1 where bit n is set if logical address n is present. Host application * must explicitly retrieve the entire topology if it wants to know how devices are connected. The bit mask includes our * own logical address. * * If CEC is running in passive mode, the host will get a VC_CEC_LOGICAL_ADDR_LOST callback if the logical address is * lost (e.g. HDMI mode change). In this case the host should try a new logical address. The physical address returned may * also change, so the host should check this. */ /** * General callback function for notifications from CEC middleware (and CEC service) * * @param client_p is the callback context passed in by user * * @param reason is the notification nature (plus message lengths, return code, etc.) * * @param param1 is the first parameter of notification (see above) * * @param param2 is the second parameter of notification (see above) * * @param param3 is the third parameter of notification (see above) * * @param param4 is the fourth parameter of notification (see above) * * @return void */ typedef void (*CEC_CALLBACK_T)(void *client_p, uint32_t reason, uint32_t param1, uint32_t param2, uint32_t param3, uint32_t param4); /** * Some macros to get some fields from the callback parameters in CEC callback */ //Marcos operating on reason #define CEC_CB_REASON(x) ((x) & 0xFFFF) /** Get callback reason */ #define CEC_CB_MSG_LENGTH(x) (((x) >> 16) & 0xFF) /** Get callback parameter length (this includes the header byte) */ #define CEC_CB_RC(x) (((x) >> 24) & 0xFF) /** Get return value (only for TX callbacks for the moment) */ //Macros operating on param1 #define CEC_CB_INITIATOR(x) (((x) >> 4) & 0xF) /** Get the initiator from first parameter */ #define CEC_CB_FOLLOWER(x) ((x) & 0xF) /** Get the follower from first parameter */ #define CEC_CB_OPCODE(x) (((x) >> 8) & 0xFF) /** Get the opcode from first parameter */ #define CEC_CB_OPERAND1(x) (((x) >> 16) & 0xFF) /** Get the button code from or the first operand of the opcode */ #define CEC_CB_OPERAND2(x) (((x) >> 24) & 0xFF) /** Get the second operand of opcode */ //CEC service return code typedef enum { VC_CEC_SUCCESS = 0, /** OK */ VC_CEC_ERROR_NO_ACK = 1, /** No acknowledgement */ VC_CEC_ERROR_SHUTDOWN = 2, /** In the process of shutting down */ VC_CEC_ERROR_BUSY = 3, /** block is busy */ VC_CEC_ERROR_NO_LA = 4, /** No logical address */ VC_CEC_ERROR_NO_PA = 5, /** No physical address */ VC_CEC_ERROR_NO_TOPO = 6, /** No topology */ VC_CEC_ERROR_INVALID_FOLLOWER = 7, /** Invalid follower */ VC_CEC_ERROR_INVALID_ARGUMENT = 8 /** Invalid arguments */ } VC_CEC_ERROR_T; #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_cecservice.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * CEC service host API, * See vc_cec.h and vc_cecservice_defs.h for related constants */ #ifndef _VC_CECSERVICE_H_ #define _VC_CECSERVICE_H_ #include "vcinclude/common.h" #include "interface/vcos/vcos.h" #include "interface/vchi/vchi.h" #include "interface/vmcs_host/vc_cecservice_defs.h" #include "interface/vmcs_host/vc_cec.h" /** * \file * This API defines the controls for CEC. HDMI must be powered on before * CEC is available (subject to CEC support in TV). * * In general, a zero return value indicates success; a negative return * value indicates error in VCHI layer; a positive return value indicates * alternative return value from the server */ /** * Callback function for host side notification * This is the SAME as the callback function type defined in vc_cec.h * Host applications register a single callback for all CEC related notifications. * See vc_cec.h for meanings of all parameters * * @param callback_data is the context passed in by user in vc_cec_register_callback * * @param reason bits 15-0 is VC_CEC_NOTIFY_T in vc_cec.h; * bits 23-16 is the valid length of message in param1 to param4 (LSB of param1 is the byte0, MSB of param4 is byte15), little endian * bits 31-24 is the return code (if any) * * @param param1 is the first parameter * * @param param2 is the second parameter * * @param param3 is the third parameter * * @param param4 is the fourth parameter * * @return void */ typedef void (*CECSERVICE_CALLBACK_T)(void *callback_data, uint32_t reason, uint32_t param1, uint32_t param2, uint32_t param3, uint32_t param4); //API at application start time /** * Call vc_vchi_cec_init to initialise the CEC service for use. * * @param initialise_instance is the VCHI instance * @param connections are array of pointers to VCHI connections * @param num_connections is the number of connections in array * @return void **********************************************************/ VCHPRE_ void vc_vchi_cec_init(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections ); /** * Call vc_vchi_cec_stop to stop host side CEC service. * * @param none * @return void **********************************************************/ VCHPRE_ void vc_vchi_cec_stop( void ); /** * Host applications use vc_cec_register_callaback to register * callback to handle all CEC notifications. If more than one applications * need to use CEC, there should be ONE central application which acts on * behalf of all clients and handles all communications with CEC services. * * @param callback function * @param context to be passed when function is called * @return void ***********************************************************/ VCHPRE_ void vc_cec_register_callback(CECSERVICE_CALLBACK_T callback, void *callback_data); //Service API /** * This function is now deprecated. Commands are always forwarded. * * vc_cec_register_command * * @param opcode to be registered. * * @return zero if the command is successful, non-zero otherwise ***********************************************************/ VCHPRE_ int VCOS_DEPRECATED("has no effect") VCHPOST_ vc_cec_register_command(CEC_OPCODE_T opcode); /** * This function is now deprecated. Commands are always forwarded. * * vc_cec_register_all * * @param None * * @return zero if the command is successful, non-zero otherwise ***********************************************************/ VCHPRE_ int VCOS_DEPRECATED("has no effect") VCHPOST_ vc_cec_register_all( void ); /** * Use vc_cec_deregister_command to remove an opcode from * the filter for forwarding. By default is always forwarded. * The following opcode cannot be deregistered: * , , * , , * and . * * @param opcode to be deregistered * * @return zero if the command is successful, non-zero otherwise ***********************************************************/ VCHPRE_ int VCOS_DEPRECATED("has no effect") VCHPOST_ vc_cec_deregister_command(CEC_OPCODE_T opcode); /** * This function is now deprecated. Commands are always forwarded. * * vc_cec_deregister_all * * @param None * * @return zero if the command is successful, non-zero otherwise ***********************************************************/ VCHPRE_ int VCOS_DEPRECATED("has no effect") VCHPOST_ vc_cec_deregister_all(void); /** * vc_cec_send_message allows a host application to * send a CEC message to another device. There are several * built-in functions for sending command messages. The host * application MUST have a valid logical address (between 1 and * 14 inclusive) before it can send a message. * (For poll message set payload to NULL and length to zero). * * @param Follower's logical address * * @param Message payload WITHOUT the header byte (can be NULL) * * @param Payload length WITHOUT the header byte (can be zero) * * @param VC_TRUE if the message is a reply to an incoming message * * @return zero if the command is successful, non-zero otherwise * If the command is successful, there will be a Tx callback * in due course to indicate whether the message has been * acknowledged by the recipient or not ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_send_message(const uint32_t follower, const uint8_t *payload, uint32_t length, vcos_bool_t is_reply); /** * vc_cec_get_logical_address gets the logical address, * If one is being allocated 0xF (unregistered) will be set. * A address value of 0xF also means CEC system is not yet ready * to send or receive any messages. * * @param pointer to logical address (set to allocated address) * * @return zero if the command is successful, non-zero otherwise * logical_address is not modified if command failed ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_get_logical_address(CEC_AllDevices_T *logical_address); /** * vc_cec_alloc_logical_address starts the allocation * of a logical address. Logical address is automatically allocated * after HDMI power on is complete and AV mute is deassert. * The host only needs to call this if the * initial allocation failed (logical address being 0xF and * physical address is NOT 0xFFFF from VC_CEC_LOGICAL_ADDR * notification), or if the host explicitly released its logical * address. * * @param none * * @return zero if the command is successful, non-zero otherwise * If successful, there will be a callback notification * VC_CEC_LOGICAL_ADDR. * The host should wait for this before calling this * function again. ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_alloc_logical_address( void ); /** * Use vc_cec_release_logical_address to clear * the set logical address. Logical address will be reset * back to 15 (unregistered) internally. No direct inbound * messages will be acknowledged. Host must call * vc_cec_set_logical_address with a valid logical address * again before attempting to send any more messages. * * @param none * * @return zero if the command is successful, non-zero otherwise * The host should get a callback reason * VC_CEC_LOGICAL_ADDR with 0xF being the * logical address and the current physical address. ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_release_logical_address( void ); /** * This function is now deprecated. Topology is always * returned as a zeroed block of data. * * Use vc_cec_get_topology to get the topology. * * @param pointer to VC_CEC_TOPOLOGY_T * * @return zero if the command is successful, non-zero otherwise * ***********************************************************/ VCHPRE_ int VCOS_DEPRECATED("returns invalid result") VCHPOST_ vc_cec_get_topology( VC_CEC_TOPOLOGY_T* topology); /** * Use vc_cec_set_vendor_id to * set the response to * * @param 24-bit IEEE vendor id * * @return zero if the command is successful, non-zero otherwise ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_set_vendor_id( const uint32_t id ); /** * Use vc_cec_set_osd_name to * set the response to * * @param OSD name (14 byte char array) * * @return zero if the command is successful, non-zero otherwise ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_set_osd_name( const char* name ); /** * vc_cec_get_physical_address gets our physical address * * @param pointer to physical address (returned as 16-bit packed value) * * @return zero if the command is successful, non-zero otherwise * If failed, physical address argument will not be changed * A physical address of 0xFFFF means CEC is not supported ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_get_physical_address(uint16_t *physical_address); /** * vc_cec_get_vendor_id( gets the vendor id of a particular logical address * * @param logical_address is the logical address of the device [in] * * @param vendorid is the pointer to vendor ID (24-bit IEEE OUI value) [out] * * @return zero if the command is successful, non-zero otherwise * If failed, vendor id argument will not be changed * A vendor ID of 0xFFFFFF means the device does not exist * A vendor ID of 0x0 means vendor ID is not known and * the application can send to that device ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_get_vendor_id(const CEC_AllDevices_T logical_address, uint32_t *vendor_id); /** * vc_cec_device_type( returns the default device type of a particular * logical address, which can be used as the argument to vc_cec_send_ReportPhysicalAddress. * * @param logical address * * @return the default device type, if there is any error, the return device * type will be CEC_DeviceType_Invalid * ************************************************************/ VCHPRE_ CEC_DEVICE_TYPE_T VCHPOST_ vc_cec_device_type(const CEC_AllDevices_T logical_address); /** * These couple of functions are provided for host application's convenience: * If the xmit message is encapsulate in a VC_CEC_MESSAGE_T * then it can be sent as a normal message (not as a reply) * and the initiator field is ignored with vc_cec_send_message2 * and return zero for success * * Applications can call vc_cec_param2message to turn the callback parameters * into a VC_CEC_MESSAGE_T (not for LOGICAL_ADDR callbacks). * It also returns zero for success. */ VCHPRE_ int VCHPOST_ vc_cec_send_message2(const VC_CEC_MESSAGE_T *message); VCHPRE_ int VCHPOST_ vc_cec_param2message( const uint32_t reason, const uint32_t param1, const uint32_t param2, const uint32_t param3, const uint32_t param4, VC_CEC_MESSAGE_T *message); //Extra API if CEC is running in passive mode //If CEC is not in passive mode the following 3 functions always //return failure /** * vc_cec_poll_address sets and polls a particular address to find out * its availability in the CEC network. Only available when CEC is running in passive * mode. The host can only call this function during logical address allocation stage. * * @param logical address to try * * @return 0 if poll is successful (address is occupied) * >0 if poll is unsuccessful (Error code is in VC_CEC_ERROR_T in vc_cec.h) * <0 VCHI errors */ VCHPRE_ int VCHPOST_ vc_cec_poll_address(const CEC_AllDevices_T logical_address); /** * vc_cec_set_logical_address sets the logical address, device type * and vendor ID to be in use. Only available when CEC is running in passive * mode. It is the responsibility of the host to make sure the logical address * is actually free to be used. Physical address will be what is read from EDID. * * @param logical address * * @param device type * * @param vendor ID * * @return 0 if successful, non-zero otherwise */ VCHPRE_ int VCHPOST_ vc_cec_set_logical_address(const CEC_AllDevices_T logical_address, const CEC_DEVICE_TYPE_T device_type, const uint32_t vendor_id); /** * This function is now deprecated and has no effect. * * vc_cec_add_device * * @return 0 if successful, non-zero otherwise */ VCHPRE_ int VCOS_DEPRECATED("has no effect") VCHPOST_ vc_cec_add_device(const CEC_AllDevices_T logical_address, const uint16_t physical_address, const CEC_DEVICE_TYPE_T device_type, vcos_bool_t last_device); /** * vc_cec_set_passive enables and disables passive mode. * Call this function first (with VC_TRUE as the argument) to enable * passive mode before calling any of the above passive API functions * * @param TRUE to enable passive mode, FALSE to disable * * @return 0 if successful, non-zero otherwise */ VCHPRE_ int VCHPOST_ vc_cec_set_passive(vcos_bool_t enabled); //API for some common CEC messages /** * Functions beginning with vc_cec_send_xxx make it easier for the * host application to send CEC message xxx to other devices */ /** * vc_cec_send_FeatureAbort sends * for a received command. * * @param follower (cannot be 0xF) * * @param rejected opcode * * @param reject reason CEC_ABORT_REASON_T * * @return zero if the command is successful, non-zero otherwise * Tx callback if successful ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_send_FeatureAbort(uint32_t follower, CEC_OPCODE_T opcode, CEC_ABORT_REASON_T reason); /** * vc_cec_send_ActiveSource broadcasts * to all devices * * @param physical address (16-bit packed) * * @param reply or not (normally not) * * @return zero if the command is successful, non-zero otherwise * Tx callback if successful ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_send_ActiveSource(uint16_t physical_address, vcos_bool_t is_reply); /** * vc_cec_send_ImageViewOn sends * * @param follower * * @param reply or not (normally not) * * @return zero if the command is successful, non-zero otherwise * Tx callback if successful ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_send_ImageViewOn(uint32_t follower, vcos_bool_t is_reply); /** * vc_cec_send_SetOSDString sends * * @param follower * * @param string (char[13]) * * @param display control CEC_DISPLAY_CONTROL_T * * @param reply or not (normally not) * * @return zero if the command is successful, non-zero otherwise * Tx callback if successful ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_send_SetOSDString(uint32_t follower, CEC_DISPLAY_CONTROL_T disp_ctrl, const char* string, vcos_bool_t is_reply); /** * vc_cec_send_Standby sends . * This will put any/all devices to standby if they support * this CEC message. * * @param follower (can be 0xF) * * @param reply or not (normally not) * * @return zero if the command is successful, non-zero otherwise * Tx callback if successful ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_send_Standby(uint32_t follower, vcos_bool_t is_reply); /** * vc_cec_send_MenuStatus sends * (response to ) * * @param follower * * @param menu state CEC_MENU_STATE_T but NOT CEC_MENU_STATE_QUERY * * @param reply or not (should always be yes) * * @return zero if the command is successful, non-zero otherwise * Tx callback if successful ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_send_MenuStatus(uint32_t follower, CEC_MENU_STATE_T menu_state, vcos_bool_t is_reply); /** * vc_cec_send_ReportPhysicalAddress broadcasts * to all devices. Note although * the passed in device type can be override the default one * associated the allocated logical address, it is not * recommended to do so. One can use vc_cec_device_type * to get the default device type associated with the logical * address returned via VC_CEC_LOGICAL_ADDR callback. * * @param physical address (16-bit packed) * * @param device type to be broadcasted * * @param reply or not (normally not) * * @return zero if the command is successful, non-zero otherwise * Tx callback if successful ***********************************************************/ VCHPRE_ int VCHPOST_ vc_cec_send_ReportPhysicalAddress(uint16_t physical_address, CEC_DEVICE_TYPE_T device_type, vcos_bool_t is_reply); #endif //_VC_CECSERVICE_H_ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_cecservice_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * CEC service command enumeration and parameter types. */ /** * \file * This file contains definition shared by host side and * Videocore side CEC service: * * In general, a zero return value indicates success of the function * A non-zero value indicates VCHI error * A positive value indicates alternative return value (for some functions). * */ #ifndef _VC_CECSERVICE_DEFS_H_ #define _VC_CECSERVICE_DEFS_H_ #include "vcinclude/common.h" #include "interface/vcos/vcos.h" #include "interface/vcos/vcos_logging.h" #include "interface/vchi/message_drivers/message.h" //CEC VCOS logging stuff #define CECHOST_LOG_CATEGORY (&cechost_log_category) #define vc_cec_log_trace(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_TRACE, __VA_ARGS__) #define vc_cec_log_warn(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_WARN, __VA_ARGS__) #define vc_cec_log_error(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_ERROR, __VA_ARGS__) #define vc_cec_log_info(...) _VCOS_LOG_X(CECHOST_LOG_CATEGORY, VCOS_LOG_INFO, __VA_ARGS__) extern VCOS_LOG_CAT_T cechost_log_category; //The actual object lives in CEC host side service code #define VC_CECSERVICE_VER 1 #define CECSERVICE_MSGFIFO_SIZE 1024 #define CECSERVICE_CLIENT_NAME MAKE_FOURCC("CECS") #define CECSERVICE_NOTIFY_NAME MAKE_FOURCC("CECN") //CEC service commands typedef enum { VC_CEC_REGISTER_CMD = 0, VC_CEC_REGISTER_ALL, VC_CEC_DEREGISTER_CMD, VC_CEC_DEREGISTER_ALL, VC_CEC_SEND_MSG, VC_CEC_GET_LOGICAL_ADDR, VC_CEC_ALLOC_LOGICAL_ADDR, VC_CEC_RELEASE_LOGICAL_ADDR, VC_CEC_GET_TOPOLOGY, VC_CEC_SET_VENDOR_ID, VC_CEC_SET_OSD_NAME, VC_CEC_GET_PHYSICAL_ADDR, VC_CEC_GET_VENDOR_ID, //The following 3 commands are used when CEC middleware is //running in passive mode (i.e. it does not allocate //logical address automatically) VC_CEC_POLL_ADDR, VC_CEC_SET_LOGICAL_ADDR, VC_CEC_ADD_DEVICE, VC_CEC_SET_PASSIVE, //Add more commands here VC_CEC_END_OF_LIST } VC_CEC_CMD_CODE_T; //See vc_cec.h for details //REGISTER_CMD //Parameters: opcode to register (CEC_OPCODE_T sent as uint32) //Reply: none //REGISTER_ALL //Parameters: none //Reply: none //DEREGISTER_CMD //Parameters: opcode to deregister (CEC_OPCODE_T sent as uint32) //Reply: none //DEREGISTER_ALL //Parameters: none //Reply: none //SEND_MSG //Parameters: destination, length, 16 bytes buffer (message can only be at most 15 bytes however) //Reply: none (callback) typedef struct { uint32_t follower; uint32_t length; uint8_t payload[16]; //max. 15 bytes padded to 16 uint32_t is_reply; //non-zero if this is a reply, zero otherwise } CEC_SEND_MSG_PARAM_T; //GET_LOGICAL_ADDR //Parameters: none //Reply: logical address (uint8 returned as uint32) //ALLOC_LOGICAL_ADDR //Parameters: none //Reply: none (callback) //GET_TOPOLOGY //Parameters: none //Reply: topology (see VC_TOPOLOGY_T) //SET_VENDOR_ID //Parameters: vendor id (uint32) //Reply: none //Set OSD name //Parameters: 14 byte char //Reply: none #define OSD_NAME_LENGTH 14 //GET_PHYSICAL_ADDR //Parameter: none //Reply: packed physical address returned as uint16 //GET_VENDOR_ID //Parameter: logical address (CEC_AllDevices_T sent as uint32_t) //Reply: (uint32_t vendor id) //POLL_LOGICAL_ADDR (only for passive mode) //Used by host to test a logical address to see if it is available for use //Only available if CEC is compiled in passive mode and while the host //is testing the availability of a logical address //Parameter: logical address //Reply: //SET_LOGICAL_ADDR [(only for passive mode) This will be changed when we support multiple logical addresses] //Set the logical address used //Only available if CEC is compiled in passive mode //Parameter: logical address, device type, vendor ID //Reply: (int32_t - zero means success, non-zero otherwise) //This function will result in a VC_CEC_LOGICAL_ADDR callback typedef struct { uint32_t logical_address; uint32_t device_type; uint32_t vendor_id; } CEC_SET_LOGICAL_ADDR_PARAM_T; //ADD_DEVICE (only for passive mode) //Only available if CEC is compiled in passive mode //Parameter: logical address, physical address, device type, last device? //Reply: (int32_t - zero means success, non-zero otherwise) typedef struct { uint32_t logical_address; /** #define VC_CMA_IOC_MAGIC 0xc5 #define VC_CMA_IOC_RESERVE _IO(VC_CMA_IOC_MAGIC, 0) #endif #define VC_CMA_FOURCC VCHIQ_MAKE_FOURCC('C','M','A',' ') #define VC_CMA_VERSION 2 #define VC_CMA_CHUNK_ORDER 6 /* 256K */ #define VC_CMA_CHUNK_SIZE (4096 << VC_CMA_CHUNK_ORDER) #define VC_CMA_MAX_PARAMS_PER_MSG ((VCHIQ_MAX_MSG_SIZE - sizeof(unsigned short)) / sizeof(unsigned short)) enum { VC_CMA_MSG_QUIT, VC_CMA_MSG_OPEN, VC_CMA_MSG_TICK, VC_CMA_MSG_ALLOC, /* chunk count */ VC_CMA_MSG_FREE, /* chunk, chunk, ... */ VC_CMA_MSG_ALLOCATED, /* chunk, chunk, ... */ VC_CMA_MSG_REQUEST_ALLOC, /* chunk count */ VC_CMA_MSG_REQUEST_FREE, /* chunk count */ VC_CMA_MSG_RESERVE, /* bytes lo, bytes hi */ VC_CMA_MSG_MAX }; typedef struct vc_cma_msg_struct { unsigned short type; unsigned short params[VC_CMA_MAX_PARAMS_PER_MSG]; } VC_CMA_MSG_T; #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_dispmanx.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Display manager service API #ifndef _VC_DISPMANX_H_ #define _VC_DISPMANX_H_ #include "interface/vcos/vcos.h" #include "interface/vctypes/vc_image_types.h" #include "vc_dispservice_x_defs.h" #include "interface/vmcs_host/vc_dispmanx_types.h" #include "interface/vchi/vchi.h" #ifdef __cplusplus extern "C" { #endif // Same function as above, to aid migration of code. VCHPRE_ int VCHPOST_ vc_dispman_init( void ); // Stop the service from being used VCHPRE_ void VCHPOST_ vc_dispmanx_stop( void ); // Set the entries in the rect structure VCHPRE_ int VCHPOST_ vc_dispmanx_rect_set( VC_RECT_T *rect, uint32_t x_offset, uint32_t y_offset, uint32_t width, uint32_t height ); // Resources // Create a new resource VCHPRE_ DISPMANX_RESOURCE_HANDLE_T VCHPOST_ vc_dispmanx_resource_create( VC_IMAGE_TYPE_T type, uint32_t width, uint32_t height, uint32_t *native_image_handle ); // Write the bitmap data to VideoCore memory VCHPRE_ int VCHPOST_ vc_dispmanx_resource_write_data( DISPMANX_RESOURCE_HANDLE_T res, VC_IMAGE_TYPE_T src_type, int src_pitch, void * src_address, const VC_RECT_T * rect ); VCHPRE_ int VCHPOST_ vc_dispmanx_resource_write_data_handle( DISPMANX_RESOURCE_HANDLE_T res, VC_IMAGE_TYPE_T src_type, int src_pitch, VCHI_MEM_HANDLE_T handle, uint32_t offset, const VC_RECT_T * rect ); VCHPRE_ int VCHPOST_ vc_dispmanx_resource_read_data( DISPMANX_RESOURCE_HANDLE_T handle, const VC_RECT_T* p_rect, void * dst_address, uint32_t dst_pitch ); // Delete a resource VCHPRE_ int VCHPOST_ vc_dispmanx_resource_delete( DISPMANX_RESOURCE_HANDLE_T res ); // Displays // Opens a display on the given device VCHPRE_ DISPMANX_DISPLAY_HANDLE_T VCHPOST_ vc_dispmanx_display_open( uint32_t device ); // Opens a display on the given device in the request mode VCHPRE_ DISPMANX_DISPLAY_HANDLE_T VCHPOST_ vc_dispmanx_display_open_mode( uint32_t device, uint32_t mode ); // Open an offscreen display VCHPRE_ DISPMANX_DISPLAY_HANDLE_T VCHPOST_ vc_dispmanx_display_open_offscreen( DISPMANX_RESOURCE_HANDLE_T dest, DISPMANX_TRANSFORM_T orientation ); // Change the mode of a display VCHPRE_ int VCHPOST_ vc_dispmanx_display_reconfigure( DISPMANX_DISPLAY_HANDLE_T display, uint32_t mode ); // Sets the desstination of the display to be the given resource VCHPRE_ int VCHPOST_ vc_dispmanx_display_set_destination( DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_RESOURCE_HANDLE_T dest ); // Set the background colour of the display VCHPRE_ int VCHPOST_ vc_dispmanx_display_set_background( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_DISPLAY_HANDLE_T display, uint8_t red, uint8_t green, uint8_t blue ); // get the width, height, frame rate and aspect ratio of the display VCHPRE_ int VCHPOST_ vc_dispmanx_display_get_info( DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_MODEINFO_T * pinfo ); // Closes a display VCHPRE_ int VCHPOST_ vc_dispmanx_display_close( DISPMANX_DISPLAY_HANDLE_T display ); // Updates // Start a new update, DISPMANX_NO_HANDLE on error VCHPRE_ DISPMANX_UPDATE_HANDLE_T VCHPOST_ vc_dispmanx_update_start( int32_t priority ); // Add an elment to a display as part of an update VCHPRE_ DISPMANX_ELEMENT_HANDLE_T VCHPOST_ vc_dispmanx_element_add ( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_DISPLAY_HANDLE_T display, int32_t layer, const VC_RECT_T *dest_rect, DISPMANX_RESOURCE_HANDLE_T src, const VC_RECT_T *src_rect, DISPMANX_PROTECTION_T protection, VC_DISPMANX_ALPHA_T *alpha, DISPMANX_CLAMP_T *clamp, DISPMANX_TRANSFORM_T transform ); // Change the source image of a display element VCHPRE_ int VCHPOST_ vc_dispmanx_element_change_source( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element, DISPMANX_RESOURCE_HANDLE_T src ); // Change the layer number of a display element VCHPRE_ int VCHPOST_ vc_dispmanx_element_change_layer ( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element, int32_t layer ); // Signal that a region of the bitmap has been modified VCHPRE_ int VCHPOST_ vc_dispmanx_element_modified( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element, const VC_RECT_T * rect ); // Remove a display element from its display VCHPRE_ int VCHPOST_ vc_dispmanx_element_remove( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element ); // Ends an update VCHPRE_ int VCHPOST_ vc_dispmanx_update_submit( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_CALLBACK_FUNC_T cb_func, void *cb_arg ); // End an update and wait for it to complete VCHPRE_ int VCHPOST_ vc_dispmanx_update_submit_sync( DISPMANX_UPDATE_HANDLE_T update ); // Query the image formats supported in the VMCS build VCHPRE_ int VCHPOST_ vc_dispmanx_query_image_formats( uint32_t *supported_formats ); //New function added to VCHI to change attributes, set_opacity does not work there. VCHPRE_ int VCHPOST_ vc_dispmanx_element_change_attributes( DISPMANX_UPDATE_HANDLE_T update, DISPMANX_ELEMENT_HANDLE_T element, uint32_t change_flags, int32_t layer, uint8_t opacity, const VC_RECT_T *dest_rect, const VC_RECT_T *src_rect, DISPMANX_RESOURCE_HANDLE_T mask, DISPMANX_TRANSFORM_T transform ); //xxx hack to get the image pointer from a resource handle, will be obsolete real soon VCHPRE_ uint32_t VCHPOST_ vc_dispmanx_resource_get_image_handle( DISPMANX_RESOURCE_HANDLE_T res); //Call this instead of vc_dispman_init VCHPRE_ void VCHPOST_ vc_vchi_dispmanx_init (VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections ); // Take a snapshot of a display in its current state. // This call may block for a time; when it completes, the snapshot is ready. // only transform=0 is supported VCHPRE_ int VCHPOST_ vc_dispmanx_snapshot( DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_RESOURCE_HANDLE_T snapshot_resource, DISPMANX_TRANSFORM_T transform ); // Set the resource palette (for VC_IMAGE_4BPP and VC_IMAGE_8BPP) VCHPRE_ int VCHPOST_ vc_dispmanx_resource_set_palette( DISPMANX_RESOURCE_HANDLE_T handle, void * src_address, int offset, int size); // Start triggering callbacks synced to vsync VCHPRE_ int VCHPOST_ vc_dispmanx_vsync_callback( DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_CALLBACK_FUNC_T cb_func, void *cb_arg ); #ifdef __cplusplus } #endif #endif // _VC_DISPMANX_H_ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_dispmanx_types.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Typedefs and enums for the VideoCore III Display Manager #ifndef _DISPMANX_TYPES_H #define _DISPMANX_TYPES_H #include "interface/vctypes/vc_image_types.h" #include "interface/vctypes/vc_display_types.h" #define VC_DISPMANX_VERSION 1 /* Opaque handles */ typedef uint32_t DISPMANX_DISPLAY_HANDLE_T; typedef uint32_t DISPMANX_UPDATE_HANDLE_T; typedef uint32_t DISPMANX_ELEMENT_HANDLE_T; typedef uint32_t DISPMANX_RESOURCE_HANDLE_T; typedef uint32_t DISPMANX_PROTECTION_T; #define DISPMANX_NO_HANDLE 0 #define DISPMANX_PROTECTION_MAX 0x0f #define DISPMANX_PROTECTION_NONE 0 #define DISPMANX_PROTECTION_HDCP 11 // Derived from the WM DRM levels, 101-300 /* Default display IDs. Note: if you overwrite with your own dispmanx_platform_init function, you should use IDs you provided during dispmanx_display_attach. */ #define DISPMANX_ID_MAIN_LCD 0 #define DISPMANX_ID_AUX_LCD 1 #define DISPMANX_ID_HDMI 2 #define DISPMANX_ID_SDTV 3 #define DISPMANX_ID_FORCE_LCD 4 #define DISPMANX_ID_FORCE_TV 5 #define DISPMANX_ID_FORCE_OTHER 6 /* non-default display */ /* Return codes. Nonzero ones indicate failure. */ typedef enum { DISPMANX_SUCCESS = 0, DISPMANX_INVALID = -1 /* XXX others TBA */ } DISPMANX_STATUS_T; typedef enum { /* Bottom 2 bits sets the orientation */ DISPMANX_NO_ROTATE = 0, DISPMANX_ROTATE_90 = 1, DISPMANX_ROTATE_180 = 2, DISPMANX_ROTATE_270 = 3, DISPMANX_FLIP_HRIZ = 1 << 16, DISPMANX_FLIP_VERT = 1 << 17, /* invert left/right images */ DISPMANX_STEREOSCOPIC_INVERT = 1 << 19, /* extra flags for controlling 3d duplication behaviour */ DISPMANX_STEREOSCOPIC_NONE = 0 << 20, DISPMANX_STEREOSCOPIC_MONO = 1 << 20, DISPMANX_STEREOSCOPIC_SBS = 2 << 20, DISPMANX_STEREOSCOPIC_TB = 3 << 20, DISPMANX_STEREOSCOPIC_MASK = 15 << 20, /* extra flags for controlling snapshot behaviour */ DISPMANX_SNAPSHOT_NO_YUV = 1 << 24, DISPMANX_SNAPSHOT_NO_RGB = 1 << 25, DISPMANX_SNAPSHOT_FILL = 1 << 26, DISPMANX_SNAPSHOT_SWAP_RED_BLUE = 1 << 27, DISPMANX_SNAPSHOT_PACK = 1 << 28 } DISPMANX_TRANSFORM_T; typedef enum { /* Bottom 2 bits sets the alpha mode */ DISPMANX_FLAGS_ALPHA_FROM_SOURCE = 0, DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS = 1, DISPMANX_FLAGS_ALPHA_FIXED_NON_ZERO = 2, DISPMANX_FLAGS_ALPHA_FIXED_EXCEED_0X07 = 3, DISPMANX_FLAGS_ALPHA_PREMULT = 1 << 16, DISPMANX_FLAGS_ALPHA_MIX = 1 << 17 } DISPMANX_FLAGS_ALPHA_T; typedef struct { DISPMANX_FLAGS_ALPHA_T flags; uint32_t opacity; VC_IMAGE_T *mask; } DISPMANX_ALPHA_T; typedef struct { DISPMANX_FLAGS_ALPHA_T flags; uint32_t opacity; DISPMANX_RESOURCE_HANDLE_T mask; } VC_DISPMANX_ALPHA_T; /* for use with vmcs_host */ typedef enum { DISPMANX_FLAGS_CLAMP_NONE = 0, DISPMANX_FLAGS_CLAMP_LUMA_TRANSPARENT = 1, #if __VCCOREVER__ >= 0x04000000 DISPMANX_FLAGS_CLAMP_TRANSPARENT = 2, DISPMANX_FLAGS_CLAMP_REPLACE = 3 #else DISPMANX_FLAGS_CLAMP_CHROMA_TRANSPARENT = 2, DISPMANX_FLAGS_CLAMP_TRANSPARENT = 3 #endif } DISPMANX_FLAGS_CLAMP_T; typedef enum { DISPMANX_FLAGS_KEYMASK_OVERRIDE = 1, DISPMANX_FLAGS_KEYMASK_SMOOTH = 1 << 1, DISPMANX_FLAGS_KEYMASK_CR_INV = 1 << 2, DISPMANX_FLAGS_KEYMASK_CB_INV = 1 << 3, DISPMANX_FLAGS_KEYMASK_YY_INV = 1 << 4 } DISPMANX_FLAGS_KEYMASK_T; typedef union { struct { uint8_t yy_upper; uint8_t yy_lower; uint8_t cr_upper; uint8_t cr_lower; uint8_t cb_upper; uint8_t cb_lower; } yuv; struct { uint8_t red_upper; uint8_t red_lower; uint8_t blue_upper; uint8_t blue_lower; uint8_t green_upper; uint8_t green_lower; } rgb; } DISPMANX_CLAMP_KEYS_T; typedef struct { DISPMANX_FLAGS_CLAMP_T mode; DISPMANX_FLAGS_KEYMASK_T key_mask; DISPMANX_CLAMP_KEYS_T key_value; uint32_t replace_value; } DISPMANX_CLAMP_T; typedef struct { int32_t width; int32_t height; DISPMANX_TRANSFORM_T transform; DISPLAY_INPUT_FORMAT_T input_format; uint32_t display_num; } DISPMANX_MODEINFO_T; /* Update callback. */ typedef void (*DISPMANX_CALLBACK_FUNC_T)(DISPMANX_UPDATE_HANDLE_T u, void * arg); /* Progress callback */ typedef void (*DISPMANX_PROGRESS_CALLBACK_FUNC_T)(DISPMANX_UPDATE_HANDLE_T u, uint32_t line, void * arg); /* Pluggable display interface */ typedef struct tag_DISPMANX_DISPLAY_FUNCS_T { // Get essential HVS configuration to be passed to the HVS driver. Options // is any combination of the following flags: HVS_ONESHOT, HVS_FIFOREG, // HVS_FIFO32, HVS_AUTOHSTART, HVS_INTLACE; and if HVS_FIFOREG, one of; // { HVS_FMT_RGB888, HVS_FMT_RGB565, HVS_FMT_RGB666, HVS_FMT_YUV }. int32_t (*get_hvs_config)(void *instance, uint32_t *pchan, uint32_t *poptions, DISPLAY_INFO_T *info, uint32_t *bg_colour, uint32_t *test_mode); // Get optional HVS configuration for gamma tables, OLED matrix and dither controls. // Set these function pointers to NULL if the relevant features are not required. int32_t (*get_gamma_params)(void * instance, int32_t gain[3], int32_t offset[3], int32_t gamma[3]); int32_t (*get_oled_params)(void * instance, uint32_t * poffsets, uint32_t coeffs[3]); int32_t (*get_dither)(void * instance, uint32_t * dither_depth, uint32_t * dither_type); // Get mode information, which may be returned to the applications as a courtesy. // Transform should be set to 0, and {width,height} should be final dimensions. int32_t (*get_info)(void * instance, DISPMANX_MODEINFO_T * info); // Inform driver that the application refcount has become nonzero / zero // These callbacks might perhaps be used for backlight and power management. int32_t (*open)(void * instance); int32_t (*close)(void * instance); // Display list updated callback. Primarily of use to a "one-shot" display. // For convenience of the driver, we pass the register address of the HVS FIFO. void (*dlist_updated)(void * instance, volatile uint32_t * fifo_reg); // End-of-field callback. This may occur in an interrupt context. void (*eof_callback)(void * instance); // Return screen resolution format DISPLAY_INPUT_FORMAT_T (*get_input_format)(void * instance); int32_t (*suspend_resume)(void *instance, int up); DISPLAY_3D_FORMAT_T (*get_3d_format)(void * instance); } DISPMANX_DISPLAY_FUNCS_T; #endif /* ifndef _DISPMANX_TYPES_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_dispservice_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VC_DISPSERVICE_DEFS_H #define VC_DISPSERVICE_DEFS_H #define HOST_PITCH_ALIGNMENT 4 //Round up to the nearest multiple of 16 #define PAD16(x) (((x) + (VC_INTERFACE_BLOCK_SIZE-1)) & ~(VC_INTERFACE_BLOCK_SIZE-1)) //The max length for an effect name #define DISPMAN_MAX_EFFECT_NAME (28) typedef enum { // Values initially chosen to match VC_IMAGE_TYPE_T to aid debugging // This is now a mandatory constraint VC_FORMAT_RGB565 = 1, VC_FORMAT_YUV420 = 3, VC_FORMAT_RGB888 = 5, VC_FORMAT_RGBA32 = 15, VC_FORMAT_RGBA565 = 17, VC_FORMAT_RGBA16 = 18, VC_FORMAT_TF_RGBA32 = 20, VC_FORMAT_TF_RGBA16 = 23, VC_FORMAT_TF_RGB565 = 25, VC_FORMAT_BGR888 = 31, VC_FORMAT_BGR888_NP = 32, VC_FORMAT_ARGB8888 = 43, VC_FORMAT_XRGB8888 = 44, /* To force 32-bit storage, enabling use in structures over-the-wire */ VC_FORMAT_RANGE_MAX = 0x7FFFFFFF } VC_IMAGE_FORMAT_T; // Transforms. /* Image transformations. These must match the DISPMAN and Media Player versions */ #define TRANSFORM_HFLIP (1<<0) #define TRANSFORM_VFLIP (1<<1) #define TRANSFORM_TRANSPOSE (1<<2) typedef enum { VC_DISPMAN_ROT0 = 0, VC_DISPMAN_MIRROR_ROT0 = TRANSFORM_HFLIP, VC_DISPMAN_MIRROR_ROT180 = TRANSFORM_VFLIP, VC_DISPMAN_ROT180 = TRANSFORM_HFLIP|TRANSFORM_VFLIP, VC_DISPMAN_MIRROR_ROT90 = TRANSFORM_TRANSPOSE, VC_DISPMAN_ROT270 = TRANSFORM_TRANSPOSE|TRANSFORM_HFLIP, VC_DISPMAN_ROT90 = TRANSFORM_TRANSPOSE|TRANSFORM_VFLIP, VC_DISPMAN_MIRROR_ROT270 = TRANSFORM_TRANSPOSE|TRANSFORM_HFLIP|TRANSFORM_VFLIP, } VC_DISPMAN_TRANSFORM_T; typedef enum { VC_RESOURCE_TYPE_HOST, VC_RESOURCE_TYPE_VIDEOCORE, VC_RESOURCE_TYPE_VIDEOCORE_UNCACHED, } VC_RESOURCE_TYPE_T; typedef struct { uint8_t type; // VC_IMAGE_FORMAT_T uint32_t width; // width in pixels uint32_t height; // height in pixels uint32_t pitch; // pitch of image_data array in *bytes* uint32_t size; // number of *bytes* available in the image_data arry uint32_t pointer; // pointer for image_data - this allows the object to be cast to a VC_IMAGE_T on the VIDEOCORE side } VC_IMAGE_PARAM_T; typedef enum { VC_DISPMAN_DISPLAY_SET_DESTINATION = 0, VC_DISPMAN_DISPLAY_UPDATE_START, VC_DISPMAN_DISPLAY_UPDATE_END, VC_DISPMAN_DISPLAY_OBJECT_ADD, VC_DISPMAN_DISPLAY_OBJECT_REMOVE, VC_DISPMAN_DISPLAY_OBJECT_MODIFY, VC_DISPMAN_DISPLAY_LOCK, VC_DISPMAN_DISPLAY_UNLOCK, VC_DISPMAN_DISPLAY_RESOURCE_CREATE, VC_DISPMAN_DISPLAY_RESOURCE_DELETE, VC_DISPMAN_DISPLAY_GET_COMPOSITE, VC_DISPMAN_DISPLAY_APPLY_EFFECT_INSTANCE, VC_DISPMAN_DISPLAY_RECONFIGURE, VC_DISPMAN_DISPLAY_CREATE_EFFECTS_INSTANCE, VC_DISPMAN_DISPLAY_DELETE_EFFECTS_INSTANCE, VC_DISPMAN_DISPLAY_SET_EFFECT, VC_DISPMAN_DISPLAY_RESOURCE_SET_ALPHA, VC_DISPMAN_DISPLAY_SNAPSHOT, VC_DISPMAN_DISPLAY_QUERY_IMAGE_FORMATS, VC_DISPMAN_DISPLAY_GET_DISPLAY_DETAILS, // new features - add to end of list VC_DISPMAN_DISPLAY_RESOURCE_CREATE_FROM_IMAGE, VC_CMD_END_OF_LIST } VC_CMD_CODE_T; /* The table of functions executed for each command. */ typedef void (*INTERFACE_EXECUTE_FN_T)(int, int); extern INTERFACE_EXECUTE_FN_T interface_execute_fn[]; //Parameter sets for dispservice commands typedef struct { uint32_t state; uint32_t dummy[3]; //Pad to multiple of 16 bytes } DISPMAN_LOCK_PARAM_T; typedef struct { uint32_t display; uint32_t dummy[3]; //Pad to multiple of 16 bytes } DISPMAN_GET_DISPLAY_DETAILS_PARAM_T; typedef struct { uint32_t display; uint32_t resource; uint32_t dummy[2]; //Pad to multiple of 16 bytes } DISPMAN_SET_DEST_PARAM_T; typedef struct { uint32_t display; uint32_t dummy[3]; //Pad to multiple of 16 bytes } DISPMAN_GET_COMPOSITE_PARAM_T; typedef struct { uint32_t display; uint32_t effects_instance; uint32_t dummy[2]; //Pad to multiple of 16 bytes } DISPMAN_APPLY_EFFECTS_INSTANCE_PARAM_T; typedef struct { uint32_t read_response; uint32_t effects_instance; } DISPMAN_CREATE_EFFECTS_INSTANCE_RESPONSE_T; typedef struct { uint32_t effects_instance; uint32_t dummy[3]; //Pad to multiple of 16 bytes } DISPMAN_DELETE_EFFECTS_INSTANCE_PARAM_T; typedef struct { uint32_t effects_instance; char effect_name[ DISPMAN_MAX_EFFECT_NAME ]; //no need to pad as long as DISPMAN_MAX_EFFECT_NAME +sizeof(uint32) = 32 } DISPMAN_SET_EFFECT_PARAM_T; typedef struct { uint32_t display; uint16_t width; uint16_t height; uint32_t dummy[2]; //Pad to multiple of 16 bytes } DISPMAN_RECONFIGURE_PARAM_T; typedef struct { uint32_t display; uint32_t transparent_colour; uint32_t dummy[2]; //Pad to multiple of 16 bytes } DISPMAN_SET_TRANSPARENT_COLOUR_PARAM_T; typedef struct { //uint32_t object; uint32_t display; int32_t layer; uint32_t transform; uint32_t resource; uint16_t dest_x; uint16_t dest_y; uint16_t dest_width; uint16_t dest_height; uint16_t src_x; uint16_t src_y; uint16_t src_width; uint16_t src_height; } DISPMAN_OBJECT_ADD_PARAM_T; typedef struct { uint32_t object; uint32_t dummy[3]; //Pad to multiple of 16 bytes } DISPMAN_OBJECT_REMOVE_PARAM_T; typedef struct { uint32_t object; uint16_t src_x; uint16_t src_y; uint16_t width; uint16_t height; uint32_t dummy[1]; // Pad to multiple of 16 bytes } DISPMAN_OBJECT_MODIFY_PARAM_T; typedef struct { uint32_t *resource; VC_IMAGE_PARAM_T image; uint8_t type; // VC_RESOURCE_TYPE_T //Removed padding. VC_IMAGE_T may change in size, so handle the size in the code that sends and receives the commands //uint32_t dummy[3]; //Pad to multiple of 16 bytes } DISPMAN_RESOURCE_CREATE_PARAM_T; typedef struct { uint32_t native_image_ptr; uint32_t type; // VC_RESOURCE_TYPE_T uint32_t dummy[2]; // Pad to multiple of 16 bytes } DISPMAN_RESOURCE_CREATE_FROM_IMAGE_PARAM_T; typedef struct { uint32_t resource; uint32_t dummy[3]; //Pad to multiple of 16 bytes } DISPMAN_RESOURCE_DELETE_PARAM_T; typedef struct { uint32_t resource; uint32_t alpha; uint32_t dummy[2]; //Pad to multiple of 16 bytes } DISPMAN_RESOURCE_SET_ALPHA_PARAM_T; typedef struct { uint32_t display; uint32_t resource; uint32_t dummy[2]; //Pad to multiple of 16 bytes } DISPMAN_DISPLAY_SNAPSHOT_PARAM_T; #endif //VC_DISPSERVICE_DEFS_H ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_dispservice_x_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Display service command enumeration. #ifndef VC_DISPSERVICEX_DEFS_H #define VC_DISPSERVICEX_DEFS_H #include "interface/vctypes/vc_image_types.h" #define HOST_PITCH_ALIGNMENT 4 //Round up to the nearest multiple of 16 #define PAD16(x) (((x) + (VC_INTERFACE_BLOCK_SIZE-1)) & ~(VC_INTERFACE_BLOCK_SIZE-1)) //The max length for an effect name #define DISPMANX_MAX_EFFECT_NAME (28) // Should really use the VC_IMAGE_TYPE_T, but this one has been extended // to force it up to 32-bits... typedef enum { // Values initially chosen to match VC_IMAGE_TYPE_T to aid debugging // This is now a mandatory constraint VC_FORMAT_RGB565 = VC_IMAGE_RGB565, VC_FORMAT_YUV420 = VC_IMAGE_YUV420, VC_FORMAT_RGB888 = VC_IMAGE_RGB888, VC_FORMAT_RGBA32 = VC_IMAGE_RGBA32, VC_FORMAT_RGBA565 = VC_IMAGE_RGBA565, VC_FORMAT_RGBA16 = VC_IMAGE_RGBA16, VC_FORMAT_TF_RGBA32 = VC_IMAGE_TF_RGBA32, VC_FORMAT_TF_RGBA16 = VC_IMAGE_TF_RGBA16, VC_FORMAT_TF_RGB565 = VC_IMAGE_TF_RGB565, VC_FORMAT_BGR888 = VC_IMAGE_BGR888, VC_FORMAT_BGR888_NP = VC_IMAGE_BGR888_NP, VC_FORMAT_ARGB8888 = VC_IMAGE_ARGB8888, VC_FORMAT_XRGB8888 = VC_IMAGE_XRGB8888, /* To force 32-bit storage, enabling use in structures over-the-wire */ VC_FORMAT_RANGE_MAX = 0x7FFFFFFF } VC_IMAGE_FORMAT_T; // Transforms. /* Image transformations. These must match the DISPMAN and Media Player versions */ #define TRANSFORM_HFLIP (1<<0) #define TRANSFORM_VFLIP (1<<1) #define TRANSFORM_TRANSPOSE (1<<2) #define VC_DISPMAN_ROT0 VC_IMAGE_ROT0 #define VC_DISPMAN_ROT90 VC_IMAGE_ROT90 #define VC_DISPMAN_ROT180 VC_IMAGE_ROT180 #define VC_DISPMAN_ROT270 VC_IMAGE_ROT270 #define VC_DISPMAN_MIRROR_ROT0 VC_IMAGE_MIRROR_ROT0 #define VC_DISPMAN_MIRROR_ROT90 VC_IMAGE_MIRROR_ROT90 #define VC_DISPMAN_MIRROR_ROT180 VC_IMAGE_MIRROR_ROT180 #define VC_DISPMAN_MIRROR_ROT270 VC_IMAGE_MIRROR_ROT270 #define VC_DISPMAN_TRANSFORM_T VC_IMAGE_TRANSFORM_T typedef enum { VC_RESOURCE_TYPE_HOST, VC_RESOURCE_TYPE_VIDEOCORE, VC_RESOURCE_TYPE_VIDEOCORE_UNCACHED, } VC_RESOURCE_TYPE_T; typedef struct { uint8_t type; // VC_IMAGE_FORMAT_T uint32_t width; // width in pixels uint32_t height; // height in pixels uint32_t pitch; // pitch of image_data array in *bytes* uint32_t size; // number of *bytes* available in the image_data arry uint32_t pointer; // pointer for image_data - this allows the object to be cast to a VC_IMAGE_T on the VIDEOCORE side } VC_IMAGE_PARAM_T; typedef enum { VC_DISPMANX_GET_DEVICES = 0, VC_DISPMANX_GET_DEVICE_NAME, VC_DISPMANX_GET_MODES, VC_DISPMANX_GET_MODE_INFO, VC_DISPMANX_DISPLAY_QUERY_IMAGE_FORMATS, // Resources VC_DISPMANX_RESOURCE_CREATE, VC_DISPMANX_RESOURCE_WRITE_DATA, VC_DISPMANX_RESOURCE_DELETE, // Displays VC_DISPMANX_DISPLAY_OPEN, VC_DISPMANX_DISPLAY_OPEN_MODE, VC_DISPMANX_DISPLAY_OPEN_OFFSCREEN, VC_DISPMANX_DISPLAY_RECONFIGURE, VC_DISPMANX_DISPLAY_SET_DESTINATION, VC_DISPMANX_DISPLAY_SET_BACKGROUND, VC_DISPMANX_DISPLAY_GET_INFO, VC_DISPMANX_DISPLAY_CLOSE, // Updates VC_DISPMANX_UPDATE_START, VC_DISPMANX_ELEMENT_ADD, VC_DISPMANX_ELEMENT_CHANGE_SOURCE, VC_DISPMANX_ELEMENT_MODIFIED, VC_DISPMANX_ELEMENT_REMOVE, VC_DISPMANX_UPDATE_SUBMIT, VC_DISPMANX_UPDATE_SUBMIT_SYNC, // Miscellaneous VC_DISPMANX_SNAPSHOT, // new features - add to end of list VC_CMD_END_OF_LIST } VC_CMD_CODE_T; /* The table of functions executed for each command. */ typedef void (*INTERFACE_EXECUTE_FN_T)(int, int); extern INTERFACE_EXECUTE_FN_T interface_execute_fn[]; #define DISPMANX_MAX_HOST_DEVICES 8 #define DISPMANX_MAX_DEVICE_NAME_LEN 16 //Parameter sets for dispservice commands typedef struct { int32_t response; uint32_t ndevices; uint32_t dummy[2]; uint8_t names[DISPMANX_MAX_HOST_DEVICES][DISPMANX_MAX_DEVICE_NAME_LEN]; } DISPMANX_GET_DEVICES_RESP_T; typedef struct { uint32_t device; uint32_t dummy[3]; //Pad to multiple of 16 bytes } DISPMANX_GET_MODES_PARAM_T; typedef struct { uint32_t display; uint32_t mode; uint32_t dummy[2]; //Pad to multiple of 16 bytes } DISPMANX_GET_MODE_INFO_PARAM_T; typedef struct { uint32_t type; uint32_t width; uint32_t height; uint32_t dummy[1]; // Pad to multiple of 16 bytes } DISPMANX_RESOURCE_CREATE_PARAM_T; typedef struct { // This will be needed when we change to vchi. int junk; // empty structure not allowed } DISPMANX_RESOURCE_WRITE_DATA_PARAM_T; typedef struct { uint32_t handle; uint32_t dummy[3]; //Pad to multiple of 16 bytes } DISPMANX_RESOURCE_DELETE_PARAM_T; typedef struct { uint32_t device; uint32_t dummy[3]; } DISPMANX_DISPLAY_OPEN_PARAM_T; typedef struct { uint32_t device; uint32_t mode; uint32_t dummy[2]; } DISPMANX_DISPLAY_OPEN_MODE_PARAM_T; typedef struct { uint32_t dest; uint32_t orientation; uint32_t dummy[2]; } DISPMANX_DISPLAY_OPEN_OFFSCREEN_PARAM_T; typedef struct { uint32_t display; uint32_t dest; uint32_t dummy[2]; } DISPMANX_DISPLAY_SET_DESTINATION_PARAM_T; typedef struct { uint32_t display; uint32_t update; uint32_t colour; uint32_t dummy; } DISPMANX_DISPLAY_SET_BACKGROUND_PARAM_T; typedef struct { uint32_t display; uint32_t dummy[3]; } DISPMANX_DISPLAY_GET_INFO_PARAM_T; typedef struct { uint32_t read_response; int32_t width; int32_t height; int32_t aspect_pixwidth; int32_t aspect_pixheight; int32_t fieldrate_num; int32_t fieldrate_denom; int32_t fields_per_frame; uint32_t transform; uint32_t dummy[3]; } DISPMANX_DISPLAY_GET_INFO_RESP_T; typedef struct { int32_t priority; uint32_t dummy[3]; } DISPMANX_UPDATE_START_PARAM_T; typedef struct { uint32_t update; uint32_t display; int32_t layer; uint32_t transform; uint32_t src_resource; uint16_t dest_x; uint16_t dest_y; uint16_t dest_width; uint16_t dest_height; uint16_t src_x; uint16_t src_y; uint16_t src_width; uint16_t src_height; uint32_t flags; uint32_t opacity; uint32_t mask_resource; // already 16 byte aligned } DISPMANX_ELEMENT_ADD_PARAM_T; typedef struct { uint32_t update; uint32_t element; uint32_t src_resource; uint32_t dummy; // pad to 16 bytes } DISPMANX_ELEMENT_CHANGE_SOURCE_PARAM_T; typedef struct { uint32_t update; uint32_t element; uint16_t x; uint16_t y; uint16_t width; uint16_t height; } DISPMANX_ELEMENT_MODIFIED_PARAM_T; typedef struct { uint32_t update; uint32_t element; uint32_t dummy[2]; } DISPMANX_ELEMENT_REMOVE_PARAM_T; typedef struct { uint32_t update; uint32_t dummy[3]; } DISPMANX_UPDATE_SUBMIT_PARAM_T; typedef struct { uint32_t update; uint32_t dummy[3]; } DISPMANX_UPDATE_SUBMIT_SYNC_PARAM_T; typedef struct { uint32_t display; uint32_t snapshot_resource; uint32_t transform; uint32_t dummy[1]; } DISPMANX_DISPLAY_SNAPSHOT_PARAM_T; // for dispmanx #define TRANSFORM_HFLIP (1<<0) #define TRANSFORM_VFLIP (1<<1) #define TRANSFORM_TRANSPOSE (1<<2) #endif //VC_DISPSERVICEX_DEFS_H ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_fileservice_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // File service command enumeration. #ifndef VC_FILESERVICE_DEFS_H #define VC_FILESERVICE_DEFS_H #define VC_FILESERV_VER 1 /* Definitions (not used by API) */ #define FS_MAX_DATA 8192 //4096 /* Protocol (not used by API) version 1.2 */ enum { /* Over-the-wire file open flags */ VC_O_RDONLY = 0x01, VC_O_WRONLY = 0x02, VC_O_RDWR = 0x04, VC_O_APPEND = 0x08, VC_O_CREAT = 0x10, VC_O_TRUNC = 0x20, VC_O_EXCL = 0x40, /* Request Commands (VC->Host->VC) */ /* These commands don't require a pathname */ VC_FILESYS_RESET = 64, VC_FILESYS_CLOSE = 65, VC_FILESYS_CLOSEDIR = 66, VC_FILESYS_LSEEK = 67, VC_FILESYS_READ = 68, VC_FILESYS_READDIR = 69, VC_FILESYS_SETEND = 70, VC_FILESYS_WRITE = 71, /* These commands require a pathname */ VC_FILESYS_FORMAT = 72, VC_FILESYS_FREESPACE = 73, VC_FILESYS_GET_ATTR = 74, VC_FILESYS_MKDIR = 75, VC_FILESYS_OPEN = 76, VC_FILESYS_OPENDIR = 77, VC_FILESYS_REMOVE = 78, VC_FILESYS_RENAME = 79, VC_FILESYS_SET_ATTR = 80, VC_FILESYS_SCANDISK = 81, VC_FILESYS_TOTALSPACE = 82, VC_FILESYS_DISKWRITABLE=83, VC_FILESYS_OPEN_DISK_RAW = 84, VC_FILESYS_CLOSE_DISK_RAW = 85, VC_FILESYS_NUMSECTORS = 86, VC_FILESYS_READ_SECTORS = 87, VC_FILESYS_WRITE_SECTORS = 88, VC_FILESYS_MOUNT = 89, VC_FILESYS_UMOUNT = 90, VC_FILESYS_FSTYPE = 91, VC_FILESYS_READ_DIRECT = 92, VC_FILESYS_LSEEK64 = 93, VC_FILESYS_FREESPACE64 = 94, VC_FILESYS_TOTALSPACE64= 95, VC_FILESYS_OPEN_DISK = 96, VC_FILESYS_CLOSE_DISK = 97, /* extra simple functions for mass storage testing */ VC_FILESYS_READ_SECTOR = 98, //1sect VC_FILESYS_STREAM_SECTOR_BEGIN = 99, VC_FILESYS_STREAM_SECTOR_END = 100, VC_FILESYS_WRITE_SECTOR = 101, VC_FILESYS_FSTAT = 102, VC_FILESYS_DIRSIZE = 103, VC_FILESYS_LIST_DIRS = 104, VC_FILESYS_LIST_FILES = 105, VC_FILESYS_NUM_DIRS = 106, VC_FILESYS_NUM_FILES = 107, VC_FILESYS_MAX_FILESIZE = 108, VC_FILESYS_CHKDSK = 109, }; /* Parameters for lseek */ #define VC_FILESYS_SEEK_SET 0 /* Set file pointer to "offset" */ #define VC_FILESYS_SEEK_CUR 1 /* Set file pointer to current plus "offset" */ #define VC_FILESYS_SEEK_END 2 /* Set file pointer to EOF plus "offset" */ /* Return values of vc_filesys_type */ #define VC_FILESYS_FS_UNKNOWN 0 #define VC_FILESYS_FS_FAT12 1 #define VC_FILESYS_FS_FAT16 2 #define VC_FILESYS_FS_FAT32 3 #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_gencmd_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VC_GENCMD_DEFS_H #define VC_GENCMD_DEFS_H //Format of reply message is error code followed by a string #define GENCMDSERVICE_MSGFIFO_SIZE 1024 #define VC_GENCMD_VER 1 #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_hdmi.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * HDMI common host header for TV service, defines resolution code which host applications should * use for power up command for HDMI */ #ifndef _VC_HDMI_H_ #define _VC_HDMI_H_ #include "vc_hdmi_property.h" /**< All HDMI related properties have been moved to here */ typedef int VC_HDMI_BOOL_T; /** * HDMI resolution groups. There are two main groups: * CEA - the conventional HDMI ones like 720p * DMT - computer monitor resolutions like XGA */ typedef enum { HDMI_RES_GROUP_INVALID = 0, /**< Initialised value */ HDMI_RES_GROUP_CEA = 1, /**< CEA - HDMI device */ HDMI_RES_GROUP_DMT = 2, /**< DMT - computer monitors */ HDMI_RES_GROUP_CEA_3D = 3, /* deprecated */ } HDMI_RES_GROUP_T; #define HDMI_RES_GROUP_NAME(g) \ (((g) == HDMI_RES_GROUP_INVALID) ? "Invalid" : \ (((g) == HDMI_RES_GROUP_CEA) ? "CEA" : \ (((g) == HDMI_RES_GROUP_DMT) ? "DMT" : \ "Unknown"))) /** * CEA 861 defined video code and aspect ratios for various HDMI modes * Not all values are valid for AVI infoframe */ typedef enum { HDMI_ASPECT_UNKNOWN = 0, /**< Unknown aspect ratio, or not one of the values below */ HDMI_ASPECT_4_3 = 1, /**< 4:3 */ HDMI_ASPECT_14_9 = 2, /**< 14:9 */ HDMI_ASPECT_16_9 = 3, /**< 16:9 */ HDMI_ASPECT_5_4 = 4, /**< 5:4 */ HDMI_ASPECT_16_10 = 5, /**< 16:10*/ HDMI_ASPECT_15_9 = 6, /**< 15:9 */ HDMI_ASPECT_64_27 = 7, /**< 64:27 */ HDMI_ASPECT_21_9 = HDMI_ASPECT_64_27 /**< 21:9 is jargon, 64:27 is the actual aspect ratio */ /* More aspect ratio values may be added here if defined by CEA in future */ } HDMI_ASPECT_T; /** * Display options set the bounding box (only used in CEA mode) */ typedef struct { uint16_t aspect; /** IL_BUFFER_BULK_UNALIGNED_MAX ) #error "VCHI_BULK_ALIGN > IL_BUFFER_BULK_UNALIGNED_MAX. Just set max higher on both VC and HOST so there's space to put the unaligned bytes." #endif typedef struct { OMX_U8 header[IL_BUFFER_BULK_UNALIGNED_MAX-1]; OMX_U8 headerlen; OMX_U8 trailer[IL_BUFFER_BULK_UNALIGNED_MAX-1]; OMX_U8 trailerlen; } IL_BUFFER_BULK_T; typedef struct { OMX_U8 buffer[1]; } IL_BUFFER_INLINE_T; typedef struct { void *reference; OMX_BUFFERHEADERTYPE bufferHeader; IL_BUFFER_METHOD_T method; OMX_U32 bufferLen; } IL_PASS_BUFFER_EXECUTE_T; // get component version typedef struct { IL_FUNCTION_T func; OMX_ERRORTYPE err; char name[128]; OMX_VERSIONTYPE component_version; OMX_VERSIONTYPE spec_version; OMX_UUIDTYPE uuid; } IL_GET_VERSION_RESPONSE_T; // get extension index typedef struct { void *reference; char name[128]; } IL_GET_EXTENSION_EXECUTE_T; typedef struct { IL_FUNCTION_T func; OMX_ERRORTYPE err; OMX_INDEXTYPE index; } IL_GET_EXTENSION_RESPONSE_T; // component role enum typedef struct { void *reference; OMX_U32 index; } IL_COMPONENT_ROLE_ENUM_EXECUTE_T; typedef struct { IL_FUNCTION_T func; OMX_ERRORTYPE err; OMX_U8 role[128]; } IL_COMPONENT_ROLE_ENUM_RESPONSE_T; typedef struct { void *reference; OMX_U32 port; OMX_PTR tunnel_ref; // reference to use in requests - address of host/vc component OMX_BOOL tunnel_host; // whether tunnel_ref is a host component OMX_U32 tunnel_port; OMX_TUNNELSETUPTYPE setup; } IL_TUNNEL_REQUEST_EXECUTE_T; typedef struct { IL_FUNCTION_T func; OMX_ERRORTYPE err; OMX_TUNNELSETUPTYPE setup; } IL_TUNNEL_REQUEST_RESPONSE_T; typedef struct { int index; } IL_COMPONENT_NAME_ENUM_EXECUTE_T; typedef struct { IL_FUNCTION_T func; OMX_ERRORTYPE err; OMX_U8 name[128]; } IL_COMPONENT_NAME_ENUM_RESPONSE_T; typedef struct { OMX_S32 len; } IL_GET_DEBUG_INFORMATION_EXECUTE_T; #endif // VC_ILCS_DEFS_H ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_imageconv_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef IMAGECONV_DEFS_H #define IMAGECONV_DEFS_H /** Statistics for image conversion to foreign image types */ typedef struct { uint32_t magic; uint32_t size; /**< Size of this structure, in bytes */ uint32_t conversions; /**< Total conversions so far */ uint32_t duplicate_conversions; /**< Duplicate conversions (same image twice) */ uint32_t size_requests; /**< Num calls to get_converted_size */ uint32_t consumed_count; /**< How many converted images were consumed */ uint32_t failures; /**< Failed conversions */ uint32_t time_spent; /**< Time spent converting, us */ uint32_t max_vrf_delay; /**< The max time waiting for the VRF */ uint32_t vrf_wait_time; /**< Total time waiting for the VRF */ uint32_t last_mem_handle; /**< Last mem handle converted */ uint32_t first_image_ts; /**< Timestamp of first image */ uint32_t last_image_ts; /**< Timestamp of first image */ uint32_t max_delay; /**< Jitter */ } IMAGECONV_STATS_T; #define IMAGECONV_STATS_MAGIC 0x494D454C #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_sdtv.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * SDTV common host header for TV service */ #ifndef _VC_SDTV_H_ #define _VC_SDTV_H_ /** Different SDTV modes */ /** colour */ typedef enum SDTV_COLOUR_ { SDTV_COLOUR_UNKNOWN = 0x0, SDTV_COLOUR_RGB = 0x4, SDTV_COLOUR_YPRPB = 0x8, SDTV_COLOUR_FORCE_32BIT = 0x80000000 } SDTV_COLOUR_T; /** operation mode */ typedef enum SDTV_MODE_T_ { SDTV_MODE_NTSC = 0, /**VC_HDMI_NOTIFY_T and VC_SDTV_NOTIFY_T in vc_hdmi.h and vc_sdtv.h * respectively for list of reasons and respective param1 and param2 * * @param callback_data is the context passed in during the call to vc_tv_register_callback * * @param reason is the notification reason * * @param param1 is the first optional parameter * * @param param2 is the second optional parameter * * @return void */ typedef void (*TVSERVICE_CALLBACK_T)(void *callback_data, uint32_t reason, uint32_t param1, uint32_t param2); /* API at application start time */ /** * vc_vchi_tv_init is called at the beginning of the application * to initialise the client to TV service * * @param initialise_instance is the VCHI instance * * @param array of pointers of connections * * @param number of connections (currently this is always 1 * * @return Zero is successful A negative return value indicates failure (which may mean it has not been started on VideoCore). */ VCHPRE_ int vc_vchi_tv_init(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections ); /** * vc_vchi_tv_stop is called to stop the host side of TV service. * * @param none * * @return void */ VCHPRE_ void vc_vchi_tv_stop( void ); /** * Host applications should call vc_tv_register_callback at * the beginning to register a callback function to handle all notifications. * See TVSERVICE_CALLBACK_T * * @param callback function * * @param callback_data is the context to be passed when function is called * * @return void */ VCHPRE_ void vc_tv_register_callback(TVSERVICE_CALLBACK_T callback, void *callback_data); /** * vc_tv_unregister_callback removes a function registered with * vc_tv_register_callback from the list of callbacks. * * @param callback function * * @return void */ VCHPRE_ void vc_tv_unregister_callback(TVSERVICE_CALLBACK_T callback); /** * vc_tv_unregister_callback removes a function registered with * vc_tv_register_callback from the list of callbacks. * In contrast to vc_tv_unregister_callback this one matches not only the * function pointer but also the data pointer before removal. * * @param callback function * * @return void */ VCHPRE_ void vc_tv_unregister_callback_full(TVSERVICE_CALLBACK_T callback, void *callback_data); /** * In the following API any functions applying to HDMI only will have hdmi_ * in the name, ditto for SDTV only will have sdtv_ in the name, * Otherwise the function applies to both SDTV and HDMI (e.g. power off) */ /** * vc_tv_get_state is used to obtain the current TV state. * Host applications should call this function right after registering * a callback in case any notifications are missed. * * Now deprecated - use vc_tv_get_display_state instead * * @param pointer to TV_GET_STATE_RESP_T * * @return zero if the command is sent successfully, non zero otherwise * If the command fails to be sent, passed in state is unchanged * */ VCHPRE_ int VCHPOST_ vc_tv_get_state(TV_GET_STATE_RESP_T *tvstate); /** * vc_tv_get_display_state is used to obtain the current TV display * state. This function supersedes vc_tv_get_state (which is only kept for * backward compatibility. * Host applications should call this function right after registering * a callback in case any notifications are missed. * * @param pointer to TV_DISPLAY_STATE_T * * @return zero if the command is sent successfully, non zero otherwise * If the command fails to be sent, passed in state is unchanged * */ VCHPRE_ int VCHPOST_ vc_tv_get_display_state(TV_DISPLAY_STATE_T *tvstate); /** * Use vc_tv_hdmi_power_on_preferred if you don't care what resolutions * a TV supports and just want to turn on its native resolution. Analogue TV will * be powered down if on (same for the following two HDMI power on functions.) * If power on is successful, a host application must wait for the power on complete * callback before attempting to open the display. * * @param none * * @return single value interpreted as HDMI_RESULT_T (zero means success) * if successful, there will be a callback when the power on is complete * **/ VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_preferred( void ); /** * Same as above, but tell the TV to enter 3D mode. The TV will go to 2D mode * if the preferred mode doesn't support 3D. **/ VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_preferred_3d( void ); /** * Use vc_tv_hdmi_power_on_best to power on HDMI at best matched resolution * based on passed in parameters. Use HDMI_MODE_MATCH_FRAMERATE if you want to * match the frame rate; use HDMI_MODE_MATCH_RESOLUTION if you want to match on * screen size; add HDMI_MODE_MATCH_SCANMODE if you want to force * interlaced/progressive mode. If no matching mode is found, the native resolution * will be used instead. * * @param width is the desired minimum screen width * * @param height is the desired minimum screen height * * @param rate is the desired frame rate * * @param scan_mode (HDMI_NONINTERLACED / HDMI_INTERLACED) is the desired scan mode * * @param match flags is the matching flag EDID_MODE_MATCH_FLAG_T * * @return same as vc_tv_hdmi_power_on_preferred */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_best(uint32_t width, uint32_t height, uint32_t frame_rate, HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags); /** * Same as above, but tell the TV to enter 3D mode. The TV will go to 2D mode * if no suitable 3D mode can be found. **/ VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_best_3d(uint32_t width, uint32_t height, uint32_t frame_rate, HDMI_INTERLACED_T scan_mode, EDID_MODE_MATCH_FLAG_T match_flags); /** * Use vc_tv_hdmi_power_on_explicit if you want full control over what mode * the TV is driven. This function is used, for example, when the host has the EDID * and HDMI middleware does not know. If HDMI middleware has knowledge of EDID, the * passed in mode is still subject to TV's supported modes * * @param mode (HDMI_MODE_HDMI/HDMI_MODE_DVI/HDMI_MODE_3D) * * @param group (HDMI_RES_GROUP_CEA/HDMI_RES_GROUP_DMT) * * @param code either HDMI_CEA_RES_CODE_T or HDMI_DMT_RES_CODE_T * * @return same as vc_tv_hdmi_power_on_preferred */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_explicit_new(HDMI_MODE_T mode, HDMI_RES_GROUP_T group, uint32_t code); /** * vc_tv_sdtv_power_on is used to turn on analogue TV. HDMI will * automatically be powered off if on. * * @param SDTV mode SDTV_MODE_T * * @param options SDTV_OPTIONS_T * * @return single value (zero means success) if successful, there will be a callback when the power on is complete * */ VCHPRE_ int VCHPOST_ vc_tv_sdtv_power_on(SDTV_MODE_T mode, SDTV_OPTIONS_T *options); /** * vc_tv_power_off is used to turn off either analogue or HDMI output. * If HDMI is powered down, there will be a callback with reason UNPLUGGED (if no * cable is attached) or STANDBY (if a cable is attached) * * @param none * * @return whether command is succcessfully sent * */ VCHPRE_ int VCHPOST_ vc_tv_power_off( void ); /** * vc_tv_hdmi_get_supported_modes is used to get a list of supported * modes for a particular standard (CEA/DMT/CEA3D). Prefer resolution (group and mode) * is also returned, if needed. If there are more modes supported than the size of the array * supply, only the array will be filled. * * @param group(HDMI_RES_GROUP_CEA/HDMI_RES_GROUP_DMT) * * @param array of TV_SUPPORT_MODE_T struct * * @param length of array above (in elements, not bytes) * * @pointer to preferred group (can be NULL) * * @pointer to prefer mode code (can be NULL) * * @return the number of modes actually written in the array, * zero means no modes (no EDID or cable unplugged) * */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_get_supported_modes_new(HDMI_RES_GROUP_T group, TV_SUPPORTED_MODE_NEW_T *supported_modes, uint32_t max_supported_modes, HDMI_RES_GROUP_T *preferred_group, uint32_t *preferred_mode); /** * vc_tv_hdmi_mode_supported is used to query whether a particular mode * is supported or not. * * @param resolution standard (HDMI_RES_GROUP_CEA/HDMI_RES_GROUP_DMT) * * @param mode code * * @return > 0 means supported, 0 means unsupported, < 0 means error * */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_mode_supported(HDMI_RES_GROUP_T group, uint32_t mode); /** * vc_tv_hdmi_audio_supported is used to query whether a * particular audio format is supported. By default a device has to support * 16-bit stereo PCM at 32/44.1/48 kHz if audio is supported at all. * Support of other audio formats allow SPDIF to be used. * A return value of zero means the audio format is completely supported. * Any non-zero values are interpreted as bit mask (EDID_AUDIO_SUPPORT_FLAG_T). * For example, if EDID_AUDIO_NO_SUPPORT is set, the audio format is not supported. * If EDID_AUDIO_CHAN_UNSUPPORTED is set, the max no. of channels has exceeded. * * @param audio format supplied as (EDID_AudioFormat + EDID_AudioCodingExtension) * * @param no. of channels (1-8) * * @param sample rate EDID_AudioSampleRate but NOT "refer to header" * * @param bit rate (or sample size if pcm) use EDID_AudioSampleSize as sample size argument * * @return: single value return interpreted as flags in EDID_AUDIO_SUPPORT_FLAG_T * */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_audio_supported(uint32_t audio_format, uint32_t num_channels, EDID_AudioSampleRate fs, uint32_t bitrate); /** * Use vc_tv_enable_copyprotect to turn on copy protection. * For HDMI, only HDMI_CP_HDCP is recognised. * For SDTV, use one of the values in SDTV_CP_MODE_T * * @param copy protect mode * * @param time out in milliseconds (only applicable to HDMI) * * @return 0 means success, additional result via callback * */ VCHPRE_ int VCHPOST_ vc_tv_enable_copyprotect(uint32_t cp_mode, uint32_t timeout); /** * Use vc_tv_disable_copyprotect to turn off copy protection * * @param none * * @rturn 0 means success, additional result via callback * */ VCHPRE_ int VCHPOST_ vc_tv_disable_copyprotect( void ); /** * Use vc_tv_show_info to show or hide info screen. * Only usable in HDMI at the moment. * * @param show (1) or hide (0) info screen * * @return zero if command is successfully sent * */ VCHPRE_ int VCHPOST_ vc_tv_show_info(uint32_t show); /** * vc_tv_hdmi_get_av_latency is used to get the AV latency * (in ms) for HDMI (lipsync), only valid if HDMI is currently powered on, * otherwise you get zero. The latency is defined as the relative delay * of the video stream to the audio stream * * @param none * * @return latency (zero if error or latency is not defined), * < 0 if failed to send command) * */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_get_av_latency( void ); /** * Use vc_tv_hdmi_set_hdcp_key to download HDCP key to HDCP middleware * * @param AES encrypted key block (328 bytes) * * @return single value return indicating queued status * Callback indicates the validity of key */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_set_hdcp_key(const uint8_t *key); /** * Use vc_tv_hdmi_set_hdcp_revoked_list to download SRM * revoked list * * @param list * * @param size of list (no. of keys) * * @return single value return indicating queued status * Callback indicates the number of keys set (zero if failed, unless you are clearing the list) * */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_set_hdcp_revoked_list(const uint8_t *list, uint32_t num_keys); /** * vc_tv_hdmi_set_spd is used to set the SPD infoframe. * * @param manufacturer (max. 8 characters) * * @param description (max. 16 characters) * * @param product type HDMI_SPD_TYPE_CODE_T * * @return whether command was sent successfully (zero means success) * */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_set_spd(const char *manufacturer, const char *description, HDMI_SPD_TYPE_CODE_T type); /** * vc_tv_hdmi_set_display_options is used to set the * active area for HDMI (bar width/height should be set to zero if absent) * This information is conveyed in AVI infoframe. * * @param aspect ratio HDMI_ASPECT_T * * @param left bar width * * @param right bar width * * @param top bar height * * @param bottom bar height * * @return whether command was sent successfully (zero means success) * */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_set_display_options(HDMI_ASPECT_T aspect, uint32_t left_bar_width, uint32_t right_bar_width, uint32_t top_bar_height, uint32_t bottom_bar_height, uint32_t overscan_flags); /** * Use vc_tv_test_mode_start to generate test signal. * At the moment only DVI test signal is supported. * HDMI must be powered off before this function is called. * * @param 24-bit background colour (if applicable) * * @param test mode TV_TEST_MODE_T * * @return whether command was sent successfully (zero means success) * */ VCHPRE_ int VCHPOST_ vc_tv_test_mode_start(uint32_t colour, TV_TEST_MODE_T test_mode); /** * Use vc_tv_test_mode_stop to stop the test signal and power down * HDMI. * * @param none * * @return whether command was sent successfully (zero means success) * */ VCHPRE_ int VCHPOST_ vc_tv_test_mode_stop( void ); /** * vc_tv_hdmi_ddc_read allows an host application to read EDID * with DDC protocol. * * @param offset * * @param length to read (this is typically 128 bytes to coincide with EDID block size) * * @param pointer to buffer, must be 16 byte aligned * * @returns length of data read (so zero means error) and the buffer will be filled * only if there is no error * */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_ddc_read(uint32_t offset, uint32_t length, uint8_t *buffer); /** * Sets the TV state to attached. * Required when hotplug interrupt is not handled by VideoCore. * * @param attached non-zero if the TV is attached or zero for unplugged. */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_set_attached(uint32_t attached); /** * Sets one of the HDMI properties. HDMI properties persist * between HDMI power on/off * * @param property [in] * * @return zero if successful, non-zero otherwise */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_set_property(const HDMI_PROPERTY_PARAM_T *property); /** * Gets the current value of an HDMI property. * * @param property [in/out] * * @return zero if success (param1/param2 will be set), non-zero otherwise (param1/param2 will not be set) */ VCHPRE_ int VCHPOST_ vc_tv_hdmi_get_property(HDMI_PROPERTY_PARAM_T *property); /** * Converts the notification reason to a string. * * @param reason is the notification reason * @return The notification reason as a string. */ VCHPRE_ const char* vc_tv_notification_name(VC_HDMI_NOTIFY_T reason); /** * Get the unique device ID from the EDID * @param pointer to device ID struct * @return zero if successful, non-zero if failed. */ VCHPRE_ int VCHPOST_ vc_tv_get_device_id(TV_DEVICE_ID_T *id); // temporary: maintain backwards compatibility VCHPRE_ int VCHPOST_ vc_tv_hdmi_get_supported_modes(HDMI_RES_GROUP_T group, TV_SUPPORTED_MODE_T *supported_modes, uint32_t max_supported_modes, HDMI_RES_GROUP_T *preferred_group, uint32_t *preferred_mode); // temporary: maintain backwards compatibility VCHPRE_ int VCHPOST_ vc_tv_hdmi_power_on_explicit(HDMI_MODE_T mode, HDMI_RES_GROUP_T group, uint32_t code); #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_tvservice_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* * TV service command enumeration and parameter types. */ #ifndef _VC_TVSERVICE_DEFS_H_ #define _VC_TVSERVICE_DEFS_H_ #include "vcinclude/common.h" #include "interface/vchi/message_drivers/message.h" #include "vc_hdmi.h" #include "vc_sdtv.h" #define VC_TVSERVICE_VER 1 #define TVSERVICE_MSGFIFO_SIZE 1024 #define TVSERVICE_CLIENT_NAME MAKE_FOURCC("TVSV") #define TVSERVICE_NOTIFY_NAME MAKE_FOURCC("TVNT") #define TVSERVICE_MAX_CALLBACKS 5 //TV service commands typedef enum { VC_TV_GET_STATE = 0, VC_TV_HDMI_ON_PREFERRED, VC_TV_HDMI_ON_BEST, VC_TV_HDMI_ON_EXPLICIT, VC_TV_SDTV_ON, VC_TV_OFF, VC_TV_QUERY_SUPPORTED_MODES, VC_TV_QUERY_MODE_SUPPORT, VC_TV_QUERY_AUDIO_SUPPORT, VC_TV_ENABLE_COPY_PROTECT, VC_TV_DISABLE_COPY_PROTECT, VC_TV_SHOW_INFO, VC_TV_GET_AV_LATENCY, VC_TV_HDCP_SET_KEY, VC_TV_HDCP_SET_SRM, VC_TV_SET_SPD, VC_TV_SET_DISPLAY_OPTIONS, VC_TV_TEST_MODE_START, VC_TV_TEST_MODE_STOP, VC_TV_DDC_READ, VC_TV_SET_ATTACHED, VC_TV_SET_PROP, VC_TV_GET_PROP, VC_TV_GET_DISPLAY_STATE, VC_TV_QUERY_SUPPORTED_MODES_ACTUAL, VC_TV_GET_DEVICE_ID, //Add more commands here VC_TV_END_OF_LIST } VC_TV_CMD_CODE_T; //Parameters for each command (padded to multiple of 16 bytes) //See vc_hdmi.h and vc_sdtv.h for details //GET_STATE //Parameters: none //Reply: state (flags of VC_HDMI_NOTIFY_T and VC_SDTV_NOTIFY_T) // current width // current height // current refresh rate // current scan mode typedef struct { uint32_t state; /**VC direction typedef enum { VC_AUDIO_MSG_TYPE_RESULT, // Generic result VC_AUDIO_MSG_TYPE_COMPLETE, // playback of samples complete VC_AUDIO_MSG_TYPE_CONFIG, // Configure VC_AUDIO_MSG_TYPE_CONTROL, // control VC_AUDIO_MSG_TYPE_OPEN, // open VC_AUDIO_MSG_TYPE_CLOSE, // close/shutdown VC_AUDIO_MSG_TYPE_START, // start output (i.e. resume) VC_AUDIO_MSG_TYPE_STOP, // stop output (i.e. pause) VC_AUDIO_MSG_TYPE_WRITE, // write samples VC_AUDIO_MSG_TYPE_LATENCY, // request latency in cycles VC_AUDIO_MSG_TYPE_MAX } VC_AUDIO_MSG_TYPE; static const char *vc_audio_msg_type_names[] = { "VC_AUDIO_MSG_TYPE_RESULT", "VC_AUDIO_MSG_TYPE_COMPLETE", "VC_AUDIO_MSG_TYPE_CONFIG", "VC_AUDIO_MSG_TYPE_CONTROL", "VC_AUDIO_MSG_TYPE_OPEN", "VC_AUDIO_MSG_TYPE_CLOSE", "VC_AUDIO_MSG_TYPE_START", "VC_AUDIO_MSG_TYPE_STOP", "VC_AUDIO_MSG_TYPE_WRITE", "VC_AUDIO_MSG_TYPE_MAX" }; // configure the audio typedef struct { uint32_t channels; uint32_t samplerate; uint32_t bps; uint32_t channelmap; } VC_AUDIO_CONFIG_T; typedef struct { uint32_t volume; uint32_t dest; } VC_AUDIO_CONTROL_T; // audio typedef struct { uint32_t dummy; } VC_AUDIO_OPEN_T; // audio typedef struct { uint32_t dummy; } VC_AUDIO_CLOSE_T; // audio typedef struct { uint32_t dummy; } VC_AUDIO_START_T; // audio typedef struct { uint32_t draining; } VC_AUDIO_STOP_T; // audio typedef struct { uint32_t dummy; } VC_AUDIO_LATENCY_T; // configure the write audio samples typedef struct { uint32_t count; // in bytes void *callback; void *cookie; uint16_t silence; uint16_t max_packet; } VC_AUDIO_WRITE_T; // Generic result for a request (VC->HOST) typedef struct { int32_t success; // Success value } VC_AUDIO_RESULT_T; // Generic result for a request (VC->HOST) typedef struct { int32_t count; // Success value void *callback; void *cookie; } VC_AUDIO_COMPLETE_T; // Message header for all messages in HOST->VC direction typedef struct { int32_t type; // Message type (VC_AUDIO_MSG_TYPE) union { VC_AUDIO_CONFIG_T config; VC_AUDIO_CONTROL_T control; VC_AUDIO_OPEN_T open; VC_AUDIO_CLOSE_T close; VC_AUDIO_START_T start; VC_AUDIO_STOP_T stop; VC_AUDIO_WRITE_T write; VC_AUDIO_LATENCY_T latency; VC_AUDIO_RESULT_T result; VC_AUDIO_COMPLETE_T complete; } u; } VC_AUDIO_MSG_T; #endif // _VC_AUDIO_DEFS_H_ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_vchi_bufman.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VC_VCHI_BUFMAN_H #define VC_VCHI_BUFMAN_H #include "interface/vctypes/vc_image_types.h" #include "interface/vchi/vchi.h" #ifdef __SYMBIAN32__ #include "interface/vmcs_host/vc_vchi_bufman_defs.h" typedef uint32_t DISPMANX_RESOURCE_HANDLE_T; namespace BufManX { #else #include "interface/vmcs_host/vc_dispmanx.h" #include "interface/vmcs_host/vc_vchi_bufman_defs.h" #endif typedef void (*vc_bufman_callback_t) (void *next_cookie, void *next_cookie2, int32_t success); VCHPRE_ void VCHPOST_ vc_vchi_bufman_init(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections); typedef struct { buf_frame_type_t type; int width, height, pitch; int bpp; // bits per pixel int size; void *pixels; } BUFMANX_IMAGE_T; #define BUFMAN_TRANSFORM_HFLIP (1<<0) #define BUFMAN_TRANSFORM_VFLIP (1<<1) #define BUFMAN_TRANSFORM_TRANSPOSE (1<<2) typedef enum { BUFMAN_TRANSFORM_ROT0 = 0, BUFMAN_TRANSFORM_MIRROR_ROT0 = BUFMAN_TRANSFORM_HFLIP, BUFMAN_TRANSFORM_MIRROR_ROT180 = BUFMAN_TRANSFORM_VFLIP, BUFMAN_TRANSFORM_ROT180 = BUFMAN_TRANSFORM_HFLIP|BUFMAN_TRANSFORM_VFLIP, BUFMAN_TRANSFORM_MIRROR_ROT90 = BUFMAN_TRANSFORM_TRANSPOSE, BUFMAN_TRANSFORM_ROT270 = BUFMAN_TRANSFORM_TRANSPOSE|BUFMAN_TRANSFORM_HFLIP, BUFMAN_TRANSFORM_ROT90 = BUFMAN_TRANSFORM_TRANSPOSE|BUFMAN_TRANSFORM_VFLIP, BUFMAN_TRANSFORM_MIRROR_ROT270 = BUFMAN_TRANSFORM_TRANSPOSE|BUFMAN_TRANSFORM_HFLIP|BUFMAN_TRANSFORM_VFLIP, } BUFMAN_TRANSFORM_T; // we use an opaque type here as the internals shouldn't be used externally, but allocation of the size of the block is required by the caller. #define BUFMANX_HANDLE_T_SIZE 1024 typedef struct { char opaque[BUFMANX_HANDLE_T_SIZE]; } BUFMANX_HANDLE_T; VCHPRE_ int32_t VCHPOST_ vc_bufmanx_convert_init(void); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_set_transform_buffer(void *pixels, int size); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_allocate_image(BUFMANX_IMAGE_T *image); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_release_image(BUFMANX_IMAGE_T *image); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_get_default_pitch( BUFMANX_IMAGE_T *src ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_get_default_size(BUFMANX_IMAGE_T *src); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_push ( BUFMANX_HANDLE_T *h, const BUFMANX_IMAGE_T *src, DISPMANX_RESOURCE_HANDLE_T dst, const VC_RECT_T *src_rect, const VC_RECT_T *dest_rect, BUFMAN_TRANSFORM_T transform, vc_bufman_callback_t callback, void *cookie, void *cookie2 ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_pull ( BUFMANX_HANDLE_T *h, BUFMANX_IMAGE_T *dst, const DISPMANX_RESOURCE_HANDLE_T src, const VC_RECT_T *src_rect, const VC_RECT_T *dest_rect, BUFMAN_TRANSFORM_T transform, vc_bufman_callback_t callback, void *cookie, void *cookie2 ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_pull_blocking ( BUFMANX_HANDLE_T *h, BUFMANX_IMAGE_T *dst, const DISPMANX_RESOURCE_HANDLE_T src, const VC_RECT_T *src_rect, const VC_RECT_T *dest_rect, BUFMAN_TRANSFORM_T transform ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_push_blocking ( BUFMANX_HANDLE_T *h, const BUFMANX_IMAGE_T *src, DISPMANX_RESOURCE_HANDLE_T dst, const VC_RECT_T *src_rect, const VC_RECT_T *dest_rect, BUFMAN_TRANSFORM_T transform ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_pull_striped ( BUFMANX_HANDLE_T *xh, BUFMANX_IMAGE_T *dst, const DISPMANX_RESOURCE_HANDLE_T src, const VC_RECT_T *src_rect, const VC_RECT_T *dest_rect, BUFMAN_TRANSFORM_T transform, vc_bufman_callback_t callback, void *cookie, void *cookie2 ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_pull_striped_blocking ( BUFMANX_HANDLE_T *xh, BUFMANX_IMAGE_T *dst, const DISPMANX_RESOURCE_HANDLE_T src, const VC_RECT_T *src_rect, const VC_RECT_T *dest_rect, BUFMAN_TRANSFORM_T transform ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_push_striped ( BUFMANX_HANDLE_T *xh, const BUFMANX_IMAGE_T *src, DISPMANX_RESOURCE_HANDLE_T dst, const VC_RECT_T *src_rect, const VC_RECT_T *dest_rect, BUFMAN_TRANSFORM_T transform, vc_bufman_callback_t callback, void *cookie, void *cookie2 ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_push_striped_blocking ( BUFMANX_HANDLE_T *xh, const BUFMANX_IMAGE_T *src, DISPMANX_RESOURCE_HANDLE_T dst, const VC_RECT_T *src_rect, const VC_RECT_T *dest_rect, BUFMAN_TRANSFORM_T transform ); VCHPRE_ void VCHPOST_ vc_bufmanx_push_multi ( BUFMANX_HANDLE_T *h, const BUFMANX_IMAGE_T *src, DISPMANX_RESOURCE_HANDLE_T dst, BUFMAN_TRANSFORM_T transform, vc_bufman_callback_t callback, void *cookie, void *cookie2 ); VCHPRE_ void VCHPOST_ vc_bufmanx_pull_multi ( BUFMANX_HANDLE_T *h, BUFMANX_IMAGE_T *dst, const DISPMANX_RESOURCE_HANDLE_T src, BUFMAN_TRANSFORM_T transform, vc_bufman_callback_t callback, void *cookie, void *cookie2 ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_push_multi_blocking ( BUFMANX_HANDLE_T *h, const BUFMANX_IMAGE_T *src, DISPMANX_RESOURCE_HANDLE_T dst, BUFMAN_TRANSFORM_T transform ); VCHPRE_ int32_t VCHPOST_ vc_bufmanx_pull_multi_blocking ( BUFMANX_HANDLE_T *h, BUFMANX_IMAGE_T *dst, const DISPMANX_RESOURCE_HANDLE_T src, BUFMAN_TRANSFORM_T transform ); // Allocate the specified number and type of buffers on the server side, for use with streams VCHPRE_ int32_t VCHPOST_ vc_bufmanx_allocate_buffers (uint32_t stream, uint32_t num_of_buffers, buf_frame_type_t type, uint32_t width, uint32_t height); // Free buffers on the server which are associated with the specified stream #define VC_BUFMANX_FREE_BUFFERS_ALL 0 VCHPRE_ int32_t VCHPOST_ vc_bufmanx_free_buffers(uint32_t stream, uint32_t num_of_buffers); // Like vc_bufmanx_push_multi(), but specifies a stream, rather than a dispmanx resource handle, // to push the data to. VCHPRE_ void VCHPOST_ vc_bufmanx_push_multi_stream ( BUFMANX_HANDLE_T *xh, const BUFMANX_IMAGE_T *src, uint32_t stream, BUFMAN_TRANSFORM_T transform, vc_bufman_callback_t callback, void *cookie, void *cookie2 ); VCHPRE_ VC_IMAGE_TYPE_T VCHPOST_ vc_bufmanx_get_vc_image_type(buf_frame_type_t bm_type); #ifdef __SYMBIAN32__ } // namespace BufManX #endif #endif /* VC_VCHI_BUFMAN_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_vchi_bufman_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VC_VCHI_BUFMAN_DEFS_H #define VC_VCHI_BUFMAN_DEFS_H #ifdef __SYMBIAN32__ typedef uint32_t DISPMANX_RESOURCE_HANDLE_T; namespace BufManX { #else #include "interface/vmcs_host/vc_dispmanx.h" #endif typedef enum { // Insert extra frame types here FRAME_HOST_IMAGE_BASE = 0x20000, // Base for host format images FRAME_HOST_IMAGE_EFormatYuv420P, FRAME_HOST_IMAGE_EFormatYuv422P, FRAME_HOST_IMAGE_EFormatYuv422LE, FRAME_HOST_IMAGE_EFormatRgb565, FRAME_HOST_IMAGE_EFormatRgb888, FRAME_HOST_IMAGE_EFormatRgbU32, FRAME_HOST_IMAGE_EFormatRgbA32, FRAME_HOST_IMAGE_EFormatRgbA32LE, FRAME_HOST_IMAGE_EFormatRgbU32LE, FRAME_FORCE_FIELD_WIDTH = 0xFFFFFFFF } buf_frame_type_t; typedef enum { //host to videocore VC_BUFMAN_CONVERT_UNUSED = 0, VC_BUFMAN_PULL_FRAME, VC_BUFMAN_PUSH_FRAME, VC_BUFMAN_MESSAGE_RESPONSE, VC_BUFMAN_SYNC, VC_BUFMAN_ALLOC_BUF, VC_BUFMAN_FREE_BUF, VC_BUFMAN_PULL_MULTI, VC_BUFMAN_PUSH_MULTI, VC_BUFMAN_PUSH_MULTI_STREAM, //vc to host VC_BUFMAN_FRAME_SENT_CALLBACK, VC_BUFMAN_FORCE_WIDTH = 0x7fffffff, } buf_command_t; /* A header used for all messages sent and received by bufman. */ typedef struct { buf_command_t command; } BUF_MSG_HDR_T; /* General remotely call this bufman operation commands */ typedef struct { uint32_t resource_handle; buf_frame_type_t type; int32_t size, width, height, pitch; VC_RECT_T src_rect; // in 16.16 units VC_RECT_T dest_rect; // in 32.0 units } BUF_MSG_REMOTE_FUNCTION_FRAME_T; typedef struct { int32_t status; int32_t total_stripes; // normal stipe height and size int32_t stripe_height, stripe_size; // last stripe size (if height not a mulitple of stripe height, last stripe nay be smaller) int32_t last_stripe_height, last_stripe_size; } BUF_MSG_RESPONSE_T; typedef struct { uint32_t stream; uint32_t num_of_buffers; buf_frame_type_t type; uint32_t width; uint32_t height; } BUF_MSG_ALLOC_BUF_FRAME_T; typedef struct { uint32_t stream; uint32_t num_of_buffers; } BUF_MSG_FREE_BUF_FRAME_T; typedef struct { BUF_MSG_HDR_T hdr; union { BUF_MSG_REMOTE_FUNCTION_FRAME_T frame; BUF_MSG_RESPONSE_T message_response; BUF_MSG_ALLOC_BUF_FRAME_T alloc_buf_frame; BUF_MSG_FREE_BUF_FRAME_T free_buf_frame; } u; } BUF_MSG_T; enum { //host to videocore VC_BUFMAN_ERROR_NONE = 0, VC_BUFMAN_ERROR_BAD_GENERALLY = -1, VC_BUFMAN_ERROR_BAD_RESOURCE = -2, VC_BUFMAN_ERROR_BAD_TRANSFORM = -3, VC_BUFMAN_ERROR_BAD_RESIZE = -4, VC_BUFMAN_ERROR_BAD_HOST_FORMAT = -5, VC_BUFMAN_ERROR_BAD_VC_FORMAT = -6, VC_BUFMAN_ERROR_BAD_SIZE = -7, }; #ifdef __SYMBIAN32__ } // namespace BufManX #endif #endif /* VC_VCHI_BUFMAN_DEFS_H */ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_vchi_dispmanx.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VC_VCHI_DISPMANX_H #define VC_VCHI_DISPMANX_H #include "interface/peer/vc_vchi_dispmanx_common.h" #define VC_NUM_HOST_RESOURCES 64 #define DISPMANX_MSGFIFO_SIZE 1024 #define DISPMANX_CLIENT_NAME MAKE_FOURCC("DISP") #define DISPMANX_NOTIFY_NAME MAKE_FOURCC("UPDH") //Or with command to indicate we don't need a response #define DISPMANX_NO_REPLY_MASK (1<<31) typedef struct { char description[32]; uint32_t width; uint32_t height; uint32_t aspect_pixwidth; uint32_t aspect_pixheight; uint32_t fieldrate_num; uint32_t fieldrate_denom; uint32_t fields_per_frame; uint32_t transform; } GET_MODES_DATA_T; typedef struct { int32_t response; uint32_t width; uint32_t height; uint32_t transform; uint32_t input_format; } GET_INFO_DATA_T; //Attributes changes flag mask #define ELEMENT_CHANGE_LAYER (1<<0) #define ELEMENT_CHANGE_OPACITY (1<<1) #define ELEMENT_CHANGE_DEST_RECT (1<<2) #define ELEMENT_CHANGE_SRC_RECT (1<<3) #define ELEMENT_CHANGE_MASK_RESOURCE (1<<4) #define ELEMENT_CHANGE_TRANSFORM (1<<5) #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_vchi_fileservice_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VC_VCHI_FILESERVICE_DEFS_H #define VC_VCHI_FILESERVICE_DEFS_H #include "interface/vchi/vchi.h" /* Definitions (not used by API) */ /* structure used by both side to communicate */ #define FILESERV_MAX_BULK_SECTOR 128 //must be power of two #define FILESERV_SECTOR_LENGTH 512 #define FILESERV_MAX_BULK (FILESERV_MAX_BULK_SECTOR*FILESERV_SECTOR_LENGTH) #define FILESERV_4CC MAKE_FOURCC("FSRV") typedef enum FILESERV_EVENT_T { FILESERV_BULK_RX = 0, FILESERV_BULK_TX, FILESERV_BULK_RX_0, FILESERV_BULK_RX_1 }FILESERV_EVENT_T; //this following structure has to equal VCHI_MAX_MSG_SIZE #define FILESERV_MAX_DATA (VCHI_MAX_MSG_SIZE - 40) //(VCHI_MAX_MSG_SIZE - 24) typedef struct{ uint32_t xid; //4 // transaction's ID, used to match cmds with response uint32_t cmd_code; //4 uint32_t params[4]; //16 char data[FILESERV_MAX_DATA]; }FILESERV_MSG_T; typedef enum { FILESERV_RESP_OK, FILESERV_RESP_ERROR, FILESERV_BULK_READ, FILESERV_BULK_WRITE, } FILESERV_RESP_CODE_T; /* Protocol (not used by API) version 1.2 */ #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_vchi_filesys.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VC_VCHI_VCFILESYS_H_ #define VC_VCHI_VCFILESYS_H_ #include "vchost_platform_config.h" #include "vcfilesys_defs.h" #include "vc_fileservice_defs.h" #include "interface/vchi/vchi.h" #ifndef _DIRENT_H // This should really be in a dirent.h header to avoid conflicts typedef struct DIR_tag DIR; #endif // ifndef _DIRENT_H typedef struct { int64_t st_size; /* total size, in bytes (off_t)*/ uint32_t st_modtime; /* time of last modification (time_t)*/ } FSTAT_T; VCHPRE_ int VCHPOST_ vc_vchi_filesys_init (VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections ); // Stop it to prevent the functions from trying to use it. VCHPRE_ void VCHPOST_ vc_filesys_stop(void); // Return the service number (-1 if not running). VCHPRE_ int VCHPOST_ vc_filesys_inum(void); // Low level file system functions equivalent to close(), lseek(), open(), read() and write() VCHPRE_ int VCHPOST_ vc_filesys_close(int fildes); VCHPRE_ long VCHPOST_ vc_filesys_lseek(int fildes, long offset, int whence); VCHPRE_ int64_t VCHPOST_ vc_filesys_lseek64(int fildes, int64_t offset, int whence); VCHPRE_ int VCHPOST_ vc_filesys_open(const char *path, int vc_oflag); VCHPRE_ int VCHPOST_ vc_filesys_read(int fildes, void *buf, unsigned int nbyte); VCHPRE_ int VCHPOST_ vc_filesys_write(int fildes, const void *buf, unsigned int nbyte); VCHPRE_ int VCHPOST_ vc_filesys_mount(const char *device, const char *mountpoint, const char *options); VCHPRE_ int VCHPOST_ vc_filesys_umount(const char *mountpoint); // Ends a directory listing iteration VCHPRE_ int VCHPOST_ vc_filesys_closedir(void *dhandle); // Formats the drive that contains the given path VCHPRE_ int VCHPOST_ vc_filesys_format(const char *path); // Returns the amount of free space on the drive that contains the given path VCHPRE_ int VCHPOST_ vc_filesys_freespace(const char *path); VCHPRE_ int64_t VCHPOST_ vc_filesys_freespace64(const char *path); // Gets the attributes of the named file VCHPRE_ int VCHPOST_ vc_filesys_get_attr(const char *path, fattributes_t *attr); // Get the file stat info struct for the specified file. VCHPRE_ int VCHPOST_ vc_filesys_fstat(int filedes, FSTAT_T *buf); // Creates a new directory VCHPRE_ int VCHPOST_ vc_filesys_mkdir(const char *path); // Starts a directory listing iteration VCHPRE_ void * VCHPOST_ vc_filesys_opendir(const char *dirname); // Directory listing iterator VCHPRE_ struct dirent * VCHPOST_ vc_filesys_readdir_r(void *dhandle, struct dirent *result); // Get the sum of the filesizes, and the number of files under the specified directory path. VCHPRE_ int64_t VCHPOST_ vc_filesys_dirsize(const char *path, uint32_t *num_files, uint32_t *num_dirs); // Deletes a file or (empty) directory VCHPRE_ int VCHPOST_ vc_filesys_remove(const char *path); // Renames a file, provided the new name is on the same file system as the old VCHPRE_ int VCHPOST_ vc_filesys_rename(const char *oldfile, const char *newfile); // Resets the co-processor side file system VCHPRE_ int VCHPOST_ vc_filesys_reset(void); // Sets the attributes of the named file VCHPRE_ int VCHPOST_ vc_filesys_set_attr(const char *path, fattributes_t attr); // Truncates a file at its current position VCHPRE_ int VCHPOST_ vc_filesys_setend(int fildes); // Returns the size of a file in bytes. VCHPRE_ int VCHPOST_ vc_filesys_size(const char *path); // Checks whether there are any messages in the incoming message fifo and responds to any such messages VCHPRE_ int VCHPOST_ vc_filesys_poll_message_fifo(void); // Return the event used to wait for reads. VCHPRE_ void * VCHPOST_ vc_filesys_read_event(void); // Sends a command for VC01 to reset the file system VCHPRE_ void VCHPOST_ vc_filesys_sendreset(void); // Return the error code of the last file system error VCHPRE_ int VCHPOST_ vc_filesys_errno(void); // Invalidates any cluster chains in the FAT that are not referenced in any directory structures VCHPRE_ void VCHPOST_ vc_filesys_scandisk(const char *path); // Checks whether or not a FAT filesystem is corrupt or not. If fix_errors is TRUE behaves exactly as vc_filesys_scandisk. VCHPRE_ int VCHPOST_ vc_filesys_chkdsk(const char *path, int fix_errors); // Return whether a disk is writeable or not. VCHPRE_ int VCHPOST_ vc_filesys_diskwritable(const char *path); // Return file system type of a disk. VCHPRE_ int VCHPOST_ vc_filesys_fstype(const char *path); // Returns the toatl amount of space on the drive that contains the given path VCHPRE_ int VCHPOST_ vc_filesys_totalspace(const char *path); VCHPRE_ int64_t VCHPOST_ vc_filesys_totalspace64(const char *path); // Open disk for block level access VCHPRE_ int VCHPOST_ vc_filesys_open_disk_raw(const char *path); // Close disk from block level access mode VCHPRE_ int VCHPOST_ vc_filesys_close_disk_raw(const char *path); // Open disk for normal access VCHPRE_ int VCHPOST_ vc_filesys_open_disk(const char *path); // Close disk for normal access VCHPRE_ int VCHPOST_ vc_filesys_close_disk(const char *path); // Return number of sectors. VCHPRE_ int VCHPOST_ vc_filesys_numsectors(const char *path); VCHPRE_ int64_t VCHPOST_ vc_filesys_numsectors64(const char *path); // Read/Write sectors VCHPRE_ int VCHPOST_ vc_filesys_read_sectors(const char *path, uint32_t sector_num, char *sectors, uint32_t num_sectors, uint32_t *sectors_read); VCHPRE_ int VCHPOST_ vc_filesys_write_sectors(const char *path, uint32_t sector_num, char *sectors, uint32_t num_sectors, uint32_t *sectors_written); // Begin reading sectors from VideoCore. VCHPRE_ int VCHPOST_ vc_filesys_read_sectors_begin(const char *path, uint32_t sector, uint32_t count); // Read the next sector. VCHPRE_ int VCHPOST_ vc_filesys_read_sector(char *buf); // End streaming sectors. VCHPRE_ int VCHPOST_ vc_filesys_read_sectors_end(uint32_t *sectors_read); // Begin writing sectors from VideoCore. VCHPRE_ int VCHPOST_ vc_filesys_write_sectors_begin(const char *path, uint32_t sector, uint32_t count); // Write the next sector. VCHPRE_ int VCHPOST_ vc_filesys_write_sector(const char *buf); // End streaming sectors. VCHPRE_ int VCHPOST_ vc_filesys_write_sectors_end(uint32_t *sectors_written); #endif //VCFILESYS_H_ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_vchi_gencmd.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VC_VCHI_GENCMD_H #define VC_VCHI_GENCMD_H #include "vchost_platform_config.h" #include "interface/vchi/vchi.h" #include "interface/vcos/vcos.h" //for VCHPRE_ abd VCHPOST_ macro's for func declaration /* Initialise general command service. Returns it's interface number. This initialises the host side of the interface, it does not send anything to VideoCore. */ VCHPRE_ int VCHPOST_ vc_gencmd_init(void); VCHPRE_ void VCHPOST_ vc_vchi_gencmd_init(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections ); /* Stop the service from being used. */ VCHPRE_ void VCHPOST_ vc_gencmd_stop(void); /* Functions to support videocore suspend/resume for cases where vc_gencmd_send expects a response to * ensure videocore is not shut down (done internally in vc_gencmd / vc_gencmd_until) */ VCHPRE_ int VCHPOST_ use_gencmd_service(void); VCHPRE_ int VCHPOST_ release_gencmd_service(void); /****************************************************************************** Send commands to VideoCore. These all return 0 for success. They return VC_MSGFIFO_FIFO_FULL if there is insufficient space for the whole message in the fifo, and none of the message is sent. ******************************************************************************/ /* send command to general command serivce */ VCHPRE_ int VCHPOST_ vc_gencmd_send( const char *format, ... ); /* get resonse from general command serivce */ VCHPRE_ int VCHPOST_ vc_gencmd_read_response(char *response, int maxlen); /* convenience function to send command and receive the response */ VCHPRE_ int VCHPOST_ vc_gencmd(char *response, int maxlen, const char *format, ...); /****************************************************************************** Utilities to help interpret the responses. ******************************************************************************/ /* Read the value of a property=value type pair from a string (typically VideoCore's response to a general command). Return non-zero if found. */ VCHPRE_ int VCHPOST_ vc_gencmd_string_property(char *text, const char *property, char **value, int *length); /* Read the numeric value of a property=number field from a response string. Return non-zero if found. */ VCHPRE_ int VCHPOST_ vc_gencmd_number_property(char *text, const char *property, int *number); /* Send a command until the desired response is received, the error message is detected, or the timeout */ VCHPRE_ int VCHPOST_ vc_gencmd_until( char *cmd, const char *property, char *value, const char *error_string, int timeout); #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vc_vchi_gpuserv.h ================================================ /* Copyright (c) 2016, Raspberry Pi (Trading) Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VC_VCHI_GPUSERV_H #define VC_VCHI_GPUSERV_H #include "interface/vchiq_arm/vchiq.h" // these go in command word of gpu_job_s // EXECUTE_VPU and EXECUTE_QPU are valid from host enum { EXECUTE_NONE, EXECUTE_VPU, EXECUTE_QPU, EXECUTE_SYNC }; struct vpu_job_s { // these are function address and parameters for vpu job uint32_t q[7]; uint32_t dummy[21]; }; struct qpu_job_s { // parameters for qpu job uint32_t jobs; uint32_t noflush; uint32_t timeout; uint32_t dummy; uint32_t control[12][2]; }; struct sync_job_s { // parameters for syncjob // bit 0 set means wait for preceding vpu jobs to complete // bit 1 set means wait for preceding qpu jobs to complete uint32_t mask; uint32_t dummy[27]; }; struct gpu_callback_s { // callback to call when complete (can be NULL) void (*func)(); void *cookie; }; struct gpu_internal_s { void *message; int refcount; }; struct gpu_job_s { // from enum above uint32_t command; // qpu or vpu jobs union { struct vpu_job_s v; struct qpu_job_s q; struct sync_job_s s; } u; // callback function to call when complete struct gpu_callback_s callback; // for internal use - leave as zero struct gpu_internal_s internal; }; /* Initialise gpu service. Returns its interface number. This initialises the host side of the interface, it does not send anything to VideoCore. */ VCHPRE_ int32_t VCHPOST_ vc_gpuserv_init(void); VCHPRE_ int32_t VCHPOST_ vc_gpuserv_execute_code(int num_jobs, struct gpu_job_s jobs[]); #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vcfilesys.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "vchost_platform_config.h" #include "vcfilesys_defs.h" #include "vc_fileservice_defs.h" #ifndef VCFILESYS_H_ #define VCFILESYS_H_ #ifndef FILESYS_DIR_DEFINED #define FILESYS_DIR_DEFINED typedef struct DIR_tag DIR; #endif // Initialises the file system for use VCHPRE_ int VCHPOST_ vc_filesys_init (void); // Stop it to prevent the functions from trying to use it. VCHPRE_ void VCHPOST_ vc_filesys_stop(void); // Return the service number (-1 if not running). VCHPRE_ int VCHPOST_ vc_filesys_inum(void); // Low level file system functions equivalent to close(), lseek(), open(), read() and write() VCHPRE_ int VCHPOST_ vc_filesys_close(int fildes); VCHPRE_ long VCHPOST_ vc_filesys_lseek(int fildes, long offset, int whence); VCHPRE_ int64_t VCHPOST_ vc_filesys_lseek64(int fildes, int64_t offset, int whence); VCHPRE_ int VCHPOST_ vc_filesys_open(const char *path, int vc_oflag); VCHPRE_ int VCHPOST_ vc_filesys_read(int fildes, void *buf, unsigned int nbyte); VCHPRE_ int VCHPOST_ vc_filesys_write(int fildes, const void *buf, unsigned int nbyte); VCHPRE_ int VCHPOST_ vc_filesys_mount(const char *device, const char *mountpoint, const char *options); VCHPRE_ int VCHPOST_ vc_filesys_umount(const char *mountpoint); // Ends a directory listing iteration VCHPRE_ int VCHPOST_ vc_filesys_closedir(void *dhandle); // Formats the drive that contains the given path VCHPRE_ int VCHPOST_ vc_filesys_format(const char *path); // Returns the amount of free space on the drive that contains the given path VCHPRE_ int VCHPOST_ vc_filesys_freespace(const char *path); VCHPRE_ int64_t VCHPOST_ vc_filesys_freespace64(const char *path); // Gets the attributes of the named file VCHPRE_ int VCHPOST_ vc_filesys_get_attr(const char *path, fattributes_t *attr); // Creates a new directory VCHPRE_ int VCHPOST_ vc_filesys_mkdir(const char *path); // Starts a directory listing iteration VCHPRE_ void * VCHPOST_ vc_filesys_opendir(const char *dirname); // Directory listing iterator VCHPRE_ struct dirent * VCHPOST_ vc_filesys_readdir_r(void *dhandle, struct dirent *result); // Deletes a file or (empty) directory VCHPRE_ int VCHPOST_ vc_filesys_remove(const char *path); // Renames a file, provided the new name is on the same file system as the old VCHPRE_ int VCHPOST_ vc_filesys_rename(const char *oldfile, const char *newfile); // Resets the co-processor side file system VCHPRE_ int VCHPOST_ vc_filesys_reset(void); // Sets the attributes of the named file VCHPRE_ int VCHPOST_ vc_filesys_set_attr(const char *path, fattributes_t attr); // Truncates a file at its current position VCHPRE_ int VCHPOST_ vc_filesys_setend(int fildes); // Checks whether there are any messages in the incoming message fifo and responds to any such messages VCHPRE_ int VCHPOST_ vc_filesys_poll_message_fifo(void); // Return the event used to wait for reads. VCHPRE_ void * VCHPOST_ vc_filesys_read_event(void); // Sends a command for VC01 to reset the file system VCHPRE_ void VCHPOST_ vc_filesys_sendreset(void); // Return the error code of the last file system error VCHPRE_ int VCHPOST_ vc_filesys_errno(void); // Invalidates any cluster chains in the FAT that are not referenced in any directory structures VCHPRE_ void VCHPOST_ vc_filesys_scandisk(const char *path); // Checks whether or not a FAT filesystem is corrupt or not. If fix_errors is TRUE behaves exactly as vc_filesys_scandisk. VCHPRE_ int VCHPOST_ vc_filesys_chkdsk(const char *path, int fix_errors); // Return whether a disk is writeable or not. VCHPRE_ int VCHPOST_ vc_filesys_diskwritable(const char *path); // Return file system type of a disk. VCHPRE_ int VCHPOST_ vc_filesys_fstype(const char *path); // Returns the toatl amount of space on the drive that contains the given path VCHPRE_ int VCHPOST_ vc_filesys_totalspace(const char *path); VCHPRE_ int64_t VCHPOST_ vc_filesys_totalspace64(const char *path); // Open disk for block level access VCHPRE_ int VCHPOST_ vc_filesys_open_disk_raw(const char *path); // Close disk from block level access mode VCHPRE_ int VCHPOST_ vc_filesys_close_disk_raw(const char *path); // Open disk for normal access VCHPRE_ int VCHPOST_ vc_filesys_open_disk(const char *path); // Close disk for normal access VCHPRE_ int VCHPOST_ vc_filesys_close_disk(const char *path); // Return number of sectors. VCHPRE_ int VCHPOST_ vc_filesys_numsectors(const char *path); VCHPRE_ int64_t VCHPOST_ vc_filesys_numsectors64(const char *path); // Begin reading sectors from VideoCore. VCHPRE_ int VCHPOST_ vc_filesys_read_sectors_begin(const char *path, uint32_t sector, uint32_t count); // Read the next sector. VCHPRE_ int VCHPOST_ vc_filesys_read_sector(char *buf); // End streaming sectors. VCHPRE_ int VCHPOST_ vc_filesys_read_sectors_end(uint32_t *sectors_read); // Begin writing sectors from VideoCore. VCHPRE_ int VCHPOST_ vc_filesys_write_sectors_begin(const char *path, uint32_t sector, uint32_t count); // Write the next sector. VCHPRE_ int VCHPOST_ vc_filesys_write_sector(const char *buf); // End streaming sectors. VCHPRE_ int VCHPOST_ vc_filesys_write_sectors_end(uint32_t *sectors_written); #endif //VCFILESYS_H_ ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vcfilesys_defs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // File service required types #ifndef VCFILESYS_DEFS_H #define VCFILESYS_DEFS_H #include // for time_t /* Define type fattributes_t and struct dirent for use in file system functions */ typedef int fattributes_t; //enum {ATTR_RDONLY=1, ATTR_DIRENT=2}; #define ATTR_RDONLY 0x01 /* Read only file attributes */ #define ATTR_HIDDEN 0x02 /* Hidden file attributes */ #define ATTR_SYSTEM 0x04 /* System file attributes */ #define ATTR_VOLUME 0x08 /* Volume Label file attributes */ #define ATTR_DIRENT 0x10 /* Dirrectory file attributes */ #define ATTR_ARCHIVE 0x20 /* Archives file attributes */ #define ATTR_NORMAL 0x00 /* Normal file attributes */ #define D_NAME_MAX_SIZE 256 #ifndef _DIRENT_H // This should really be in a dirent.h header to avoid conflicts struct dirent { char d_name[D_NAME_MAX_SIZE]; unsigned int d_size; fattributes_t d_attrib; time_t d_creatime; time_t d_modtime; }; #endif // ifndef _DIRENT_H #define FS_MAX_PATH 256 // The maximum length of a pathname /* Although not used in the API, this value is required on the host and VC01 sides of the file system, even if there is no host side. Putting it in vc_fileservice_defs.h is not appropriate as it would only be included if there was a host side. */ /* File system error codes */ #define FS_BAD_USER -7000 // The task isn't registered as a file system user #define FS_BAD_FILE -7001 // The path or filename or file descriptor is invalid #define FS_BAD_PARM -7002 // Invalid parameter given #define FS_ACCESS -7003 // File access conflict #define FS_MAX_FILES -7004 // Maximum number of files already open #define FS_NOEMPTY -7005 // Directory isn't empty #define FS_MAX_SIZE -7006 // File is over the maximum file size #define FS_NO_DISK -7007 // No disk is present, or the disk has not been opened #define FS_DISK_ERR -7008 // There is a problem with the disk #define FS_IO_ERROR -7009 // Driver level error #define FS_FMT_ERR -7010 // Format error #define FS_NO_BUFFER -7011 // Internal Nucleus File buffer not available #define FS_NUF_INT -7012 // Internal Nucleus File error #define FS_UNSPEC_ERR -7013 // Unspecified error #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vcgencmd.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // General command service API #ifndef GENCMD_H #define GENCMD_H #include "vchost_platform_config.h" #include "interface/vchi/vchi.h" VCHPRE_ void VCHPOST_ vc_vchi_gencmd_init(VCHI_INSTANCE_T initialise_instance, VCHI_CONNECTION_T **connections, uint32_t num_connections ); /* Initialise general command service. Returns it's interface number. This initialises the host side of the interface, it does not send anything to VideoCore. */ VCHPRE_ int VCHPOST_ vc_gencmd_init(void); /* Stop the service from being used. */ VCHPRE_ void VCHPOST_ vc_gencmd_stop(void); /* Return the service number (-1 if not running). */ VCHPRE_ int VCHPOST_ vc_gencmd_inum(void); /****************************************************************************** Send commands to VideoCore. These all return 0 for success. They return VC_MSGFIFO_FIFO_FULL if there is insufficient space for the whole message in the fifo, and none of the message is sent. ******************************************************************************/ /* send command to general command serivce */ VCHPRE_ int VCHPOST_ vc_gencmd_send( const char *format, ... ); /* get resonse from general command serivce */ VCHPRE_ int VCHPOST_ vc_gencmd_read_response(char *response, int maxlen); /* convenience function to send command and receive the response */ VCHPRE_ int VCHPOST_ vc_gencmd(char *response, int maxlen, const char *format, ...); /* read part of a response from the general command service */ VCHPRE_ int VCHPOST_ vc_gencmd_read_response_partial(char *response, int nbytes); /* if reading with vc_gencmd_read_response_partial end response reads with this */ VCHPRE_ int VCHPOST_ vc_gencmd_close_response_partial(void); /* get state of reading of response */ VCHPRE_ int VCHPOST_ vc_gencmd_read_partial_state(void); /****************************************************************************** Utilities to help interpret the responses. ******************************************************************************/ /* Read the value of a property=value type pair from a string (typically VideoCore's response to a general command). Return non-zero if found. */ VCHPRE_ int VCHPOST_ vc_gencmd_string_property(char *text, const char *property, char **value, int *length); /* Read the numeric value of a property=number field from a response string. Return non-zero if found. */ VCHPRE_ int VCHPOST_ vc_gencmd_number_property(char *text, const char *property, int *number); /* Send a command until the desired response is received, the error message is detected, or the timeout */ VCHPRE_ int VCHPOST_ vc_gencmd_until( char *cmd, const char *property, char *value, const char *error_string, int timeout); #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vchost.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCHOST_H #define VCHOST_H #include "vchost_platform_config.h" #include "vcfilesys_defs.h" #include "interface/vcos/vcos.h" //for VCHPRE_ abd VCHPOST_ macro's for func declaration #include "interface/vmcs_host/vc_fileservice_defs.h" // for VC_O_XXX file definitions #include "interface/vchi/vchi.h" #define UNUSED_PARAMETER(x) ((void)(x))/* macro to suppress not use warning */ /*---------------------------------------------------------------------------*/ /* Byte-swapping, dependent on host's orientation */ /*---------------------------------------------------------------------------*/ #ifndef VC_HOST_IS_BIG_ENDIAN #define VC_HTOV32(val) (val) #define VC_HTOV16(val) (val) #define VC_VTOH32(val) (val) #define VC_VTOH16(val) (val) #else static unsigned long VC_HTOV32(unsigned long val) { return ((val<<24) | ((val&0xff00)<<8) | ((val>>8)&0xff00) | ((val>>24)&0xff)); } static unsigned short VC_HTOV16(unsigned short val) { return ((val<<8)|(val>>8)); } static unsigned long VC_VTOH32(unsigned long val) { return ((val<<24) | ((val&0xff00)<<8) | ((val>>8)&0xff00) | ((val>>24)&0xff)); } static unsigned short VC_VTOH16(unsigned short val) { return ((val<<8)|(val>>8)); } #endif /*---------------------------------------------------------------------------*/ /* Host port related functions */ /*---------------------------------------------------------------------------*/ /* Boot a bin file from flash into RAM. Returns the id of the application running */ VCHPRE_ int VCHPOST_ vc_host_boot(char *cmd_line, void *binimg, int nbytes, int bootloader); /* Perform any platform specific initialisations. */ VCHPRE_ int VCHPOST_ vc_host_init(void); /* Read a multiple of 16 bytes from VideoCore. host_addr has no particular alignment, but it is important that it transfers the data in 16-bit chunks if this is possible. */ VCHPRE_ int VCHPOST_ vc_host_read_consecutive(void *host_addr, uint32_t vc_addr, int nbytes, int channel); #ifdef VC_HOST_IS_BIG_ENDIAN // Reads from VideoCore with an implicit swap of each pair of bytes. VCHPRE_ int VCHPOST_ vc_host_read_byteswapped(void *host_addr, uint32_t vc_addr, int nbytes, int channel); #endif /* Write a multiple of 16 bytes to VideoCore. host_addr has no particular alignment, but it is important that it transfers the data in 16-bit chunks if this is possible. */ VCHPRE_ int VCHPOST_ vc_host_write_consecutive(uint32_t vc_addr, void *host_addr, int nbytes, int channel); #ifdef VC_HOST_IS_BIG_ENDIAN // Write to VideoCore with an implicit swap of each pair of bytes. VCHPRE_ int VCHPOST_ vc_host_write_byteswapped(uint32_t vc_addr, void *host_addr, int nbytes, int channel); #endif /* Send an interrupt to VideoCore. */ VCHPRE_ int VCHPOST_ vc_host_send_interrupt(int channel); /* Wait for an interrupt from VideoCore. This can return immediately if applications are happy to busy-wait. */ VCHPRE_ int VCHPOST_ vc_host_wait_interrupt(void); /* Tell the host to act on or ignore interrupts. */ VCHPRE_ void VCHPOST_ vc_host_interrupts(int on); /* Function called when there is some kind of internal error. Breakpoints can be set on this for debugging. */ VCHPRE_ void VCHPOST_ vc_error(void); /*---------------------------------------------------------------------------*/ /* Event (interrupt) related functions */ /*---------------------------------------------------------------------------*/ // Minimum number of event objects an implementation should support. // Sufficient for 2 per 8 interfaces/services + 4 others #define VC_EVENT_MAX_NUM 20 /* Create (and clear) an event. Returns a pointer to the event object. */ VCHPRE_ void * VCHPOST_ vc_event_create(void); /* Wait for an event to be set, blocking until it is set. Only one thread may be waiting at any one time. The event is automatically cleared on leaving this function. */ VCHPRE_ void VCHPOST_ vc_event_wait(void *sig); /* Reads the state of an event (for polling systems) */ VCHPRE_ int VCHPOST_ vc_event_status(void *sig); /* Forcibly clears any pending event */ VCHPRE_ void VCHPOST_ vc_event_clear(void *sig); /* Sets an event - can be called from any thread */ VCHPRE_ void VCHPOST_ vc_event_set(void *sig); /* Register the calling task to be notified of an event. */ VCHPRE_ void VCHPOST_ vc_event_register(void *ievent); /* Set events to block, stopping polling mode. */ VCHPRE_ void VCHPOST_ vc_event_blocking(void); /*---------------------------------------------------------------------------*/ /* Semaphore related functions */ /*---------------------------------------------------------------------------*/ // Minimum number of locks an implementation should support. #define VC_LOCK_MAX_NUM 32 // Create a lock. Returns a pointer to the lock object. A lock is initially available // just once. VCHPRE_ void * VCHPOST_ vc_lock_create(void); // Obtain a lock. Block until we have it. Locks are not re-entrant for the same thread. VCHPRE_ void VCHPOST_ vc_lock_obtain(void *lock); // Release a lock. Anyone can call this, even if they didn't obtain the lock first. VCHPRE_ void VCHPOST_ vc_lock_release(void *lock); /*---------------------------------------------------------------------------*/ /* File system related functions */ /*---------------------------------------------------------------------------*/ // Initialises the host dependent file system functions for use VCHPRE_ void VCHPOST_ vc_hostfs_init(void); VCHPRE_ void VCHPOST_ vc_hostfs_exit(void); // Low level file system functions equivalent to close(), lseek(), open(), read() and write() VCHPRE_ int VCHPOST_ vc_hostfs_close(int fildes); VCHPRE_ long VCHPOST_ vc_hostfs_lseek(int fildes, long offset, int whence); VCHPRE_ int64_t VCHPOST_ vc_hostfs_lseek64(int fildes, int64_t offset, int whence); VCHPRE_ int VCHPOST_ vc_hostfs_open(const char *path, int vc_oflag); VCHPRE_ int VCHPOST_ vc_hostfs_read(int fildes, void *buf, unsigned int nbyte); VCHPRE_ int VCHPOST_ vc_hostfs_write(int fildes, const void *buf, unsigned int nbyte); // Ends a directory listing iteration VCHPRE_ int VCHPOST_ vc_hostfs_closedir(void *dhandle); // Formats the drive that contains the given path VCHPRE_ int VCHPOST_ vc_hostfs_format(const char *path); // Returns the amount of free space on the drive that contains the given path VCHPRE_ int VCHPOST_ vc_hostfs_freespace(const char *path); VCHPRE_ int64_t VCHPOST_ vc_hostfs_freespace64(const char *path); // Gets the attributes of the named file VCHPRE_ int VCHPOST_ vc_hostfs_get_attr(const char *path, fattributes_t *attr); // Creates a new directory VCHPRE_ int VCHPOST_ vc_hostfs_mkdir(const char *path); // Starts a directory listing iteration VCHPRE_ void * VCHPOST_ vc_hostfs_opendir(const char *dirname); // Directory listing iterator VCHPRE_ struct dirent * VCHPOST_ vc_hostfs_readdir_r(void *dhandle, struct dirent *result); // Deletes a file or (empty) directory VCHPRE_ int VCHPOST_ vc_hostfs_remove(const char *path); // Renames a file, provided the new name is on the same file system as the old VCHPRE_ int VCHPOST_ vc_hostfs_rename(const char *oldfile, const char *newfile); // Sets the attributes of the named file VCHPRE_ int VCHPOST_ vc_hostfs_set_attr(const char *path, fattributes_t attr); // Truncates a file at its current position VCHPRE_ int VCHPOST_ vc_hostfs_setend(int fildes); // Returns the total amount of space on the drive that contains the given path VCHPRE_ int VCHPOST_ vc_hostfs_totalspace(const char *path); VCHPRE_ int64_t VCHPOST_ vc_hostfs_totalspace64(const char *path); // Return millisecond resolution system time, only used for differences VCHPRE_ int VCHPOST_ vc_millitime(void); // Invalidates any cluster chains in the FAT that are not referenced in any directory structures VCHPRE_ void VCHPOST_ vc_hostfs_scandisk(const char *path); // Checks whether or not a FAT filesystem is corrupt or not. If fix_errors is TRUE behaves exactly as vc_filesys_scandisk. VCHPRE_ int VCHPOST_ vc_hostfs_chkdsk(const char *path, int fix_errors); /*---------------------------------------------------------------------------*/ /* These functions only need to be implemented for the test system. */ /*---------------------------------------------------------------------------*/ // Open a log file. VCHPRE_ void VCHPOST_ vc_log_open(const char *fname); // Flush any pending data to the log file. VCHPRE_ void VCHPOST_ vc_log_flush(void); // Close the log file. VCHPRE_ void VCHPOST_ vc_log_close(void); // Log an error. VCHPRE_ void VCHPOST_ vc_log_error(const char *format, ...); // Log a warning. VCHPRE_ void VCHPOST_ vc_log_warning(const char *format, ...); // Write a message to the log. VCHPRE_ void VCHPOST_ vc_log_msg(const char *format, ...); // Flush the log. VCHPRE_ void VCHPOST_ vc_log_flush(void); // Return the total number of warnings and errors logged. VCHPRE_ void VCHPOST_ vc_log_counts(int *warnings, int *errors); // Wait for the specified number of microseconds. Used in test system only. VCHPRE_ void VCHPOST_ vc_sleep(int ms); // Get a time value in milliseconds. Used for measuring time differences VCHPRE_ uint32_t VCHPOST_ vc_time(void); // Check timing functions are available. Use in calibrating tests. VCHPRE_ int VCHPOST_ calibrate_sleep (const char *data_dir); /*---------------------------------------------------------------------------*/ /* Functions to allow dynamic service creation */ /*---------------------------------------------------------------------------*/ VCHPRE_ void VCHPOST_ vc_host_get_vchi_state(VCHI_INSTANCE_T *initialise_instance, VCHI_CONNECTION_T **connection); #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vchost_platform_config.h ================================================ /* Copyright (c) 2016, Raspberry Pi (Trading) Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #if defined(__unix__) && !defined(__ANDROID__) #include "linux/vchost_config.h" #else #include "vchost_config.h" #endif ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vcilcs.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // OpenMAX IL Component Service definitions #ifndef ILCS_H #define ILCS_H #include "interface/vmcs_host/khronos/IL/OMX_Component.h" #include "interface/vmcs_host/vc_ilcs_defs.h" struct ILCS_SERVICE_T; typedef struct ILCS_SERVICE_T ILCS_SERVICE_T; struct ILCS_COMMON_T; typedef struct ILCS_COMMON_T ILCS_COMMON_T; typedef void (*IL_FN_T)(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); typedef struct { IL_FN_T *fns; ILCS_COMMON_T *(*ilcs_common_init)(ILCS_SERVICE_T *); void (*ilcs_common_deinit)(ILCS_COMMON_T *st); void (*ilcs_thread_init)(ILCS_COMMON_T *st); unsigned char *(*ilcs_mem_lock)(OMX_BUFFERHEADERTYPE *buffer); void (*ilcs_mem_unlock)(OMX_BUFFERHEADERTYPE *buffer); } ILCS_CONFIG_T; // initialise the VideoCore IL Component service // returns pointer to state on success, NULL on failure #ifdef USE_VCHIQ_ARM VCHPRE_ ILCS_SERVICE_T VCHPOST_ *ilcs_init(VCHIQ_INSTANCE_T state, void **connection, ILCS_CONFIG_T *config, int use_memmgr); #else VCHPRE_ ILCS_SERVICE_T VCHPOST_ *ilcs_init(VCHIQ_STATE_T *state, void **connection, ILCS_CONFIG_T *config, int use_memmgr); #endif // deinitialises the IL Component service VCHPRE_ void VCHPOST_ ilcs_deinit(ILCS_SERVICE_T *ilcs); // returns 1 if the current thread is the ilcs thread, 0 otherwise VCHPRE_ int VCHPOST_ ilcs_thread_current(void *param); // returns pointer to shared state VCHPRE_ ILCS_COMMON_T *ilcs_get_common(ILCS_SERVICE_T *ilcs); VCHPRE_ int VCHPOST_ ilcs_execute_function(ILCS_SERVICE_T *ilcs, IL_FUNCTION_T func, void *data, int len, void *resp, int *rlen); VCHPRE_ OMX_ERRORTYPE VCHPOST_ ilcs_pass_buffer(ILCS_SERVICE_T *ilcs, IL_FUNCTION_T func, void *reference, OMX_BUFFERHEADERTYPE *pBuffer); VCHPRE_ OMX_BUFFERHEADERTYPE * VCHPOST_ ilcs_receive_buffer(ILCS_SERVICE_T *ilcs, void *call, int clen, OMX_COMPONENTTYPE **pComp); // bulks are 16 bytes aligned, implicit in use of vchiq #define ILCS_ALIGN 16 #define ILCS_ROUND_UP(x) ((((unsigned long)(x))+ILCS_ALIGN-1) & ~(ILCS_ALIGN-1)) #define ILCS_ROUND_DOWN(x) (((unsigned long)(x)) & ~(ILCS_ALIGN-1)) #define ILCS_ALIGNED(x) (((unsigned long)(x) & (ILCS_ALIGN-1)) == 0) #ifdef _VIDEOCORE #include "vcfw/logging/logging.h" #ifdef ILCS_LOGGING #define LOG_MSG ILCS_LOGGING extern void ilcs_log_event_handler(OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_EVENTTYPE eEvent, OMX_U32 nData1,OMX_U32 nData2,OMX_PTR pEventData); #else #define LOG_MSG LOGGING_GENERAL #define ilcs_log_event_handler(...) extern void dummy_logging_message(int level, const char *format, ...); #undef logging_message #define logging_message if (1) {} else dummy_logging_message #endif // ILCS_LOGGING #endif // _VIDEOCORE #endif // ILCS_H ================================================ FILE: Libraries/Core/RPi/Headers/interface/vmcs_host/vcilcs_common.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // OpenMAX IL Component Service common - Host side header typedef struct { OMX_U32 port; IL_FUNCTION_T func; OMX_BOOL bEGL; OMX_U32 numBuffers; OMX_DIRTYPE dir; } VC_PRIVATE_PORT_T; struct _VC_PRIVATE_COMPONENT_T { OMX_COMPONENTTYPE *comp; void *reference; OMX_U32 numPorts; OMX_CALLBACKTYPE callbacks; OMX_PTR callback_state; VC_PRIVATE_PORT_T *port; struct _VC_PRIVATE_COMPONENT_T *next; }; typedef struct _VC_PRIVATE_COMPONENT_T VC_PRIVATE_COMPONENT_T; struct ILCS_COMMON_T { VCOS_SEMAPHORE_T component_lock; VC_PRIVATE_COMPONENT_T *component_list; ILCS_SERVICE_T *ilcs; }; VCHPRE_ void VCHPOST_ vcilcs_config(ILCS_CONFIG_T *config); // functions that implement incoming functions calls // from VideoCore components to host based components VCHPRE_ void VCHPOST_ vcil_in_get_state(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_get_parameter(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_set_parameter(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_get_config(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_set_config(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_use_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_free_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_empty_this_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_fill_this_buffer(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_get_component_version(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_get_extension_index(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_in_component_role_enum(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); // functions that implement callbacks from VideoCore // components to the host core. // The prefix is vcil_out since they implement part // of the API that the host uses out to VideoCore VCHPRE_ void VCHPOST_ vcil_out_event_handler(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_out_empty_buffer_done(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); VCHPRE_ void VCHPOST_ vcil_out_fill_buffer_done(ILCS_COMMON_T *st, void *call, int clen, void *resp, int *rlen); // functions used by the host IL core VCHPRE_ OMX_ERRORTYPE VCHPOST_ vcil_out_get_debug_information(ILCS_COMMON_T *st, OMX_STRING debugInfo, OMX_S32 *pLen); VCHPRE_ OMX_ERRORTYPE VCHPOST_ vcil_out_create_component(ILCS_COMMON_T *st, OMX_HANDLETYPE hComponent, OMX_STRING component_name); VCHPRE_ OMX_ERRORTYPE VCHPOST_ vcil_out_component_name_enum(ILCS_COMMON_T *st, OMX_STRING cComponentName, OMX_U32 nNameLength, OMX_U32 nIndex); ================================================ FILE: Libraries/Core/RPi/Headers/json/assertions.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED #define CPPTL_JSON_ASSERTIONS_H_INCLUDED #include #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) #if JSON_USE_EXCEPTION #include #define JSON_ASSERT(condition) \ assert(condition); // @todo <= change this into an exception throw #define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message); #else // JSON_USE_EXCEPTION #define JSON_ASSERT(condition) assert(condition); // The call to assert() will show the failure message in debug builds. In // release bugs we write to invalid memory in order to crash hard, so that a // debugger or crash reporter gets the chance to take over. We still call exit() // afterward in order to tell the compiler that this macro doesn't return. #define JSON_FAIL_MESSAGE(message) \ { \ assert(false &&message); \ strcpy(reinterpret_cast(666), message); \ exit(123); \ } #endif #define JSON_ASSERT_MESSAGE(condition, message) \ if (!(condition)) { \ JSON_FAIL_MESSAGE(message) \ } #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED ================================================ FILE: Libraries/Core/RPi/Headers/json/autolink.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_AUTOLINK_H_INCLUDED #define JSON_AUTOLINK_H_INCLUDED #include "config.h" #ifdef JSON_IN_CPPTL #include #endif #if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \ !defined(JSON_IN_CPPTL) #define CPPTL_AUTOLINK_NAME "json" #undef CPPTL_AUTOLINK_DLL #ifdef JSON_DLL #define CPPTL_AUTOLINK_DLL #endif #include "autolink.h" #endif #endif // JSON_AUTOLINK_H_INCLUDED ================================================ FILE: Libraries/Core/RPi/Headers/json/config.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_CONFIG_H_INCLUDED #define JSON_CONFIG_H_INCLUDED /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 /// If defined, indicates that json may leverage CppTL library //# define JSON_USE_CPPTL 1 /// If defined, indicates that cpptl vector based map should be used instead of /// std::map /// as Value container. //# define JSON_USE_CPPTL_SMALLMAP 1 /// If defined, indicates that Json specific container should be used /// (hash table & simple deque container with customizable allocator). /// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 //# define JSON_VALUE_USE_INTERNAL_MAP 1 /// Force usage of standard new/malloc based allocator instead of memory pool /// based allocator. /// The memory pools allocator used optimization (initializing Value and /// ValueInternalLink /// as if it was a POD) that may cause some validation tool to report errors. /// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. //# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 // If non-zero, the library uses exceptions to report bad input instead of C // assertion macros. The default is to use exceptions. #ifndef JSON_USE_EXCEPTION #define JSON_USE_EXCEPTION 1 #endif /// If defined, indicates that the source file is amalgated /// to prevent private header inclusion. /// Remarks: it is automatically defined in the generated amalgated header. // #define JSON_IS_AMALGAMATION #ifdef JSON_IN_CPPTL #include #ifndef JSON_USE_CPPTL #define JSON_USE_CPPTL 1 #endif #endif #ifdef JSON_IN_CPPTL #define JSON_API CPPTL_API #elif defined(JSON_DLL_BUILD) #if defined(_MSC_VER) #define JSON_API __declspec(dllexport) #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING #endif // if defined(_MSC_VER) #elif defined(JSON_DLL) #if defined(_MSC_VER) #define JSON_API __declspec(dllimport) #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING #endif // if defined(_MSC_VER) #endif // ifdef JSON_IN_CPPTL #if !defined(JSON_API) #define JSON_API #endif // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for // integer // Storages, and 64 bits integer support is disabled. // #define JSON_NO_INT64 1 #if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 // Microsoft Visual Studio 6 only support conversion from __int64 to double // (no conversion from unsigned __int64). #define JSON_USE_INT64_DOUBLE_CONVERSION 1 // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' // characters in the debug information) // All projects I've ever seen with VS6 were using this globally (not bothering // with pragma push/pop). #pragma warning(disable : 4786) #endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 #if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 /// Indicates that the following function is deprecated. #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) #endif #if !defined(JSONCPP_DEPRECATED) #define JSONCPP_DEPRECATED(message) #endif // if !defined(JSONCPP_DEPRECATED) namespace Json { typedef int Int; typedef unsigned int UInt; #if defined(JSON_NO_INT64) typedef int LargestInt; typedef unsigned int LargestUInt; #undef JSON_HAS_INT64 #else // if defined(JSON_NO_INT64) // For Microsoft Visual use specific types as long long is not supported #if defined(_MSC_VER) // Microsoft Visual Studio typedef __int64 Int64; typedef unsigned __int64 UInt64; #else // if defined(_MSC_VER) // Other platforms, use long long typedef long long int Int64; typedef unsigned long long int UInt64; #endif // if defined(_MSC_VER) typedef Int64 LargestInt; typedef UInt64 LargestUInt; #define JSON_HAS_INT64 #endif // if defined(JSON_NO_INT64) } // end namespace Json #endif // JSON_CONFIG_H_INCLUDED ================================================ FILE: Libraries/Core/RPi/Headers/json/features.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_FEATURES_H_INCLUDED #define CPPTL_JSON_FEATURES_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { /** \brief Configuration passed to reader and writer. * This configuration object can be used to force the Reader or Writer * to behave in a standard conforming way. */ class JSON_API Features { public: /** \brief A configuration that allows all features and assumes all strings * are UTF-8. * - C & C++ comments are allowed * - Root object can be any JSON value * - Assumes Value strings are encoded in UTF-8 */ static Features all(); /** \brief A configuration that is strictly compatible with the JSON * specification. * - Comments are forbidden. * - Root object must be either an array or an object value. * - Assumes Value strings are encoded in UTF-8 */ static Features strictMode(); /** \brief Initialize the configuration like JsonConfig::allFeatures; */ Features(); /// \c true if comments are allowed. Default: \c true. bool allowComments_; /// \c true if root must be either an array or an object value. Default: \c /// false. bool strictRoot_; /// \c true if dropped null placeholders are allowed. Default: \c false. bool allowDroppedNullPlaceholders_; /// \c true if numeric object key are allowed. Default: \c false. bool allowNumericKeys_; }; } // namespace Json #endif // CPPTL_JSON_FEATURES_H_INCLUDED ================================================ FILE: Libraries/Core/RPi/Headers/json/forwards.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_FORWARDS_H_INCLUDED #define JSON_FORWARDS_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { // writer.h class FastWriter; class StyledWriter; // reader.h class Reader; // features.h class Features; // value.h typedef unsigned int ArrayIndex; class StaticString; class Path; class PathArgument; class Value; class ValueIteratorBase; class ValueIterator; class ValueConstIterator; #ifdef JSON_VALUE_USE_INTERNAL_MAP class ValueMapAllocator; class ValueInternalLink; class ValueInternalArray; class ValueInternalMap; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP } // namespace Json #endif // JSON_FORWARDS_H_INCLUDED ================================================ FILE: Libraries/Core/RPi/Headers/json/json.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_JSON_H_INCLUDED #define JSON_JSON_H_INCLUDED #include "autolink.h" #include "value.h" #include "reader.h" #include "writer.h" #include "features.h" #endif // JSON_JSON_H_INCLUDED ================================================ FILE: Libraries/Core/RPi/Headers/json/json_batchallocator.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED #define JSONCPP_BATCHALLOCATOR_H_INCLUDED #include #include #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION namespace Json { /* Fast memory allocator. * * This memory allocator allocates memory for a batch of object (specified by * the page size, the number of object in each page). * * It does not allow the destruction of a single object. All the allocated * objects can be destroyed at once. The memory can be either released or reused * for future allocation. * * The in-place new operator must be used to construct the object using the * pointer returned by allocate. */ template class BatchAllocator { public: BatchAllocator(unsigned int objectsPerPage = 255) : freeHead_(0), objectsPerPage_(objectsPerPage) { // printf( "Size: %d => %s\n", sizeof(AllocatedType), // typeid(AllocatedType).name() ); assert(sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *)); // We must be able to store a slist in the // object free space. assert(objectsPerPage >= 16); batches_ = allocateBatch(0); // allocated a dummy page currentBatch_ = batches_; } ~BatchAllocator() { for (BatchInfo *batch = batches_; batch;) { BatchInfo *nextBatch = batch->next_; free(batch); batch = nextBatch; } } /// allocate space for an array of objectPerAllocation object. /// @warning it is the responsability of the caller to call objects /// constructors. AllocatedType *allocate() { if (freeHead_) // returns node from free list. { AllocatedType *object = freeHead_; freeHead_ = *(AllocatedType **)object; return object; } if (currentBatch_->used_ == currentBatch_->end_) { currentBatch_ = currentBatch_->next_; while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_) currentBatch_ = currentBatch_->next_; if (!currentBatch_) // no free batch found, allocate a new one { currentBatch_ = allocateBatch(objectsPerPage_); currentBatch_->next_ = batches_; // insert at the head of the list batches_ = currentBatch_; } } AllocatedType *allocated = currentBatch_->used_; currentBatch_->used_ += objectPerAllocation; return allocated; } /// Release the object. /// @warning it is the responsability of the caller to actually destruct the /// object. void release(AllocatedType *object) { assert(object != 0); *(AllocatedType **)object = freeHead_; freeHead_ = object; } private: struct BatchInfo { BatchInfo *next_; AllocatedType *used_; AllocatedType *end_; AllocatedType buffer_[objectPerAllocation]; }; // disabled copy constructor and assignement operator. BatchAllocator(const BatchAllocator &); void operator=(const BatchAllocator &); static BatchInfo *allocateBatch(unsigned int objectsPerPage) { const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; BatchInfo *batch = static_cast(malloc(mallocSize)); batch->next_ = 0; batch->used_ = batch->buffer_; batch->end_ = batch->buffer_ + objectsPerPage; return batch; } BatchInfo *batches_; BatchInfo *currentBatch_; /// Head of a single linked list within the allocated space of freeed object AllocatedType *freeHead_; unsigned int objectsPerPage_; }; } // namespace Json #endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION #endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED // vim: et ts=2 sts=2 sw=2 tw=0 ================================================ FILE: Libraries/Core/RPi/Headers/json/json_internalarray.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueArrayAllocator::~ValueArrayAllocator() { } // ////////////////////////////////////////////////////////////////// // class DefaultValueArrayAllocator // ////////////////////////////////////////////////////////////////// #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destructArray( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; #else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray(); // placement new return array; } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray( other ); // placement new return array; } virtual void destructArray( ValueInternalArray *array ) { if ( array ) { array->~ValueInternalArray(); arraysAllocator_.release( array ); } } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( pagesAllocator_.allocate() ); } virtual void releaseArrayPage( Value *value ) { if ( value ) pagesAllocator_.release( value ); } private: BatchAllocator arraysAllocator_; BatchAllocator pagesAllocator_; }; #endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR static ValueArrayAllocator *&arrayAllocator() { static DefaultValueArrayAllocator defaultAllocator; static ValueArrayAllocator *arrayAllocator = &defaultAllocator; return arrayAllocator; } static struct DummyArrayAllocatorInitializer { DummyArrayAllocatorInitializer() { arrayAllocator(); // ensure arrayAllocator() statics are initialized before main(). } } dummyArrayAllocatorInitializer; // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// bool ValueInternalArray::equals( const IteratorState &x, const IteratorState &other ) { return x.array_ == other.array_ && x.currentItemIndex_ == other.currentItemIndex_ && x.currentPageIndex_ == other.currentPageIndex_; } void ValueInternalArray::increment( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ != it.array_->size_, "ValueInternalArray::increment(): moving iterator beyond end" ); ++(it.currentItemIndex_); if ( it.currentItemIndex_ == itemsPerPage ) { it.currentItemIndex_ = 0; ++(it.currentPageIndex_); } } void ValueInternalArray::decrement( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && it.currentPageIndex_ == it.array_->pages_ && it.currentItemIndex_ == 0, "ValueInternalArray::decrement(): moving iterator beyond end" ); if ( it.currentItemIndex_ == 0 ) { it.currentItemIndex_ = itemsPerPage-1; --(it.currentPageIndex_); } else { --(it.currentItemIndex_); } } Value & ValueInternalArray::unsafeDereference( const IteratorState &it ) { return (*(it.currentPageIndex_))[it.currentItemIndex_]; } Value & ValueInternalArray::dereference( const IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ < it.array_->size_, "ValueInternalArray::dereference(): dereferencing invalid iterator" ); return unsafeDereference( it ); } void ValueInternalArray::makeBeginIterator( IteratorState &it ) const { it.array_ = const_cast( this ); it.currentItemIndex_ = 0; it.currentPageIndex_ = pages_; } void ValueInternalArray::makeIterator( IteratorState &it, ArrayIndex index ) const { it.array_ = const_cast( this ); it.currentItemIndex_ = index % itemsPerPage; it.currentPageIndex_ = pages_ + index / itemsPerPage; } void ValueInternalArray::makeEndIterator( IteratorState &it ) const { makeIterator( it, size_ ); } ValueInternalArray::ValueInternalArray() : pages_( 0 ) , size_( 0 ) , pageCount_( 0 ) { } ValueInternalArray::ValueInternalArray( const ValueInternalArray &other ) : pages_( 0 ) , size_( other.size_ ) , pageCount_( 0 ) { PageIndex minNewPages = other.size_ / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); IteratorState itOther; other.makeBeginIterator( itOther ); Value *value; for ( ArrayIndex index = 0; index < size_; ++index, increment(itOther) ) { if ( index % itemsPerPage == 0 ) { PageIndex pageIndex = index / itemsPerPage; value = arrayAllocator()->allocateArrayPage(); pages_[pageIndex] = value; } new (value) Value( dereference( itOther ) ); } } ValueInternalArray & ValueInternalArray::operator=(ValueInternalArray other) { swap(other); return *this; } ValueInternalArray::~ValueInternalArray() { // destroy all constructed items IteratorState it; IteratorState itEnd; makeBeginIterator( it); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } // release all pages PageIndex lastPageIndex = size_ / itemsPerPage; for ( PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); // release pages index arrayAllocator()->releaseArrayPageIndex( pages_, pageCount_ ); } void ValueInternalArray::swap( ValueInternalArray &other ) { Value **tempPages = pages_; pages_ = other.pages_; other.pages_ = tempPages; ArrayIndex tempSize = size_; size_ = other.size_; other.size_ = tempSize; PageIndex tempPageCount = pageCount_; pageCount_ = other.pageCount_; other.pageCount_ = tempPageCount; } void ValueInternalArray::clear() { ValueInternalArray dummy; swap( dummy ); } void ValueInternalArray::resize( ArrayIndex newSize ) { if ( newSize == 0 ) clear(); else if ( newSize < size_ ) { IteratorState it; IteratorState itEnd; makeIterator( it, newSize ); makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage; PageIndex lastPageIndex = size_ / itemsPerPage; for ( ; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); size_ = newSize; } else if ( newSize > size_ ) resolveReference( newSize ); } void ValueInternalArray::makeIndexValid( ArrayIndex index ) { // Need to enlarge page index ? if ( index >= pageCount_ * itemsPerPage ) { PageIndex minNewPages = (index + 1) / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); } // Need to allocate new pages ? ArrayIndex nextPageIndex = (size_ % itemsPerPage) != 0 ? size_ - (size_%itemsPerPage) + itemsPerPage : size_; if ( nextPageIndex <= index ) { PageIndex pageIndex = nextPageIndex / itemsPerPage; PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1; for ( ; pageToAllocate-- > 0; ++pageIndex ) pages_[pageIndex] = arrayAllocator()->allocateArrayPage(); } // Initialize all new entries IteratorState it; IteratorState itEnd; makeIterator( it, size_ ); size_ = index + 1; makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); new (value) Value(); // Construct a default value using placement new } } Value & ValueInternalArray::resolveReference( ArrayIndex index ) { if ( index >= size_ ) makeIndexValid( index ); return pages_[index/itemsPerPage][index%itemsPerPage]; } Value * ValueInternalArray::find( ArrayIndex index ) const { if ( index >= size_ ) return 0; return &(pages_[index/itemsPerPage][index%itemsPerPage]); } ValueInternalArray::ArrayIndex ValueInternalArray::size() const { return size_; } int ValueInternalArray::distance( const IteratorState &x, const IteratorState &y ) { return indexOf(y) - indexOf(x); } ValueInternalArray::ArrayIndex ValueInternalArray::indexOf( const IteratorState &iterator ) { if ( !iterator.array_ ) return ArrayIndex(-1); return ArrayIndex( (iterator.currentPageIndex_ - iterator.array_->pages_) * itemsPerPage + iterator.currentItemIndex_ ); } int ValueInternalArray::compare( const ValueInternalArray &other ) const { int sizeDiff( size_ - other.size_ ); if ( sizeDiff != 0 ) return sizeDiff; for ( ArrayIndex index =0; index < size_; ++index ) { int diff = pages_[index/itemsPerPage][index%itemsPerPage].compare( other.pages_[index/itemsPerPage][index%itemsPerPage] ); if ( diff != 0 ) return diff; } return 0; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/RPi/Headers/json/json_internalmap.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalMap // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// /** \internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) ); * This optimization is used by the fast allocator. */ ValueInternalLink::ValueInternalLink() : previous_( 0 ) , next_( 0 ) { } ValueInternalLink::~ValueInternalLink() { for ( int index =0; index < itemPerLink; ++index ) { if ( !items_[index].isItemAvailable() ) { if ( !items_[index].isMemberNameStatic() ) free( keys_[index] ); } else break; } } ValueMapAllocator::~ValueMapAllocator() { } #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; #else /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap(); // placement new return map; } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap( other ); // placement new return map; } virtual void destructMap( ValueInternalMap *map ) { if ( map ) { map->~ValueInternalMap(); mapsAllocator_.release( map ); } } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { ValueInternalLink *link = linksAllocator_.allocate(); memset( link, 0, sizeof(ValueInternalLink) ); return link; } virtual void releaseMapLink( ValueInternalLink *link ) { link->~ValueInternalLink(); linksAllocator_.release( link ); } private: BatchAllocator mapsAllocator_; BatchAllocator linksAllocator_; }; #endif static ValueMapAllocator *&mapAllocator() { static DefaultValueMapAllocator defaultAllocator; static ValueMapAllocator *mapAllocator = &defaultAllocator; return mapAllocator; } static struct DummyMapAllocatorInitializer { DummyMapAllocatorInitializer() { mapAllocator(); // ensure mapAllocator() statics are initialized before main(). } } dummyMapAllocatorInitializer; // h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32. /* use linked list hash map. buckets array is a container. linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124) value have extra state: valid, available, deleted */ ValueInternalMap::ValueInternalMap() : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { } ValueInternalMap::ValueInternalMap( const ValueInternalMap &other ) : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { reserve( other.itemCount_ ); IteratorState it; IteratorState itEnd; other.makeBeginIterator( it ); other.makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { bool isStatic; const char *memberName = key( it, isStatic ); const Value &aValue = value( it ); resolveReference(memberName, isStatic) = aValue; } } ValueInternalMap & ValueInternalMap::operator=(ValueInternalMap other) { swap(other); return *this; } ValueInternalMap::~ValueInternalMap() { if ( buckets_ ) { for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex ) { ValueInternalLink *link = buckets_[bucketIndex].next_; while ( link ) { ValueInternalLink *linkToRelease = link; link = link->next_; mapAllocator()->releaseMapLink( linkToRelease ); } } mapAllocator()->releaseMapBuckets( buckets_ ); } } void ValueInternalMap::swap( ValueInternalMap &other ) { ValueInternalLink *tempBuckets = buckets_; buckets_ = other.buckets_; other.buckets_ = tempBuckets; ValueInternalLink *tempTailLink = tailLink_; tailLink_ = other.tailLink_; other.tailLink_ = tempTailLink; BucketIndex tempBucketsSize = bucketsSize_; bucketsSize_ = other.bucketsSize_; other.bucketsSize_ = tempBucketsSize; BucketIndex tempItemCount = itemCount_; itemCount_ = other.itemCount_; other.itemCount_ = tempItemCount; } void ValueInternalMap::clear() { ValueInternalMap dummy; swap( dummy ); } ValueInternalMap::BucketIndex ValueInternalMap::size() const { return itemCount_; } bool ValueInternalMap::reserveDelta( BucketIndex growth ) { return reserve( itemCount_ + growth ); } bool ValueInternalMap::reserve( BucketIndex newItemCount ) { if ( !buckets_ && newItemCount > 0 ) { buckets_ = mapAllocator()->allocateMapBuckets( 1 ); bucketsSize_ = 1; tailLink_ = &buckets_[0]; } // BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink; return true; } const Value * ValueInternalMap::find( const char *key ) const { if ( !bucketsSize_ ) return 0; HashKey hashedKey = hash( key ); BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( const ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; current = current->next_ ) { for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return 0; if ( strcmp( key, current->keys_[index] ) == 0 ) return ¤t->items_[index]; } } return 0; } Value * ValueInternalMap::find( const char *key ) { const ValueInternalMap *constThis = this; return const_cast( constThis->find( key ) ); } Value & ValueInternalMap::resolveReference( const char *key, bool isStatic ) { HashKey hashedKey = hash( key ); if ( bucketsSize_ ) { BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink **previous = 0; BucketIndex index; for ( ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; previous = ¤t->next_, current = current->next_ ) { for ( index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return setNewItem( key, isStatic, current, index ); if ( strcmp( key, current->keys_[index] ) == 0 ) return current->items_[index]; } } } reserveDelta( 1 ); return unsafeAdd( key, isStatic, hashedKey ); } void ValueInternalMap::remove( const char *key ) { HashKey hashedKey = hash( key ); if ( !bucketsSize_ ) return; BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( ValueInternalLink *link = &buckets_[bucketIndex]; link != 0; link = link->next_ ) { BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) return; if ( strcmp( key, link->keys_[index] ) == 0 ) { doActualRemove( link, index, bucketIndex ); return; } } } } void ValueInternalMap::doActualRemove( ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex ) { // find last item of the bucket and swap it with the 'removed' one. // set removed items flags to 'available'. // if last page only contains 'available' items, then desallocate it (it's empty) ValueInternalLink *&lastLink = getLastLinkInBucket( index ); BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1 for ( ; lastItemIndex < ValueInternalLink::itemPerLink; ++lastItemIndex ) // may be optimized with dicotomic search { if ( lastLink->items_[lastItemIndex].isItemAvailable() ) break; } BucketIndex lastUsedIndex = lastItemIndex - 1; Value *valueToDelete = &link->items_[index]; Value *valueToPreserve = &lastLink->items_[lastUsedIndex]; if ( valueToDelete != valueToPreserve ) valueToDelete->swap( *valueToPreserve ); if ( lastUsedIndex == 0 ) // page is now empty { // remove it from bucket linked list and delete it. ValueInternalLink *linkPreviousToLast = lastLink->previous_; if ( linkPreviousToLast != 0 ) // can not deleted bucket link. { mapAllocator()->releaseMapLink( lastLink ); linkPreviousToLast->next_ = 0; lastLink = linkPreviousToLast; } } else { Value dummy; valueToPreserve->swap( dummy ); // restore deleted to default Value. valueToPreserve->setItemUsed( false ); } --itemCount_; } ValueInternalLink *& ValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex ) { if ( bucketIndex == bucketsSize_ - 1 ) return tailLink_; ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_; if ( !previous ) previous = &buckets_[bucketIndex]; return previous; } Value & ValueInternalMap::setNewItem( const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index ) { char *duplicatedKey = makeMemberName( key ); ++itemCount_; link->keys_[index] = duplicatedKey; link->items_[index].setItemUsed(); link->items_[index].setMemberNameIsStatic( isStatic ); return link->items_[index]; // items already default constructed. } Value & ValueInternalMap::unsafeAdd( const char *key, bool isStatic, HashKey hashedKey ) { JSON_ASSERT_MESSAGE( bucketsSize_ > 0, "ValueInternalMap::unsafeAdd(): internal logic error." ); BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex ); ValueInternalLink *link = previousLink; BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) break; } if ( index == ValueInternalLink::itemPerLink ) // need to add a new page { ValueInternalLink *newLink = mapAllocator()->allocateMapLink(); index = 0; link->next_ = newLink; previousLink = newLink; link = newLink; } return setNewItem( key, isStatic, link, index ); } ValueInternalMap::HashKey ValueInternalMap::hash( const char *key ) const { HashKey hash = 0; while ( *key ) hash += *key++ * 37; return hash; } int ValueInternalMap::compare( const ValueInternalMap &other ) const { int sizeDiff( itemCount_ - other.itemCount_ ); if ( sizeDiff != 0 ) return sizeDiff; // Strict order guaranty is required. Compare all keys FIRST, then compare values. IteratorState it; IteratorState itEnd; makeBeginIterator( it ); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { if ( !other.find( key( it ) ) ) return 1; } // All keys are equals, let's compare values makeBeginIterator( it ); for ( ; !equals(it,itEnd); increment(it) ) { const Value *otherValue = other.find( key( it ) ); int valueDiff = value(it).compare( *otherValue ); if ( valueDiff != 0 ) return valueDiff; } return 0; } void ValueInternalMap::makeBeginIterator( IteratorState &it ) const { it.map_ = const_cast( this ); it.bucketIndex_ = 0; it.itemIndex_ = 0; it.link_ = buckets_; } void ValueInternalMap::makeEndIterator( IteratorState &it ) const { it.map_ = const_cast( this ); it.bucketIndex_ = bucketsSize_; it.itemIndex_ = 0; it.link_ = 0; } bool ValueInternalMap::equals( const IteratorState &x, const IteratorState &other ) { return x.map_ == other.map_ && x.bucketIndex_ == other.bucketIndex_ && x.link_ == other.link_ && x.itemIndex_ == other.itemIndex_; } void ValueInternalMap::incrementBucket( IteratorState &iterator ) { ++iterator.bucketIndex_; JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_, "ValueInternalMap::increment(): attempting to iterate beyond end." ); if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ ) iterator.link_ = 0; else iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]); iterator.itemIndex_ = 0; } void ValueInternalMap::increment( IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterator using invalid iterator." ); ++iterator.itemIndex_; if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink ) { JSON_ASSERT_MESSAGE( iterator.link_ != 0, "ValueInternalMap::increment(): attempting to iterate beyond end." ); iterator.link_ = iterator.link_->next_; if ( iterator.link_ == 0 ) incrementBucket( iterator ); } else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() ) { incrementBucket( iterator ); } } void ValueInternalMap::decrement( IteratorState &iterator ) { if ( iterator.itemIndex_ == 0 ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterate using invalid iterator." ); if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] ) { JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, "Attempting to iterate beyond beginning." ); --(iterator.bucketIndex_); } iterator.link_ = iterator.link_->previous_; iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1; } } const char * ValueInternalMap::key( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->keys_[iterator.itemIndex_]; } const char * ValueInternalMap::key( const IteratorState &iterator, bool &isStatic ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic(); return iterator.link_->keys_[iterator.itemIndex_]; } Value & ValueInternalMap::value( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->items_[iterator.itemIndex_]; } int ValueInternalMap::distance( const IteratorState &x, const IteratorState &y ) { int offset = 0; IteratorState it = x; while ( !equals( it, y ) ) increment( it ); return offset; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/RPi/Headers/json/json_tool.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED /* This header provides common string manipulation support, such as UTF-8, * portable conversion from/to string... * * It is an internal header that must not be exposed. */ namespace Json { /// Converts a unicode code-point to UTF-8. static inline std::string codePointToUTF8(unsigned int cp) { std::string result; // based on description from http://en.wikipedia.org/wiki/UTF-8 if (cp <= 0x7f) { result.resize(1); result[0] = static_cast(cp); } else if (cp <= 0x7FF) { result.resize(2); result[1] = static_cast(0x80 | (0x3f & cp)); result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); } else if (cp <= 0xFFFF) { result.resize(3); result[2] = static_cast(0x80 | (0x3f & cp)); result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); } else if (cp <= 0x10FFFF) { result.resize(4); result[3] = static_cast(0x80 | (0x3f & cp)); result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); } return result; } /// Returns true if ch is a control character (in range [0,32[). static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } enum { /// Constant that specify the size of the buffer that must be passed to /// uintToString. uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 }; // Defines a char buffer for use with uintToString(). typedef char UIntToStringBuffer[uintToStringBufferSize]; /** Converts an unsigned integer to string. * @param value Unsigned interger to convert to string * @param current Input/Output string buffer. * Must have at least uintToStringBufferSize chars free. */ static inline void uintToString(LargestUInt value, char *¤t) { *--current = 0; do { *--current = char(value % 10) + '0'; value /= 10; } while (value != 0); } /** Change ',' to '.' everywhere in buffer. * * We had a sophisticated way, but it did not work in WinCE. * @see https://github.com/open-source-parsers/jsoncpp/pull/9 */ static inline void fixNumericLocale(char* begin, char* end) { while (begin < end) { if (*begin == ',') { *begin = '.'; } ++begin; } } } // namespace Json { #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED // vim: et ts=2 sts=2 sw=2 tw=0 ================================================ FILE: Libraries/Core/RPi/Headers/json/json_valueiterator.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIteratorBase // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIteratorBase::ValueIteratorBase() #ifndef JSON_VALUE_USE_INTERNAL_MAP : current_() , isNull_( true ) { } #else : isArray_( true ) , isNull_( true ) { iterator_.array_ = ValueInternalArray::IteratorState(); } #endif #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator ¤t ) : current_( current ) , isNull_( false ) { } #else ValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state ) : isArray_( true ) { iterator_.array_ = state; } ValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state ) : isArray_( false ) { iterator_.map_ = state; } #endif Value & ValueIteratorBase::deref() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP return current_->second; #else if ( isArray_ ) return ValueInternalArray::dereference( iterator_.array_ ); return ValueInternalMap::value( iterator_.map_ ); #endif } void ValueIteratorBase::increment() { #ifndef JSON_VALUE_USE_INTERNAL_MAP ++current_; #else if ( isArray_ ) ValueInternalArray::increment( iterator_.array_ ); ValueInternalMap::increment( iterator_.map_ ); #endif } void ValueIteratorBase::decrement() { #ifndef JSON_VALUE_USE_INTERNAL_MAP --current_; #else if ( isArray_ ) ValueInternalArray::decrement( iterator_.array_ ); ValueInternalMap::decrement( iterator_.map_ ); #endif } ValueIteratorBase::difference_type ValueIteratorBase::computeDistance( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP # ifdef JSON_USE_CPPTL_SMALLMAP return current_ - other.current_; # else // Iterator for null value are initialized using the default // constructor, which initialize current_ to the default // std::map::iterator. As begin() and end() are two instance // of the default std::map::iterator, they can not be compared. // To allow this, we handle this comparison specifically. if ( isNull_ && other.isNull_ ) { return 0; } // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL, // which is the one used by default). // Using a portable hand-made version for non random iterator instead: // return difference_type( std::distance( current_, other.current_ ) ); difference_type myDistance = 0; for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it ) { ++myDistance; } return myDistance; # endif #else if ( isArray_ ) return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ ); #endif } bool ValueIteratorBase::isEqual( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP if ( isNull_ ) { return other.isNull_; } return current_ == other.current_; #else if ( isArray_ ) return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ ); #endif } void ValueIteratorBase::copy( const SelfType &other ) { #ifndef JSON_VALUE_USE_INTERNAL_MAP current_ = other.current_; isNull_ = other.isNull_; #else if ( isArray_ ) iterator_.array_ = other.iterator_.array_; iterator_.map_ = other.iterator_.map_; #endif } Value ValueIteratorBase::key() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( czstring.c_str() ) { if ( czstring.isStaticString() ) return Value( StaticString( czstring.c_str() ) ); return Value( czstring.c_str() ); } return Value( czstring.index() ); #else if ( isArray_ ) return Value( ValueInternalArray::indexOf( iterator_.array_ ) ); bool isStatic; const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic ); if ( isStatic ) return Value( StaticString( memberName ) ); return Value( memberName ); #endif } UInt ValueIteratorBase::index() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( !czstring.c_str() ) return czstring.index(); return Value::UInt( -1 ); #else if ( isArray_ ) return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) ); return Value::UInt( -1 ); #endif } const char * ValueIteratorBase::memberName() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const char *name = (*current_).first.c_str(); return name ? name : ""; #else if ( !isArray_ ) return ValueInternalMap::key( iterator_.map_ ); return ""; #endif } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueConstIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueConstIterator::ValueConstIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueConstIterator & ValueConstIterator::operator =( const ValueIteratorBase &other ) { copy( other ); return *this; } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIterator::ValueIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIterator::ValueIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueIterator::ValueIterator( const ValueConstIterator &other ) : ValueIteratorBase( other ) { } ValueIterator::ValueIterator( const ValueIterator &other ) : ValueIteratorBase( other ) { } ValueIterator & ValueIterator::operator =( const SelfType &other ) { copy( other ); return *this; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/RPi/Headers/json/reader.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_READER_H_INCLUDED #define CPPTL_JSON_READER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "features.h" #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include #include #include // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) namespace Json { /** \brief Unserialize a JSON document into a *Value. * */ class JSON_API Reader { public: typedef char Char; typedef const Char *Location; /** \brief An error tagged with where in the JSON text it was encountered. * * The offsets give the [start, limit) range of bytes within the text. Note * that this is bytes, not codepoints. * */ struct StructuredError { size_t offset_start; size_t offset_limit; std::string message; }; /** \brief Constructs a Reader allowing all features * for parsing. */ Reader(); /** \brief Constructs a Reader allowing the specified feature set * for parsing. */ Reader(const Features &features); /** \brief Read a Value from a JSON * document. * \param document UTF-8 encoded string containing the document to read. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them * back during * serialization, \c false to discard comments. * This parameter is ignored if * Features::allowComments_ * is \c false. * \return \c true if the document was successfully parsed, \c false if an * error occurred. */ bool parse(const std::string &document, Value &root, bool collectComments = true); /** \brief Read a Value from a JSON document. * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the document to read. * \param endDoc Pointer on the end of the UTF-8 encoded string of the document to read. \ Must be >= beginDoc. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them back during * serialization, \c false to discard comments. * This parameter is ignored if Features::allowComments_ * is \c false. * \return \c true if the document was successfully parsed, \c false if an error occurred. */ bool parse(const char *beginDoc, const char *endDoc, Value &root, bool collectComments = true); /// \brief Parse from input stream. /// \see Json::operator>>(std::istream&, Json::Value&). bool parse(std::istream &is, Value &root, bool collectComments = true); /** \brief Returns a user friendly string that list errors in the parsed * document. * \return Formatted error message with the list of errors with their location * in * the parsed document. An empty string is returned if no error * occurred * during parsing. * \deprecated Use getFormattedErrorMessages() instead (typo fix). */ JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead") std::string getFormatedErrorMessages() const; /** \brief Returns a user friendly string that list errors in the parsed * document. * \return Formatted error message with the list of errors with their location * in * the parsed document. An empty string is returned if no error * occurred * during parsing. */ std::string getFormattedErrorMessages() const; /** \brief Returns a vector of structured erros encounted while parsing. * \return A (possibly empty) vector of StructuredError objects. Currently * only one error can be returned, but the caller should tolerate * multiple * errors. This can occur if the parser recovers from a non-fatal * parse error and then encounters additional errors. */ std::vector getStructuredErrors() const; private: enum TokenType { tokenEndOfStream = 0, tokenObjectBegin, tokenObjectEnd, tokenArrayBegin, tokenArrayEnd, tokenString, tokenNumber, tokenTrue, tokenFalse, tokenNull, tokenArraySeparator, tokenMemberSeparator, tokenComment, tokenError }; class Token { public: TokenType type_; Location start_; Location end_; }; class ErrorInfo { public: Token token_; std::string message_; Location extra_; }; typedef std::deque Errors; bool expectToken(TokenType type, Token &token, const char *message); bool readToken(Token &token); void skipSpaces(); bool match(Location pattern, int patternLength); bool readComment(); bool readCStyleComment(); bool readCppStyleComment(); bool readString(); void readNumber(); bool readValue(); bool readObject(Token &token); bool readArray(Token &token); bool decodeNumber(Token &token); bool decodeNumber(Token &token, Value &decoded); bool decodeString(Token &token); bool decodeString(Token &token, std::string &decoded); bool decodeDouble(Token &token); bool decodeDouble(Token &token, Value &decoded); bool decodeUnicodeCodePoint(Token &token, Location ¤t, Location end, unsigned int &unicode); bool decodeUnicodeEscapeSequence(Token &token, Location ¤t, Location end, unsigned int &unicode); bool addError(const std::string &message, Token &token, Location extra = 0); bool recoverFromError(TokenType skipUntilToken); bool addErrorAndRecover(const std::string &message, Token &token, TokenType skipUntilToken); void skipUntilSpace(); Value ¤tValue(); Char getNextChar(); void getLocationLineAndColumn(Location location, int &line, int &column) const; std::string getLocationLineAndColumn(Location location) const; void addComment(Location begin, Location end, CommentPlacement placement); void skipCommentTokens(Token &token); typedef std::stack Nodes; Nodes nodes_; Errors errors_; std::string document_; Location begin_; Location end_; Location current_; Location lastValueEnd_; Value *lastValue_; std::string commentsBefore_; Features features_; bool collectComments_; }; /** \brief Read from 'sin' into 'root'. Always keep comments from the input JSON. This can be used to read a file into a particular sub-object. For example: \code Json::Value root; cin >> root["dir"]["file"]; cout << root; \endcode Result: \verbatim { "dir": { "file": { // The input stream JSON would be nested here. } } } \endverbatim \throw std::exception on parse error. \see Json::operator<<() */ JSON_API std::istream &operator>>(std::istream &, Value &); } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // CPPTL_JSON_READER_H_INCLUDED ================================================ FILE: Libraries/Core/RPi/Headers/json/value.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_H_INCLUDED #define CPPTL_JSON_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include #ifndef JSON_USE_CPPTL_SMALLMAP #include #else #include #endif #ifdef JSON_USE_CPPTL #include #endif // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) /** \brief JSON (JavaScript Object Notation). */ namespace Json { /** \brief Type of the value held by a Value object. */ enum ValueType { nullValue = 0, ///< 'null' value intValue, ///< signed integer value uintValue, ///< unsigned integer value realValue, ///< double value stringValue, ///< UTF-8 string value booleanValue, ///< bool value arrayValue, ///< array value (ordered list) objectValue ///< object value (collection of name/value pairs). }; enum CommentPlacement { commentBefore = 0, ///< a comment placed on the line before a value commentAfterOnSameLine, ///< a comment just after a value on the same line commentAfter, ///< a comment on the line after a value (only make sense for /// root value) numberOfCommentPlacement }; //# ifdef JSON_USE_CPPTL // typedef CppTL::AnyEnumerator EnumMemberNames; // typedef CppTL::AnyEnumerator EnumValues; //# endif /** \brief Lightweight wrapper to tag static string. * * Value constructor and objectValue member assignement takes advantage of the * StaticString and avoid the cost of string duplication when storing the * string or the member name. * * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ class JSON_API StaticString { public: explicit StaticString(const char *czstring) : str_(czstring) {} operator const char *() const { return str_; } const char *c_str() const { return str_; } private: const char *str_; }; /** \brief Represents a JSON value. * * This class is a discriminated union wrapper that can represents a: * - signed integer [range: Value::minInt - Value::maxInt] * - unsigned integer (range: 0 - Value::maxUInt) * - double * - UTF-8 string * - boolean * - 'null' * - an ordered list of Value * - collection of name/value pairs (javascript object) * * The type of the held value is represented by a #ValueType and * can be obtained using type(). * * values of an #objectValue or #arrayValue can be accessed using operator[]() *methods. * Non const methods will automatically create the a #nullValue element * if it does not exist. * The sequence of an #arrayValue will be automatically resize and initialized * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. * * The get() methods can be used to obtanis default value in the case the *required element * does not exist. * * It is possible to iterate over the list of a #objectValue values using * the getMemberNames() method. */ class JSON_API Value { friend class ValueIteratorBase; #ifdef JSON_VALUE_USE_INTERNAL_MAP friend class ValueInternalLink; friend class ValueInternalMap; #endif public: typedef std::vector Members; typedef ValueIterator iterator; typedef ValueConstIterator const_iterator; typedef Json::UInt UInt; typedef Json::Int Int; #if defined(JSON_HAS_INT64) typedef Json::UInt64 UInt64; typedef Json::Int64 Int64; #endif // defined(JSON_HAS_INT64) typedef Json::LargestInt LargestInt; typedef Json::LargestUInt LargestUInt; typedef Json::ArrayIndex ArrayIndex; static const Value& null; /// Minimum signed integer value that can be stored in a Json::Value. static const LargestInt minLargestInt; /// Maximum signed integer value that can be stored in a Json::Value. static const LargestInt maxLargestInt; /// Maximum unsigned integer value that can be stored in a Json::Value. static const LargestUInt maxLargestUInt; /// Minimum signed int value that can be stored in a Json::Value. static const Int minInt; /// Maximum signed int value that can be stored in a Json::Value. static const Int maxInt; /// Maximum unsigned int value that can be stored in a Json::Value. static const UInt maxUInt; #if defined(JSON_HAS_INT64) /// Minimum signed 64 bits int value that can be stored in a Json::Value. static const Int64 minInt64; /// Maximum signed 64 bits int value that can be stored in a Json::Value. static const Int64 maxInt64; /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. static const UInt64 maxUInt64; #endif // defined(JSON_HAS_INT64) private: #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION #ifndef JSON_VALUE_USE_INTERNAL_MAP class CZString { public: enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy }; CZString(ArrayIndex index); CZString(const char *cstr, DuplicationPolicy allocate); CZString(const CZString &other); ~CZString(); CZString &operator=(CZString other); bool operator<(const CZString &other) const; bool operator==(const CZString &other) const; ArrayIndex index() const; const char *c_str() const; bool isStaticString() const; private: void swap(CZString &other); const char *cstr_; ArrayIndex index_; }; public: #ifndef JSON_USE_CPPTL_SMALLMAP typedef std::map ObjectValues; #else typedef CppTL::SmallMap ObjectValues; #endif // ifndef JSON_USE_CPPTL_SMALLMAP #endif // ifndef JSON_VALUE_USE_INTERNAL_MAP #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION public: /** \brief Create a default Value of the given type. This is a very useful constructor. To create an empty array, pass arrayValue. To create an empty object, pass objectValue. Another Value can then be set to this one by assignment. This is useful since clear() and resize() will not alter types. Examples: \code Json::Value null_value; // null Json::Value arr_value(Json::arrayValue); // [] Json::Value obj_value(Json::objectValue); // {} \endcode */ Value(ValueType type = nullValue); Value(Int value); Value(UInt value); #if defined(JSON_HAS_INT64) Value(Int64 value); Value(UInt64 value); #endif // if defined(JSON_HAS_INT64) Value(double value); Value(const char *value); Value(const char *beginValue, const char *endValue); /** \brief Constructs a value from a static string. * Like other value string constructor but do not duplicate the string for * internal storage. The given string must remain alive after the call to this * constructor. * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * \endcode */ Value(const StaticString &value); Value(const std::string &value); #ifdef JSON_USE_CPPTL Value(const CppTL::ConstString &value); #endif Value(bool value); Value(const Value &other); ~Value(); Value &operator=(Value other); /// Swap values. /// \note Currently, comments are intentionally not swapped, for /// both logic and efficiency. void swap(Value &other); ValueType type() const; bool operator<(const Value &other) const; bool operator<=(const Value &other) const; bool operator>=(const Value &other) const; bool operator>(const Value &other) const; bool operator==(const Value &other) const; bool operator!=(const Value &other) const; int compare(const Value &other) const; const char *asCString() const; std::string asString() const; #ifdef JSON_USE_CPPTL CppTL::ConstString asConstString() const; #endif Int asInt() const; UInt asUInt() const; #if defined(JSON_HAS_INT64) Int64 asInt64() const; UInt64 asUInt64() const; #endif // if defined(JSON_HAS_INT64) LargestInt asLargestInt() const; LargestUInt asLargestUInt() const; float asFloat() const; double asDouble() const; bool asBool() const; bool isNull() const; bool isBool() const; bool isInt() const; bool isInt64() const; bool isUInt() const; bool isUInt64() const; bool isIntegral() const; bool isDouble() const; bool isNumeric() const; bool isString() const; bool isArray() const; bool isObject() const; bool isConvertibleTo(ValueType other) const; /// Number of values in array or object ArrayIndex size() const; /// \brief Return true if empty array, empty object, or null; /// otherwise, false. bool empty() const; /// Return isNull() bool operator!() const; /// Remove all object members and array elements. /// \pre type() is arrayValue, objectValue, or nullValue /// \post type() is unchanged void clear(); /// Resize the array to size elements. /// New elements are initialized to null. /// May only be called on nullValue or arrayValue. /// \pre type() is arrayValue or nullValue /// \post type() is arrayValue void resize(ArrayIndex size); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are /// inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) Value &operator[](ArrayIndex index); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are /// inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) Value &operator[](int index); /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) const Value &operator[](ArrayIndex index) const; /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) const Value &operator[](int index) const; /// If the array contains at least index+1 elements, returns the element /// value, /// otherwise returns defaultValue. Value get(ArrayIndex index, const Value &defaultValue) const; /// Return true if index < size(). bool isValidIndex(ArrayIndex index) const; /// \brief Append value to array at the end. /// /// Equivalent to jsonvalue[jsonvalue.size()] = value; Value &append(const Value &value); /// Access an object value by name, create a null member if it does not exist. Value &operator[](const char *key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const char *key) const; /// Access an object value by name, create a null member if it does not exist. Value &operator[](const std::string &key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const std::string &key) const; /** \brief Access an object value by name, create a null member if it does not exist. * If the object as no entry for that name, then the member name used to store * the new entry is not duplicated. * Example of use: * \code * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ Value &operator[](const StaticString &key); #ifdef JSON_USE_CPPTL /// Access an object value by name, create a null member if it does not exist. Value &operator[](const CppTL::ConstString &key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const CppTL::ConstString &key) const; #endif /// Return the member named key if it exist, defaultValue otherwise. Value get(const char *key, const Value &defaultValue) const; /// Return the member named key if it exist, defaultValue otherwise. Value get(const std::string &key, const Value &defaultValue) const; #ifdef JSON_USE_CPPTL /// Return the member named key if it exist, defaultValue otherwise. Value get(const CppTL::ConstString &key, const Value &defaultValue) const; #endif /// \brief Remove and return the named member. /// /// Do nothing if it did not exist. /// \return the removed Value, or null. /// \pre type() is objectValue or nullValue /// \post type() is unchanged Value removeMember(const char *key); /// Same as removeMember(const char*) Value removeMember(const std::string &key); /// Return true if the object has a member named key. bool isMember(const char *key) const; /// Return true if the object has a member named key. bool isMember(const std::string &key) const; #ifdef JSON_USE_CPPTL /// Return true if the object has a member named key. bool isMember(const CppTL::ConstString &key) const; #endif /// \brief Return a list of the member names. /// /// If null, return an empty list. /// \pre type() is objectValue or nullValue /// \post if type() was nullValue, it remains nullValue Members getMemberNames() const; //# ifdef JSON_USE_CPPTL // EnumMemberNames enumMemberNames() const; // EnumValues enumValues() const; //# endif /// Comments must be //... or /* ... */ void setComment(const char *comment, CommentPlacement placement); /// Comments must be //... or /* ... */ void setComment(const std::string &comment, CommentPlacement placement); bool hasComment(CommentPlacement placement) const; /// Include delimiters and embedded newlines. std::string getComment(CommentPlacement placement) const; std::string toStyledString() const; const_iterator begin() const; const_iterator end() const; iterator begin(); iterator end(); // Accessors for the [start, limit) range of bytes within the JSON text from // which this value was parsed, if any. void setOffsetStart(size_t start); void setOffsetLimit(size_t limit); size_t getOffsetStart() const; size_t getOffsetLimit() const; private: Value &resolveReference(const char *key, bool isStatic); #ifdef JSON_VALUE_USE_INTERNAL_MAP inline bool isItemAvailable() const { return itemIsUsed_ == 0; } inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; } inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; } inline void setMemberNameIsStatic(bool isStatic) { memberNameIsStatic_ = isStatic ? 1 : 0; } #endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP private: struct CommentInfo { CommentInfo(); ~CommentInfo(); void setComment(const char *text); char *comment_; }; // struct MemberNamesTransform //{ // typedef const char *result_type; // const char *operator()( const CZString &name ) const // { // return name.c_str(); // } //}; union ValueHolder { LargestInt int_; LargestUInt uint_; double real_; bool bool_; char *string_; #ifdef JSON_VALUE_USE_INTERNAL_MAP ValueInternalArray *array_; ValueInternalMap *map_; #else ObjectValues *map_; #endif } value_; ValueType type_ : 8; int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. #ifdef JSON_VALUE_USE_INTERNAL_MAP unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. #endif CommentInfo *comments_; // [start, limit) byte offsets in the source JSON text from which this Value // was extracted. size_t start_; size_t limit_; }; /** \brief Experimental and untested: represents an element of the "path" to * access a node. */ class JSON_API PathArgument { public: friend class Path; PathArgument(); PathArgument(ArrayIndex index); PathArgument(const char *key); PathArgument(const std::string &key); private: enum Kind { kindNone = 0, kindIndex, kindKey }; std::string key_; ArrayIndex index_; Kind kind_; }; /** \brief Experimental and untested: represents a "path" to access a node. * * Syntax: * - "." => root node * - ".[n]" => elements at index 'n' of root node (an array value) * - ".name" => member named 'name' of root node (an object value) * - ".name1.name2.name3" * - ".[0][1][2].name1[3]" * - ".%" => member name is provided as parameter * - ".[%]" => index is provied as parameter */ class JSON_API Path { public: Path(const std::string &path, const PathArgument &a1 = PathArgument(), const PathArgument &a2 = PathArgument(), const PathArgument &a3 = PathArgument(), const PathArgument &a4 = PathArgument(), const PathArgument &a5 = PathArgument()); const Value &resolve(const Value &root) const; Value resolve(const Value &root, const Value &defaultValue) const; /// Creates the "path" to access the specified node and returns a reference on /// the node. Value &make(Value &root) const; private: typedef std::vector InArgs; typedef std::vector Args; void makePath(const std::string &path, const InArgs &in); void addPathInArg(const std::string &path, const InArgs &in, InArgs::const_iterator &itInArg, PathArgument::Kind kind); void invalidPath(const std::string &path, int location); Args args_; }; #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief Allocator to customize Value internal map. * Below is an example of a simple implementation (default implementation actually * use memory pool for speed). * \code class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; * \endcode */ class JSON_API ValueMapAllocator { public: virtual ~ValueMapAllocator(); virtual ValueInternalMap *newMap() = 0; virtual ValueInternalMap *newMapCopy(const ValueInternalMap &other) = 0; virtual void destructMap(ValueInternalMap *map) = 0; virtual ValueInternalLink *allocateMapBuckets(unsigned int size) = 0; virtual void releaseMapBuckets(ValueInternalLink *links) = 0; virtual ValueInternalLink *allocateMapLink() = 0; virtual void releaseMapLink(ValueInternalLink *link) = 0; }; /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). * \internal previous_ & next_ allows for bidirectional traversal. */ class JSON_API ValueInternalLink { public: enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. enum InternalFlags { flagAvailable = 0, flagUsed = 1 }; ValueInternalLink(); ~ValueInternalLink(); Value items_[itemPerLink]; char *keys_[itemPerLink]; ValueInternalLink *previous_; ValueInternalLink *next_; }; /** \brief A linked page based hash-table implementation used internally by *Value. * \internal ValueInternalMap is a tradional bucket based hash-table, with a *linked * list in each bucket to handle collision. There is an addional twist in that * each node of the collision linked list is a page containing a fixed amount of * value. This provides a better compromise between memory usage and speed. * * Each bucket is made up of a chained list of ValueInternalLink. The last * link of a given bucket can be found in the 'previous_' field of the following *bucket. * The last link of the last bucket is stored in tailLink_ as it has no *following bucket. * Only the last link of a bucket may contains 'available' item. The last link *always * contains at least one element unless is it the bucket one very first link. */ class JSON_API ValueInternalMap { friend class ValueIteratorBase; friend class Value; public: typedef unsigned int HashKey; typedef unsigned int BucketIndex; #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState { IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {} ValueInternalMap *map_; ValueInternalLink *link_; BucketIndex itemIndex_; BucketIndex bucketIndex_; }; #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalMap(); ValueInternalMap(const ValueInternalMap &other); ValueInternalMap &operator=(ValueInternalMap other); ~ValueInternalMap(); void swap(ValueInternalMap &other); BucketIndex size() const; void clear(); bool reserveDelta(BucketIndex growth); bool reserve(BucketIndex newItemCount); const Value *find(const char *key) const; Value *find(const char *key); Value &resolveReference(const char *key, bool isStatic); void remove(const char *key); void doActualRemove(ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex); ValueInternalLink *&getLastLinkInBucket(BucketIndex bucketIndex); Value &setNewItem(const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index); Value &unsafeAdd(const char *key, bool isStatic, HashKey hashedKey); HashKey hash(const char *key) const; int compare(const ValueInternalMap &other) const; private: void makeBeginIterator(IteratorState &it) const; void makeEndIterator(IteratorState &it) const; static bool equals(const IteratorState &x, const IteratorState &other); static void increment(IteratorState &iterator); static void incrementBucket(IteratorState &iterator); static void decrement(IteratorState &iterator); static const char *key(const IteratorState &iterator); static const char *key(const IteratorState &iterator, bool &isStatic); static Value &value(const IteratorState &iterator); static int distance(const IteratorState &x, const IteratorState &y); private: ValueInternalLink *buckets_; ValueInternalLink *tailLink_; BucketIndex bucketsSize_; BucketIndex itemCount_; }; /** \brief A simplified deque implementation used internally by Value. * \internal * It is based on a list of fixed "page", each page contains a fixed number of *items. * Instead of using a linked-list, a array of pointer is used for fast item *look-up. * Look-up for an element is as follow: * - compute page index: pageIndex = itemIndex / itemsPerPage * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] * * Insertion is amortized constant time (only the array containing the index of *pointers * need to be reallocated when items are appended). */ class JSON_API ValueInternalArray { friend class Value; friend class ValueIteratorBase; public: enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. typedef Value::ArrayIndex ArrayIndex; typedef unsigned int PageIndex; #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState // Must be a POD { IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {} ValueInternalArray *array_; Value **currentPageIndex_; unsigned int currentItemIndex_; }; #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalArray(); ValueInternalArray(const ValueInternalArray &other); ValueInternalArray &operator=(ValueInternalArray other); ~ValueInternalArray(); void swap(ValueInternalArray &other); void clear(); void resize(ArrayIndex newSize); Value &resolveReference(ArrayIndex index); Value *find(ArrayIndex index) const; ArrayIndex size() const; int compare(const ValueInternalArray &other) const; private: static bool equals(const IteratorState &x, const IteratorState &other); static void increment(IteratorState &iterator); static void decrement(IteratorState &iterator); static Value &dereference(const IteratorState &iterator); static Value &unsafeDereference(const IteratorState &iterator); static int distance(const IteratorState &x, const IteratorState &y); static ArrayIndex indexOf(const IteratorState &iterator); void makeBeginIterator(IteratorState &it) const; void makeEndIterator(IteratorState &it) const; void makeIterator(IteratorState &it, ArrayIndex index) const; void makeIndexValid(ArrayIndex index); Value **pages_; ArrayIndex size_; PageIndex pageCount_; }; /** \brief Experimental: do not use. Allocator to customize Value internal array. * Below is an example of a simple implementation (actual implementation use * memory pool). \code class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destruct( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); if ( !newIndexes ) throw std::bad_alloc(); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; \endcode */ class JSON_API ValueArrayAllocator { public: virtual ~ValueArrayAllocator(); virtual ValueInternalArray *newArray() = 0; virtual ValueInternalArray *newArrayCopy(const ValueInternalArray &other) = 0; virtual void destructArray(ValueInternalArray *array) = 0; /** \brief Reallocate array page index. * Reallocates an array of pointer on each page. * \param indexes [input] pointer on the current index. May be \c NULL. * [output] pointer on the new index of at least * \a minNewIndexCount pages. * \param indexCount [input] current number of pages in the index. * [output] number of page the reallocated index can handle. * \b MUST be >= \a minNewIndexCount. * \param minNewIndexCount Minimum number of page the new index must be able * to * handle. */ virtual void reallocateArrayPageIndex(Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount) = 0; virtual void releaseArrayPageIndex(Value **indexes, ValueInternalArray::PageIndex indexCount) = 0; virtual Value *allocateArrayPage() = 0; virtual void releaseArrayPage(Value *value) = 0; }; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief base class for Value iterators. * */ class JSON_API ValueIteratorBase { public: typedef std::bidirectional_iterator_tag iterator_category; typedef unsigned int size_t; typedef int difference_type; typedef ValueIteratorBase SelfType; ValueIteratorBase(); #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIteratorBase(const Value::ObjectValues::iterator ¤t); #else ValueIteratorBase(const ValueInternalArray::IteratorState &state); ValueIteratorBase(const ValueInternalMap::IteratorState &state); #endif bool operator==(const SelfType &other) const { return isEqual(other); } bool operator!=(const SelfType &other) const { return !isEqual(other); } difference_type operator-(const SelfType &other) const { return computeDistance(other); } /// Return either the index or the member name of the referenced value as a /// Value. Value key() const; /// Return the index of the referenced Value. -1 if it is not an arrayValue. UInt index() const; /// Return the member name of the referenced Value. "" if it is not an /// objectValue. const char *memberName() const; protected: Value &deref() const; void increment(); void decrement(); difference_type computeDistance(const SelfType &other) const; bool isEqual(const SelfType &other) const; void copy(const SelfType &other); private: #ifndef JSON_VALUE_USE_INTERNAL_MAP Value::ObjectValues::iterator current_; // Indicates that iterator is for a null value. bool isNull_; #else union { ValueInternalArray::IteratorState array_; ValueInternalMap::IteratorState map_; } iterator_; bool isArray_; #endif }; /** \brief const iterator for object and array value. * */ class JSON_API ValueConstIterator : public ValueIteratorBase { friend class Value; public: typedef const Value value_type; typedef unsigned int size_t; typedef int difference_type; typedef const Value &reference; typedef const Value *pointer; typedef ValueConstIterator SelfType; ValueConstIterator(); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueConstIterator(const Value::ObjectValues::iterator ¤t); #else ValueConstIterator(const ValueInternalArray::IteratorState &state); ValueConstIterator(const ValueInternalMap::IteratorState &state); #endif public: SelfType &operator=(const ValueIteratorBase &other); SelfType operator++(int) { SelfType temp(*this); ++*this; return temp; } SelfType operator--(int) { SelfType temp(*this); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator*() const { return deref(); } }; /** \brief Iterator for object and array value. */ class JSON_API ValueIterator : public ValueIteratorBase { friend class Value; public: typedef Value value_type; typedef unsigned int size_t; typedef int difference_type; typedef Value &reference; typedef Value *pointer; typedef ValueIterator SelfType; ValueIterator(); ValueIterator(const ValueConstIterator &other); ValueIterator(const ValueIterator &other); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIterator(const Value::ObjectValues::iterator ¤t); #else ValueIterator(const ValueInternalArray::IteratorState &state); ValueIterator(const ValueInternalMap::IteratorState &state); #endif public: SelfType &operator=(const SelfType &other); SelfType operator++(int) { SelfType temp(*this); ++*this; return temp; } SelfType operator--(int) { SelfType temp(*this); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator*() const { return deref(); } }; } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // CPPTL_JSON_H_INCLUDED ================================================ FILE: Libraries/Core/RPi/Headers/json/writer.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_WRITER_H_INCLUDED #define JSON_WRITER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) namespace Json { class Value; /** \brief Abstract class for writers. */ class JSON_API Writer { public: virtual ~Writer(); virtual std::string write(const Value &root) = 0; }; /** \brief Outputs a Value in JSON format *without formatting (not human friendly). * * The JSON document is written in a single line. It is not intended for 'human' *consumption, * but may be usefull to support feature such as RPC where bandwith is limited. * \sa Reader, Value */ class JSON_API FastWriter : public Writer { public: FastWriter(); virtual ~FastWriter() {} void enableYAMLCompatibility(); /** \brief Drop the "null" string from the writer's output for nullValues. * Strictly speaking, this is not valid JSON. But when the output is being * fed to a browser's Javascript, it makes for smaller output and the * browser can handle the output just fine. */ void dropNullPlaceholders(); void omitEndingLineFeed(); public: // overridden from Writer virtual std::string write(const Value &root); private: void writeValue(const Value &value); std::string document_; bool yamlCompatiblityEnabled_; bool dropNullPlaceholders_; bool omitEndingLineFeed_; }; /** \brief Writes a Value in JSON format in a *human friendly way. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per *line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value *types, * and all the values fit on one lines, then print the array on a single *line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their *#CommentPlacement. * * \sa Reader, Value, Value::setComment() */ class JSON_API StyledWriter : public Writer { public: StyledWriter(); virtual ~StyledWriter() {} public: // overridden from Writer /** \brief Serialize a Value in JSON format. * \param root Value to serialize. * \return String containing the JSON document that represents the root value. */ virtual std::string write(const Value &root); private: void writeValue(const Value &value); void writeArrayValue(const Value &value); bool isMultineArray(const Value &value); void pushValue(const std::string &value); void writeIndent(); void writeWithIndent(const std::string &value); void indent(); void unindent(); void writeCommentBeforeValue(const Value &root); void writeCommentAfterValueOnSameLine(const Value &root); bool hasCommentForValue(const Value &value); static std::string normalizeEOL(const std::string &text); typedef std::vector ChildValues; ChildValues childValues_; std::string document_; std::string indentString_; int rightMargin_; int indentSize_; bool addChildValues_; }; /** \brief Writes a Value in JSON format in a human friendly way, to a stream rather than to a string. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value types, * and all the values fit on one lines, then print the array on a single line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their #CommentPlacement. * * \param indentation Each level will be indented by this amount extra. * \sa Reader, Value, Value::setComment() */ class JSON_API StyledStreamWriter { public: StyledStreamWriter(std::string indentation = "\t"); ~StyledStreamWriter() {} public: /** \brief Serialize a Value in JSON format. * \param out Stream to write to. (Can be ostringstream, e.g.) * \param root Value to serialize. * \note There is no point in deriving from Writer, since write() should not * return a value. */ void write(std::ostream &out, const Value &root); private: void writeValue(const Value &value); void writeArrayValue(const Value &value); bool isMultineArray(const Value &value); void pushValue(const std::string &value); void writeIndent(); void writeWithIndent(const std::string &value); void indent(); void unindent(); void writeCommentBeforeValue(const Value &root); void writeCommentAfterValueOnSameLine(const Value &root); bool hasCommentForValue(const Value &value); static std::string normalizeEOL(const std::string &text); typedef std::vector ChildValues; ChildValues childValues_; std::ostream *document_; std::string indentString_; int rightMargin_; std::string indentation_; bool addChildValues_; }; #if defined(JSON_HAS_INT64) std::string JSON_API valueToString(Int value); std::string JSON_API valueToString(UInt value); #endif // if defined(JSON_HAS_INT64) std::string JSON_API valueToString(LargestInt value); std::string JSON_API valueToString(LargestUInt value); std::string JSON_API valueToString(double value); std::string JSON_API valueToString(bool value); std::string JSON_API valueToQuotedString(const char *value); /// \brief Output using the StyledStreamWriter. /// \see Json::operator>>() JSON_API std::ostream &operator<<(std::ostream &, const Value &root); } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // JSON_WRITER_H_INCLUDED ================================================ FILE: Libraries/Core/RPi/Headers/libevdev/libevdev-uinput.h ================================================ /* * Copyright © 2013 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * that the name of the copyright holders not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holders make no representations * about the suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef LIBEVDEV_UINPUT_H #define LIBEVDEV_UINPUT_H #ifdef __cplusplus extern "C" { #endif #include struct libevdev_uinput; /** * @defgroup uinput uinput device creation * * Creation of uinput devices based on existing libevdev devices. These functions * help to create uinput devices that emulate libevdev devices. In the simplest * form it serves to duplicate an existing device: * @code int err; int new_fd; struct libevdev *dev; struct libevdev_uinput *uidev; struct input_event ev[2]; err = libevdev_new_from_fd(&dev, fd); if (err != 0) return err; uifd = open("/dev/uinput", O_RDWR); if (uidev < 0) return -errno; err = libevdev_uinput_create_from_device(dev, uifd, &uidev); if (err != 0) return err; // post a REL_X event err = libevdev_uinput_write_event(uidev, EV_REL, REL_X, -1); if (err != 0) return err; libevdev_uinput_write_event(uidev, EV_SYN, SYN_REPORT, 0); if (err != 0) return err; libevdev_uinput_destroy(uidev); close(uifd); @endcode * * Alternatively, a device can be constructed from scratch: * @code int err; struct libevdev *dev; struct libevdev_uinput *uidev; dev = libevdev_new(); libevdev_set_name(dev, "test device"); libevdev_enable_event_type(dev, EV_REL); libevdev_enable_event_code(dev, EV_REL, REL_X); libevdev_enable_event_code(dev, EV_REL, REL_Y); libevdev_enable_event_type(dev, EV_KEY); libevdev_enable_event_code(dev, EV_KEY, BTN_LEFT); libevdev_enable_event_code(dev, EV_KEY, BTN_MIDDLE); libevdev_enable_event_code(dev, EV_KEY, BTN_RIGHT); err = libevdev_uinput_create_from_device(dev, LIBEVDEV_UINPUT_OPEN_MANAGED, &uidev); if (err != 0) return err; // ... do something ... libevdev_uinput_destroy(uidev); @endcode */ enum libevdev_uinput_open_mode { /* intentionally -2 to avoid to avoid code like the below from accidentally working: fd = open("/dev/uinput", O_RDWR); // fails, fd is -1 libevdev_uinput_create_from_device(dev, fd, &uidev); // may hide the error */ LIBEVDEV_UINPUT_OPEN_MANAGED = -2 /**< let libevdev open and close @c /dev/uinput */ }; /** * @ingroup uinput * * Create a uinput device based on the given libevdev device. The uinput device * will be an exact copy of the libevdev device, minus the bits that uinput doesn't * allow to be set. * * If uinput_fd is @ref LIBEVDEV_UINPUT_OPEN_MANAGED, libevdev_uinput_create_from_device() * will open @c /dev/uinput in read/write mode and manage the file descriptor. * Otherwise, uinput_fd must be opened by the caller and opened with the * appropriate permissions. * * The device's lifetime is tied to the uinput file descriptor, closing it will * destroy the uinput device. You should call libevdev_uinput_destroy() before * closing the file descriptor to free allocated resources. * A file descriptor can only create one uinput device at a time; the second device * will fail with -EINVAL. * * You don't need to keep the file descriptor variable around, * libevdev_uinput_get_fd() will return it when needed. * * @note Due to limitations in the uinput kernel module, REP_DELAY and * REP_PERIOD will default to the kernel defaults, not to the ones set in the * source device. * * @param dev The device to duplicate * @param uinput_fd @ref LIBEVDEV_UINPUT_OPEN_MANAGED or a file descriptor to @c /dev/uinput, * @param[out] uinput_dev The newly created libevdev device. * * @return 0 on success or a negative errno on failure. On failure, the value of * uinput_dev is unmodified. * * @see libevdev_uinput_destroy */ int libevdev_uinput_create_from_device(const struct libevdev *dev, int uinput_fd, struct libevdev_uinput **uinput_dev); /** * @ingroup uinput * * Destroy a previously created uinput device and free associated memory. * * If the device was opened with @ref LIBEVDEV_UINPUT_OPEN_MANAGED, * libevdev_uinput_destroy() also closes the file descriptor. Otherwise, the * fd is left as-is and must be closed by the caller. * * @param uinput_dev A previously created uinput device. */ void libevdev_uinput_destroy(struct libevdev_uinput *uinput_dev); /** * @ingroup uinput * * Return the file descriptor used to create this uinput device. This is the * fd pointing to /dev/uinput. This file descriptor may be used to write * events that are emitted by the uinput device. * Closing this file descriptor will destroy the uinput device, you should * call libevdev_uinput_destroy() first to free allocated resources. * * @param uinput_dev A previously created uinput device. * * @return The file descriptor used to create this device */ int libevdev_uinput_get_fd(const struct libevdev_uinput *uinput_dev); /** * @ingroup uinput * * Return the syspath representing this uinput device. If the UI_GET_SYSNAME * ioctl not available, libevdev makes an educated guess. * The UI_GET_SYSNAME ioctl is available since Linux 3.15. * * @note This function may return NULL if UI_GET_SYSNAME is not available. * In that case, libevdev uses ctime and the device name to guess devices. * To avoid false positives, wait at least wait at least 1.5s between * creating devices that have the same name. * @param uinput_dev A previously created uinput device. * @return The syspath for this device, including the preceding /sys * * @see libevdev_uinput_get_devnode */ const char* libevdev_uinput_get_syspath(struct libevdev_uinput *uinput_dev); /** * @ingroup uinput * * Return the device node representing this uinput device. * * This relies on libevdev_uinput_get_syspath() to provide a valid syspath. * See libevdev_uinput_get_syspath() for more details. * * @note This function may return NULL. libevdev may have to guess the * syspath and the device node. See libevdev_uinput_get_syspath() for details. * @param uinput_dev A previously created uinput device. * @return The device node for this device, in the form of /dev/input/eventN * * @see libevdev_uinput_get_syspath */ const char* libevdev_uinput_get_devnode(struct libevdev_uinput *uinput_dev); /** * @ingroup uinput * * Post an event through the uinput device. It is the caller's responsibility * that any event sequence is terminated with an EV_SYN/SYN_REPORT/0 event. * Otherwise, listeners on the device node will not see the events until the * next EV_SYN event is posted. * * @param uinput_dev A previously created uinput device. * @param type Event type (EV_ABS, EV_REL, etc.) * @param code Event code (ABS_X, REL_Y, etc.) * @param value The event value * @return 0 on success or a negative errno on error */ int libevdev_uinput_write_event(const struct libevdev_uinput *uinput_dev, unsigned int type, unsigned int code, int value); #ifdef __cplusplus } #endif #endif /* LIBEVDEV_UINPUT_H */ ================================================ FILE: Libraries/Core/RPi/Headers/libevdev/libevdev.h ================================================ /* * Copyright © 2013 Red Hat, Inc. * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that copyright * notice and this permission notice appear in supporting documentation, and * that the name of the copyright holders not be used in advertising or * publicity pertaining to distribution of the software without specific, * written prior permission. The copyright holders make no representations * about the suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. * * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ #ifndef LIBEVDEV_H #define LIBEVDEV_H #ifdef __cplusplus extern "C" { #endif #include #include #define LIBEVDEV_ATTRIBUTE_PRINTF(_format, _args) __attribute__ ((format (printf, _format, _args))) /** * @mainpage * * **libevdev** is a library for handling evdev kernel devices. It abstracts * the \ref ioctls through type-safe interfaces and provides functions to change * the appearance of the device. * * Development of libevdev is discussed on * [input-tools@lists.freedesktop.org](http://lists.freedesktop.org/mailman/listinfo/input-tools) * Please submit patches, questions or general comments there. * * Handling events and SYN_DROPPED * =============================== * * libevdev provides an interface for handling events, including most notably * SYN_DROPPED events. SYN_DROPPED events are sent by the kernel when the * process does not read events fast enough and the kernel is forced to drop * some events. This causes the device to get out of sync with the process' * view of it. libevdev handles this by telling the caller that a SYN_DROPPED * has been received and that the state of the device is different to what is * to be expected. It then provides the delta between the previous state and * the actual state of the device as a set of events. See * libevdev_next_event() and @ref syn_dropped for more information on how * SYN_DROPPED is handled. * * Signal safety * ============= * * libevdev is signal-safe for the majority of its operations, i.e. many of * its functions are safe to be called from within a signal handler. * Check the API documentation to make sure, unless explicitly stated a call * is not signal safe. * * Device handling * =============== * * A libevdev context is valid for a given file descriptor and its * duration. Closing the file descriptor will not destroy the libevdev device * but libevdev will not be able to read further events. * * libevdev does not attempt duplicate detection. Initializing two libevdev * devices for the same fd is valid and behaves the same as for two different * devices. * * libevdev does not handle the file descriptors directly, it merely uses * them. The caller is responsible for opening the file descriptors, setting * them to O_NONBLOCK and handling permissions. * * Where does libevdev sit? * ======================== * * libevdev is essentially a `read(2)` on steroids for `/dev/input/eventX` * devices. It sits below the process that handles input events, in between * the kernel and that process. In the simplest case, e.g. an evtest-like tool * the stack would look like this: * * kernel → libevdev → evtest * * For X.Org input modules, the stack would look like this: * * kernel → libevdev → xf86-input-evdev → X server → X client * * For Weston/Wayland, the stack would look like this: * * kernel → libevdev → Weston → Wayland client * * libevdev does **not** have knowledge of X clients or Wayland clients, it is * too low in the stack. * * Example * ======= * Below is a simple example that shows how libevdev could be used. This example * opens a device, checks for relative axes and a left mouse button and if it * finds them monitors the device to print the event. * * @code struct libevdev *dev = NULL; int fd; int rc = 1; fd = open("/dev/input/event0", O_RDONLY|O_NONBLOCK); rc = libevdev_new_from_fd(fd, &dev); if (rc < 0) { fprintf(stderr, "Failed to init libevdev (%s)\n", strerror(-rc)); exit(1); } printf("Input device name: \"%s\"\n", libevdev_get_name(dev)); printf("Input device ID: bus %#x vendor %#x product %#x\n", libevdev_get_id_bustype(dev), libevdev_get_id_vendor(dev), libevdev_get_id_product(dev)); if (!libevdev_has_event_type(dev, EV_REL) || !libevdev_has_event_code(dev, EV_KEY, BTN_LEFT)) { printf("This device does not look like a mouse\n"); exit(1); } do { struct input_event ev; rc = libevdev_next_event(dev, LIBEVDEV_READ_FLAG_NORMAL, &ev); if (rc == 0) printf("Event: %s %s %d\n", libevdev_get_event_type_name(ev.type), libevdev_get_event_code_name(ev.type, ev.code), ev.value); } while (rc == 1 || rc == 0 || rc == -EAGAIN); @endcode * * A more complete example is available with the libevdev-events tool here: * http://cgit.freedesktop.org/libevdev/tree/tools/libevdev-events.c * * Backwards compatibility with older kernel * ========================================= * libevdev attempts to build and run correctly on a number of kernel versions. * If features required are not available, libevdev attempts to work around them * in the most reasonable way. For more details see \ref backwardscompatibility. * * License information * =================== * libevdev is licensed under the * [X11 license](http://cgit.freedesktop.org/libevdev/tree/COPYING). * * Reporting bugs * ============== * Please report bugs in the freedesktop.org bugzilla under the libevdev product: * https://bugs.freedesktop.org/enter_bug.cgi?product=libevdev */ /** * @page syn_dropped SYN_DROPPED handling * * This page describes how libevdev handles SYN_DROPPED events. * * Receiving SYN_DROPPED events * ============================ * * The kernel sends evdev events separated by an event of type EV_SYN and * code SYN_REPORT. Such an event marks the end of a frame of hardware * events. The number of events between SYN_REPORT events is arbitrary and * depends on the hardware. An example event sequence may look like this: * @code EV_ABS ABS_X 9 EV_ABS ABS_Y 8 EV_SYN SYN_REPORT 0 ------------------------ EV_ABS ABS_X 10 EV_ABS ABS_Y 10 EV_KEY BTN_TOUCH 1 EV_SYN SYN_REPORT 0 ------------------------ EV_ABS ABS_X 11 EV_SYN SYN_REPORT 0 * @endcode * * Events are handed to the client buffer as they appear, the kernel adjusts * the buffer size to handle at least one full event. In the normal case, * the client reads the event and the kernel can place the next event in the * buffer. If the client is not fast enough, the kernel places an event of * type EV_SYN and code SYN_DROPPED into the buffer, effectively notifying * the client that some events were lost. The above example event sequence * may look like this (note the missing/repeated events): * @code EV_ABS ABS_X 9 EV_ABS ABS_Y 8 EV_SYN SYN_REPORT 0 ------------------------ EV_ABS ABS_X 10 EV_ABS ABS_Y 10 EV_SYN SYN_DROPPED 0 EV_ABS ABS_Y 15 EV_SYN SYN_REPORT 0 ------------------------ EV_ABS ABS_X 11 EV_KEY BTN_TOUCH 0 EV_SYN SYN_REPORT 0 * @endcode * * A SYN_DROPPED event may be recieved at any time in the event sequence. * When a SYN_DROPPED event is received, the client must: * * discard all events since the last SYN_REPORT * * discard all events until including the next SYN_REPORT * These event are part of incomplete event frames. * * Synchronizing the state of the device * ===================================== * * The handling of the device after a SYN_DROPPED depends on the available * event codes. For all event codes of type EV_REL, no handling is * necessary, there is no state attached. For all event codes of type * EV_KEY, EV_SW, EV_LED and EV_SND, the matching @ref ioctls retrieve the * current state. The caller must then compare the last-known state to the * retrieved state and handle the deltas accordingly. * libevdev simplifies this approach: if the state of the device has * changed, libevdev generates an event for each code with the new value and * passes it to the caller during libevdev_next_event() if * @ref LIBEVDEV_READ_FLAG_SYNC is set. * * For events of type EV_ABS and an event code less than ABS_MT_SLOT, the * handling of state changes is as described above. For events between * ABS_MT_SLOT and ABS_MAX, the event handling differs. * Slots are the vehicles to transport information for multiple simultaneous * touchpoints on a device. Slots are re-used once a touchpoint has ended. * The kernel sends an ABS_MT_SLOT event whenever the current slot * changes; any event in the above axis range applies only to the currently * active slot. * Thus, an event sequence from a slot-capable device may look like this: * @code EV_ABS ABS_MT_POSITION_Y 10 EV_ABS ABS_MT_SLOT 1 EV_ABS ABS_MT_POSITION_X 100 EV_ABS ABS_MT_POSITION_Y 80 EV_SYN SYN_REPORT 0 * @endcode * Note the lack of ABS_MT_SLOT: the first ABS_MT_POSITION_Y applies to * a slot opened previously, and is the only axis that changed for that * slot. The touchpoint in slot 1 now has position 100/80. * The kernel does not provide events if a value does not change, and does * not send ABS_MT_SLOT events if the slot does not change, or none of the * values within a slot changes. A client must thus keep the state for each * slot. * * If a SYN_DROPPED is received, the client must sync all slots * individually and update its internal state. libevdev simplifies this by * generating multiple events: * * for each slot on the device, libevdev generates an * ABS_MT_SLOT event with the value set to the slot number * * for each event code between ABS_MT_SLOT + 1 and ABS_MAX that changed * state for this slot, libevdev generates an event for the new state * * libevdev sends a final ABS_MT_SLOT event for the current slot as * seen by the kernel * * libevdev terminates this sequence with an EV_SYN SYN_REPORT event * * An example event sequence for such a sync may look like this: * @code EV_ABS ABS_MT_SLOT 0 EV_ABS ABS_MT_POSITION_Y 10 EV_ABS ABS_MT_SLOT 1 EV_ABS ABS_MT_POSITION_X 100 EV_ABS ABS_MT_POSITION_Y 80 EV_ABS ABS_MT_SLOT 2 EV_ABS ABS_MT_POSITION_Y 8 EV_ABS ABS_MT_PRESSURE 12 EV_ABS ABS_MT_SLOT 1 EV_SYN SYN_REPORT 0 * @endcode * Note the terminating ABS_MT_SLOT event, this indicates that the kernel * currently has slot 1 active. * * Synchronizing ABS_MT_TRACKING_ID * ================================ * * The event code ABS_MT_TRACKING_ID is used to denote the start and end of * a touch point within a slot. An ABS_MT_TRACKING_ID of zero or greater * denotes the start of a touchpoint, an ABS_MT_TRACKING_ID of -1 denotes * the end of a touchpoint within this slot. During SYN_DROPPED, a touch * point may have ended and re-started within a slot - a client must check * the ABS_MT_TRACKING_ID. libevdev simplifies this by emulating extra * events if the ABS_MT_TRACKING_ID has changed: * * if the ABS_MT_TRACKING_ID was valid and is -1, libevdev enqueues an * ABS_MT_TRACKING_ID event with value -1. * * if the ABS_MT_TRACKING_ID was -1 and is now a valid ID, libevdev * enqueues an ABS_MT_TRACKING_ID event with the current value. * * if the ABS_MT_TRACKING_ID was a valid ID and is now a different valid * ID, libevev enqueues an ABS_MT_TRACKING_ID event with value -1 and * another ABS_MT_TRACKING_ID event with the new value. * * An example event sequence for such a sync may look like this: * @code EV_ABS ABS_MT_SLOT 0 EV_ABS ABS_MT_TRACKING_ID -1 EV_ABS ABS_MT_SLOT 2 EV_ABS ABS_MT_TRACKING_ID -1 EV_SYN SYN_REPORT 0 ------------------------ EV_ABS ABS_MT_SLOT 1 EV_ABS ABS_MT_POSITION_X 100 EV_ABS ABS_MT_POSITION_Y 80 EV_ABS ABS_MT_SLOT 2 EV_ABS ABS_MT_TRACKING_ID 45 EV_ABS ABS_MT_POSITION_Y 8 EV_ABS ABS_MT_PRESSURE 12 EV_ABS ABS_MT_SLOT 1 EV_SYN SYN_REPORT 0 * @endcode * Note how the touchpoint in slot 0 was terminated, the touchpoint in slot * 2 was terminated and then started with a new ABS_MT_TRACKING_ID. The touchpoint * in slot 1 maintained the same ABS_MT_TRACKING_ID and only updated the * coordinates. Slot 1 is the currently active slot. * * In the case of a SYN_DROPPED event, a touch point may be invisible to a * client if it started after SYN_DROPPED and finished before the client * handles events again. The below example shows an example event sequence * and what libevdev sees in the case of a SYN_DROPPED event: * @code kernel | userspace | EV_ABS ABS_MT_SLOT 0 | EV_ABS ABS_MT_SLOT 0 EV_ABS ABS_MT_TRACKING_ID -1 | EV_ABS ABS_MT_TRACKING_ID -1 EV_SYN SYN_REPORT 0 | EV_SYN SYN_REPORT 0 ------------------------ | ------------------------ EV_ABS ABS_MT_TRACKING_ID 30 | EV_ABS ABS_MT_POSITION_X 100 | EV_ABS ABS_MT_POSITION_Y 80 | EV_SYN SYN_REPORT 0 | SYN_DROPPED ------------------------ | EV_ABS ABS_MT_TRACKING_ID -1 | EV_SYN SYN_REPORT 0 | ------------------------ | ------------------------ EV_ABS ABS_MT_SLOT 1 | EV_ABS ABS_MT_SLOT 1 EV_ABS ABS_MT_POSITION_X 90 | EV_ABS ABS_MT_POSITION_X 90 EV_ABS ABS_MT_POSITION_Y 10 | EV_ABS ABS_MT_POSITION_Y 10 EV_SYN SYN_REPORT 0 | EV_SYN SYN_REPORT 0 * @endcode * If such an event sequence occurs, libevdev will send all updated axes * during the sync process. Axis events may thus be generated for devices * without a currently valid ABS_MT_TRACKING_ID. Specifically for the above * example, the client would receive the following event sequence: * @code EV_ABS ABS_MT_SLOT 0 ← LIBEVDEV_READ_FLAG_NORMAL EV_ABS ABS_MT_TRACKING_ID -1 EV_SYN SYN_REPORT 0 ------------------------ EV_SYN SYN_DROPPED 0 → LIBEVDEV_READ_STATUS_SYNC ------------------------ EV_ABS ABS_MT_POSITION_X 100 ← LIBEVDEV_READ_FLAG_SYNC EV_ABS ABS_MT_POSITION_Y 80 EV_SYN SYN_REPORT 0 ----------------------------- → -EGAIN EV_ABS ABS_MT_SLOT 1 ← LIBEVDEV_READ_FLAG_NORMAL EV_ABS ABS_MT_POSITION_X 90 EV_ABS ABS_MT_POSITION_Y 10 EV_SYN SYN_REPORT 0 ------------------- * @endcode * The axis events do not reflect the position of a current touch point, a * client must take care not to generate a new touch point based on those * updates. * * Discarding events before synchronizing * ===================================== * * The kernel implements the client buffer as a ring buffer. SYN_DROPPED * events are handled when the buffer is full and a new event is received * from a device. All existing events are discarded, a SYN_DROPPED is added * to the buffer followed by the actual device event. Further events will be * appended to the buffer until it is either read by the client, or filled * again, at which point the sequence repeats. * * When the client reads the buffer, the buffer will thus always consist of * exactly one SYN_DROPPED event followed by an unspecified number of real * events. The data the ioctls return is the current state of the device, * i.e. the state after all these events have been processed. For example, * assume the buffer contains the following sequence: * * @code EV_SYN SYN_DROPPED EV_ABS ABS_X 1 EV_SYN SYN_REPORT 0 EV_ABS ABS_X 2 EV_SYN SYN_REPORT 0 EV_ABS ABS_X 3 EV_SYN SYN_REPORT 0 EV_ABS ABS_X 4 EV_SYN SYN_REPORT 0 EV_ABS ABS_X 5 EV_SYN SYN_REPORT 0 EV_ABS ABS_X 6 EV_SYN SYN_REPORT 0 * @endcode * An ioctl at any time in this sequence will return a value of 6 for ABS_X. * * libevdev discards all events after a SYN_DROPPED to ensure the events * during @ref LIBEVDEV_READ_FLAG_SYNC represent the last known state of the * device. This loses some granularity of the events especially as the time * between the SYN_DROPPED and the sync process increases. It does however * avoid spurious cursor movements. In the above example, the event sequence * by libevdev is: * @code EV_SYN SYN_DROPPED EV_ABS ABS_X 6 EV_SYN SYN_REPORT 0 @endcode */ /** * @page backwardscompatibility Compatibility and Behavior across kernel versions * * This page describes libevdev's behavior when the build-time kernel and the * run-time kernel differ in their feature set. * * With the exception of event names, libevdev defines features that may be * missing on older kernels and building on such kernels will not disable * features. Running libevdev on a kernel that is missing some feature will * change libevdev's behavior. In most cases, the new behavior should be * obvious, but it is spelled out below in detail. * * Minimum requirements * ==================== * libevdev requires a 2.6.36 kernel as minimum. Specifically, it requires * kernel-support for ABS_MT_SLOT. * * Event and input property names * ============================== * Event names and input property names are defined at build-time by the * linux/input.h shipped with libevdev. * The list of event names is compiled at build-time, any events not defined * at build time will not resolve. Specifically, * libevdev_event_code_get_name() for an undefined type or code will * always return NULL. Likewise, libevdev_property_get_name() will return NULL * for properties undefined at build-time. * * Input properties * ================ * If the kernel does not support input properties, specifically the * EVIOCGPROPS ioctl, libevdev does not expose input properties to the caller. * Specifically, libevdev_has_property() will always return 0 unless the * property has been manually set with libevdev_enable_property(). * * This also applies to the libevdev-uinput code. If uinput does not honor * UI_SET_PROPBIT, libevdev will continue without setting the properties on * the device. * * MT slot behavior * ================= * If the kernel does not support the EVIOCGMTSLOTS ioctl, libevdev * assumes all values in all slots are 0 and continues without an error. * * SYN_DROPPED behavior * ==================== * A kernel without SYN_DROPPED won't send such an event. libevdev_next_event() * will never require the switch to sync mode. */ /** * @page ioctls evdev ioctls * * This page lists the status of the evdev-specific ioctls in libevdev. * *
*
EVIOCGVERSION:
*
supported, see libevdev_get_driver_version()
*
EVIOCGID:
*
supported, see libevdev_get_id_product(), libevdev_get_id_vendor(), * libevdev_get_id_bustype(), libevdev_get_id_version()
*
EVIOCGREP:
*
supported, see libevdev_get_event_value())
*
EVIOCSREP:
*
supported, see libevdev_enable_event_code()
*
EVIOCGKEYCODE:
*
currently not supported
*
EVIOCGKEYCODE:
*
currently not supported
*
EVIOCSKEYCODE:
*
currently not supported
*
EVIOCSKEYCODE:
*
currently not supported
*
EVIOCGNAME:
*
supported, see libevdev_get_name()
*
EVIOCGPHYS:
*
supported, see libevdev_get_phys()
*
EVIOCGUNIQ:
*
supported, see libevdev_get_uniq()
*
EVIOCGPROP:
*
supported, see libevdev_has_property()
*
EVIOCGMTSLOTS:
*
supported, see libevdev_get_num_slots(), libevdev_get_slot_value()
*
EVIOCGKEY:
*
supported, see libevdev_has_event_code(), libevdev_get_event_value()
*
EVIOCGLED:
*
supported, see libevdev_has_event_code(), libevdev_get_event_value()
*
EVIOCGSND:
*
currently not supported
*
EVIOCGSW:
*
supported, see libevdev_has_event_code(), libevdev_get_event_value()
*
EVIOCGBIT:
*
supported, see libevdev_has_event_code(), libevdev_get_event_value()
*
EVIOCGABS:
*
supported, see libevdev_has_event_code(), libevdev_get_event_value(), * libevdev_get_abs_info()
*
EVIOCSABS:
*
supported, see libevdev_kernel_set_abs_info()
*
EVIOCSFF:
*
currently not supported
*
EVIOCRMFF:
*
currently not supported
*
EVIOCGEFFECTS:
*
currently not supported
*
EVIOCGRAB:
*
supported, see libevdev_grab()
*
EVIOCSCLOCKID:
*
supported, see libevdev_set_clock_id()
*
EVIOCREVOKE:
*
currently not supported, see * http://lists.freedesktop.org/archives/input-tools/2014-January/000688.html
*
* */ /** * @page kernel_header Kernel header * * libevdev provides its own copy of the Linux kernel header file and * compiles against the definitions define here. Event type and event code * names, etc. are taken from the file below: * @include linux/input.h */ /** * @page static_linking Statically linking libevdev * * Statically linking libevdev.a is not recommended. Symbol visibility is * difficult to control in a static library, so extra care must be taken to * only use symbols that are explicitly exported. libevdev's API stability * guarantee only applies to those symbols. * * If you do link libevdev statically, note that in addition to the exported * symbols, libevdev reserves the _libevdev_* namespace. Do not use * or create symbols with that prefix, they are subject to change at any * time. */ /** * @page testing libevdev-internal test suite * * libevdev's internal test suite uses the * [Check unit testing framework](http://check.sourceforge.net/). Tests are * divided into test suites and test cases. Most tests create a uinput device, * so you'll need to run as root, and your kernel must have * CONFIG_INPUT_UINPUT enabled. * * To run a specific suite only: * * export CK_RUN_SUITE="suite name" * * To run a specific test case only: * * export CK_RUN_TEST="test case name" * * To get a list of all suites or tests: * * git grep "suite_create" * git grep "tcase_create" * * By default, Check forks, making debugging harder. The test suite tries to detect * if it is running inside gdb and disable forking. If that doesn't work for * some reason, run gdb as below to avoid forking. * * sudo CK_FORK=no CK_RUN_TEST="test case name" gdb ./test/test-libevdev * * A special target `make gcov-report.txt` exists that runs gcov and leaves a * `libevdev.c.gcov` file. Check that for test coverage. * * `make check` is hooked up to run the test and gcov (again, needs root). * * The test suite creates a lot of devices, very quickly. Add the following * xorg.conf.d snippet to avoid the devices being added as X devices (at the * time of writing, mutter can't handle these devices and exits after getting * a BadDevice error). * * $ cat /etc/X11/xorg.conf.d/99-ignore-libevdev-devices.conf * Section "InputClass" * Identifier "Ignore libevdev test devices" * MatchProduct "libevdev test device" * Option "Ignore" "on" * EndSection * */ /** * @defgroup init Initialization and setup * * Initialization, initial setup and file descriptor handling. * These functions are the main entry points for users of libevdev, usually a * caller will use this series of calls: * * @code * struct libevdev *dev; * int err; * * dev = libevdev_new(); * if (!dev) * return ENOMEM; * * err = libevdev_set_fd(dev, fd); * if (err < 0) { * printf("Failed (errno %d): %s\n", -err, strerror(-err)); * * libevdev_free(dev); * @endcode * * libevdev_set_fd() is the central call and initializes the internal structs * for the device at the given fd. libevdev functions will fail if called * before libevdev_set_fd() unless documented otherwise. */ /** * @defgroup logging Library logging facilities * * libevdev provides two methods of logging library-internal messages. The * old method is to provide a global log handler in * libevdev_set_log_function(). The new method is to provide a per-context * log handler in libevdev_set_device_log_function(). Developers are encouraged * to use the per-context logging facilities over the global log handler as * it provides access to the libevdev instance that caused a message, and is * more flexible when libevdev is used from within a shared library. * * If a caller sets both the global log handler and a per-context log * handler, each device with a per-context log handler will only invoke that * log handler. * * @note To set a context-specific log handler, a context is needed. * Thus developers are discouraged from using libevdev_new_from_fd() as * important messages from the device initialization process may get lost. * * @note A context-specific handler cannot be used for libevdev's uinput * devices. @ref uinput must use the global log handler. */ /** * @defgroup bits Querying device capabilities * * Abstraction functions to handle device capabilities, specificially * device properties such as the name of the device and the bits * representing the events suppported by this device. * * The logical state returned may lag behind the physical state of the device. * libevdev queries the device state on libevdev_set_fd() and then relies on * the caller to parse events through libevdev_next_event(). If a caller does not * use libevdev_next_event(), libevdev will not update the internal state of the * device and thus returns outdated values. */ /** * @defgroup mt Multi-touch related functions * Functions for querying multi-touch-related capabilities. MT devices * following the kernel protocol B (using ABS_MT_SLOT) provide multiple touch * points through so-called slots on the same axis. The slots are enumerated, * a client reading from the device will first get an ABS_MT_SLOT event, then * the values of axes changed in this slot. Multiple slots may be provided in * before an EV_SYN event. * * As with @ref bits, the logical state of the device as seen by the library * depends on the caller using libevdev_next_event(). * * The Linux kernel requires all axes on a device to have a semantic * meaning, matching the axis names in linux/input.h. Some devices merely * export a number of axes beyond the available axis list. For those * devices, the multitouch information is invalid. Specfically, if a device * provides the ABS_MT_SLOT axis AND also the (ABS_MT_SLOT - 1) axis, the * device is not treated as multitouch device. No slot information is * available and the ABS_MT axis range for these devices is treated as all * other EV_ABS axes. * * Note that because of limitations in the kernel API, such fake multitouch * devices can not be reliably synched after a SYN_DROPPED event. libevdev * ignores all ABS_MT axis values during the sync process and instead * relies on the device to send the current axis value with the first event * after SYN_DROPPED. */ /** * @defgroup kernel Modifying the appearance or capabilities of the device * * Modifying the set of events reported by this device. By default, the * libevdev device mirrors the kernel device, enabling only those bits * exported by the kernel. This set of functions enable or disable bits as * seen from the caller. * * Enabling an event type or code does not affect event reporting - a * software-enabled event will not be generated by the physical hardware. * Disabling an event will prevent libevdev from routing such events to the * caller. Enabling and disabling event types and codes is at the library * level and thus only affects the caller. * * If an event type or code is enabled at kernel-level, future users of this * device will see this event enabled. Currently there is no option of * disabling an event type or code at kernel-level. */ /** * @defgroup misc Miscellaneous helper functions * * Functions for printing or querying event ranges. The list of names is * compiled into libevdev and is independent of the run-time kernel. * Likewise, the max for each event type is compiled in and does not check * the kernel at run-time. */ /** * @defgroup events Event handling * * Functions to handle events and fetch the current state of the event. * libevdev updates its internal state as the event is processed and forwarded * to the caller. Thus, the libevdev state of the device should always be identical * to the caller's state. It may however lag behind the actual state of the device. */ /** * @ingroup init * * Opaque struct representing an evdev device. */ struct libevdev; /** * @ingroup events */ enum libevdev_read_flag { LIBEVDEV_READ_FLAG_SYNC = 1, /**< Process data in sync mode */ LIBEVDEV_READ_FLAG_NORMAL = 2, /**< Process data in normal mode */ LIBEVDEV_READ_FLAG_FORCE_SYNC = 4, /**< Pretend the next event is a SYN_DROPPED and require the caller to sync */ LIBEVDEV_READ_FLAG_BLOCKING = 8 /**< The fd is not in O_NONBLOCK and a read may block */ }; /** * @ingroup init * * Initialize a new libevdev device. This function only allocates the * required memory and initializes the struct to sane default values. * To actually hook up the device to a kernel device, use * libevdev_set_fd(). * * Memory allocated through libevdev_new() must be released by the * caller with libevdev_free(). * * @see libevdev_set_fd * @see libevdev_free */ struct libevdev* libevdev_new(void); /** * @ingroup init * * Initialize a new libevdev device from the given fd. * * This is a shortcut for * @code int err; struct libevdev *dev = libevdev_new(); err = libevdev_set_fd(dev, fd); @endcode * * @param fd A file descriptor to the device in O_RDWR or O_RDONLY mode. * @param[out] dev The newly initialized evdev device. * * @return On success, 0 is returned and dev is set to the newly * allocated struct. On failure, a negative errno is returned and the value * of dev is undefined. * * @see libevdev_free */ int libevdev_new_from_fd(int fd, struct libevdev **dev); /** * @ingroup init * * Clean up and free the libevdev struct. After completion, the struct * libevdev is invalid and must not be used. * * @param dev The evdev device * * @note This function may be called before libevdev_set_fd(). */ void libevdev_free(struct libevdev *dev); /** * @ingroup logging */ enum libevdev_log_priority { LIBEVDEV_LOG_ERROR = 10, /**< critical errors and application bugs */ LIBEVDEV_LOG_INFO = 20, /**< informational messages */ LIBEVDEV_LOG_DEBUG = 30 /**< debug information */ }; /** * @ingroup logging * * Logging function called by library-internal logging. * This function is expected to treat its input like printf would. * * @param priority Log priority of this message * @param data User-supplied data pointer (see libevdev_set_log_function()) * @param file libevdev source code file generating this message * @param line libevdev source code line generating this message * @param func libevdev source code function generating this message * @param format printf-style format string * @param args List of arguments * * @see libevdev_set_log_function */ typedef void (*libevdev_log_func_t)(enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args) LIBEVDEV_ATTRIBUTE_PRINTF(6, 0); /** * @ingroup logging * * Set a printf-style logging handler for library-internal logging. The default * logging function is to stdout. * * @note The global log handler is only called if no context-specific log * handler has been set with libevdev_set_device_log_function(). * * @param logfunc The logging function for this device. If NULL, the current * logging function is unset and no logging is performed. * @param data User-specific data passed to the log handler. * * @note This function may be called before libevdev_set_fd(). * * @deprecated Use per-context logging instead, see * libevdev_set_device_log_function(). */ void libevdev_set_log_function(libevdev_log_func_t logfunc, void *data); /** * @ingroup logging * * Define the minimum level to be printed to the log handler. * Messages higher than this level are printed, others are discarded. This * is a global setting and applies to any future logging messages. * * @param priority Minimum priority to be printed to the log. * * @deprecated Use per-context logging instead, see * libevdev_set_device_log_function(). */ void libevdev_set_log_priority(enum libevdev_log_priority priority); /** * @ingroup logging * * Return the current log priority level. Messages higher than this level * are printed, others are discarded. This is a global setting. * * @return the current log level * * @deprecated Use per-context logging instead, see * libevdev_set_device_log_function(). */ enum libevdev_log_priority libevdev_get_log_priority(void); /** * @ingroup logging * * Logging function called by library-internal logging for a specific * libevdev context. This function is expected to treat its input like * printf would. * * @param dev The evdev device * @param priority Log priority of this message * @param data User-supplied data pointer (see libevdev_set_log_function()) * @param file libevdev source code file generating this message * @param line libevdev source code line generating this message * @param func libevdev source code function generating this message * @param format printf-style format string * @param args List of arguments * * @see libevdev_set_log_function * @since 1.3 */ typedef void (*libevdev_device_log_func_t)(const struct libevdev *dev, enum libevdev_log_priority priority, void *data, const char *file, int line, const char *func, const char *format, va_list args) LIBEVDEV_ATTRIBUTE_PRINTF(7, 0); /** * @ingroup logging * * Set a printf-style logging handler for library-internal logging for this * device context. The default logging function is NULL, i.e. the global log * handler is invoked. If a context-specific log handler is set, the global * log handler is not invoked for this device. * * @note This log function applies for this device context only, even if * another context exists for the same fd. * * @param dev The evdev device * @param logfunc The logging function for this device. If NULL, the current * logging function is unset and logging falls back to the global log * handler, if any. * @param priority Minimum priority to be printed to the log. * @param data User-specific data passed to the log handler. * * @note This function may be called before libevdev_set_fd(). * @since 1.3 */ void libevdev_set_device_log_function(struct libevdev *dev, libevdev_device_log_func_t logfunc, enum libevdev_log_priority priority, void *data); /** * @ingroup init */ enum libevdev_grab_mode { LIBEVDEV_GRAB = 3, /**< Grab the device if not currently grabbed */ LIBEVDEV_UNGRAB = 4 /**< Ungrab the device if currently grabbed */ }; /** * @ingroup init * * Grab or ungrab the device through a kernel EVIOCGRAB. This prevents other * clients (including kernel-internal ones such as rfkill) from receiving * events from this device. * * This is generally a bad idea. Don't do this. * * Grabbing an already grabbed device, or ungrabbing an ungrabbed device is * a noop and always succeeds. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param grab If true, grab the device. Otherwise ungrab the device. * * @return 0 if the device was successfull grabbed or ungrabbed, or a * negative errno in case of failure. */ int libevdev_grab(struct libevdev *dev, enum libevdev_grab_mode grab); /** * @ingroup init * * Set the fd for this struct and initialize internal data. * The fd must be in O_RDONLY or O_RDWR mode. * * This function may only be called once per device. If the device changed and * you need to re-read a device, use libevdev_free() and libevdev_new(). If * you need to change the fd after closing and re-opening the same device, use * libevdev_change_fd(). * * Unless otherwise specified, libevdev function behavior is undefined until * a successfull call to libevdev_set_fd(). * * @param dev The evdev device * @param fd The file descriptor for the device * * @return 0 on success, or a negative errno on failure * * @see libevdev_change_fd * @see libevdev_new * @see libevdev_free */ int libevdev_set_fd(struct libevdev* dev, int fd); /** * @ingroup init * * Change the fd for this device, without re-reading the actual device. If the fd * changes after initializing the device, for example after a VT-switch in the * X.org X server, this function updates the internal fd to the newly opened. * No check is made that new fd points to the same device. If the device has * changed, libevdev's behavior is undefined. * * libevdev does not sync itself after changing the fd and keeps the current * device state. Use libevdev_next_event with the * @ref LIBEVDEV_READ_FLAG_FORCE_SYNC flag to force a re-sync. * * The example code below illustrates how to force a re-sync of the * library-internal state. Note that this code doesn't handle the events in * the caller, it merely forces an update of the internal library state. @code struct input_event ev; libevdev_change_fd(dev, new_fd); libevdev_next_event(dev, LIBEVDEV_READ_FLAG_FORCE_SYNC, &ev); while (libevdev_next_event(dev, LIBEVDEV_READ_FLAG_SYNC, &ev) == LIBEVDEV_READ_STATUS_SYNC) ; // noop @endcode * * The fd may be open in O_RDONLY or O_RDWR. * * It is an error to call this function before calling libevdev_set_fd(). * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param fd The new fd * * @return 0 on success, or -1 on failure. * * @see libevdev_set_fd */ int libevdev_change_fd(struct libevdev* dev, int fd); /** * @ingroup init * * @param dev The evdev device * * @return The previously set fd, or -1 if none had been set previously. * @note This function may be called before libevdev_set_fd(). */ int libevdev_get_fd(const struct libevdev* dev); /** * @ingroup events */ enum libevdev_read_status { /** * libevdev_next_event() has finished without an error * and an event is available for processing. * * @see libevdev_next_event */ LIBEVDEV_READ_STATUS_SUCCESS = 0, /** * Depending on the libevdev_next_event() read flag: * * libevdev received a SYN_DROPPED from the device, and the caller should * now resync the device, or, * * an event has been read in sync mode. * * @see libevdev_next_event */ LIBEVDEV_READ_STATUS_SYNC = 1 }; /** * @ingroup events * * Get the next event from the device. This function operates in two different * modes: normal mode or sync mode. * * In normal mode (when flags has @ref LIBEVDEV_READ_FLAG_NORMAL set), this * function returns @ref LIBEVDEV_READ_STATUS_SUCCESS and returns the event * in the argument @p ev. If no events are available at this * time, it returns -EAGAIN and ev is undefined. * * If the current event is an EV_SYN SYN_DROPPED event, this function returns * @ref LIBEVDEV_READ_STATUS_SYNC and ev is set to the EV_SYN event. * The caller should now call this function with the * @ref LIBEVDEV_READ_FLAG_SYNC flag set, to get the set of events that make up the * device state delta. This function returns @ref LIBEVDEV_READ_STATUS_SYNC for * each event part of that delta, until it returns -EAGAIN once all events * have been synced. For more details on what libevdev does to sync after a * SYN_DROPPED event, see @ref syn_dropped. * * If a device needs to be synced by the caller but the caller does not call * with the @ref LIBEVDEV_READ_FLAG_SYNC flag set, all events from the diff are * dropped after libevdev updates its internal state and event processing * continues as normal. Note that the current slot and the state of touch * points may have updated during the SYN_DROPPED event, it is strongly * recommended that a caller ignoring all sync events calls * libevdev_get_current_slot() and checks the ABS_MT_TRACKING_ID values for * all slots. * * If a device has changed state without events being enqueued in libevdev, * e.g. after changing the file descriptor, use the @ref * LIBEVDEV_READ_FLAG_FORCE_SYNC flag. This triggers an internal sync of the * device and libevdev_next_event() returns @ref LIBEVDEV_READ_STATUS_SYNC. * Any state changes are available as events as described above. If * @ref LIBEVDEV_READ_FLAG_FORCE_SYNC is set, the value of ev is undefined. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param flags Set of flags to determine behaviour. If @ref LIBEVDEV_READ_FLAG_NORMAL * is set, the next event is read in normal mode. If @ref LIBEVDEV_READ_FLAG_SYNC is * set, the next event is read in sync mode. * @param ev On success, set to the current event. * @return On failure, a negative errno is returned. * @retval LIBEVDEV_READ_STATUS_SUCCESS One or more events were read of the * device and ev points to the next event in the queue * @retval -EAGAIN No events are currently available on the device * @retval LIBEVDEV_READ_STATUS_SYNC A SYN_DROPPED event was received, or a * synced event was returned and ev points to the SYN_DROPPED event * * @note This function is signal-safe. */ int libevdev_next_event(struct libevdev *dev, unsigned int flags, struct input_event *ev); /** * @ingroup events * * Check if there are events waiting for us. This function does not read an * event off the fd and may not access the fd at all. If there are events * queued internally this function will return non-zero. If the internal * queue is empty, this function will poll the file descriptor for data. * * This is a convenience function for simple processes, most complex programs * are expected to use select(2) or poll(2) on the file descriptor. The kernel * guarantees that if data is available, it is a multiple of sizeof(struct * input_event), and thus calling libevdev_next_event() when select(2) or * poll(2) return is safe. You do not need libevdev_has_event_pending() if * you're using select(2) or poll(2). * * @param dev The evdev device, already initialized with libevdev_set_fd() * @return On failure, a negative errno is returned. * @retval 0 No event is currently available * @retval 1 One or more events are available on the fd * * @note This function is signal-safe. */ int libevdev_has_event_pending(struct libevdev *dev); /** * @ingroup bits * * Retrieve the device's name, either as set by the caller or as read from * the kernel. The string returned is valid until libevdev_free() or until * libevdev_set_name(), whichever comes earlier. * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return The device name as read off the kernel device. The name is never * NULL but it may be the empty string. * * @note This function is signal-safe. */ const char* libevdev_get_name(const struct libevdev *dev); /** * @ingroup kernel * * Change the device's name as returned by libevdev_get_name(). This * function destroys the string previously returned by libevdev_get_name(), * a caller must take care that no references are kept. * * @param dev The evdev device * @param name The new, non-NULL, name to assign to this device. * * @note This function may be called before libevdev_set_fd(). A call to * libevdev_set_fd() will overwrite any previously set value. */ void libevdev_set_name(struct libevdev *dev, const char *name); /** * @ingroup bits * * Retrieve the device's physical location, either as set by the caller or * as read from the kernel. The string returned is valid until * libevdev_free() or until libevdev_set_phys(), whichever comes earlier. * * Virtual devices such as uinput devices have no phys location. * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return The physical location of this device, or NULL if there is none * * @note This function is signal safe. */ const char * libevdev_get_phys(const struct libevdev *dev); /** * @ingroup kernel * * Change the device's physical location as returned by libevdev_get_phys(). * This function destroys the string previously returned by * libevdev_get_phys(), a caller must take care that no references are kept. * * @param dev The evdev device * @param phys The new phys to assign to this device. * * @note This function may be called before libevdev_set_fd(). A call to * libevdev_set_fd() will overwrite any previously set value. */ void libevdev_set_phys(struct libevdev *dev, const char *phys); /** * @ingroup bits * * Retrieve the device's unique identifier, either as set by the caller or * as read from the kernel. The string returned is valid until * libevdev_free() or until libevdev_set_uniq(), whichever comes earlier. * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return The unique identifier for this device, or NULL if there is none * * @note This function is signal safe. */ const char * libevdev_get_uniq(const struct libevdev *dev); /** * @ingroup kernel * * Change the device's unique identifier as returned by libevdev_get_uniq(). * This function destroys the string previously returned by * libevdev_get_uniq(), a caller must take care that no references are kept. * * @param dev The evdev device * @param uniq The new uniq to assign to this device. * * @note This function may be called before libevdev_set_fd(). A call to * libevdev_set_fd() will overwrite any previously set value. */ void libevdev_set_uniq(struct libevdev *dev, const char *uniq); /** * @ingroup bits * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return The device's product ID * * @note This function is signal-safe. */ int libevdev_get_id_product(const struct libevdev *dev); /** * @ingroup kernel * * @param dev The evdev device * @param product_id The product ID to assign to this device * * @note This function may be called before libevdev_set_fd(). A call to * libevdev_set_fd() will overwrite any previously set value. */ void libevdev_set_id_product(struct libevdev *dev, int product_id); /** * @ingroup bits * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return The device's vendor ID * * @note This function is signal-safe. */ int libevdev_get_id_vendor(const struct libevdev *dev); /** * @ingroup kernel * * @param dev The evdev device * @param vendor_id The vendor ID to assign to this device * * @note This function may be called before libevdev_set_fd(). A call to * libevdev_set_fd() will overwrite any previously set value. */ void libevdev_set_id_vendor(struct libevdev *dev, int vendor_id); /** * @ingroup bits * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return The device's bus type * * @note This function is signal-safe. */ int libevdev_get_id_bustype(const struct libevdev *dev); /** * @ingroup kernel * * @param dev The evdev device * @param bustype The bustype to assign to this device * * @note This function may be called before libevdev_set_fd(). A call to * libevdev_set_fd() will overwrite any previously set value. */ void libevdev_set_id_bustype(struct libevdev *dev, int bustype); /** * @ingroup bits * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return The device's firmware version * * @note This function is signal-safe. */ int libevdev_get_id_version(const struct libevdev *dev); /** * @ingroup kernel * * @param dev The evdev device * @param version The version to assign to this device * * @note This function may be called before libevdev_set_fd(). A call to * libevdev_set_fd() will overwrite any previously set value. */ void libevdev_set_id_version(struct libevdev *dev, int version); /** * @ingroup bits * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return The driver version for this device * * @note This function is signal-safe. */ int libevdev_get_driver_version(const struct libevdev *dev); /** * @ingroup bits * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param prop The input property to query for, one of INPUT_PROP_... * * @return 1 if the device provides this input property, or 0 otherwise. * * @note This function is signal-safe */ int libevdev_has_property(const struct libevdev *dev, unsigned int prop); /** * @ingroup kernel * * @param dev The evdev device * @param prop The input property to enable, one of INPUT_PROP_... * * @return 0 on success or -1 on failure * * @note This function may be called before libevdev_set_fd(). A call to * libevdev_set_fd() will overwrite any previously set value. */ int libevdev_enable_property(struct libevdev *dev, unsigned int prop); /** * @ingroup bits * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param type The event type to query for, one of EV_SYN, EV_REL, etc. * * @return 1 if the device supports this event type, or 0 otherwise. * * @note This function is signal-safe. */ int libevdev_has_event_type(const struct libevdev *dev, unsigned int type); /** * @ingroup bits * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param type The event type for the code to query (EV_SYN, EV_REL, etc.) * @param code The event code to query for, one of ABS_X, REL_X, etc. * * @return 1 if the device supports this event type and code, or 0 otherwise. * * @note This function is signal-safe. */ int libevdev_has_event_code(const struct libevdev *dev, unsigned int type, unsigned int code); /** * @ingroup bits * * Get the minimum axis value for the given axis, as advertised by the kernel. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. * * @return axis minimum for the given axis or 0 if the axis is invalid * * @note This function is signal-safe. */ int libevdev_get_abs_minimum(const struct libevdev *dev, unsigned int code); /** * @ingroup bits * * Get the maximum axis value for the given axis, as advertised by the kernel. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. * * @return axis maximum for the given axis or 0 if the axis is invalid * * @note This function is signal-safe. */ int libevdev_get_abs_maximum(const struct libevdev *dev, unsigned int code); /** * @ingroup bits * * Get the axis fuzz for the given axis, as advertised by the kernel. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. * * @return axis fuzz for the given axis or 0 if the axis is invalid * * @note This function is signal-safe. */ int libevdev_get_abs_fuzz(const struct libevdev *dev, unsigned int code); /** * @ingroup bits * * Get the axis flat for the given axis, as advertised by the kernel. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. * * @return axis flat for the given axis or 0 if the axis is invalid * * @note This function is signal-safe. */ int libevdev_get_abs_flat(const struct libevdev *dev, unsigned int code); /** * @ingroup bits * * Get the axis resolution for the given axis, as advertised by the kernel. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. * * @return axis resolution for the given axis or 0 if the axis is invalid * * @note This function is signal-safe. */ int libevdev_get_abs_resolution(const struct libevdev *dev, unsigned int code); /** * @ingroup bits * * Get the axis info for the given axis, as advertised by the kernel. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code The EV_ABS event code to query for, one of ABS_X, ABS_Y, etc. * * @return The input_absinfo for the given code, or NULL if the device does * not support this event code. * * @note This function is signal-safe. */ const struct input_absinfo* libevdev_get_abs_info(const struct libevdev *dev, unsigned int code); /** * @ingroup bits * * Behaviour of this function is undefined if the device does not provide * the event. * * If the device supports ABS_MT_SLOT, the value returned for any ABS_MT_* * event code is the value of the currently active slot. You should use * libevdev_get_slot_value() instead. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param type The event type for the code to query (EV_SYN, EV_REL, etc.) * @param code The event code to query for, one of ABS_X, REL_X, etc. * * @return The current value of the event. * * @note This function is signal-safe. * @note The value for ABS_MT_ events is undefined, use * libevdev_get_slot_value() instead * * @see libevdev_get_slot_value */ int libevdev_get_event_value(const struct libevdev *dev, unsigned int type, unsigned int code); /** * @ingroup kernel * * Set the value for a given event type and code. This only makes sense for * some event types, e.g. setting the value for EV_REL is pointless. * * This is a local modification only affecting only this representation of * this device. A future call to libevdev_get_event_value() will return this * value, unless the value was overwritten by an event. * * If the device supports ABS_MT_SLOT, the value set for any ABS_MT_* * event code is the value of the currently active slot. You should use * libevdev_set_slot_value() instead. * * If the device supports ABS_MT_SLOT and the type is EV_ABS and the code is * ABS_MT_SLOT, the value must be a positive number less then the number of * slots on the device. Otherwise, libevdev_set_event_value() returns -1. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param type The event type for the code to query (EV_SYN, EV_REL, etc.) * @param code The event code to set the value for, one of ABS_X, LED_NUML, etc. * @param value The new value to set * * @return 0 on success, or -1 on failure. * @retval -1 the device does not have the event type or code enabled, or the code is outside the * allowed limits for the given type, or the type cannot be set, or the * value is not permitted for the given code. * * @see libevdev_set_slot_value * @see libevdev_get_event_value */ int libevdev_set_event_value(struct libevdev *dev, unsigned int type, unsigned int code, int value); /** * @ingroup bits * * Fetch the current value of the event type. This is a shortcut for * @code if (libevdev_has_event_type(dev, t) && libevdev_has_event_code(dev, t, c)) val = libevdev_get_event_value(dev, t, c); @endcode * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param type The event type for the code to query (EV_SYN, EV_REL, etc.) * @param code The event code to query for, one of ABS_X, REL_X, etc. * @param[out] value The current value of this axis returned. * * @return If the device supports this event type and code, the return value is * non-zero and value is set to the current value of this axis. Otherwise, * 0 is returned and value is unmodified. * * @note This function is signal-safe. * @note The value for ABS_MT_ events is undefined, use * libevdev_fetch_slot_value() instead * * @see libevdev_fetch_slot_value */ int libevdev_fetch_event_value(const struct libevdev *dev, unsigned int type, unsigned int code, int *value); /** * @ingroup mt * * Return the current value of the code for the given slot. * * The return value is undefined for a slot exceeding the available slots on * the device, for a code that is not in the permitted ABS_MT range or for a * device that does not have slots. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param slot The numerical slot number, must be smaller than the total number * of slots on this device * @param code The event code to query for, one of ABS_MT_POSITION_X, etc. * * @note This function is signal-safe. * @note The value for events other than ABS_MT_ is undefined, use * libevdev_fetch_value() instead * * @see libevdev_get_event_value */ int libevdev_get_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code); /** * @ingroup kernel * * Set the value for a given code for the given slot. * * This is a local modification only affecting only this representation of * this device. A future call to libevdev_get_slot_value() will return this * value, unless the value was overwritten by an event. * * This function does not set event values for axes outside the ABS_MT range, * use libevdev_set_event_value() instead. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param slot The numerical slot number, must be smaller than the total number * of slots on this device * @param code The event code to set the value for, one of ABS_MT_POSITION_X, etc. * @param value The new value to set * * @return 0 on success, or -1 on failure. * @retval -1 the device does not have the event code enabled, or the code is * outside the allowed limits for multitouch events, or the slot number is outside * the limits for this device, or the device does not support multitouch events. * * @see libevdev_set_event_value * @see libevdev_get_slot_value */ int libevdev_set_slot_value(struct libevdev *dev, unsigned int slot, unsigned int code, int value); /** * @ingroup mt * * Fetch the current value of the code for the given slot. This is a shortcut for * @code if (libevdev_has_event_type(dev, EV_ABS) && libevdev_has_event_code(dev, EV_ABS, c) && slot < device->number_of_slots) val = libevdev_get_slot_value(dev, slot, c); @endcode * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param slot The numerical slot number, must be smaller than the total number * of slots on this * device * @param[out] value The current value of this axis returned. * * @param code The event code to query for, one of ABS_MT_POSITION_X, etc. * @return If the device supports this event code, the return value is * non-zero and value is set to the current value of this axis. Otherwise, or * if the event code is not an ABS_MT_* event code, 0 is returned and value * is unmodified. * * @note This function is signal-safe. */ int libevdev_fetch_slot_value(const struct libevdev *dev, unsigned int slot, unsigned int code, int *value); /** * @ingroup mt * * Get the number of slots supported by this device. * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return The number of slots supported, or -1 if the device does not provide * any slots * * @note A device may provide ABS_MT_SLOT but a total number of 0 slots. Hence * the return value of -1 for "device does not provide slots at all" */ int libevdev_get_num_slots(const struct libevdev *dev); /** * @ingroup mt * * Get the currently active slot. This may differ from the value * an ioctl may return at this time as events may have been read off the fd * since changing the slot value but those events are still in the buffer * waiting to be processed. The returned value is the value a caller would * see if it were to process events manually one-by-one. * * @param dev The evdev device, already initialized with libevdev_set_fd() * * @return the currently active slot (logically) * * @note This function is signal-safe. */ int libevdev_get_current_slot(const struct libevdev *dev); /** * @ingroup kernel * * Change the minimum for the given EV_ABS event code, if the code exists. * This function has no effect if libevdev_has_event_code() returns false for * this code. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code One of ABS_X, ABS_Y, ... * @param min The new minimum for this axis */ void libevdev_set_abs_minimum(struct libevdev *dev, unsigned int code, int min); /** * @ingroup kernel * * Change the maximum for the given EV_ABS event code, if the code exists. * This function has no effect if libevdev_has_event_code() returns false for * this code. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code One of ABS_X, ABS_Y, ... * @param max The new maxium for this axis */ void libevdev_set_abs_maximum(struct libevdev *dev, unsigned int code, int max); /** * @ingroup kernel * * Change the fuzz for the given EV_ABS event code, if the code exists. * This function has no effect if libevdev_has_event_code() returns false for * this code. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code One of ABS_X, ABS_Y, ... * @param fuzz The new fuzz for this axis */ void libevdev_set_abs_fuzz(struct libevdev *dev, unsigned int code, int fuzz); /** * @ingroup kernel * * Change the flat for the given EV_ABS event code, if the code exists. * This function has no effect if libevdev_has_event_code() returns false for * this code. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code One of ABS_X, ABS_Y, ... * @param flat The new flat for this axis */ void libevdev_set_abs_flat(struct libevdev *dev, unsigned int code, int flat); /** * @ingroup kernel * * Change the resolution for the given EV_ABS event code, if the code exists. * This function has no effect if libevdev_has_event_code() returns false for * this code. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code One of ABS_X, ABS_Y, ... * @param resolution The new axis resolution */ void libevdev_set_abs_resolution(struct libevdev *dev, unsigned int code, int resolution); /** * @ingroup kernel * * Change the abs info for the given EV_ABS event code, if the code exists. * This function has no effect if libevdev_has_event_code() returns false for * this code. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code One of ABS_X, ABS_Y, ... * @param abs The new absolute axis data (min, max, fuzz, flat, resolution) */ void libevdev_set_abs_info(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs); /** * @ingroup kernel * * Forcibly enable an event type on this device, even if the underlying * device does not support it. While this cannot make the device actually * report such events, it will now return true for libevdev_has_event_type(). * * This is a local modification only affecting only this representation of * this device. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param type The event type to enable (EV_ABS, EV_KEY, ...) * * @return 0 on success or -1 otherwise * * @see libevdev_has_event_type */ int libevdev_enable_event_type(struct libevdev *dev, unsigned int type); /** * @ingroup kernel * * Forcibly disable an event type on this device, even if the underlying * device provides it. This effectively mutes the respective set of * events. libevdev will filter any events matching this type and none will * reach the caller. libevdev_has_event_type() will return false for this * type. * * In most cases, a caller likely only wants to disable a single code, not * the whole type. Use libevdev_disable_event_code() for that. * * Disabling EV_SYN will not work. Don't shoot yourself in the foot. * It hurts. * * This is a local modification only affecting only this representation of * this device. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param type The event type to disable (EV_ABS, EV_KEY, ...) * * @return 0 on success or -1 otherwise * * @see libevdev_has_event_type * @see libevdev_disable_event_type */ int libevdev_disable_event_type(struct libevdev *dev, unsigned int type); /** * @ingroup kernel * * Forcibly enable an event code on this device, even if the underlying * device does not support it. While this cannot make the device actually * report such events, it will now return true for libevdev_has_event_code(). * * The last argument depends on the type and code: * - If type is EV_ABS, data must be a pointer to a struct input_absinfo * containing the data for this axis. * - If type is EV_REP, daat must be a pointer to a int containing the data * for this axis * - For all other types, the argument must be NULL. * * This function calls libevdev_enable_event_type() if necessary. * * This is a local modification only affecting only this representation of * this device. * * If this function is called with a type of EV_ABS and EV_REP on a device * that already has the given event code enabled, the values in data * overwrite the previous values. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param type The event type to enable (EV_ABS, EV_KEY, ...) * @param code The event code to enable (ABS_X, REL_X, etc.) * @param data If type is EV_ABS, data points to a struct input_absinfo. If type is EV_REP, data * points to an integer. Otherwise, data must be NULL. * * @return 0 on success or -1 otherwise * * @see libevdev_enable_event_type */ int libevdev_enable_event_code(struct libevdev *dev, unsigned int type, unsigned int code, const void *data); /** * @ingroup kernel * * Forcibly disable an event code on this device, even if the underlying * device provides it. This effectively mutes the respective set of * events. libevdev will filter any events matching this type and code and * none will reach the caller. libevdev_has_event_code() will return false for * this code. * * Disabling all event codes for a given type will not disable the event * type. Use libevdev_disable_event_type() for that. * * This is a local modification only affecting only this representation of * this device. * * Disabling codes of type EV_SYN will not work. Don't shoot yourself in the * foot. It hurts. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param type The event type to disable (EV_ABS, EV_KEY, ...) * @param code The event code to disable (ABS_X, REL_X, etc.) * * @return 0 on success or -1 otherwise * * @see libevdev_has_event_code * @see libevdev_disable_event_type */ int libevdev_disable_event_code(struct libevdev *dev, unsigned int type, unsigned int code); /** * @ingroup kernel * * Set the device's EV_ABS axis to the value defined in the abs * parameter. This will be written to the kernel. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code The EV_ABS event code to modify, one of ABS_X, ABS_Y, etc. * @param abs Axis info to set the kernel axis to * * @return 0 on success, or a negative errno on failure * * @see libevdev_enable_event_code */ int libevdev_kernel_set_abs_info(struct libevdev *dev, unsigned int code, const struct input_absinfo *abs); /** * @ingroup kernel */ enum libevdev_led_value { LIBEVDEV_LED_ON = 3, /**< Turn the LED on */ LIBEVDEV_LED_OFF = 4 /**< Turn the LED off */ }; /** * @ingroup kernel * * Turn an LED on or off. Convenience function, if you need to modify multiple * LEDs simultaneously, use libevdev_kernel_set_led_values() instead. * * @note enabling an LED requires write permissions on the device's file descriptor. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param code The EV_LED event code to modify, one of LED_NUML, LED_CAPSL, ... * @param value Specifies whether to turn the LED on or off * @return 0 on success, or a negative errno on failure */ int libevdev_kernel_set_led_value(struct libevdev *dev, unsigned int code, enum libevdev_led_value value); /** * @ingroup kernel * * Turn multiple LEDs on or off simultaneously. This function expects a pair * of LED codes and values to set them to, terminated by a -1. For example, to * switch the NumLock LED on but the CapsLock LED off, use: * @code libevdev_kernel_set_led_values(dev, LED_NUML, LIBEVDEV_LED_ON, LED_CAPSL, LIBEVDEV_LED_OFF, -1); @endcode * * If any LED code or value is invalid, this function returns -EINVAL and no * LEDs are modified. * * @note enabling an LED requires write permissions on the device's file descriptor. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param ... A pair of LED_* event codes and libevdev_led_value_t, followed by * -1 to terminate the list. * @return 0 on success, or a negative errno on failure */ int libevdev_kernel_set_led_values(struct libevdev *dev, ...); /** * @ingroup kernel * * Set the clock ID to be used for timestamps. Further events from this device * will report an event time based on the given clock. * * This is a modification only affecting this representation of * this device. * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param clockid The clock to use for future events. Permitted values * are CLOCK_MONOTONIC and CLOCK_REALTIME (the default). * @return 0 on success, or a negative errno on failure */ int libevdev_set_clock_id(struct libevdev *dev, int clockid); /** * @ingroup misc * * Helper function to check if an event is of a specific type. This is * virtually the same as: * * ev->type == type * * with the exception that some sanity checks are performed to ensure type * is valid. * * @note The ranges for types are compiled into libevdev. If the kernel * changes the max value, libevdev will not automatically pick these up. * * @param ev The input event to check * @param type Input event type to compare the event against (EV_REL, EV_ABS, * etc.) * * @return 1 if the event type matches the given type, 0 otherwise (or if * type is invalid) */ int libevdev_event_is_type(const struct input_event *ev, unsigned int type); /** * @ingroup misc * * Helper function to check if an event is of a specific type and code. This * is virtually the same as: * * ev->type == type && ev->code == code * * with the exception that some sanity checks are performed to ensure type and * code are valid. * * @note The ranges for types and codes are compiled into libevdev. If the kernel * changes the max value, libevdev will not automatically pick these up. * * @param ev The input event to check * @param type Input event type to compare the event against (EV_REL, EV_ABS, * etc.) * @param code Input event code to compare the event against (ABS_X, REL_X, * etc.) * * @return 1 if the event type matches the given type and code, 0 otherwise * (or if type/code are invalid) */ int libevdev_event_is_code(const struct input_event *ev, unsigned int type, unsigned int code); /** * @ingroup misc * * @param type The event type to return the name for. * * @return The name of the given event type (e.g. EV_ABS) or NULL for an * invalid type * * @note The list of names is compiled into libevdev. If the kernel adds new * defines for new event types, libevdev will not automatically pick these up. */ const char * libevdev_event_type_get_name(unsigned int type); /** * @ingroup misc * * @param type The event type for the code to query (EV_SYN, EV_REL, etc.) * @param code The event code to return the name for (e.g. ABS_X) * * @return The name of the given event code (e.g. ABS_X) or NULL for an * invalid type or code * * @note The list of names is compiled into libevdev. If the kernel adds new * defines for new event codes, libevdev will not automatically pick these up. */ const char * libevdev_event_code_get_name(unsigned int type, unsigned int code); /** * @ingroup misc * * @param prop The input prop to return the name for (e.g. INPUT_PROP_BUTTONPAD) * * @return The name of the given input prop (e.g. INPUT_PROP_BUTTONPAD) or NULL for an * invalid property * * @note The list of names is compiled into libevdev. If the kernel adds new * defines for new properties libevdev will not automatically pick these up. * @note On older kernels input properties may not be defined and * libevdev_property_get_name() will always return NULL */ const char* libevdev_property_get_name(unsigned int prop); /** * @ingroup misc * * @param type The event type to return the maximum for (EV_ABS, EV_REL, etc.). No max is defined for * EV_SYN. * * @return The max value defined for the given event type, e.g. ABS_MAX for a type of EV_ABS, or -1 * for an invalid type. * * @note The max value is compiled into libevdev. If the kernel changes the * max value, libevdev will not automatically pick these up. */ int libevdev_event_type_get_max(unsigned int type); /** * @ingroup misc * * Look up an event-type by its name. Event-types start with "EV_" followed by * the name (eg., "EV_ABS"). The "EV_" prefix must be included in the name. It * returns the constant assigned to the event-type or -1 if not found. * * @param name A non-NULL string describing an input-event type ("EV_KEY", * "EV_ABS", ...), zero-terminated. * * @return The given type constant for the passed name or -1 if not found. * * @note EV_MAX is also recognized. */ int libevdev_event_type_from_name(const char *name); /** * @ingroup misc * * Look up an event-type by its name. Event-types start with "EV_" followed by * the name (eg., "EV_ABS"). The "EV_" prefix must be included in the name. It * returns the constant assigned to the event-type or -1 if not found. * * @param name A non-NULL string describing an input-event type ("EV_KEY", * "EV_ABS", ...). * @param len The length of the passed string excluding any terminating 0 * character. * * @return The given type constant for the passed name or -1 if not found. * * @note EV_MAX is also recognized. */ int libevdev_event_type_from_name_n(const char *name, size_t len); /** * @ingroup misc * * Look up an event code by its type and name. Event codes start with a fixed * prefix followed by their name (eg., "ABS_X"). The prefix must be included in * the name. It returns the constant assigned to the event code or -1 if not * found. * * You have to pass the event type where to look for the name. For instance, to * resolve "ABS_X" you need to pass EV_ABS as type and "ABS_X" as string. * Supported event codes are codes starting with SYN_, KEY_, BTN_, REL_, ABS_, * MSC_, SND_, SW_, LED_, REP_, FF_. * * @param type The event type (EV_* constant) where to look for the name. * @param name A non-NULL string describing an input-event code ("KEY_A", * "ABS_X", "BTN_Y", ...), zero-terminated. * * @return The given code constant for the passed name or -1 if not found. */ int libevdev_event_code_from_name(unsigned int type, const char *name); /** * @ingroup misc * * Look up an event code by its type and name. Event codes start with a fixed * prefix followed by their name (eg., "ABS_X"). The prefix must be included in * the name. It returns the constant assigned to the event code or -1 if not * found. * * You have to pass the event type where to look for the name. For instance, to * resolve "ABS_X" you need to pass EV_ABS as type and "ABS_X" as string. * Supported event codes are codes starting with SYN_, KEY_, BTN_, REL_, ABS_, * MSC_, SND_, SW_, LED_, REP_, FF_. * * @param type The event type (EV_* constant) where to look for the name. * @param name A non-NULL string describing an input-event code ("KEY_A", * "ABS_X", "BTN_Y", ...). * @param len The length of the string in @p name excluding any terminating 0 * character. * * @return The given code constant for the name or -1 if not found. */ int libevdev_event_code_from_name_n(unsigned int type, const char *name, size_t len); /** * @ingroup misc * * Look up an input property by its name. Properties start with the fixed * prefix "INPUT_PROP_" followed by their name (eg., "INPUT_PROP_POINTER"). * The prefix must be included in the name. It returns the constant assigned * to the property or -1 if not found. * * @param name A non-NULL string describing an input property * * @return The given code constant for the name or -1 if not found. */ int libevdev_property_from_name(const char *name); /** * @ingroup misc * * Look up an input property by its name. Properties start with the fixed * prefix "INPUT_PROP_" followed by their name (eg., "INPUT_PROP_POINTER"). * The prefix must be included in the name. It returns the constant assigned * to the property or -1 if not found. * * @param name A non-NULL string describing an input property * @param len The length of the string in @p name excluding any terminating 0 * character. * * @return The given code constant for the name or -1 if not found. */ int libevdev_property_from_name_n(const char *name, size_t len); /** * @ingroup bits * * Get the repeat delay and repeat period values for this device. This * function is a convenience function only, EV_REP is supported by * libevdev_get_event_value(). * * @param dev The evdev device, already initialized with libevdev_set_fd() * @param delay If not null, set to the repeat delay value * @param period If not null, set to the repeat period value * * @return 0 on success, -1 if this device does not have repeat settings. * * @note This function is signal-safe * * @see libevdev_get_event_value */ int libevdev_get_repeat(const struct libevdev *dev, int *delay, int *period); /********* DEPRECATED SECTION *********/ #if defined(__GNUC__) && __GNUC__ >= 4 #define LIBEVDEV_DEPRECATED __attribute__ ((deprecated)) #else #define LIBEVDEV_DEPRECATED #endif #ifdef __cplusplus } #endif #endif /* LIBEVDEV_H */ ================================================ FILE: Libraries/Core/RPi/Headers/libudev.h ================================================ /*** This file is part of systemd. Copyright 2008-2012 Kay Sievers systemd is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. systemd 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with systemd; If not, see . ***/ #ifndef _LIBUDEV_H_ #define _LIBUDEV_H_ #include #include #include #ifdef __cplusplus extern "C" { #endif /* * udev - library context * * reads the udev config and system environment * allows custom logging */ struct udev; struct udev *udev_ref(struct udev *udev); struct udev *udev_unref(struct udev *udev); struct udev *udev_new(void); void udev_set_log_fn(struct udev *udev, void (*log_fn)(struct udev *udev, int priority, const char *file, int line, const char *fn, const char *format, va_list args)); int udev_get_log_priority(struct udev *udev); void udev_set_log_priority(struct udev *udev, int priority); void *udev_get_userdata(struct udev *udev); void udev_set_userdata(struct udev *udev, void *userdata); /* * udev_list * * access to libudev generated lists */ struct udev_list_entry; struct udev_list_entry *udev_list_entry_get_next(struct udev_list_entry *list_entry); struct udev_list_entry *udev_list_entry_get_by_name(struct udev_list_entry *list_entry, const char *name); const char *udev_list_entry_get_name(struct udev_list_entry *list_entry); const char *udev_list_entry_get_value(struct udev_list_entry *list_entry); /** * udev_list_entry_foreach: * @list_entry: entry to store the current position * @first_entry: first entry to start with * * Helper to iterate over all entries of a list. */ #define udev_list_entry_foreach(list_entry, first_entry) \ for (list_entry = first_entry; \ list_entry != NULL; \ list_entry = udev_list_entry_get_next(list_entry)) /* * udev_device * * access to sysfs/kernel devices */ struct udev_device; struct udev_device *udev_device_ref(struct udev_device *udev_device); struct udev_device *udev_device_unref(struct udev_device *udev_device); struct udev *udev_device_get_udev(struct udev_device *udev_device); struct udev_device *udev_device_new_from_syspath(struct udev *udev, const char *syspath); struct udev_device *udev_device_new_from_devnum(struct udev *udev, char type, dev_t devnum); struct udev_device *udev_device_new_from_subsystem_sysname(struct udev *udev, const char *subsystem, const char *sysname); struct udev_device *udev_device_new_from_device_id(struct udev *udev, const char *id); struct udev_device *udev_device_new_from_environment(struct udev *udev); /* udev_device_get_parent_*() does not take a reference on the returned device, it is automatically unref'd with the parent */ struct udev_device *udev_device_get_parent(struct udev_device *udev_device); struct udev_device *udev_device_get_parent_with_subsystem_devtype(struct udev_device *udev_device, const char *subsystem, const char *devtype); /* retrieve device properties */ const char *udev_device_get_devpath(struct udev_device *udev_device); const char *udev_device_get_subsystem(struct udev_device *udev_device); const char *udev_device_get_devtype(struct udev_device *udev_device); const char *udev_device_get_syspath(struct udev_device *udev_device); const char *udev_device_get_sysname(struct udev_device *udev_device); const char *udev_device_get_sysnum(struct udev_device *udev_device); const char *udev_device_get_devnode(struct udev_device *udev_device); int udev_device_get_is_initialized(struct udev_device *udev_device); struct udev_list_entry *udev_device_get_devlinks_list_entry(struct udev_device *udev_device); struct udev_list_entry *udev_device_get_properties_list_entry(struct udev_device *udev_device); struct udev_list_entry *udev_device_get_tags_list_entry(struct udev_device *udev_device); struct udev_list_entry *udev_device_get_sysattr_list_entry(struct udev_device *udev_device); const char *udev_device_get_property_value(struct udev_device *udev_device, const char *key); const char *udev_device_get_driver(struct udev_device *udev_device); dev_t udev_device_get_devnum(struct udev_device *udev_device); const char *udev_device_get_action(struct udev_device *udev_device); unsigned long long int udev_device_get_seqnum(struct udev_device *udev_device); unsigned long long int udev_device_get_usec_since_initialized(struct udev_device *udev_device); const char *udev_device_get_sysattr_value(struct udev_device *udev_device, const char *sysattr); int udev_device_set_sysattr_value(struct udev_device *udev_device, const char *sysattr, char *value); int udev_device_has_tag(struct udev_device *udev_device, const char *tag); /* * udev_monitor * * access to kernel uevents and udev events */ struct udev_monitor; struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor); struct udev_monitor *udev_monitor_unref(struct udev_monitor *udev_monitor); struct udev *udev_monitor_get_udev(struct udev_monitor *udev_monitor); /* kernel and udev generated events over netlink */ struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev, const char *name); /* bind socket */ int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor); int udev_monitor_set_receive_buffer_size(struct udev_monitor *udev_monitor, int size); int udev_monitor_get_fd(struct udev_monitor *udev_monitor); struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monitor); /* in-kernel socket filters to select messages that get delivered to a listener */ int udev_monitor_filter_add_match_subsystem_devtype(struct udev_monitor *udev_monitor, const char *subsystem, const char *devtype); int udev_monitor_filter_add_match_tag(struct udev_monitor *udev_monitor, const char *tag); int udev_monitor_filter_update(struct udev_monitor *udev_monitor); int udev_monitor_filter_remove(struct udev_monitor *udev_monitor); /* * udev_enumerate * * search sysfs for specific devices and provide a sorted list */ struct udev_enumerate; struct udev_enumerate *udev_enumerate_ref(struct udev_enumerate *udev_enumerate); struct udev_enumerate *udev_enumerate_unref(struct udev_enumerate *udev_enumerate); struct udev *udev_enumerate_get_udev(struct udev_enumerate *udev_enumerate); struct udev_enumerate *udev_enumerate_new(struct udev *udev); /* device properties filter */ int udev_enumerate_add_match_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem); int udev_enumerate_add_nomatch_subsystem(struct udev_enumerate *udev_enumerate, const char *subsystem); int udev_enumerate_add_match_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value); int udev_enumerate_add_nomatch_sysattr(struct udev_enumerate *udev_enumerate, const char *sysattr, const char *value); int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value); int udev_enumerate_add_match_sysname(struct udev_enumerate *udev_enumerate, const char *sysname); int udev_enumerate_add_match_tag(struct udev_enumerate *udev_enumerate, const char *tag); int udev_enumerate_add_match_parent(struct udev_enumerate *udev_enumerate, struct udev_device *parent); int udev_enumerate_add_match_is_initialized(struct udev_enumerate *udev_enumerate); int udev_enumerate_add_syspath(struct udev_enumerate *udev_enumerate, const char *syspath); /* run enumeration with active filters */ int udev_enumerate_scan_devices(struct udev_enumerate *udev_enumerate); int udev_enumerate_scan_subsystems(struct udev_enumerate *udev_enumerate); /* return device list */ struct udev_list_entry *udev_enumerate_get_list_entry(struct udev_enumerate *udev_enumerate); /* * udev_queue * * access to the currently running udev events */ struct udev_queue; struct udev_queue *udev_queue_ref(struct udev_queue *udev_queue); struct udev_queue *udev_queue_unref(struct udev_queue *udev_queue); struct udev *udev_queue_get_udev(struct udev_queue *udev_queue); struct udev_queue *udev_queue_new(struct udev *udev); unsigned long long int udev_queue_get_kernel_seqnum(struct udev_queue *udev_queue) __attribute__ ((deprecated)); unsigned long long int udev_queue_get_udev_seqnum(struct udev_queue *udev_queue) __attribute__ ((deprecated)); int udev_queue_get_udev_is_active(struct udev_queue *udev_queue); int udev_queue_get_queue_is_empty(struct udev_queue *udev_queue); int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned long long int seqnum) __attribute__ ((deprecated)); int udev_queue_get_seqnum_sequence_is_finished(struct udev_queue *udev_queue, unsigned long long int start, unsigned long long int end) __attribute__ ((deprecated)); int udev_queue_get_fd(struct udev_queue *udev_queue); int udev_queue_flush(struct udev_queue *udev_queue); struct udev_list_entry *udev_queue_get_queued_list_entry(struct udev_queue *udev_queue) __attribute__ ((deprecated)); /* * udev_hwdb * * access to the static hardware properties database */ struct udev_hwdb; struct udev_hwdb *udev_hwdb_new(struct udev *udev); struct udev_hwdb *udev_hwdb_ref(struct udev_hwdb *hwdb); struct udev_hwdb *udev_hwdb_unref(struct udev_hwdb *hwdb); struct udev_list_entry *udev_hwdb_get_properties_list_entry(struct udev_hwdb *hwdb, const char *modalias, unsigned int flags); /* * udev_util * * udev specific utilities */ int udev_util_encode_string(const char *str, char *str_enc, size_t len); #ifdef __cplusplus } /* extern "C" */ #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/md5/md5.h ================================================ /* MD5 converted to C++ class by Frank Thilo (thilo@unix-ag.org) for bzflag (http://www.bzflag.org) based on: md5.h and md5.c reference implementation of RFC 1321 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #ifndef BZF_MD5_H #define BZF_MD5_H #include #include // a small class for calculating MD5 hashes of strings or byte arrays // it is not meant to be fast or secure // // usage: 1) feed it blocks of uchars with update() // 2) finalize() // 3) get hexdigest() string // or // MD5(std::string).hexdigest() // // assumes that char is 8 bit and int is 32 bit class MD5 { public: typedef unsigned int size_type; // must be 32bit MD5(); MD5(const std::string& text); void update(const unsigned char *buf, size_type length); void update(const char *buf, size_type length); MD5& finalize(); std::string hexdigest() const; friend std::ostream& operator<<(std::ostream&, MD5 md5); std::string binarydigest() const {return std::string(reinterpret_cast(digest), 16);} //Ian Copland, 09/06/2014: added accessor for the raw digest. private: void init(); typedef unsigned char uint1; // 8bit typedef unsigned int uint4; // 32bit enum {blocksize = 64}; // VC6 won't eat a const static int here void transform(const uint1 block[blocksize]); static void decode(uint4 output[], const uint1 input[], size_type len); static void encode(uint1 output[], const uint4 input[], size_type len); bool finalized; uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk uint4 count[2]; // 64bit counter for number of bits (lo, hi) uint4 state[4]; // digest so far uint1 digest[16]; // the result // low level logic operations static inline uint4 F(uint4 x, uint4 y, uint4 z); static inline uint4 G(uint4 x, uint4 y, uint4 z); static inline uint4 H(uint4 x, uint4 y, uint4 z); static inline uint4 I(uint4 x, uint4 y, uint4 z); static inline uint4 rotate_left(uint4 x, int n); static inline void FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); }; std::string md5(const std::string str); #endif ================================================ FILE: Libraries/Core/RPi/Headers/minizip/crypt.h ================================================ /* crypt.h -- base code for crypt/uncrypt ZIPfile Version 1.01e, February 12th, 2005 Copyright (C) 1998-2005 Gilles Vollant This code is a modified version of crypting code in Infozip distribution The encryption/decryption parts of this source code (as opposed to the non-echoing password parts) were originally written in Europe. The whole source package can be freely distributed, including from the USA. (Prior to January 2000, re-export from the US was a violation of US law.) This encryption code is a direct transcription of the algorithm from Roger Schlafly, described by Phil Katz in the file appnote.txt. This file (appnote.txt) is distributed with the PKZIP program (even in the version without encryption capabilities). If you don't need crypting in your application, just define symbols NOCRYPT and NOUNCRYPT. This code support the "Traditional PKWARE Encryption". The new AES encryption added on Zip format by Winzip (see the page http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong Encryption is not supported. */ #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) /*********************************************************************** * Return the next byte in the pseudo-random sequence */ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) { unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); } /*********************************************************************** * Update the encryption keys with the next byte of plain text */ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) { (*(pkeys+0)) = CRC32((*(pkeys+0)), c); (*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; { register int keyshift = (int)((*(pkeys+1)) >> 24); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); } return c; } /*********************************************************************** * Initialize the encryption keys and the random header according to * the given password. */ static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) { *(pkeys+0) = 305419896L; *(pkeys+1) = 591751049L; *(pkeys+2) = 878082192L; while (*passwd != '\0') { update_keys(pkeys,pcrc_32_tab,(int)*passwd); passwd++; } } #define zdecode(pkeys,pcrc_32_tab,c) \ (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) #define zencode(pkeys,pcrc_32_tab,c,t) \ (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED #define RAND_HEAD_LEN 12 /* "last resort" source for second part of crypt seed pattern */ # ifndef ZCR_SEED2 # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ # endif static int crypthead(const char* passwd, /* password string */ unsigned char* buf, /* where to write header */ int bufSize, unsigned long* pkeys, const unsigned long* pcrc_32_tab, unsigned long crcForCrypting) { int n; /* index in random header */ int t; /* temporary */ int c; /* random byte */ unsigned char header[RAND_HEAD_LEN-2]; /* random header */ static unsigned calls = 0; /* ensure different random header each time */ if (bufSize> 7) & 0xff; header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); } /* Encrypt random header (last two bytes is high word of crc) */ init_keys(passwd, pkeys, pcrc_32_tab); for (n = 0; n < RAND_HEAD_LEN-2; n++) { buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); } buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); return n; } #endif ================================================ FILE: Libraries/Core/RPi/Headers/minizip/ioapi.h ================================================ /* ioapi.h -- IO base function header for compress/uncompress .zip part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt Changes Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. More if/def section may be needed to support other platforms Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. (but you should use iowin32.c for windows instead) */ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H #if (!defined(_WIN32)) && (!defined(WIN32)) // Linux needs this to support file operation on files larger then 4+GB // But might need better if/def to select just the platforms that needs them. #ifndef __USE_FILE_OFFSET64 #define __USE_FILE_OFFSET64 #endif #ifndef __USE_LARGEFILE64 #define __USE_LARGEFILE64 #endif #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif #ifndef _FILE_OFFSET_BIT #define _FILE_OFFSET_BIT 64 #endif #endif #include #include #include "zlib.h" #if defined(USE_FILE32API) #define fopen64 fopen #define ftello64 ftell #define fseeko64 fseek #else #ifdef _MSC_VER #define fopen64 fopen #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) #define ftello64 _ftelli64 #define fseeko64 _fseeki64 #else // old MSC #define ftello64 ftell #define fseeko64 fseek #endif #endif #endif /* #ifndef ZPOS64_T #ifdef _WIN32 #define ZPOS64_T fpos_t #else #include #define ZPOS64_T uint64_t #endif #endif */ #ifdef HAVE_MINIZIP64_CONF_H #include "mz64conf.h" #endif /* a type choosen by DEFINE */ #ifdef HAVE_64BIT_INT_CUSTOM typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; #else #ifdef HAS_STDINT_H #include "stdint.h" typedef uint64_t ZPOS64_T; #else #if defined(_MSC_VER) || defined(__BORLANDC__) typedef unsigned __int64 ZPOS64_T; #else typedef unsigned long long int ZPOS64_T; #endif #endif #endif #ifdef __cplusplus extern "C" { #endif #define ZLIB_FILEFUNC_SEEK_CUR (1) #define ZLIB_FILEFUNC_SEEK_END (2) #define ZLIB_FILEFUNC_SEEK_SET (0) #define ZLIB_FILEFUNC_MODE_READ (1) #define ZLIB_FILEFUNC_MODE_WRITE (2) #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) #define ZLIB_FILEFUNC_MODE_EXISTING (4) #define ZLIB_FILEFUNC_MODE_CREATE (8) #ifndef ZCALLBACK #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) #define ZCALLBACK CALLBACK #else #define ZCALLBACK #endif #endif typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); /* here is the "old" 32 bits structure structure */ typedef struct zlib_filefunc_def_s { open_file_func zopen_file; read_file_func zread_file; write_file_func zwrite_file; tell_file_func ztell_file; seek_file_func zseek_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; } zlib_filefunc_def; typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); typedef struct zlib_filefunc64_def_s { open64_file_func zopen64_file; read_file_func zread_file; write_file_func zwrite_file; tell64_file_func ztell64_file; seek64_file_func zseek64_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; } zlib_filefunc64_def; void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); /* now internal definition, only for zip.c and unzip.h */ typedef struct zlib_filefunc64_32_def_s { zlib_filefunc64_def zfile_func64; open_file_func zopen32_file; tell_file_func ztell32_file; seek_file_func zseek32_file; } zlib_filefunc64_32_def; #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) //#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) //#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/minizip/mztools.h ================================================ /* Additional tools for Minizip Code: Xavier Roche '2004 License: Same as ZLIB (www.gzip.org) */ #ifndef _zip_tools_H #define _zip_tools_H #ifdef __cplusplus extern "C" { #endif #ifndef _ZLIB_H #include "zlib.h" #endif #include "unzip.h" /* Repair a ZIP file (missing central directory) file: file to recover fileOut: output file after recovery fileOutTmp: temporary file name used for recovery */ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char* fileOutTmp, uLong* nRecovered, uLong* bytesRecovered); #endif ================================================ FILE: Libraries/Core/RPi/Headers/minizip/unzip.h ================================================ /* unzip.h -- IO for uncompress .zip files using zlib Version 1.1, February 14h, 2010 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications of Unzip for Zip64 Copyright (C) 2007-2008 Even Rouault Modifications for Zip64 support on both zip and unzip Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt --------------------------------------------------------------------------------- Condition of use and distribution are the same than zlib : This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- Changes See header of unzip64.c */ #ifndef _unz64_H #define _unz64_H #ifdef __cplusplus extern "C" { #endif #ifndef _ZLIB_H #include "zlib.h" #endif #ifndef _ZLIBIOAPI_H #include "ioapi.h" #endif #ifdef HAVE_BZIP2 #include "bzlib.h" #endif #define Z_BZIP2ED 12 #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ typedef struct TagunzFile__ { int unused; } unzFile__; typedef unzFile__ *unzFile; #else typedef voidp unzFile; #endif #define UNZ_OK (0) #define UNZ_END_OF_LIST_OF_FILE (-100) #define UNZ_ERRNO (Z_ERRNO) #define UNZ_EOF (0) #define UNZ_PARAMERROR (-102) #define UNZ_BADZIPFILE (-103) #define UNZ_INTERNALERROR (-104) #define UNZ_CRCERROR (-105) /* tm_unz contain date/time info */ typedef struct tm_unz_s { uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mon; /* months since January - [0,11] */ uInt tm_year; /* years - [1980..2044] */ } tm_unz; /* unz_global_info structure contain global data about the ZIPfile These data comes from the end of central dir */ typedef struct unz_global_info64_s { ZPOS64_T number_entry; /* total number of entries in the central dir on this disk */ uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info64; typedef struct unz_global_info_s { uLong number_entry; /* total number of entries in the central dir on this disk */ uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info; /* unz_file_info contain information about a file in the zipfile */ typedef struct unz_file_info64_s { uLong version; /* version made by 2 bytes */ uLong version_needed; /* version needed to extract 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */ uLong compression_method; /* compression method 2 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong crc; /* crc-32 4 bytes */ ZPOS64_T compressed_size; /* compressed size 8 bytes */ ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ uLong size_filename; /* filename length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */ uLong disk_num_start; /* disk number start 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info64; typedef struct unz_file_info_s { uLong version; /* version made by 2 bytes */ uLong version_needed; /* version needed to extract 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */ uLong compression_method; /* compression method 2 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong crc; /* crc-32 4 bytes */ uLong compressed_size; /* compressed size 4 bytes */ uLong uncompressed_size; /* uncompressed size 4 bytes */ uLong size_filename; /* filename length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */ uLong disk_num_start; /* disk number start 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info; extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, const char* fileName2, int iCaseSensitivity)); /* Compare two filename (fileName1,fileName2). If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi or strcasecmp) If iCaseSenisivity = 0, case sensitivity is defaut of your operating system (like 1 on Unix, 2 on Windows) */ extern unzFile ZEXPORT unzOpen OF((const char *path)); extern unzFile ZEXPORT unzOpen64 OF((const void *path)); /* Open a Zip file. path contain the full pathname (by example, on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip". If the zipfile cannot be opened (file don't exist or in not valid), the return value is NULL. Else, the return value is a unzFile Handle, usable with other function of this unzip package. the "64" function take a const void* pointer, because the path is just the value passed to the open64_file_func callback. Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* does not describe the reality */ extern unzFile ZEXPORT unzOpen2 OF((const char *path, zlib_filefunc_def* pzlib_filefunc_def)); /* Open a Zip file, like unzOpen, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, zlib_filefunc64_def* pzlib_filefunc_def)); /* Open a Zip file, like unz64Open, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ extern int ZEXPORT unzClose OF((unzFile file)); /* Close a ZipFile opened with unzipOpen. If there is files inside the .Zip opened with unzOpenCurrentFile (see later), these files MUST be closed with unzipCloseCurrentFile before call unzipClose. return UNZ_OK if there is no problem. */ extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, unz_global_info *pglobal_info)); extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, unz_global_info64 *pglobal_info)); /* Write info about the ZipFile in the *pglobal_info structure. No preparation of the structure is needed return UNZ_OK if there is no problem. */ extern int ZEXPORT unzGetGlobalComment OF((unzFile file, char *szComment, uLong uSizeBuf)); /* Get the global comment string of the ZipFile, in the szComment buffer. uSizeBuf is the size of the szComment buffer. return the number of byte copied or an error code <0 */ /***************************************************************************/ /* Unzip package allow you browse the directory of the zipfile */ extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); /* Set the current file of the zipfile to the first file. return UNZ_OK if there is no problem */ extern int ZEXPORT unzGoToNextFile OF((unzFile file)); /* Set the current file of the zipfile to the next file. return UNZ_OK if there is no problem return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. */ extern int ZEXPORT unzLocateFile OF((unzFile file, const char *szFileName, int iCaseSensitivity)); /* Try locate the file szFileName in the zipfile. For the iCaseSensitivity signification, see unzStringFileNameCompare return value : UNZ_OK if the file is found. It becomes the current file. UNZ_END_OF_LIST_OF_FILE if the file is not found */ /* ****************************************** */ /* Ryan supplied functions */ /* unz_file_info contain information about a file in the zipfile */ typedef struct unz_file_pos_s { uLong pos_in_zip_directory; /* offset in zip file directory */ uLong num_of_file; /* # of file */ } unz_file_pos; extern int ZEXPORT unzGetFilePos( unzFile file, unz_file_pos* file_pos); extern int ZEXPORT unzGoToFilePos( unzFile file, unz_file_pos* file_pos); typedef struct unz64_file_pos_s { ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ ZPOS64_T num_of_file; /* # of file */ } unz64_file_pos; extern int ZEXPORT unzGetFilePos64( unzFile file, unz64_file_pos* file_pos); extern int ZEXPORT unzGoToFilePos64( unzFile file, const unz64_file_pos* file_pos); /* ****************************************** */ extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, unz_file_info64 *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)); extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, unz_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)); /* Get Info about the current file if pfile_info!=NULL, the *pfile_info structure will contain somes info about the current file if szFileName!=NULL, the filemane string will be copied in szFileName (fileNameBufferSize is the size of the buffer) if extraField!=NULL, the extra field information will be copied in extraField (extraFieldBufferSize is the size of the buffer). This is the Central-header version of the extra field if szComment!=NULL, the comment string of the file will be copied in szComment (commentBufferSize is the size of the buffer) */ /** Addition for GDAL : START */ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); /** Addition for GDAL : END */ /***************************************************************************/ /* for reading the content of the current zipfile, you can open it, read data from it, and close it (you can close it before reading all the file) */ extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); /* Open for reading data the current file in the zipfile. If there is no error, the return value is UNZ_OK. */ extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, const char* password)); /* Open for reading data the current file in the zipfile. password is a crypting password If there is no error, the return value is UNZ_OK. */ extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, int* method, int* level, int raw)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 *method will receive method of compression, *level will receive level of compression note : you can set level parameter as NULL (if you did not want known level, but you CANNOT set method parameter as NULL */ extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, int* method, int* level, int raw, const char* password)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 *method will receive method of compression, *level will receive level of compression note : you can set level parameter as NULL (if you did not want known level, but you CANNOT set method parameter as NULL */ extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); /* Close the file in zip opened with unzOpenCurrentFile Return UNZ_CRCERROR if all the file was read but the CRC is not good */ extern int ZEXPORT unzReadCurrentFile OF((unzFile file, voidp buf, unsigned len)); /* Read bytes from the current file (opened by unzOpenCurrentFile) buf contain buffer where data must be copied len the size of buf. return the number of byte copied if somes bytes are copied return 0 if the end of file was reached return <0 with error code if there is an error (UNZ_ERRNO for IO error, or zLib error for uncompress error) */ extern z_off_t ZEXPORT unztell OF((unzFile file)); extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); /* Give the current position in uncompressed data */ extern int ZEXPORT unzeof OF((unzFile file)); /* return 1 if the end of file was reached, 0 elsewhere */ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, voidp buf, unsigned len)); /* Read extra field from the current file (opened by unzOpenCurrentFile) This is the local-header version of the extra field (sometimes, there is more info in the local-header version than in the central-header) if buf==NULL, it return the size of the local extra field if buf!=NULL, len is the size of the buffer, the extra header is copied in buf. the return value is the number of bytes copied in buf, or (if <0) the error code */ /***************************************************************************/ /* Get the current file offset */ extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); extern uLong ZEXPORT unzGetOffset (unzFile file); /* Set the current file offset */ extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); #ifdef __cplusplus } #endif #endif /* _unz64_H */ ================================================ FILE: Libraries/Core/RPi/Headers/minizip/zip.h ================================================ /* zip.h -- IO on .zip files using zlib Version 1.1, February 14h, 2010 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt --------------------------------------------------------------------------- Condition of use and distribution are the same than zlib : This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------- Changes See header of zip.h */ #ifndef _zip12_H #define _zip12_H #ifdef __cplusplus extern "C" { #endif //#define HAVE_BZIP2 #ifndef _ZLIB_H #include "zlib.h" #endif #ifndef _ZLIBIOAPI_H #include "ioapi.h" #endif #ifdef HAVE_BZIP2 #include "bzlib.h" #endif #define Z_BZIP2ED 12 #if defined(STRICTZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ typedef struct TagzipFile__ { int unused; } zipFile__; typedef zipFile__ *zipFile; #else typedef voidp zipFile; #endif #define ZIP_OK (0) #define ZIP_EOF (0) #define ZIP_ERRNO (Z_ERRNO) #define ZIP_PARAMERROR (-102) #define ZIP_BADZIPFILE (-103) #define ZIP_INTERNALERROR (-104) #ifndef DEF_MEM_LEVEL # if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 # else # define DEF_MEM_LEVEL MAX_MEM_LEVEL # endif #endif /* default memLevel */ /* tm_zip contain date/time info */ typedef struct tm_zip_s { uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mon; /* months since January - [0,11] */ uInt tm_year; /* years - [1980..2044] */ } tm_zip; typedef struct { tm_zip tmz_date; /* date in understandable format */ uLong dosDate; /* if dos_date == 0, tmu_date is used */ /* uLong flag; */ /* general purpose bit flag 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ } zip_fileinfo; typedef const char* zipcharpc; #define APPEND_STATUS_CREATE (0) #define APPEND_STATUS_CREATEAFTER (1) #define APPEND_STATUS_ADDINZIP (2) extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); /* Create a zipfile. pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip". if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip will be created at the end of the file. (useful if the file contain a self extractor code) if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will add files in existing zip (be sure you don't add file that doesn't exist) If the zipfile cannot be opened, the return value is NULL. Else, the return value is a zipFile Handle, usable with other function of this zip package. */ /* Note : there is no delete function into a zipfile. If you want delete file into a zipfile, you must open a zipfile, and create another Of couse, you can use RAW reading and writing to copy the file you did not want delte */ extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc_def)); extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def)); extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level)); extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int zip64)); /* Open a file in the ZIP for writing. filename : the filename in zip (if NULL, '-' without quote will be used *zipfi contain supplemental information if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local contains the extrafield data the the local header if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global contains the extrafield data the the local header if comment != NULL, comment contain the comment string method contain the compression method (0 for store, Z_DEFLATED for deflate) level contain the level of compression (can be Z_DEFAULT_COMPRESSION) zip64 is set to 1 if a zip64 extended information block should be added to the local file header. this MUST be '1' if the uncompressed size is >= 0xffffffff. */ extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw)); extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int zip64)); /* Same than zipOpenNewFileInZip, except if raw=1, we write raw file */ extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting)); extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, int zip64 )); /* Same than zipOpenNewFileInZip2, except windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 password : crypting password (NULL for no crypting) crcForCrypting : crc of file to compress (needed for crypting) */ extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase )); extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64 )); /* Same than zipOpenNewFileInZip4, except versionMadeBy : value for Version made by field flag : value for flag field (compression level info will be added) */ extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, const void* buf, unsigned len)); /* Write data in the zipfile */ extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); /* Close the current file in the zipfile */ extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, uLong uncompressed_size, uLong crc32)); extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, ZPOS64_T uncompressed_size, uLong crc32)); /* Close the current file in the zipfile, for file opened with parameter raw=1 in zipOpenNewFileInZip2 uncompressed_size and crc32 are value for the uncompressed size */ extern int ZEXPORT zipClose OF((zipFile file, const char* global_comment)); /* Close the zipfile */ extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); /* zipRemoveExtraInfoBlock - Added by Mathias Svensson Remove extra information block from a extra information data for the local file header or central directory header It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode. 0x0001 is the signature header for the ZIP64 extra information blocks usage. Remove ZIP64 Extra information from a central director extra field data zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001); Remove ZIP64 Extra information from a Local File Header extra field data zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001); */ #ifdef __cplusplus } #endif #endif /* _zip64_H */ ================================================ FILE: Libraries/Core/RPi/Headers/png/png.h ================================================ /* png.h - header file for PNG reference library * * libpng version 1.6.10 - March 6, 2014 * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license (See LICENSE, below) * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.97, January 1998, through 1.6.10 - March 6, 2014: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: * * Due to various miscommunications, unforeseen code incompatibilities * and occasional factors outside the authors' control, version numbering * on the library has not always been consistent and straightforward. * The following table summarizes matters since version 0.89c, which was * the first widely used release: * * source png.h png.h shared-lib * version string int version * ------- ------ ----- ---------- * 0.89c "1.0 beta 3" 0.89 89 1.0.89 * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] * 0.97c 0.97 97 2.0.97 * 0.98 0.98 98 2.0.98 * 0.99 0.99 98 2.0.99 * 0.99a-m 0.99 99 2.0.99 * 1.00 1.00 100 2.1.0 [100 should be 10000] * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] * 1.0.1 png.h string is 10001 2.1.0 * 1.0.1a-e identical to the 10002 from here on, the shared library * 1.0.2 source version) 10002 is 2.V where V is the source code * 1.0.2a-b 10003 version, except as noted. * 1.0.3 10003 * 1.0.3a-d 10004 * 1.0.4 10004 * 1.0.4a-f 10005 * 1.0.5 (+ 2 patches) 10005 * 1.0.5a-d 10006 * 1.0.5e-r 10100 (not source compatible) * 1.0.5s-v 10006 (not binary compatible) * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) * 1.0.6d-f 10007 (still binary incompatible) * 1.0.6g 10007 * 1.0.6h 10007 10.6h (testing xy.z so-numbering) * 1.0.6i 10007 10.6i * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) * 1.0.7 1 10007 (still compatible) * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 * 1.0.8rc1 1 10008 2.1.0.8rc1 * 1.0.8 1 10008 2.1.0.8 * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 * 1.0.9rc1 1 10009 2.1.0.9rc1 * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 * 1.0.9rc2 1 10009 2.1.0.9rc2 * 1.0.9 1 10009 2.1.0.9 * 1.0.10beta1 1 10010 2.1.0.10beta1 * 1.0.10rc1 1 10010 2.1.0.10rc1 * 1.0.10 1 10010 2.1.0.10 * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 * 1.0.11rc1 1 10011 2.1.0.11rc1 * 1.0.11 1 10011 2.1.0.11 * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 * 1.0.12rc1 2 10012 2.1.0.12rc1 * 1.0.12 2 10012 2.1.0.12 * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 * 1.2.0rc1 3 10200 3.1.2.0rc1 * 1.2.0 3 10200 3.1.2.0 * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 * 1.2.1 3 10201 3.1.2.1 * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 * 1.0.13 10 10013 10.so.0.1.0.13 * 1.2.2 12 10202 12.so.0.1.2.2 * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 * 1.2.3 12 10203 12.so.0.1.2.3 * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 * 1.0.14 10 10014 10.so.0.1.0.14 * 1.2.4 13 10204 12.so.0.1.2.4 * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 * 1.0.15 10 10015 10.so.0.1.0.15 * 1.2.5 13 10205 12.so.0.1.2.5 * 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 * 1.0.16 10 10016 10.so.0.1.0.16 * 1.2.6 13 10206 12.so.0.1.2.6 * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 * 1.0.17rc1 10 10017 12.so.0.1.0.17rc1 * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 * 1.0.17 10 10017 12.so.0.1.0.17 * 1.2.7 13 10207 12.so.0.1.2.7 * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 * 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5 * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 * 1.0.18 10 10018 12.so.0.1.0.18 * 1.2.8 13 10208 12.so.0.1.2.8 * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 * 1.2.9beta4-11 13 10209 12.so.0.9[.0] * 1.2.9rc1 13 10209 12.so.0.9[.0] * 1.2.9 13 10209 12.so.0.9[.0] * 1.2.10beta1-7 13 10210 12.so.0.10[.0] * 1.2.10rc1-2 13 10210 12.so.0.10[.0] * 1.2.10 13 10210 12.so.0.10[.0] * 1.4.0beta1-5 14 10400 14.so.0.0[.0] * 1.2.11beta1-4 13 10211 12.so.0.11[.0] * 1.4.0beta7-8 14 10400 14.so.0.0[.0] * 1.2.11 13 10211 12.so.0.11[.0] * 1.2.12 13 10212 12.so.0.12[.0] * 1.4.0beta9-14 14 10400 14.so.0.0[.0] * 1.2.13 13 10213 12.so.0.13[.0] * 1.4.0beta15-36 14 10400 14.so.0.0[.0] * 1.4.0beta37-87 14 10400 14.so.14.0[.0] * 1.4.0rc01 14 10400 14.so.14.0[.0] * 1.4.0beta88-109 14 10400 14.so.14.0[.0] * 1.4.0rc02-08 14 10400 14.so.14.0[.0] * 1.4.0 14 10400 14.so.14.0[.0] * 1.4.1beta01-03 14 10401 14.so.14.1[.0] * 1.4.1rc01 14 10401 14.so.14.1[.0] * 1.4.1beta04-12 14 10401 14.so.14.1[.0] * 1.4.1 14 10401 14.so.14.1[.0] * 1.4.2 14 10402 14.so.14.2[.0] * 1.4.3 14 10403 14.so.14.3[.0] * 1.4.4 14 10404 14.so.14.4[.0] * 1.5.0beta01-58 15 10500 15.so.15.0[.0] * 1.5.0rc01-07 15 10500 15.so.15.0[.0] * 1.5.0 15 10500 15.so.15.0[.0] * 1.5.1beta01-11 15 10501 15.so.15.1[.0] * 1.5.1rc01-02 15 10501 15.so.15.1[.0] * 1.5.1 15 10501 15.so.15.1[.0] * 1.5.2beta01-03 15 10502 15.so.15.2[.0] * 1.5.2rc01-03 15 10502 15.so.15.2[.0] * 1.5.2 15 10502 15.so.15.2[.0] * 1.5.3beta01-10 15 10503 15.so.15.3[.0] * 1.5.3rc01-02 15 10503 15.so.15.3[.0] * 1.5.3beta11 15 10503 15.so.15.3[.0] * 1.5.3 [omitted] * 1.5.4beta01-08 15 10504 15.so.15.4[.0] * 1.5.4rc01 15 10504 15.so.15.4[.0] * 1.5.4 15 10504 15.so.15.4[.0] * 1.5.5beta01-08 15 10505 15.so.15.5[.0] * 1.5.5rc01 15 10505 15.so.15.5[.0] * 1.5.5 15 10505 15.so.15.5[.0] * 1.5.6beta01-07 15 10506 15.so.15.6[.0] * 1.5.6rc01-03 15 10506 15.so.15.6[.0] * 1.5.6 15 10506 15.so.15.6[.0] * 1.5.7beta01-05 15 10507 15.so.15.7[.0] * 1.5.7rc01-03 15 10507 15.so.15.7[.0] * 1.5.7 15 10507 15.so.15.7[.0] * 1.6.0beta01-40 16 10600 16.so.16.0[.0] * 1.6.0rc01-08 16 10600 16.so.16.0[.0] * 1.6.0 16 10600 16.so.16.0[.0] * 1.6.1beta01-09 16 10601 16.so.16.1[.0] * 1.6.1rc01 16 10601 16.so.16.1[.0] * 1.6.1 16 10601 16.so.16.1[.0] * 1.6.2beta01 16 10602 16.so.16.2[.0] * 1.6.2rc01-06 16 10602 16.so.16.2[.0] * 1.6.2 16 10602 16.so.16.2[.0] * 1.6.3beta01-11 16 10603 16.so.16.3[.0] * 1.6.3rc01 16 10603 16.so.16.3[.0] * 1.6.3 16 10603 16.so.16.3[.0] * 1.6.4beta01-02 16 10604 16.so.16.4[.0] * 1.6.4rc01 16 10604 16.so.16.4[.0] * 1.6.4 16 10604 16.so.16.4[.0] * 1.6.5 16 10605 16.so.16.5[.0] * 1.6.6 16 10606 16.so.16.6[.0] * 1.6.7beta01-04 16 10607 16.so.16.7[.0] * 1.6.7rc01-03 16 10607 16.so.16.7[.0] * 1.6.7 16 10607 16.so.16.7[.0] * 1.6.8beta01-02 16 10608 16.so.16.8[.0] * 1.6.8rc01-02 16 10608 16.so.16.8[.0] * 1.6.8 16 10608 16.so.16.8[.0] * 1.6.9beta01-04 16 10609 16.so.16.9[.0] * 1.6.9rc01-02 16 10609 16.so.16.9[.0] * 1.6.9 16 10609 16.so.16.9[.0] * 1.6.10beta01-03 16 10610 16.so.16.10[.0] * 1.6.10betarc01-04 16 10610 16.so.16.10[.0] * 1.6.10beta 16 10610 16.so.16.10[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The * PNG_LIBPNG_VER macro, which is not used within libpng but is available * for applications, is an unsigned integer of the form xyyzz corresponding * to the source version x.y.z (leading zeros in y and z). Beta versions * were given the previous public release number plus a letter, until * version 1.0.6j; from then on they were given the upcoming public * release number plus "betaNN" or "rcNN". * * Binary incompatibility exists only when applications make direct access * to the info_ptr or png_ptr members through png.h, and the compiled * application is loaded with a different version of the library. * * DLLNUM will change each time there are forward or backward changes * in binary compatibility (e.g., when a new feature is added). * * See libpng-manual.txt or libpng.3 for more information. The PNG * specification is available as a W3C Recommendation and as an ISO * Specification, defines should NOT be changed. */ #define PNG_INFO_gAMA 0x0001 #define PNG_INFO_sBIT 0x0002 #define PNG_INFO_cHRM 0x0004 #define PNG_INFO_PLTE 0x0008 #define PNG_INFO_tRNS 0x0010 #define PNG_INFO_bKGD 0x0020 #define PNG_INFO_hIST 0x0040 #define PNG_INFO_pHYs 0x0080 #define PNG_INFO_oFFs 0x0100 #define PNG_INFO_tIME 0x0200 #define PNG_INFO_pCAL 0x0400 #define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ #define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ #define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using * the routines for other purposes. */ typedef struct png_row_info_struct { png_uint_32 width; /* width of row */ png_size_t rowbytes; /* number of bytes in row */ png_byte color_type; /* color type of row */ png_byte bit_depth; /* bit depth of row */ png_byte channels; /* number of channels (1, 2, 3, or 4) */ png_byte pixel_depth; /* bits per pixel (depth * channels) */ } png_row_info; typedef png_row_info * png_row_infop; typedef png_row_info * * png_row_infopp; /* These are the function types for the I/O functions and for the functions * that allow the user to override the default I/O functions with his or her * own. The png_error_ptr type should match that of user-supplied warning * and error functions, while the png_rw_ptr type should match that of the * user read/write data functions. Note that the 'write' function must not * modify the buffer it is passed. The 'read' function, on the other hand, is * expected to return the read data in the buffer. */ typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp)); typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t)); typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp)); typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32, int)); typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32, int)); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); /* The following callback receives png_uint_32 row_number, int pass for the * png_bytep data of the row. When transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ typedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep, png_uint_32, int)); #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) typedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop, png_bytep)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp, png_unknown_chunkp)); #endif #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED /* not used anywhere */ /* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */ #endif #ifdef PNG_SETJMP_SUPPORTED /* This must match the function definition in , and the application * must include this before png.h to obtain the definition of jmp_buf. The * function is required to be PNG_NORETURN, but this is not checked. If the * function does return the application will crash via an abort() or similar * system level call. * * If you get a warning here while building the library you may need to make * changes to ensure that pnglibconf.h records the calling convention used by * your compiler. This may be very difficult - try using a different compiler * to build the library! */ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef); #endif /* Transform masks for the high-level interface */ #define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ #define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ #define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ #define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ #define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ #define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ #define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ #define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ #define PNG_TRANSFORM_BGR 0x0080 /* read and write */ #define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ #define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ #define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only */ /* Added to libpng-1.2.34 */ #define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER #define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ /* Added to libpng-1.4.0 */ #define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ /* Added to libpng-1.5.4 */ #define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ #define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ /* Flags for MNG supported features */ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 #define PNG_FLAG_MNG_FILTER_64 0x04 #define PNG_ALL_MNG_FEATURES 0x05 /* NOTE: prior to 1.5 these functions had no 'API' style declaration, * this allowed the zlib default functions to be used on Windows * platforms. In 1.5 the zlib default malloc (which just calls malloc and * ignores the first argument) should be completely compatible with the * following. */ typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp, png_alloc_size_t)); typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp)); /* Section 3: exported functions * Here are the function definitions most commonly used. This is not * the place to find out how to use libpng. See libpng-manual.txt for the * full explanation, see example.c for the summary. This just provides * a simple one line description of the use of each function. * * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in * pngconf.h and in the *.dfn files in the scripts directory. * * PNG_EXPORT(ordinal, type, name, (args)); * * ordinal: ordinal that is used while building * *.def files. The ordinal value is only * relevant when preprocessing png.h with * the *.dfn files for building symbol table * entries, and are removed by pngconf.h. * type: return type of the function * name: function name * args: function arguments, with types * * When we wish to append attributes to a function prototype we use * the PNG_EXPORTA() macro instead. * * PNG_EXPORTA(ordinal, type, name, (args), attributes); * * ordinal, type, name, and args: same as in PNG_EXPORT(). * attributes: function attributes */ /* Returns the version number of the library */ PNG_EXPORT(1, png_uint_32, png_access_version_number, (void)); /* Tell lib we have already handled the first magic bytes. * Handling more than 8 bytes from the beginning of the file is an error. */ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes)); /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a * PNG file. Returns zero if the supplied bytes match the 8-byte PNG * signature, and non-zero otherwise. Having num_to_check == 0 or * start > 7 will always fail (ie return non-zero). */ PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start, png_size_t num_to_check)); /* Simple signature checking function. This is the same as calling * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). */ #define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n)) /* Allocate and initialize png_ptr struct for reading, and any other memory. */ PNG_EXPORTA(4, png_structp, png_create_read_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); /* Allocate and initialize png_ptr struct for writing, and any other memory */ PNG_EXPORTA(5, png_structp, png_create_write_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size, (png_const_structrp png_ptr)); PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr, png_size_t size)); /* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp * match up. */ #ifdef PNG_SETJMP_SUPPORTED /* This function returns the jmp_buf built in to *png_ptr. It must be * supplied with an appropriate 'longjmp' function to use on that jmp_buf * unless the default error function is overridden in which case NULL is * acceptable. The size of the jmp_buf is checked against the actual size * allocated by the library - the call will return NULL on a mismatch * indicating an ABI mismatch. */ PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr, png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)); # define png_jmpbuf(png_ptr) \ (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf)))) #else # define png_jmpbuf(png_ptr) \ (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) #endif /* This function should be used by libpng applications in place of * longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it * will use it; otherwise it will call PNG_ABORT(). This function was * added in libpng-1.5.0. */ PNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val), PNG_NORETURN); #ifdef PNG_READ_SUPPORTED /* Reset the compression stream */ PNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED); #endif /* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(11, png_structp, png_create_read_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); PNG_EXPORTA(12, png_structp, png_create_write_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); #endif /* Write the PNG file signature. */ PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr)); /* Write a PNG chunk - size, type, (optional) data, CRC. */ PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep chunk_name, png_const_bytep data, png_size_t length)); /* Write the start of a PNG chunk - length and chunk name. */ PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr, png_const_bytep chunk_name, png_uint_32 length)); /* Write the data of a PNG chunk started with png_write_chunk_start(). */ PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr, png_const_bytep data, png_size_t length)); /* Finish a chunk started with png_write_chunk_start() (includes CRC). */ PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr)); /* Allocate and initialize the info structure */ PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr), PNG_ALLOCATED); /* DEPRECATED: this function allowed init structures to be created using the * default allocation method (typically malloc). Use is deprecated in 1.6.0 and * the API will be removed in the future. */ PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr, png_size_t png_info_struct_size), PNG_DEPRECATED); /* Writes all the PNG information before the image. */ PNG_EXPORT(20, void, png_write_info_before_PLTE, (png_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(21, void, png_write_info, (png_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the information before the actual image data. */ PNG_EXPORT(22, void, png_read_info, (png_structrp png_ptr, png_inforp info_ptr)); #endif #ifdef PNG_TIME_RFC1123_SUPPORTED /* Convert to a US string format: there is no localization support in this * routine. The original implementation used a 29 character buffer in * png_struct, this will be removed in future versions. */ #if PNG_LIBPNG_VER < 10700 /* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */ PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr, png_const_timep ptime),PNG_DEPRECATED); #endif PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29], png_const_timep ptime)); #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Convert from a struct tm to png_time */ PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime, const struct tm * ttime)); /* Convert from time_t to png_time. Uses gmtime() */ PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime)); #endif /* PNG_CONVERT_tIME_SUPPORTED */ #ifdef PNG_READ_EXPAND_SUPPORTED /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ PNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr)); PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr)); PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr)); PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr)); #endif #ifdef PNG_READ_EXPAND_16_SUPPORTED /* Expand to 16-bit channels, forces conversion of palette to RGB and expansion * of a tRNS chunk if present. */ PNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr)); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) /* Use blue, green, red order for pixels. */ PNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr)); #endif #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED /* Expand the grayscale to 24-bit RGB if necessary. */ PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr)); #endif #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED /* Reduce RGB to grayscale. */ #define PNG_ERROR_ACTION_NONE 1 #define PNG_ERROR_ACTION_WARN 2 #define PNG_ERROR_ACTION_ERROR 3 #define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr, int error_action, double red, double green)) PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr, int error_action, png_fixed_point red, png_fixed_point green)) PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp png_ptr)); #endif #ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth, png_colorp palette)); #endif #ifdef PNG_READ_ALPHA_MODE_SUPPORTED /* How the alpha channel is interpreted - this affects how the color channels * of a PNG file are returned to the calling application when an alpha channel, * or a tRNS chunk in a palette file, is present. * * This has no effect on the way pixels are written into a PNG output * datastream. The color samples in a PNG datastream are never premultiplied * with the alpha samples. * * The default is to return data according to the PNG specification: the alpha * channel is a linear measure of the contribution of the pixel to the * corresponding composited pixel, and the color channels are unassociated * (not premultiplied). The gamma encoded color channels must be scaled * according to the contribution and to do this it is necessary to undo * the encoding, scale the color values, perform the composition and reencode * the values. This is the 'PNG' mode. * * The alternative is to 'associate' the alpha with the color information by * storing color channel values that have been scaled by the alpha. * image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes * (the latter being the two common names for associated alpha color channels). * * For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha * value is equal to the maximum value. * * The final choice is to gamma encode the alpha channel as well. This is * broken because, in practice, no implementation that uses this choice * correctly undoes the encoding before handling alpha composition. Use this * choice only if other serious errors in the software or hardware you use * mandate it; the typical serious error is for dark halos to appear around * opaque areas of the composited PNG image because of arithmetic overflow. * * The API function png_set_alpha_mode specifies which of these choices to use * with an enumerated 'mode' value and the gamma of the required output: */ #define PNG_ALPHA_PNG 0 /* according to the PNG standard */ #define PNG_ALPHA_STANDARD 1 /* according to Porter/Duff */ #define PNG_ALPHA_ASSOCIATED 1 /* as above; this is the normal practice */ #define PNG_ALPHA_PREMULTIPLIED 1 /* as above */ #define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ #define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode, double output_gamma)) PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr, int mode, png_fixed_point output_gamma)) #endif #if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) /* The output_gamma value is a screen gamma in libpng terminology: it expresses * how to decode the output values, not how they are encoded. */ #define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */ #define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */ #define PNG_GAMMA_sRGB 220000 /* Television standards--matches sRGB gamma */ #define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */ #endif /* The following are examples of calls to png_set_alpha_mode to achieve the * required overall gamma correction and, where necessary, alpha * premultiplication. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * This is the default libpng handling of the alpha channel - it is not * pre-multiplied into the color components. In addition the call states * that the output is for a sRGB system and causes all PNG files without gAMA * chunks to be assumed to be encoded using sRGB. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * In this case the output is assumed to be something like an sRGB conformant * display preceeded by a power-law lookup table of power 1.45. This is how * early Mac systems behaved. * * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); * This is the classic Jim Blinn approach and will work in academic * environments where everything is done by the book. It has the shortcoming * of assuming that input PNG data with no gamma information is linear - this * is unlikely to be correct unless the PNG files where generated locally. * Most of the time the output precision will be so low as to show * significant banding in dark areas of the image. * * png_set_expand_16(pp); * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB); * This is a somewhat more realistic Jim Blinn inspired approach. PNG files * are assumed to have the sRGB encoding if not marked with a gamma value and * the output is always 16 bits per component. This permits accurate scaling * and processing of the data. If you know that your input PNG files were * generated locally you might need to replace PNG_DEFAULT_sRGB with the * correct value for your system. * * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB); * If you just need to composite the PNG image onto an existing background * and if you control the code that does this you can use the optimization * setting. In this case you just copy completely opaque pixels to the * output. For pixels that are not completely transparent (you just skip * those) you do the composition math using png_composite or png_composite_16 * below then encode the resultant 8-bit or 16-bit values to match the output * encoding. * * Other cases * If neither the PNG nor the standard linear encoding work for you because * of the software or hardware you use then you have a big problem. The PNG * case will probably result in halos around the image. The linear encoding * will probably result in a washed out, too bright, image (it's actually too * contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably * substantially reduce the halos. Alternatively try: * * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB); * This option will also reduce the halos, but there will be slight dark * halos round the opaque parts of the image where the background is light. * In the OPTIMIZED mode the halos will be light halos where the background * is dark. Take your pick - the halos are unavoidable unless you can get * your hardware/software fixed! (The OPTIMIZED approach is slightly * faster.) * * When the default gamma of PNG files doesn't match the output gamma. * If you have PNG files with no gamma information png_set_alpha_mode allows * you to provide a default gamma, but it also sets the ouput gamma to the * matching value. If you know your PNG files have a gamma that doesn't * match the output you can take advantage of the fact that * png_set_alpha_mode always sets the output gamma but only sets the PNG * default if it is not already set: * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * The first call sets both the default and the output gamma values, the * second call overrides the output gamma without changing the default. This * is easier than achieving the same effect with png_set_gamma. You must use * PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will * fire if more than one call to png_set_alpha_mode and png_set_background is * made in the same read operation, however multiple calls with PNG_ALPHA_PNG * are ignored. */ #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED PNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) PNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) /* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler, int flags)); /* The values of the PNG_FILLER_ defines should NOT be changed */ # define PNG_FILLER_BEFORE 0 # define PNG_FILLER_AFTER 1 /* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, png_uint_32 filler, int flags)); #endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) /* Swap bytes in 16-bit depth files. */ PNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ PNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) /* Swap packing order of pixels in bytes. */ PNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) /* Converts files to legal bit depths. */ PNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p true_bits)); #endif #if defined(PNG_READ_INTERLACING_SUPPORTED) || \ defined(PNG_WRITE_INTERLACING_SUPPORTED) /* Have the code handle the interlacing. Returns the number of passes. * MUST be called before png_read_update_info or png_start_read_image, * otherwise it will not have the desired effect. Note that it is still * necessary to call png_read_row or png_read_rows png_get_image_height * times for each pass. */ PNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) /* Invert monochrome files */ PNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr)); #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED /* Handle alpha and tRNS by replacing with a background color. Prior to * libpng-1.5.4 this API must not be called before the PNG file header has been * read. Doing so will result in unexpected behavior and possible warnings or * errors if the PNG file contains a bKGD chunk. */ PNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma)) PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, png_fixed_point background_gamma)) #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED # define PNG_BACKGROUND_GAMMA_UNKNOWN 0 # define PNG_BACKGROUND_GAMMA_SCREEN 1 # define PNG_BACKGROUND_GAMMA_FILE 2 # define PNG_BACKGROUND_GAMMA_UNIQUE 3 #endif #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED /* Scale a 16-bit depth file down to 8-bit, accurately. */ PNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED #define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */ /* Strip the second byte of information from a 16-bit depth file. */ PNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED /* Turn on quantizing, and reduce the palette to the number of colors * available. */ PNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr, png_colorp palette, int num_palette, int maximum_colors, png_const_uint_16p histogram, int full_quantize)); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* The threshold on gamma processing is configurable but hard-wired into the * library. The following is the floating point variant. */ #define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001) /* Handle gamma correction. Screen_gamma=(display_exponent). * NOTE: this API simply sets the screen and file gamma values. It will * therefore override the value for gamma in a PNG file if it is called after * the file header has been read - use with care - call before reading the PNG * file for best results! * * These routines accept the same gamma values as png_set_alpha_mode (described * above). The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either * API (floating point or fixed.) Notice, however, that the 'file_gamma' value * is the inverse of a 'screen gamma' value. */ PNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr, double screen_gamma, double override_file_gamma)) PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr, png_fixed_point screen_gamma, png_fixed_point override_file_gamma)) #endif #ifdef PNG_WRITE_FLUSH_SUPPORTED /* Set how many lines between output flushes - 0 for no flushing */ PNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows)); /* Flush the current PNG output buffer */ PNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr)); #endif /* Optional update palette with requested transformations */ PNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr)); /* Optional call to update the users info structure */ PNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read one or more rows of image data. */ PNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read a row of data. */ PNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row, png_bytep display_row)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the whole image into memory at once. */ PNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image)); #endif /* Write a row of image data */ PNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr, png_const_bytep row)); /* Write a few rows of image data: (*row) is not written; however, the type * is declared as writeable to maintain compatibility with previous versions * of libpng and to allow the 'display_row' array from read_rows to be passed * unchanged to write_rows. */ PNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows)); /* Write the image data */ PNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image)); /* Write the end of the PNG file. */ PNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the end of the PNG file. */ PNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr)); #endif /* Free any memory associated with the png_info_struct */ PNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr, png_infopp info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); /* Set the libpng method of handling chunk CRC errors */ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, int ancil_action)); /* Values for png_set_crc_action() say how to handle CRC errors in * ancillary and critical chunks, and whether to use the data contained * therein. Note that it is impossible to "discard" data in a critical * chunk. For versions prior to 0.90, the action was always error/quit, * whereas in version 0.90 and later, the action for CRC errors in ancillary * chunks is warn/discard. These values should NOT be changed. * * value action:critical action:ancillary */ #define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ #define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ #define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ #define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ #define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ #define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ /* These functions give the user control over the scan-line filtering in * libpng and the compression methods used by zlib. These functions are * mainly useful for testing, as the defaults should work with most users. * Those users who are tight on memory or want faster performance at the * expense of compression can modify them. See the compression library * header file (zlib.h) for an explination of the compression functions. */ /* Set the filtering method(s) used by libpng. Currently, the only valid * value for "method" is 0. */ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, int filters)); /* Flags for png_set_filter() to say which filters to use. The flags * are chosen so that they don't conflict with real filter types * below, in case they are supplied instead of the #defined constants. * These values should NOT be changed. */ #define PNG_NO_FILTERS 0x00 #define PNG_FILTER_NONE 0x08 #define PNG_FILTER_SUB 0x10 #define PNG_FILTER_UP 0x20 #define PNG_FILTER_AVG 0x40 #define PNG_FILTER_PAETH 0x80 #define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ PNG_FILTER_AVG | PNG_FILTER_PAETH) /* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. * These defines should NOT be changed. */ #define PNG_FILTER_VALUE_NONE 0 #define PNG_FILTER_VALUE_SUB 1 #define PNG_FILTER_VALUE_UP 2 #define PNG_FILTER_VALUE_AVG 3 #define PNG_FILTER_VALUE_PAETH 4 #define PNG_FILTER_VALUE_LAST 5 #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */ /* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ * defines, either the default (minimum-sum-of-absolute-differences), or * the experimental method (weighted-minimum-sum-of-absolute-differences). * * Weights are factors >= 1.0, indicating how important it is to keep the * filter type consistent between rows. Larger numbers mean the current * filter is that many times as likely to be the same as the "num_weights" * previous filters. This is cumulative for each previous row with a weight. * There needs to be "num_weights" values in "filter_weights", or it can be * NULL if the weights aren't being specified. Weights have no influence on * the selection of the first row filter. Well chosen weights can (in theory) * improve the compression for a given image. * * Costs are factors >= 1.0 indicating the relative decoding costs of a * filter type. Higher costs indicate more decoding expense, and are * therefore less likely to be selected over a filter with lower computational * costs. There needs to be a value in "filter_costs" for each valid filter * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't * setting the costs. Costs try to improve the speed of decompression without * unduly increasing the compressed image size. * * A negative weight or cost indicates the default value is to be used, and * values in the range [0.0, 1.0) indicate the value is to remain unchanged. * The default values for both weights and costs are currently 1.0, but may * change if good general weighting/cost heuristics can be found. If both * the weights and costs are set to 1.0, this degenerates the WEIGHTED method * to the UNWEIGHTED method, but with added encoding time/computation. */ PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_doublep filter_weights, png_const_doublep filter_costs)) PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_fixed_point_p filter_weights, png_const_fixed_point_p filter_costs)) #endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ /* Heuristic used for row filter selection. These defines should NOT be * changed. */ #define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ #define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ #define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ #define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ #ifdef PNG_WRITE_SUPPORTED /* Set the library compression level. Currently, valid values range from * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 * (0 - no compression, 9 - "maximal" compression). Note that tests have * shown that zlib compression levels 3-6 usually perform as well as level 9 * for PNG images, and do considerably fewer caclulations. In the future, * these values may not correspond directly to the zlib compression levels. */ PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr, int method)); #endif #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED /* Also set zlib parameters for compressing non-IDAT chunks */ PNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr, int method)); #endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */ /* These next functions are called for input/output, memory, and error * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, * and call standard C I/O routines such as fread(), fwrite(), and * fprintf(). These functions can be made to use other I/O routines * at run time for those applications that need to handle I/O in a * different manner by calling png_set_???_fn(). See libpng-manual.txt for * more information. */ #ifdef PNG_STDIO_SUPPORTED /* Initialize the input/output for the PNG file to the default functions. */ PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp)); #endif /* Replace the (error and abort), and warning functions with user * supplied functions. If no messages are to be printed you must still * write and use replacement functions. The replacement error_fn should * still do a longjmp to the last setjmp location if you are using this * method of error handling. If error_fn or warning_fn is NULL, the * default function will be used. */ PNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); /* Return the user pointer associated with the error functions */ PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr)); /* Replace the default data output functions with a user supplied one(s). * If buffered output is not used, then output_flush_fn can be set to NULL. * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time * output_flush_fn will be ignored (and thus can be NULL). * It is probably a mistake to use NULL for output_flush_fn if * write_data_fn is not also NULL unless you have built libpng with * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's * default flush function, which uses the standard *FILE structure, will * be used. */ PNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); /* Replace the default data input function with a user supplied one. */ PNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)); /* Return the user pointer associated with the I/O functions */ PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr)); PNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr, png_read_status_ptr read_row_fn)); PNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr, png_write_status_ptr write_row_fn)); #ifdef PNG_USER_MEM_SUPPORTED /* Replace the default memory allocation functions with user supplied one(s). */ PNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); /* Return the user pointer associated with the memory functions */ PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn)); #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn)); #endif #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED PNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels)); /* Return the user pointer associated with the user transform functions */ PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED /* Return information about the row currently being processed. Note that these * APIs do not fail but will return unexpected results if called outside a user * transform callback. Also note that when transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp)); PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp)); #endif #ifdef PNG_READ_USER_CHUNKS_SUPPORTED /* This callback is called only for *unknown* chunks. If * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known * chunks to be treated as unknown, however in this case the callback must do * any processing required by the chunk (e.g. by calling the appropriate * png_set_ APIs.) * * There is no write support - on write, by default, all the chunks in the * 'unknown' list are written in the specified position. * * The integer return from the callback function is interpreted thus: * * negative: An error occured, png_chunk_error will be called. * zero: The chunk was not handled, the chunk will be saved. A critical * chunk will cause an error at this point unless it is to be saved. * positive: The chunk was handled, libpng will ignore/discard it. * * See "INTERACTION WTIH USER CHUNK CALLBACKS" below for important notes about * how this behavior will change in libpng 1.7 */ PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED /* Sets the function callbacks for the push reader, and a pointer to a * user-defined structure available to the callback functions. */ PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr, png_voidp progressive_ptr, png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn)); /* Returns the user pointer associated with the push read functions */ PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, (png_const_structrp png_ptr)); /* Function to be called when data becomes available */ PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr, png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size)); /* A function which may be called *only* within png_process_data to stop the * processing of any more data. The function returns the number of bytes * remaining, excluding any that libpng has cached internally. A subsequent * call to png_process_data must supply these bytes again. If the argument * 'save' is set to true the routine will first save all the pending data and * will always return 0. */ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save)); /* A function which may be called *only* outside (after) a call to * png_process_data. It returns the number of bytes of data to skip in the * input. Normally it will return 0, but if it returns a non-zero value the * application must skip than number of bytes of input data and pass the * following data to the next call to png_process_data. */ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp)); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Function that combines rows. 'new_row' is a flag that should come from * the callback and be non-NULL if anything needs to be done; the library * stores its own version of the new data internally and ignores the passed * in value. */ PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr, png_bytep old_row, png_const_bytep new_row)); #endif /* PNG_READ_INTERLACING_SUPPORTED */ #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.4.0 */ PNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.2.4 */ PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Frees a pointer allocated by png_malloc() */ PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr)); /* Free data that was allocated internally */ PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 free_me, int num)); /* Reassign responsibility for freeing existing data, whether allocated * by libpng or by the application; this works on the png_info structure passed * in, it does not change the state for other png_info structures. * * It is unlikely that this function works correctly as of 1.6.0 and using it * may result either in memory leaks or double free of allocated data. */ PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr, png_inforp info_ptr, int freer, png_uint_32 mask)); /* Assignments for png_data_freer */ #define PNG_DESTROY_WILL_FREE_DATA 1 #define PNG_SET_WILL_FREE_DATA 1 #define PNG_USER_WILL_FREE_DATA 2 /* Flags for png_ptr->free_me and info_ptr->free_me */ #define PNG_FREE_HIST 0x0008 #define PNG_FREE_ICCP 0x0010 #define PNG_FREE_SPLT 0x0020 #define PNG_FREE_ROWS 0x0040 #define PNG_FREE_PCAL 0x0080 #define PNG_FREE_SCAL 0x0100 #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED # define PNG_FREE_UNKN 0x0200 #endif /* PNG_FREE_LIST 0x0400 removed in 1.6.0 because it is ignored */ #define PNG_FREE_PLTE 0x1000 #define PNG_FREE_TRNS 0x2000 #define PNG_FREE_TEXT 0x4000 #define PNG_FREE_ALL 0x7fff #define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED); PNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr, png_voidp ptr), PNG_DEPRECATED); #endif #ifdef PNG_ERROR_TEXT_SUPPORTED /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); /* The same, but the chunk name is prepended to the error string. */ PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); #else /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN); # define png_error(s1,s2) png_err(s1) # define png_chunk_error(s1,s2) png_err(s1) #endif #ifdef PNG_WARNINGS_SUPPORTED /* Non-fatal error in libpng. Can continue, but may have a problem. */ PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); /* Non-fatal error in libpng, chunk name is prepended to message. */ PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); #else # define png_warning(s1,s2) ((void)(s1)) # define png_chunk_warning(s1,s2) ((void)(s1)) #endif #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Benign error in libpng. Can continue, but may have a problem. * User can choose whether to handle as a fatal error or as a warning. */ PNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #ifdef PNG_READ_SUPPORTED /* Same, chunk name is prepended to message (only during read) */ PNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #endif PNG_EXPORT(109, void, png_set_benign_errors, (png_structrp png_ptr, int allowed)); #else # ifdef PNG_ALLOW_BENIGN_ERRORS # define png_benign_error png_warning # define png_chunk_benign_error png_chunk_warning # else # define png_benign_error png_error # define png_chunk_benign_error png_chunk_error # endif #endif /* The png_set_ functions are for storing values in the png_info_struct. * Similarly, the png_get_ calls are used to read values from the * png_info_struct, either storing the parameters in the passed variables, or * setting pointers into the png_info_struct where the data is stored. The * png_get_ functions return a non-zero value if the data was available * in info_ptr, or return zero and do not change any of the parameters if the * data was not available. * * These functions should be used instead of directly accessing png_info * to avoid problems with future changes in the size and internal layout of * png_info_struct. */ /* Returns "flag" if chunk data is valid in info_ptr. */ PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 flag)); /* Returns number of bytes needed to hold a transformed row. */ PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* Returns row_pointers, which is an array of pointers to scanlines that was * returned from png_read_png(). */ PNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Set row_pointers, which is an array of pointers to scanlines for use * by png_write_png(). */ PNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytepp row_pointers)); #endif /* Returns number of color channels in image. */ PNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_EASY_ACCESS_SUPPORTED /* Returns image width in pixels. */ PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image height in pixels. */ PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image bit_depth. */ PNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image color_type. */ PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image filter_type. */ PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image interlace_type. */ PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image compression_type. */ PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image resolution in pixels per meter, from pHYs chunk data. */ PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns pixel aspect ratio, computed from pHYs chunk data. */ PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio, (png_const_structrp png_ptr, png_const_inforp info_ptr)) PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(128, png_int_32, png_get_x_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(129, png_int_32, png_get_y_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif /* PNG_EASY_ACCESS_SUPPORTED */ #ifdef PNG_READ_SUPPORTED /* Returns pointer to signature string read from PNG header */ PNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_16p *background)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_16p background)); #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y)) PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z, double *green_X, double *green_Y, double *green_Z, double *blue_X, double *blue_Y, double *blue_Z)) PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_white_x, png_fixed_point *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)) PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_red_X, png_fixed_point *int_red_Y, png_fixed_point *int_red_Z, png_fixed_point *int_green_X, png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, png_fixed_point *int_blue_Z)) #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y)) PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr, png_inforp info_ptr, double red_X, double red_Y, double red_Z, double green_X, double green_Y, double green_Z, double blue_X, double blue_Y, double blue_Z)) PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, png_fixed_point int_blue_y)) PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y, png_fixed_point int_red_Z, png_fixed_point int_green_X, png_fixed_point int_green_Y, png_fixed_point int_green_Z, png_fixed_point int_blue_X, png_fixed_point int_blue_Y, png_fixed_point int_blue_Z)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *file_gamma)) PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_file_gamma)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr, png_inforp info_ptr, double file_gamma)) PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_file_gamma)) #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_16p *hist)); #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist)); #endif PNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method)); PNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_method, int compression_method, int filter_method)); #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)); #endif #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr, png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); #endif PNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr, png_inforp info_ptr, png_colorp *palette, int *num_palette)); PNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette)); #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_8p *sig_bit)); #endif #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_8p sig_bit)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *file_srgb_intent)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_charpp name, int *compression_type, png_bytepp profile, png_uint_32 *proflen)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp name, int compression_type, png_const_bytep profile, png_uint_32 proflen)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_sPLT_tpp entries)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_sPLT_tp entries, int nentries)); #endif #ifdef PNG_TEXT_SUPPORTED /* png_get_text also returns the number of text chunks in *num_text */ PNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_textp *text_ptr, int *num_text)); #endif /* Note while png_set_text() will accept a structure whose text, * language, and translated keywords are NULL pointers, the structure * returned by png_get_text will always contain regular * zero-terminated C strings. They might be empty strings but * they will never be NULL pointers. */ #ifdef PNG_TEXT_SUPPORTED PNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_timep *mod_time)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_timep mod_time)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr, png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans, png_const_color_16p trans_color)); #endif #ifdef PNG_sCAL_SUPPORTED PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, double *width, double *height)) #if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \ defined(PNG_FLOATING_POINT_SUPPORTED) /* NOTE: this API is currently implemented using floating point arithmetic, * consequently it can only be used on systems with floating point support. * In any case the range of values supported by png_fixed_point is small and it * is highly recommended that png_get_sCAL_s be used instead. */ PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_fixed_point *width, png_fixed_point *height)) #endif PNG_EXPORT(169, png_uint_32, png_get_sCAL_s, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); PNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, double width, double height)) PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_fixed_point width, png_fixed_point height)) PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_const_charp swidth, png_const_charp sheight)); #endif /* PNG_sCAL_SUPPORTED */ #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED /* Provide the default handling for all unknown chunks or, optionally, for * specific unknown chunks. * * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was * ignored and the default was used, the per-chunk setting only had an effect on * write. If you wish to have chunk-specific handling on read in code that must * work on earlier versions you must use a user chunk callback to specify the * desired handling (keep or discard.) * * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below. The * parameter is interpreted as follows: * * READ: * PNG_HANDLE_CHUNK_AS_DEFAULT: * Known chunks: do normal libpng processing, do not keep the chunk (but * see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED) * Unknown chunks: for a specific chunk use the global default, when used * as the default discard the chunk data. * PNG_HANDLE_CHUNK_NEVER: * Discard the chunk data. * PNG_HANDLE_CHUNK_IF_SAFE: * Keep the chunk data if the chunk is not critical else raise a chunk * error. * PNG_HANDLE_CHUNK_ALWAYS: * Keep the chunk data. * * If the chunk data is saved it can be retrieved using png_get_unknown_chunks, * below. Notice that specifying "AS_DEFAULT" as a global default is equivalent * to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks * it simply resets the behavior to the libpng default. * * INTERACTION WTIH USER CHUNK CALLBACKS: * The per-chunk handling is always used when there is a png_user_chunk_ptr * callback and the callback returns 0; the chunk is then always stored *unless* * it is critical and the per-chunk setting is other than ALWAYS. Notice that * the global default is *not* used in this case. (In effect the per-chunk * value is incremented to at least IF_SAFE.) * * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and * per-chunk defaults will be honored. If you want to preserve the current * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE * as the default - if you don't do this libpng 1.6 will issue a warning. * * If you want unhandled unknown chunks to be discarded in libpng 1.6 and * earlier simply return '1' (handled). * * PNG_HANDLE_AS_UNKNOWN_SUPPORTED: * If this is *not* set known chunks will always be handled by libpng and * will never be stored in the unknown chunk list. Known chunks listed to * png_set_keep_unknown_chunks will have no effect. If it is set then known * chunks listed with a keep other than AS_DEFAULT will *never* be processed * by libpng, in addition critical chunks must either be processed by the * callback or saved. * * The IHDR and IEND chunks must not be listed. Because this turns off the * default handling for chunks that would otherwise be recognized the * behavior of libpng transformations may well become incorrect! * * WRITE: * When writing chunks the options only apply to the chunks specified by * png_set_unknown_chunks (below), libpng will *always* write known chunks * required by png_set_ calls and will always write the core critical chunks * (as required for PLTE). * * Each chunk in the png_set_unknown_chunks list is looked up in the * png_set_keep_unknown_chunks list to find the keep setting, this is then * interpreted as follows: * * PNG_HANDLE_CHUNK_AS_DEFAULT: * Write safe-to-copy chunks and write other chunks if the global * default is set to _ALWAYS, otherwise don't write this chunk. * PNG_HANDLE_CHUNK_NEVER: * Do not write the chunk. * PNG_HANDLE_CHUNK_IF_SAFE: * Write the chunk if it is safe-to-copy, otherwise do not write it. * PNG_HANDLE_CHUNK_ALWAYS: * Write the chunk. * * Note that the default behavior is effectively the opposite of the read case - * in read unknown chunks are not stored by default, in write they are written * by default. Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different * - on write the safe-to-copy bit is checked, on read the critical bit is * checked and on read if the chunk is critical an error will be raised. * * num_chunks: * =========== * If num_chunks is positive, then the "keep" parameter specifies the manner * for handling only those chunks appearing in the chunk_list array, * otherwise the chunk list array is ignored. * * If num_chunks is 0 the "keep" parameter specifies the default behavior for * unknown chunks, as described above. * * If num_chunks is negative, then the "keep" parameter specifies the manner * for handling all unknown chunks plus all chunks recognized by libpng * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to * be processed by libpng. */ PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks)); /* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; * the result is therefore true (non-zero) if special handling is required, * false for the default handling. */ PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr, png_const_bytep chunk_name)); #endif #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)); /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added * unknowns to the location currently stored in the png_struct. This is * invariably the wrong value on write. To fix this call the following API * for each chunk in the list with the correct location. If you know your * code won't be compiled on earlier versions you can rely on * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing * the correct thing. */ PNG_EXPORT(175, void, png_set_unknown_chunk_location, (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location)); PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_unknown_chunkpp entries)); #endif /* Png_free_data() will turn off the "valid" flag for anything it frees. * If you need to turn it off for a chunk that your application has freed, * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr, png_inforp info_ptr, int mask)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* The "params" pointer is currently not used and is for future expansion. */ #ifdef PNG_SEQUENTIAL_READ_SUPPORTED PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #ifdef PNG_WRITE_SUPPORTED PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #endif PNG_EXPORT(180, png_const_charp, png_get_copyright, (png_const_structrp png_ptr)); PNG_EXPORT(181, png_const_charp, png_get_header_ver, (png_const_structrp png_ptr)); PNG_EXPORT(182, png_const_charp, png_get_header_version, (png_const_structrp png_ptr)); PNG_EXPORT(183, png_const_charp, png_get_libpng_ver, (png_const_structrp png_ptr)); #ifdef PNG_MNG_FEATURES_SUPPORTED PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr, png_uint_32 mng_features_permitted)); #endif /* For use in png_set_keep_unknown, added to version 1.2.6 */ #define PNG_HANDLE_CHUNK_AS_DEFAULT 0 #define PNG_HANDLE_CHUNK_NEVER 1 #define PNG_HANDLE_CHUNK_IF_SAFE 2 #define PNG_HANDLE_CHUNK_ALWAYS 3 #define PNG_HANDLE_CHUNK_LAST 4 /* Strip the prepended error numbers ("#nnn ") from error and warning * messages before passing them to the error or warning handler. */ #ifdef PNG_ERROR_NUMBERS_SUPPORTED PNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr, png_uint_32 strip_mode)); #endif /* Added in libpng-1.2.6 */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED PNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); PNG_EXPORT(187, png_uint_32, png_get_user_width_max, (png_const_structrp png_ptr)); PNG_EXPORT(188, png_uint_32, png_get_user_height_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.0 */ PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)); PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.1 */ PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr, png_alloc_size_t user_chunk_cache_max)); PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max, (png_const_structrp png_ptr)); #endif #if defined(PNG_INCH_CONVERSIONS_SUPPORTED) PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_FP_EXPORT(196, float, png_get_x_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif # ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); # endif /* PNG_pHYs_SUPPORTED */ #endif /* PNG_INCH_CONVERSIONS_SUPPORTED */ /* Added in libpng-1.4.0 */ #ifdef PNG_IO_STATE_SUPPORTED PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr)); /* Removed from libpng 1.6; use png_get_io_chunk_type. */ PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr), PNG_DEPRECATED) PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, (png_const_structrp png_ptr)); /* The flags returned by png_get_io_state() are the following: */ # define PNG_IO_NONE 0x0000 /* no I/O at this moment */ # define PNG_IO_READING 0x0001 /* currently reading */ # define PNG_IO_WRITING 0x0002 /* currently writing */ # define PNG_IO_SIGNATURE 0x0010 /* currently at the file signature */ # define PNG_IO_CHUNK_HDR 0x0020 /* currently at the chunk header */ # define PNG_IO_CHUNK_DATA 0x0040 /* currently at the chunk data */ # define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */ # define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */ # define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */ #endif /* ?PNG_IO_STATE_SUPPORTED */ /* Interlace support. The following macros are always defined so that if * libpng interlace handling is turned off the macros may be used to handle * interlaced images within the application. */ #define PNG_INTERLACE_ADAM7_PASSES 7 /* Two macros to return the first row and first column of the original, * full, image which appears in a given pass. 'pass' is in the range 0 * to 6 and the result is in the range 0 to 7. */ #define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7) #define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7) /* A macro to return the offset between pixels in the output row for a pair of * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that * follows. Note that ROW_OFFSET is the offset from one row to the next whereas * COL_OFFSET is from one column to the next, within a row. */ #define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8) #define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1)) /* Two macros to help evaluate the number of rows or columns in each * pass. This is expressed as a shift - effectively log2 of the number or * rows or columns in each 8x8 tile of the original image. */ #define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) #define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) /* Hence two macros to determine the number of rows or columns in a given * pass of an image given its height or width. In fact these macros may * return non-zero even though the sub-image is empty, because the other * dimension may be empty for a small image. */ #define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) #define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) /* For the reader row callbacks (both progressive and sequential) it is * necessary to find the row in the output image given a row in an interlaced * image, so two more macros: */ #define PNG_ROW_FROM_PASS_ROW(y_in, pass) \ (((y_in)<>(((7-(off))-(pass))<<2)) & 0xF) | \ ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0)) #define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) #define PNG_COL_IN_INTERLACE_PASS(x, pass) \ ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED /* With these routines we avoid an integer divide, which will be slower on * most machines. However, it does take more operations than the corresponding * divide method, so it may be slower on a few RISC systems. There are two * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. * * Note that the rounding factors are NOT supposed to be the same! 128 and * 32768 are correct for the NODIV code; 127 and 32767 are correct for the * standard method. * * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] */ /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ # define png_composite(composite, fg, alpha, bg) \ { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ * (png_uint_16)(alpha) \ + (png_uint_16)(bg)*(png_uint_16)(255 \ - (png_uint_16)(alpha)) + 128); \ (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } # define png_composite_16(composite, fg, alpha, bg) \ { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ * (png_uint_32)(alpha) \ + (png_uint_32)(bg)*(65535 \ - (png_uint_32)(alpha)) + 32768); \ (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } #else /* Standard method using integer division */ # define png_composite(composite, fg, alpha, bg) \ (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ 127) / 255) # define png_composite_16(composite, fg, alpha, bg) \ (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ 32767) / 65535) #endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ #ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf)); PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf)); PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf)); #endif PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr, png_const_bytep buf)); /* No png_get_int_16 -- may be added if there's a real need for it. */ /* Place a 32-bit number into a buffer in PNG byte order (big-endian). */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i)); #endif #ifdef PNG_SAVE_INT_32_SUPPORTED PNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i)); #endif /* Place a 16-bit number into a buffer in PNG byte order. * The parameter is declared unsigned int, not png_uint_16, * just to avoid potential problems on pre-ANSI C compilers. */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); /* No png_save_int_16 -- may be added if there's a real need for it. */ #endif #ifdef PNG_USE_READ_MACROS /* Inline macros to do direct reads of bytes from the input buffer. * The png_get_int_32() routine assumes we are using two's complement * format for negative values, which is almost certainly true. */ # define PNG_get_uint_32(buf) \ (((png_uint_32)(*(buf)) << 24) + \ ((png_uint_32)(*((buf) + 1)) << 16) + \ ((png_uint_32)(*((buf) + 2)) << 8) + \ ((png_uint_32)(*((buf) + 3)))) /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the * function) incorrectly returned a value of type png_uint_32. */ # define PNG_get_uint_16(buf) \ ((png_uint_16) \ (((unsigned int)(*(buf)) << 8) + \ ((unsigned int)(*((buf) + 1))))) # define PNG_get_int_32(buf) \ ((png_int_32)((*(buf) & 0x80) \ ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \ : (png_int_32)png_get_uint_32(buf))) /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, * but defining a macro name prefixed with PNG_PREFIX. */ # ifndef PNG_PREFIX # define png_get_uint_32(buf) PNG_get_uint_32(buf) # define png_get_uint_16(buf) PNG_get_uint_16(buf) # define png_get_int_32(buf) PNG_get_int_32(buf) # endif #else # ifdef PNG_PREFIX /* No macros; revert to the (redefined) function */ # define PNG_get_uint_32 (png_get_uint_32) # define PNG_get_uint_16 (png_get_uint_16) # define PNG_get_int_32 (png_get_int_32) # endif #endif /******************************************************************************* * SIMPLIFIED API ******************************************************************************* * * Please read the documentation in libpng-manual.txt (TODO: write said * documentation) if you don't understand what follows. * * The simplified API hides the details of both libpng and the PNG file format * itself. It allows PNG files to be read into a very limited number of * in-memory bitmap formats or to be written from the same formats. If these * formats do not accomodate your needs then you can, and should, use the more * sophisticated APIs above - these support a wide variety of in-memory formats * and a wide variety of sophisticated transformations to those formats as well * as a wide variety of APIs to manipulate ancillary information. * * To read a PNG file using the simplified API: * * 1) Declare a 'png_image' structure (see below) on the stack and set the * version field to PNG_IMAGE_VERSION. * 2) Call the appropriate png_image_begin_read... function. * 3) Set the png_image 'format' member to the required sample format. * 4) Allocate a buffer for the image and, if required, the color-map. * 5) Call png_image_finish_read to read the image and, if required, the * color-map into your buffers. * * There are no restrictions on the format of the PNG input itself; all valid * color types, bit depths, and interlace methods are acceptable, and the * input image is transformed as necessary to the requested in-memory format * during the png_image_finish_read() step. The only caveat is that if you * request a color-mapped image from a PNG that is full-color or makes * complex use of an alpha channel the transformation is extremely lossy and the * result may look terrible. * * To write a PNG file using the simplified API: * * 1) Declare a 'png_image' structure on the stack and memset() it to all zero. * 2) Initialize the members of the structure that describe the image, setting * the 'format' member to the format of the image samples. * 3) Call the appropriate png_image_write... function with a pointer to the * image and, if necessary, the color-map to write the PNG data. * * png_image is a structure that describes the in-memory format of an image * when it is being read or defines the in-memory format of an image that you * need to write: */ #define PNG_IMAGE_VERSION 1 typedef struct png_control *png_controlp; typedef struct { png_controlp opaque; /* Initialize to NULL, free with png_image_free */ png_uint_32 version; /* Set to PNG_IMAGE_VERSION */ png_uint_32 width; /* Image width in pixels (columns) */ png_uint_32 height; /* Image height in pixels (rows) */ png_uint_32 format; /* Image format as defined below */ png_uint_32 flags; /* A bit mask containing informational flags */ png_uint_32 colormap_entries; /* Number of entries in the color-map */ /* In the event of an error or warning the following field will be set to a * non-zero value and the 'message' field will contain a '\0' terminated * string with the libpng error or warning message. If both warnings and * an error were encountered, only the error is recorded. If there * are multiple warnings, only the first one is recorded. * * The upper 30 bits of this value are reserved, the low two bits contain * a value as follows: */ # define PNG_IMAGE_WARNING 1 # define PNG_IMAGE_ERROR 2 /* * The result is a two bit code such that a value more than 1 indicates * a failure in the API just called: * * 0 - no warning or error * 1 - warning * 2 - error * 3 - error preceded by warning */ # define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1) png_uint_32 warning_or_error; char message[64]; } png_image, *png_imagep; /* The samples of the image have one to four channels whose components have * original values in the range 0 to 1.0: * * 1: A single gray or luminance channel (G). * 2: A gray/luminance channel and an alpha channel (GA). * 3: Three red, green, blue color channels (RGB). * 4: Three color channels and an alpha channel (RGBA). * * The components are encoded in one of two ways: * * a) As a small integer, value 0..255, contained in a single byte. For the * alpha channel the original value is simply value/255. For the color or * luminance channels the value is encoded according to the sRGB specification * and matches the 8-bit format expected by typical display devices. * * The color/gray channels are not scaled (pre-multiplied) by the alpha * channel and are suitable for passing to color management software. * * b) As a value in the range 0..65535, contained in a 2-byte integer. All * channels can be converted to the original value by dividing by 65535; all * channels are linear. Color channels use the RGB encoding (RGB end-points) of * the sRGB specification. This encoding is identified by the * PNG_FORMAT_FLAG_LINEAR flag below. * * When the simplified API needs to convert between sRGB and linear colorspaces, * the actual sRGB transfer curve defined in the sRGB specification (see the * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 * approximation used elsewhere in libpng. * * When an alpha channel is present it is expected to denote pixel coverage * of the color or luminance channels and is returned as an associated alpha * channel: the color/gray channels are scaled (pre-multiplied) by the alpha * value. * * The samples are either contained directly in the image data, between 1 and 8 * bytes per pixel according to the encoding, or are held in a color-map indexed * by bytes in the image data. In the case of a color-map the color-map entries * are individual samples, encoded as above, and the image data has one byte per * pixel to select the relevant sample from the color-map. */ /* PNG_FORMAT_* * * #defines to be used in png_image::format. Each #define identifies a * particular layout of sample data and, if present, alpha values. There are * separate defines for each of the two component encodings. * * A format is built up using single bit flag values. All combinations are * valid. Formats can be built up from the flag values or you can use one of * the predefined values below. When testing formats always use the FORMAT_FLAG * macros to test for individual features - future versions of the library may * add new flags. * * When reading or writing color-mapped images the format should be set to the * format of the entries in the color-map then png_image_{read,write}_colormap * called to read or write the color-map and set the format correctly for the * image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! * * NOTE: libpng can be built with particular features disabled, if you see * compiler errors because the definition of one of the following flags has been * compiled out it is because libpng does not have the required support. It is * possible, however, for the libpng configuration to enable the format on just * read or just write; in that case you may see an error at run time. You can * guard against this by checking for the definition of the appropriate * "_SUPPORTED" macro, one of: * * PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED */ #define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ #define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ #define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2 byte channels else 1 byte */ #define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ #ifdef PNG_FORMAT_BGR_SUPPORTED # define PNG_FORMAT_FLAG_BGR 0x10U /* BGR colors, else order is RGB */ #endif #ifdef PNG_FORMAT_AFIRST_SUPPORTED # define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */ #endif /* Commonly used formats have predefined macros. * * First the single byte (sRGB) formats: */ #define PNG_FORMAT_GRAY 0 #define PNG_FORMAT_GA PNG_FORMAT_FLAG_ALPHA #define PNG_FORMAT_AG (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_RGB PNG_FORMAT_FLAG_COLOR #define PNG_FORMAT_BGR (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR) #define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST) /* Then the linear 2-byte formats. When naming these "Y" is used to * indicate a luminance (gray) channel. */ #define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR #define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR) #define PNG_FORMAT_LINEAR_RGB_ALPHA \ (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA) /* With color-mapped formats the image data is one byte for each pixel, the byte * is an index into the color-map which is formatted as above. To obtain a * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP * to one of the above definitions, or you can use one of the definitions below. */ #define PNG_FORMAT_RGB_COLORMAP (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGR_COLORMAP (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP) /* PNG_IMAGE macros * * These are convenience macros to derive information from a png_image * structure. The PNG_IMAGE_SAMPLE_ macros return values appropriate to the * actual image sample values - either the entries in the color-map or the * pixels in the image. The PNG_IMAGE_PIXEL_ macros return corresponding values * for the pixels and will always return 1 for color-mapped formats. The * remaining macros return information about the rows in the image and the * complete image. * * NOTE: All the macros that take a png_image::format parameter are compile time * constants if the format parameter is, itself, a constant. Therefore these * macros can be used in array declarations and case labels where required. * Similarly the macros are also pre-processor constants (sizeof is not used) so * they can be used in #if tests. * * First the information about the samples. */ #define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\ (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1) /* Return the total number of channels in a given format: 1..4 */ #define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\ ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1) /* Return the size in bytes of a single component of a pixel or color-map * entry (as appropriate) in the image: 1 or 2. */ #define PNG_IMAGE_SAMPLE_SIZE(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)) /* This is the size of the sample data for one sample. If the image is * color-mapped it is the size of one color-map entry (and image pixels are * one byte in size), otherwise it is the size of one image pixel. */ #define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256) /* The maximum size of the color-map required by the format expressed in a * count of components. This can be used to compile-time allocate a * color-map: * * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)]; * * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)]; * * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the * information from one of the png_image_begin_read_ APIs and dynamically * allocate the required memory. */ /* Corresponding information about the pixels */ #define PNG_IMAGE_PIXEL_(test,fmt)\ (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt)) #define PNG_IMAGE_PIXEL_CHANNELS(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt) /* The number of separate channels (components) in a pixel; 1 for a * color-mapped image. */ #define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt) /* The size, in bytes, of each component in a pixel; 1 for a color-mapped * image. */ #define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt) /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */ /* Information about the whole row, or whole image */ #define PNG_IMAGE_ROW_STRIDE(image)\ (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width) /* Return the total number of components in a single row of the image; this * is the minimum 'row stride', the minimum count of components between each * row. For a color-mapped image this is the minimum number of bytes in a * row. */ #define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\ (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride)) /* Return the size, in bytes, of an image buffer given a png_image and a row * stride - the number of components to leave space for in each row. */ #define PNG_IMAGE_SIZE(image)\ PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image)) /* Return the size, in bytes, of the image in memory given just a png_image; * the row stride is the minimum stride required for the image. */ #define PNG_IMAGE_COLORMAP_SIZE(image)\ (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries) /* Return the size, in bytes, of the color-map of this image. If the image * format is not a color-map format this will return a size sufficient for * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if * you don't want to allocate a color-map in this case. */ /* PNG_IMAGE_FLAG_* * * Flags containing additional information about the image are held in the * 'flags' field of png_image. */ #define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01 /* This indicates the the RGB values of the in-memory bitmap do not * correspond to the red, green and blue end-points defined by sRGB. */ #define PNG_IMAGE_FLAG_FAST 0x02 /* On write emphasise speed over compression; the resultant PNG file will be * larger but will be produced significantly faster, particular for large * images. Do not use this option for images which will be distributed, only * used it when producing intermediate files that will be read back in * repeatedly. For a typical 24-bit image the option will double the read * speed at the cost of increasing the image size by 25%, however for many * more compressible images the PNG file can be 10 times larger with only a * slight speed gain. */ #define PNG_IMAGE_FLAG_16BIT_sRGB 0x04 /* On read if the image is a 16-bit per component image and there is no gAMA * or sRGB chunk assume that the components are sRGB encoded. Notice that * images output by the simplified API always have gamma information; setting * this flag only affects the interpretation of 16-bit images from an * external source. It is recommended that the application expose this flag * to the user; the user can normally easily recognize the difference between * linear and sRGB encoding. This flag has no effect on write - the data * passed to the write APIs must have the correct encoding (as defined * above.) * * If the flag is not set (the default) input 16-bit per component data is * assumed to be linear. * * NOTE: the flag can only be set after the png_image_begin_read_ call, * because that call initializes the 'flags' field. */ #ifdef PNG_SIMPLIFIED_READ_SUPPORTED /* READ APIs * --------- * * The png_image passed to the read APIs must have been initialized by setting * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.) */ #ifdef PNG_STDIO_SUPPORTED PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image, const char *file_name)); /* The named file is opened for read and the image header is filled in * from the PNG header in the file. */ PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image, FILE* file)); /* The PNG header is read from the stdio FILE object. */ #endif /* PNG_STDIO_SUPPORTED */ PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image, png_const_voidp memory, png_size_t size)); /* The PNG header is read from the given memory buffer. */ PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image, png_const_colorp background, void *buffer, png_int_32 row_stride, void *colormap)); /* Finish reading the image into the supplied buffer and clean up the * png_image structure. * * row_stride is the step, in byte or 2-byte units as appropriate, * between adjacent rows. A positive stride indicates that the top-most row * is first in the buffer - the normal top-down arrangement. A negative * stride indicates that the bottom-most row is first in the buffer. * * background need only be supplied if an alpha channel must be removed from * a png_byte format and the removal is to be done by compositing on a solid * color; otherwise it may be NULL and any composition will be done directly * onto the buffer. The value is an sRGB color to use for the background, * for grayscale output the green channel is used. * * background must be supplied when an alpha channel must be removed from a * single byte color-mapped output format, in other words if: * * 1) The original format from png_image_begin_read_from_* had * PNG_FORMAT_FLAG_ALPHA set. * 2) The format set by the application does not. * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and * PNG_FORMAT_FLAG_LINEAR *not* set. * * For linear output removing the alpha channel is always done by compositing * on black and background is ignored. * * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set. It must * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE. * image->colormap_entries will be updated to the actual number of entries * written to the colormap; this may be less than the original value. */ PNG_EXPORT(238, void, png_image_free, (png_imagep image)); /* Free any data allocated by libpng in image->opaque, setting the pointer to * NULL. May be called at any time after the structure is initialized. */ #endif /* PNG_SIMPLIFIED_READ_SUPPORTED */ #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED #ifdef PNG_STDIO_SUPPORTED /* WRITE APIS * ---------- * For write you must initialize a png_image structure to describe the image to * be written. To do this use memset to set the whole structure to 0 then * initialize fields describing your image. * * version: must be set to PNG_IMAGE_VERSION * opaque: must be initialized to NULL * width: image width in pixels * height: image height in rows * format: the format of the data (image and color-map) you wish to write * flags: set to 0 unless one of the defined flags applies; set * PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB * values do not correspond to the colors in sRGB. * colormap_entries: set to the number of entries in the color-map (0 to 256) */ PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image, const char *file, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the named file. */ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, int convert_to_8_bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the given (FILE*). */ /* With both write APIs if image is in one of the linear formats with 16-bit * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG * gamma encoded according to the sRGB specification, otherwise a 16-bit linear * encoded PNG file is written. * * With color-mapped data formats the colormap parameter point to a color-map * with at least image->colormap_entries encoded in the specified format. If * the format is linear the written PNG color-map will be converted to sRGB * regardless of the convert_to_8_bit flag. * * With all APIs row_stride is handled as in the read APIs - it is the spacing * from one row to the next in component sized units (1 or 2 bytes) and if * negative indicates a bottom-up row layout in the buffer. * * Note that the write API does not support interlacing or sub-8-bit pixels. */ #endif /* PNG_STDIO_SUPPORTED */ #endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */ /******************************************************************************* * END OF SIMPLIFIED API ******************************************************************************/ #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED PNG_EXPORT(242, void, png_set_check_for_invalid_index, (png_structrp png_ptr, int allowed)); # ifdef PNG_GET_PALETTE_MAX_SUPPORTED PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, png_const_infop info_ptr)); # endif #endif /* CHECK_FOR_INVALID_INDEX */ /******************************************************************************* * IMPLEMENTATION OPTIONS ******************************************************************************* * * Support for arbitrary implementation-specific optimizations. The API allows * particular options to be turned on or off. 'Option' is the number of the * option and 'onoff' is 0 (off) or non-0 (on). The value returned is given * by the PNG_OPTION_ defines below. * * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions, * are detected at run time, however sometimes it may be impossible * to do this in user mode, in which case it is necessary to discover * the capabilities in an OS specific way. Such capabilities are * listed here when libpng has support for them and must be turned * ON by the application if present. * * SOFTWARE: sometimes software optimizations actually result in performance * decrease on some architectures or systems, or with some sets of * PNG images. 'Software' options allow such optimizations to be * selected at run time. */ #ifdef PNG_SET_OPTION_SUPPORTED #ifdef PNG_ARM_NEON_API_SUPPORTED # define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */ #endif #define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */ #define PNG_OPTION_NEXT 4 /* Next option - numbers must be even */ /* Return values: NOTE: there are four values and 'off' is *not* zero */ #define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ #define PNG_OPTION_INVALID 1 /* Option number out of range */ #define PNG_OPTION_OFF 2 #define PNG_OPTION_ON 3 PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, int onoff)); #endif /******************************************************************************* * END OF HARDWARE OPTIONS ******************************************************************************/ /* Maintainer: Put new public prototypes here ^, in libpng.3, and project * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt */ /* The last ordinal number (this is the *last* one already used; the next * one to use is one more than this.) Maintainer, remember to add an entry to * scripts/symbols.def as well. */ #ifdef PNG_EXPORT_LAST_ORDINAL PNG_EXPORT_LAST_ORDINAL(244); #endif #ifdef __cplusplus } #endif #endif /* PNG_VERSION_INFO_ONLY */ /* Do not put anything past this line */ #endif /* PNG_H */ ================================================ FILE: Libraries/Core/RPi/Headers/png/pngconf.h ================================================ /* pngconf.h - machine configurable file for libpng * * libpng version 1.6.10 - March 6, 2014 * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h * */ /* Any machine specific code is near the front of this file, so if you * are configuring libpng for a machine, you may want to read the section * starting here down to where it starts to typedef png_color, png_text, * and png_info. */ #ifndef PNGCONF_H #define PNGCONF_H /* To do: Do all of this in scripts/pnglibconf.dfa */ #ifdef PNG_SAFE_LIMITS_SUPPORTED # ifdef PNG_USER_WIDTH_MAX # undef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 1000000L # endif # ifdef PNG_USER_HEIGHT_MAX # undef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 1000000L # endif # ifdef PNG_USER_CHUNK_MALLOC_MAX # undef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 4000000L # endif # ifdef PNG_USER_CHUNK_CACHE_MAX # undef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 128 # endif #endif #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C * compiler for correct compilation. The following header files are required by * the standard. If your compiler doesn't provide these header files, or they * do not match the standard, you will need to provide/improve them. */ #include #include /* Library header files. These header files are all defined by ISOC90; libpng * expects conformant implementations, however, an ISOC90 conformant system need * not provide these header files if the functionality cannot be implemented. * In this case it will be necessary to disable the relevant parts of libpng in * the build of pnglibconf.h. * * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not * include this unnecessary header file. */ #ifdef PNG_STDIO_SUPPORTED /* Required for the definition of FILE: */ # include #endif #ifdef PNG_SETJMP_SUPPORTED /* Required for the definition of jmp_buf and the declaration of longjmp: */ # include #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Required for struct tm: */ # include #endif #endif /* PNG_BUILDING_SYMBOL_TABLE */ /* Prior to 1.6.0 it was possible to turn off 'const' in declarations using * PNG_NO_CONST; this is no longer supported except for data declarations which * apparently still cause problems in 2011 on some compilers. */ #define PNG_CONST const /* backward compatibility only */ /* This controls optimization of the reading of 16 and 32 bit values * from PNG files. It can be set on a per-app-file basis - it * just changes whether a macro is used when the function is called. * The library builder sets the default; if read functions are not * built into the library the macro implementation is forced on. */ #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED # define PNG_USE_READ_MACROS #endif #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) # if PNG_DEFAULT_READ_MACROS # define PNG_USE_READ_MACROS # endif #endif /* COMPILER SPECIFIC OPTIONS. * * These options are provided so that a variety of difficult compilers * can be used. Some are fixed at build time (e.g. PNG_API_RULE * below) but still have compiler specific implementations, others * may be changed on a per-file basis when compiling against libpng. */ /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect * against legacy (pre ISOC90) compilers that did not understand function * prototypes. It is not required for modern C compilers. */ #ifndef PNGARG # define PNGARG(arglist) arglist #endif /* Function calling conventions. * ============================= * Normally it is not necessary to specify to the compiler how to call * a function - it just does it - however on x86 systems derived from * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems * and some others) there are multiple ways to call a function and the * default can be changed on the compiler command line. For this reason * libpng specifies the calling convention of every exported function and * every function called via a user supplied function pointer. This is * done in this file by defining the following macros: * * PNGAPI Calling convention for exported functions. * PNGCBAPI Calling convention for user provided (callback) functions. * PNGCAPI Calling convention used by the ANSI-C library (required * for longjmp callbacks and sometimes used internally to * specify the calling convention for zlib). * * These macros should never be overridden. If it is necessary to * change calling convention in a private build this can be done * by setting PNG_API_RULE (which defaults to 0) to one of the values * below to select the correct 'API' variants. * * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. * This is correct in every known environment. * PNG_API_RULE=1 Use the operating system convention for PNGAPI and * the 'C' calling convention (from PNGCAPI) for * callbacks (PNGCBAPI). This is no longer required * in any known environment - if it has to be used * please post an explanation of the problem to the * libpng mailing list. * * These cases only differ if the operating system does not use the C * calling convention, at present this just means the above cases * (x86 DOS/Windows sytems) and, even then, this does not apply to * Cygwin running on those systems. * * Note that the value must be defined in pnglibconf.h so that what * the application uses to call the library matches the conventions * set when building the library. */ /* Symbol export * ============= * When building a shared library it is almost always necessary to tell * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' * is used to mark the symbols. On some systems these symbols can be * extracted at link time and need no special processing by the compiler, * on other systems the symbols are flagged by the compiler and just * the declaration requires a special tag applied (unfortunately) in a * compiler dependent way. Some systems can do either. * * A small number of older systems also require a symbol from a DLL to * be flagged to the program that calls it. This is a problem because * we do not know in the header file included by application code that * the symbol will come from a shared library, as opposed to a statically * linked one. For this reason the application must tell us by setting * the magic flag PNG_USE_DLL to turn on the special processing before * it includes png.h. * * Four additional macros are used to make this happen: * * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from * the build or imported if PNG_USE_DLL is set - compiler * and system specific. * * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to * 'type', compiler specific. * * PNG_DLL_EXPORT Set to the magic to use during a libpng build to * make a symbol exported from the DLL. Not used in the * public header files; see pngpriv.h for how it is used * in the libpng build. * * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come * from a DLL - used to define PNG_IMPEXP when * PNG_USE_DLL is set. */ /* System specific discovery. * ========================== * This code is used at build time to find PNG_IMPEXP, the API settings * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL * import processing is possible. On Windows systems it also sets * compiler-specific macros to the values required to change the calling * conventions of the various functions. */ #if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or * MinGW on any architecture currently supported by Windows. Also includes * Watcom builds but these need special treatment because they are not * compatible with GCC or Visual C because of different calling conventions. */ # if PNG_API_RULE == 2 /* If this line results in an error, either because __watcall is not * understood or because of a redefine just below you cannot use *this* * build of the library with the compiler you are using. *This* build was * build using Watcom and applications must also be built using Watcom! */ # define PNGCAPI __watcall # endif # if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) # define PNGCAPI __cdecl # if PNG_API_RULE == 1 /* If this line results in an error __stdcall is not understood and * PNG_API_RULE should not have been set to '1'. */ # define PNGAPI __stdcall # endif # else /* An older compiler, or one not detected (erroneously) above, * if necessary override on the command line to get the correct * variants for the compiler. */ # ifndef PNGCAPI # define PNGCAPI _cdecl # endif # if PNG_API_RULE == 1 && !defined(PNGAPI) # define PNGAPI _stdcall # endif # endif /* compiler/api */ /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) # error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed" # endif # if (defined(_MSC_VER) && _MSC_VER < 800) ||\ (defined(__BORLANDC__) && __BORLANDC__ < 0x500) /* older Borland and MSC * compilers used '__export' and required this to be after * the type. */ # ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP # endif # define PNG_DLL_EXPORT __export # else /* newer compiler */ # define PNG_DLL_EXPORT __declspec(dllexport) # ifndef PNG_DLL_IMPORT # define PNG_DLL_IMPORT __declspec(dllimport) # endif # endif /* compiler */ #else /* !Windows */ # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) # define PNGAPI _System # else /* !Windows/x86 && !OS/2 */ /* Use the defaults, or define PNG*API on the command line (but * this will have to be done for every compile!) */ # endif /* other system, !OS/2 */ #endif /* !Windows/x86 */ /* Now do all the defaulting . */ #ifndef PNGCAPI # define PNGCAPI #endif #ifndef PNGCBAPI # define PNGCBAPI PNGCAPI #endif #ifndef PNGAPI # define PNGAPI PNGCAPI #endif /* PNG_IMPEXP may be set on the compilation system command line or (if not set) * then in an internal header file when building the library, otherwise (when * using the library) it is set here. */ #ifndef PNG_IMPEXP # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) /* This forces use of a DLL, disallowing static linking */ # define PNG_IMPEXP PNG_DLL_IMPORT # endif # ifndef PNG_IMPEXP # define PNG_IMPEXP # endif #endif /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat * 'attributes' as a storage class - the attributes go at the start of the * function definition, and attributes are always appended regardless of the * compiler. This considerably simplifies these macros but may cause problems * if any compilers both need function attributes and fail to handle them as * a storage class (this is unlikely.) */ #ifndef PNG_FUNCTION # define PNG_FUNCTION(type, name, args, attributes) attributes type name args #endif #ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type #endif /* The ordinal value is only relevant when preprocessing png.h for symbol * table entries, so we discard it here. See the .dfn files in the * scripts directory. */ #ifndef PNG_EXPORTA # define PNG_EXPORTA(ordinal, type, name, args, attributes)\ PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \ extern attributes) #endif /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, * so make something non-empty to satisfy the requirement: */ #define PNG_EMPTY /*empty list*/ #define PNG_EXPORT(ordinal, type, name, args)\ PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) /* Use PNG_REMOVED to comment out a removed interface. */ #ifndef PNG_REMOVED # define PNG_REMOVED(ordinal, type, name, args, attributes) #endif #ifndef PNG_CALLBACK # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args) #endif /* Support for compiler specific function attributes. These are used * so that where compiler support is available incorrect use of API * functions in png.h will generate compiler warnings. * * Added at libpng-1.2.41. */ #ifndef PNG_NO_PEDANTIC_WARNINGS # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED # define PNG_PEDANTIC_WARNINGS_SUPPORTED # endif #endif #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED /* Support for compiler specific function attributes. These are used * so that where compiler support is available, incorrect use of API * functions in png.h will generate compiler warnings. Added at libpng * version 1.2.41. Disabling these removes the warnings but may also produce * less efficient code. */ # if defined(__clang__) /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ # if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # if !defined(PNG_NORETURN) && __has_attribute(__noreturn__) # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__) # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__) # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # if !defined(PNG_PRIVATE) # ifdef __has_extension # if __has_extension(attribute_unavailable_with_message) # define PNG_PRIVATE __attribute__((__unavailable__(\ "This function is not exported by libpng."))) # endif # endif # endif # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # elif defined(__GNUC__) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # ifndef PNG_NORETURN # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if __GNUC__ >= 3 # ifndef PNG_ALLOCATED # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # ifndef PNG_PRIVATE # if 0 /* Doesn't work so we use deprecated instead*/ # define PNG_PRIVATE \ __attribute__((warning("This function is not exported by libpng."))) # else # define PNG_PRIVATE \ __attribute__((__deprecated__)) # endif # endif # if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */ # endif /* __GNUC__ >= 3 */ # elif defined(_MSC_VER) && (_MSC_VER >= 1300) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* not supported */ # endif # ifndef PNG_NORETURN # define PNG_NORETURN __declspec(noreturn) # endif # ifndef PNG_ALLOCATED # if (_MSC_VER >= 1400) # define PNG_ALLOCATED __declspec(restrict) # endif # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __declspec(deprecated) # endif # ifndef PNG_PRIVATE # define PNG_PRIVATE __declspec(deprecated) # endif # ifndef PNG_RESTRICT # if (_MSC_VER >= 1400) # define PNG_RESTRICT __restrict # endif # endif # elif defined(__WATCOMC__) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif #endif /* PNG_PEDANTIC_WARNINGS */ #ifndef PNG_DEPRECATED # define PNG_DEPRECATED /* Use of this function is deprecated */ #endif #ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* The result of this function must be checked */ #endif #ifndef PNG_NORETURN # define PNG_NORETURN /* This function does not return */ #endif #ifndef PNG_ALLOCATED # define PNG_ALLOCATED /* The result of the function is new memory */ #endif #ifndef PNG_PRIVATE # define PNG_PRIVATE /* This is a private libpng function */ #endif #ifndef PNG_RESTRICT # define PNG_RESTRICT /* The C99 "restrict" feature */ #endif #ifndef PNG_FP_EXPORT /* A floating point API. */ # ifdef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No floating point APIs */ # define PNG_FP_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_FIXED_EXPORT /* A fixed point API. */ # ifdef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No fixed point APIs */ # define PNG_FIXED_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_BUILDING_SYMBOL_TABLE /* Some typedefs to get us started. These should be safe on most of the common * platforms. * * png_uint_32 and png_int_32 may, currently, be larger than required to hold a * 32-bit value however this is not normally advisable. * * png_uint_16 and png_int_16 should always be two bytes in size - this is * verified at library build time. * * png_byte must always be one byte in size. * * The checks below use constants from limits.h, as defined by the ISOC90 * standard. */ #if CHAR_BIT == 8 && UCHAR_MAX == 255 typedef unsigned char png_byte; #else # error "libpng requires 8 bit bytes" #endif #if INT_MIN == -32768 && INT_MAX == 32767 typedef int png_int_16; #elif SHRT_MIN == -32768 && SHRT_MAX == 32767 typedef short png_int_16; #else # error "libpng requires a signed 16 bit type" #endif #if UINT_MAX == 65535 typedef unsigned int png_uint_16; #elif USHRT_MAX == 65535 typedef unsigned short png_uint_16; #else # error "libpng requires an unsigned 16 bit type" #endif #if INT_MIN < -2147483646 && INT_MAX > 2147483646 typedef int png_int_32; #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 typedef long int png_int_32; #else # error "libpng requires a signed 32 bit (or more) type" #endif #if UINT_MAX > 4294967294 typedef unsigned int png_uint_32; #elif ULONG_MAX > 4294967294 typedef unsigned long int png_uint_32; #else # error "libpng requires an unsigned 32 bit (or more) type" #endif /* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however, * requires an ISOC90 compiler and relies on consistent behavior of sizeof. */ typedef size_t png_size_t; typedef ptrdiff_t png_ptrdiff_t; /* libpng needs to know the maximum value of 'size_t' and this controls the * definition of png_alloc_size_t, below. This maximum value of size_t limits * but does not control the maximum allocations the library makes - there is * direct application control of this through png_set_user_limits(). */ #ifndef PNG_SMALL_SIZE_T /* Compiler specific tests for systems where size_t is known to be less than * 32 bits (some of these systems may no longer work because of the lack of * 'far' support; see above.) */ # if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ (defined(_MSC_VER) && defined(MAXSEG_64K)) # define PNG_SMALL_SIZE_T # endif #endif /* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to * png_alloc_size_t are not necessary; in fact, it is recommended not to use * them at all so that the compiler can complain when something turns out to be * problematic. * * Casts in the other direction (from png_alloc_size_t to png_size_t or * png_uint_32) should be explicitly applied; however, we do not expect to * encounter practical situations that require such conversions. * * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than * 4294967295 - i.e. less than the maximum value of png_uint_32. */ #ifdef PNG_SMALL_SIZE_T typedef png_uint_32 png_alloc_size_t; #else typedef png_size_t png_alloc_size_t; #endif /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler * implementations of Intel CPU specific support of user-mode segmented address * spaces, where 16-bit pointers address more than 65536 bytes of memory using * separate 'segment' registers. The implementation requires two different * types of pointer (only one of which includes the segment value.) * * If required this support is available in version 1.2 of libpng and may be * available in versions through 1.5, although the correctness of the code has * not been verified recently. */ /* Typedef for floating-point numbers that are converted to fixed-point with a * multiple of 100,000, e.g., gamma */ typedef png_int_32 png_fixed_point; /* Add typedefs for pointers */ typedef void * png_voidp; typedef const void * png_const_voidp; typedef png_byte * png_bytep; typedef const png_byte * png_const_bytep; typedef png_uint_32 * png_uint_32p; typedef const png_uint_32 * png_const_uint_32p; typedef png_int_32 * png_int_32p; typedef const png_int_32 * png_const_int_32p; typedef png_uint_16 * png_uint_16p; typedef const png_uint_16 * png_const_uint_16p; typedef png_int_16 * png_int_16p; typedef const png_int_16 * png_const_int_16p; typedef char * png_charp; typedef const char * png_const_charp; typedef png_fixed_point * png_fixed_point_p; typedef const png_fixed_point * png_const_fixed_point_p; typedef png_size_t * png_size_tp; typedef const png_size_t * png_const_size_tp; #ifdef PNG_STDIO_SUPPORTED typedef FILE * png_FILE_p; #endif #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * png_doublep; typedef const double * png_const_doublep; #endif /* Pointers to pointers; i.e. arrays */ typedef png_byte * * png_bytepp; typedef png_uint_32 * * png_uint_32pp; typedef png_int_32 * * png_int_32pp; typedef png_uint_16 * * png_uint_16pp; typedef png_int_16 * * png_int_16pp; typedef const char * * png_const_charpp; typedef char * * png_charpp; typedef png_fixed_point * * png_fixed_point_pp; #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * * png_doublepp; #endif /* Pointers to pointers to pointers; i.e., pointer to array */ typedef char * * * png_charppp; #endif /* PNG_BUILDING_SYMBOL_TABLE */ #endif /* PNGCONF_H */ ================================================ FILE: Libraries/Core/RPi/Headers/png/pngdebug.h ================================================ /* pngdebug.h - Debugging macros for libpng, also used in pngtest.c * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.8 [December 19, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* Define PNG_DEBUG at compile time for debugging information. Higher * numbers for PNG_DEBUG mean more debugging information. This has * only been added since version 0.95 so it is not implemented throughout * libpng yet, but more support will be added as needed. * * png_debug[1-2]?(level, message ,arg{0-2}) * Expands to a statement (either a simple expression or a compound * do..while(0) statement) that outputs a message with parameter * substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG * is undefined, 0 or 1 every png_debug expands to a simple expression * (actually ((void)0)). * * level: level of detail of message, starting at 0. A level 'n' * message is preceded by 'n' 3-space indentations (not implemented * on Microsoft compilers unless PNG_DEBUG_FILE is also * defined, to allow debug DLL compilation with no standard IO). * message: a printf(3) style text string. A trailing '\n' is added * to the message. * arg: 0 to 2 arguments for printf(3) style substitution in message. */ #ifndef PNGDEBUG_H #define PNGDEBUG_H /* These settings control the formatting of messages in png.c and pngerror.c */ /* Moved to pngdebug.h at 1.5.0 */ # ifndef PNG_LITERAL_SHARP # define PNG_LITERAL_SHARP 0x23 # endif # ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET # define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b # endif # ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET # define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d # endif # ifndef PNG_STRING_NEWLINE # define PNG_STRING_NEWLINE "\n" # endif #ifdef PNG_DEBUG # if (PNG_DEBUG > 0) # if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) # include # if (PNG_DEBUG > 1) # ifndef _DEBUG # define _DEBUG # endif # ifndef png_debug # define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) # endif # endif # else /* PNG_DEBUG_FILE || !_MSC_VER */ # ifndef PNG_STDIO_SUPPORTED # include /* not included yet */ # endif # ifndef PNG_DEBUG_FILE # define PNG_DEBUG_FILE stderr # endif /* PNG_DEBUG_FILE */ # if (PNG_DEBUG > 1) # ifdef __STDC__ # ifndef png_debug # define png_debug(l,m) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \ } while (0) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \ } while (0) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\ } while (0) # endif # else /* __STDC __ */ # ifndef png_debug # define png_debug(l,m) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format); \ } while (0) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format,p1); \ } while (0) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format,p1,p2); \ } while (0) # endif # endif /* __STDC __ */ # endif /* (PNG_DEBUG > 1) */ # endif /* _MSC_VER */ # endif /* (PNG_DEBUG > 0) */ #endif /* PNG_DEBUG */ #ifndef png_debug # define png_debug(l, m) ((void)0) #endif #ifndef png_debug1 # define png_debug1(l, m, p1) ((void)0) #endif #ifndef png_debug2 # define png_debug2(l, m, p1, p2) ((void)0) #endif #endif /* PNGDEBUG_H */ ================================================ FILE: Libraries/Core/RPi/Headers/png/pnginfo.h ================================================ /* pnginfo.h - header file for PNG reference library * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.1 [March 28, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* png_info is a structure that holds the information in a PNG file so * that the application can find out the characteristics of the image. * If you are reading the file, this structure will tell you what is * in the PNG file. If you are writing the file, fill in the information * you want to put into the PNG file, using png_set_*() functions, then * call png_write_info(). * * The names chosen should be very close to the PNG specification, so * consult that document for information about the meaning of each field. * * With libpng < 0.95, it was only possible to directly set and read the * the values in the png_info_struct, which meant that the contents and * order of the values had to remain fixed. With libpng 0.95 and later, * however, there are now functions that abstract the contents of * png_info_struct from the application, so this makes it easier to use * libpng with dynamic libraries, and even makes it possible to use * libraries that don't have all of the libpng ancillary chunk-handing * functionality. In libpng-1.5.0 this was moved into a separate private * file that is not visible to applications. * * The following members may have allocated storage attached that should be * cleaned up before the structure is discarded: palette, trans, text, * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these * are automatically freed when the info structure is deallocated, if they were * allocated internally by libpng. This behavior can be changed by means * of the png_data_freer() function. * * More allocation details: all the chunk-reading functions that * change these members go through the corresponding png_set_* * functions. A function to clear these members is available: see * png_free_data(). The png_set_* functions do not depend on being * able to point info structure members to any of the storage they are * passed (they make their own copies), EXCEPT that the png_set_text * functions use the same storage passed to them in the text_ptr or * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns * functions do not make their own copies. */ #ifndef PNGINFO_H #define PNGINFO_H struct png_info_def { /* The following are necessary for every PNG file */ png_uint_32 width; /* width of image in pixels (from IHDR) */ png_uint_32 height; /* height of image in pixels (from IHDR) */ png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ png_size_t rowbytes; /* bytes needed to hold an untransformed row */ png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ /* The following three should have been named *_method not *_type */ png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ /* The following are set by png_set_IHDR, called from the application on * write, but the are never actually used by the write code. */ png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ png_byte pixel_depth; /* number of bits per pixel */ png_byte spare_byte; /* to align the data, and for future use */ #ifdef PNG_READ_SUPPORTED /* This is never set during write */ png_byte signature[8]; /* magic bytes read by libpng from start of file */ #endif /* The rest of the data is optional. If you are reading, check the * valid field to see if the information in these are valid. If you * are writing, set the valid field to those chunks you want written, * and initialize the appropriate fields below. */ #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) /* png_colorspace only contains 'flags' if neither GAMMA or COLORSPACE are * defined. When COLORSPACE is switched on all the colorspace-defining * chunks should be enabled, when GAMMA is switched on all the gamma-defining * chunks should be enabled. If this is not done it becomes possible to read * inconsistent PNG files and assign a probably incorrect interpretation to * the information. (In other words, by carefully choosing which chunks to * recognize the system configuration can select an interpretation for PNG * files containing ambiguous data and this will result in inconsistent * behavior between different libpng builds!) */ png_colorspace colorspace; #endif #ifdef PNG_iCCP_SUPPORTED /* iCCP chunk data. */ png_charp iccp_name; /* profile name */ png_bytep iccp_profile; /* International Color Consortium profile data */ png_uint_32 iccp_proflen; /* ICC profile data length */ #endif #ifdef PNG_TEXT_SUPPORTED /* The tEXt, and zTXt chunks contain human-readable textual data in * uncompressed, compressed, and optionally compressed forms, respectively. * The data in "text" is an array of pointers to uncompressed, * null-terminated C strings. Each chunk has a keyword that describes the * textual data contained in that chunk. Keywords are not required to be * unique, and the text string may be empty. Any number of text chunks may * be in an image. */ int num_text; /* number of comments read or comments to write */ int max_text; /* current size of text array */ png_textp text; /* array of comments read or comments to write */ #endif /* PNG_TEXT_SUPPORTED */ #ifdef PNG_tIME_SUPPORTED /* The tIME chunk holds the last time the displayed image data was * modified. See the png_time struct for the contents of this struct. */ png_time mod_time; #endif #ifdef PNG_sBIT_SUPPORTED /* The sBIT chunk specifies the number of significant high-order bits * in the pixel data. Values are in the range [1, bit_depth], and are * only specified for the channels in the pixel data. The contents of * the low-order bits is not specified. Data is valid if * (valid & PNG_INFO_sBIT) is non-zero. */ png_color_8 sig_bit; /* significant bits in color channels */ #endif #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ defined(PNG_READ_BACKGROUND_SUPPORTED) /* The tRNS chunk supplies transparency data for paletted images and * other image types that don't need a full alpha channel. There are * "num_trans" transparency values for a paletted image, stored in the * same order as the palette colors, starting from index 0. Values * for the data are in the range [0, 255], ranging from fully transparent * to fully opaque, respectively. For non-paletted images, there is a * single color specified that should be treated as fully transparent. * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. */ png_bytep trans_alpha; /* alpha values for paletted image */ png_color_16 trans_color; /* transparent color for non-palette image */ #endif #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) /* The bKGD chunk gives the suggested image background color if the * display program does not have its own background color and the image * is needs to composited onto a background before display. The colors * in "background" are normally in the same color space/depth as the * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. */ png_color_16 background; #endif #ifdef PNG_oFFs_SUPPORTED /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards * and downwards from the top-left corner of the display, page, or other * application-specific co-ordinate space. See the PNG_OFFSET_ defines * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. */ png_int_32 x_offset; /* x offset on page */ png_int_32 y_offset; /* y offset on page */ png_byte offset_unit_type; /* offset units type */ #endif #ifdef PNG_pHYs_SUPPORTED /* The pHYs chunk gives the physical pixel density of the image for * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. */ png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ png_uint_32 y_pixels_per_unit; /* vertical pixel density */ png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ #endif #ifdef PNG_hIST_SUPPORTED /* The hIST chunk contains the relative frequency or importance of the * various palette entries, so that a viewer can intelligently select a * reduced-color palette, if required. Data is an array of "num_palette" * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) * is non-zero. */ png_uint_16p hist; #endif #ifdef PNG_pCAL_SUPPORTED /* The pCAL chunk describes a transformation between the stored pixel * values and original physical data values used to create the image. * The integer range [0, 2^bit_depth - 1] maps to the floating-point * range given by [pcal_X0, pcal_X1], and are further transformed by a * (possibly non-linear) transformation function given by "pcal_type" * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ * defines below, and the PNG-Group's PNG extensions document for a * complete description of the transformations and how they should be * implemented, and for a description of the ASCII parameter strings. * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. */ png_charp pcal_purpose; /* pCAL chunk description string */ png_int_32 pcal_X0; /* minimum value */ png_int_32 pcal_X1; /* maximum value */ png_charp pcal_units; /* Latin-1 string giving physical units */ png_charpp pcal_params; /* ASCII strings containing parameter values */ png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ png_byte pcal_nparams; /* number of parameters given in pcal_params */ #endif /* New members added in libpng-1.0.6 */ png_uint_32 free_me; /* flags items libpng is responsible for freeing */ #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED /* Storage for unknown chunks that the library doesn't recognize. */ png_unknown_chunkp unknown_chunks; /* The type of this field is limited by the type of * png_struct::user_chunk_cache_max, else overflow can occur. */ int unknown_chunks_num; #endif #ifdef PNG_sPLT_SUPPORTED /* Data on sPLT chunks (there may be more than one). */ png_sPLT_tp splt_palettes; int splt_palettes_num; /* Match type returned by png_get API */ #endif #ifdef PNG_sCAL_SUPPORTED /* The sCAL chunk describes the actual physical dimensions of the * subject matter of the graphic. The chunk contains a unit specification * a byte value, and two ASCII strings representing floating-point * values. The values are width and height corresponsing to one pixel * in the image. Data values are valid if (valid & PNG_INFO_sCAL) is * non-zero. */ png_byte scal_unit; /* unit of physical scale */ png_charp scal_s_width; /* string containing height */ png_charp scal_s_height; /* string containing width */ #endif #ifdef PNG_INFO_IMAGE_SUPPORTED /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */ /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ png_bytepp row_pointers; /* the image bits */ #endif }; #endif /* PNGINFO_H */ ================================================ FILE: Libraries/Core/RPi/Headers/png/pnglibconf.h ================================================ /* libpng 1.6.10 STANDARD API DEFINITION */ /* pnglibconf.h - library build configuration */ /* Libpng version 1.6.10 - March 6, 2014 */ /* Copyright (c) 1998-2013 Glenn Randers-Pehrson */ /* This code is released under the libpng license. */ /* For conditions of distribution and use, see the disclaimer */ /* and license in png.h */ /* pnglibconf.h */ /* Machine generated file: DO NOT EDIT */ /* Derived from: scripts/pnglibconf.dfa */ #ifndef PNGLCONF_H #define PNGLCONF_H /* options */ #define PNG_16BIT_SUPPORTED #define PNG_ALIGNED_MEMORY_SUPPORTED /*#undef PNG_ARM_NEON_API_SUPPORTED*/ /*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/ #define PNG_BENIGN_ERRORS_SUPPORTED #define PNG_BENIGN_READ_ERRORS_SUPPORTED /*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/ #define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED #define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_COLORSPACE_SUPPORTED #define PNG_CONSOLE_IO_SUPPORTED #define PNG_CONVERT_tIME_SUPPORTED #define PNG_EASY_ACCESS_SUPPORTED /*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ #define PNG_ERROR_TEXT_SUPPORTED #define PNG_FIXED_POINT_SUPPORTED #define PNG_FLOATING_ARITHMETIC_SUPPORTED #define PNG_FLOATING_POINT_SUPPORTED #define PNG_FORMAT_AFIRST_SUPPORTED #define PNG_FORMAT_BGR_SUPPORTED #define PNG_GAMMA_SUPPORTED #define PNG_GET_PALETTE_MAX_SUPPORTED #define PNG_HANDLE_AS_UNKNOWN_SUPPORTED #define PNG_INCH_CONVERSIONS_SUPPORTED #define PNG_INFO_IMAGE_SUPPORTED #define PNG_IO_STATE_SUPPORTED #define PNG_MNG_FEATURES_SUPPORTED #define PNG_POINTER_INDEXING_SUPPORTED #define PNG_PROGRESSIVE_READ_SUPPORTED #define PNG_READ_16BIT_SUPPORTED #define PNG_READ_ALPHA_MODE_SUPPORTED #define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED #define PNG_READ_BACKGROUND_SUPPORTED #define PNG_READ_BGR_SUPPORTED #define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_READ_COMPOSITE_NODIV_SUPPORTED #define PNG_READ_COMPRESSED_TEXT_SUPPORTED #define PNG_READ_EXPAND_16_SUPPORTED #define PNG_READ_EXPAND_SUPPORTED #define PNG_READ_FILLER_SUPPORTED #define PNG_READ_GAMMA_SUPPORTED #define PNG_READ_GET_PALETTE_MAX_SUPPORTED #define PNG_READ_GRAY_TO_RGB_SUPPORTED #define PNG_READ_INTERLACING_SUPPORTED #define PNG_READ_INT_FUNCTIONS_SUPPORTED #define PNG_READ_INVERT_ALPHA_SUPPORTED #define PNG_READ_INVERT_SUPPORTED #define PNG_READ_OPT_PLTE_SUPPORTED #define PNG_READ_PACKSWAP_SUPPORTED #define PNG_READ_PACK_SUPPORTED #define PNG_READ_QUANTIZE_SUPPORTED #define PNG_READ_RGB_TO_GRAY_SUPPORTED #define PNG_READ_SCALE_16_TO_8_SUPPORTED #define PNG_READ_SHIFT_SUPPORTED #define PNG_READ_STRIP_16_TO_8_SUPPORTED #define PNG_READ_STRIP_ALPHA_SUPPORTED #define PNG_READ_SUPPORTED #define PNG_READ_SWAP_ALPHA_SUPPORTED #define PNG_READ_SWAP_SUPPORTED #define PNG_READ_TEXT_SUPPORTED #define PNG_READ_TRANSFORMS_SUPPORTED #define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED #define PNG_READ_USER_CHUNKS_SUPPORTED #define PNG_READ_USER_TRANSFORM_SUPPORTED #define PNG_READ_bKGD_SUPPORTED #define PNG_READ_cHRM_SUPPORTED #define PNG_READ_gAMA_SUPPORTED #define PNG_READ_hIST_SUPPORTED #define PNG_READ_iCCP_SUPPORTED #define PNG_READ_iTXt_SUPPORTED #define PNG_READ_oFFs_SUPPORTED #define PNG_READ_pCAL_SUPPORTED #define PNG_READ_pHYs_SUPPORTED #define PNG_READ_sBIT_SUPPORTED #define PNG_READ_sCAL_SUPPORTED #define PNG_READ_sPLT_SUPPORTED #define PNG_READ_sRGB_SUPPORTED #define PNG_READ_tEXt_SUPPORTED #define PNG_READ_tIME_SUPPORTED #define PNG_READ_tRNS_SUPPORTED #define PNG_READ_zTXt_SUPPORTED /*#undef PNG_SAFE_LIMITS_SUPPORTED*/ #define PNG_SAVE_INT_32_SUPPORTED #define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SEQUENTIAL_READ_SUPPORTED #define PNG_SETJMP_SUPPORTED #define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED #define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED #define PNG_SET_OPTION_SUPPORTED #define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SET_USER_LIMITS_SUPPORTED #define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED #define PNG_SIMPLIFIED_READ_BGR_SUPPORTED #define PNG_SIMPLIFIED_READ_SUPPORTED #define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED #define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED #define PNG_SIMPLIFIED_WRITE_SUPPORTED #define PNG_STDIO_SUPPORTED #define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_TEXT_SUPPORTED #define PNG_TIME_RFC1123_SUPPORTED #define PNG_UNKNOWN_CHUNKS_SUPPORTED #define PNG_USER_CHUNKS_SUPPORTED #define PNG_USER_LIMITS_SUPPORTED #define PNG_USER_MEM_SUPPORTED #define PNG_USER_TRANSFORM_INFO_SUPPORTED #define PNG_USER_TRANSFORM_PTR_SUPPORTED #define PNG_WARNINGS_SUPPORTED #define PNG_WRITE_16BIT_SUPPORTED #define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED #define PNG_WRITE_BGR_SUPPORTED #define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED #define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED #define PNG_WRITE_FILLER_SUPPORTED #define PNG_WRITE_FILTER_SUPPORTED #define PNG_WRITE_FLUSH_SUPPORTED #define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED #define PNG_WRITE_INTERLACING_SUPPORTED #define PNG_WRITE_INT_FUNCTIONS_SUPPORTED #define PNG_WRITE_INVERT_ALPHA_SUPPORTED #define PNG_WRITE_INVERT_SUPPORTED #define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED #define PNG_WRITE_PACKSWAP_SUPPORTED #define PNG_WRITE_PACK_SUPPORTED #define PNG_WRITE_SHIFT_SUPPORTED #define PNG_WRITE_SUPPORTED #define PNG_WRITE_SWAP_ALPHA_SUPPORTED #define PNG_WRITE_SWAP_SUPPORTED #define PNG_WRITE_TEXT_SUPPORTED #define PNG_WRITE_TRANSFORMS_SUPPORTED #define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_WRITE_USER_TRANSFORM_SUPPORTED #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED #define PNG_WRITE_bKGD_SUPPORTED #define PNG_WRITE_cHRM_SUPPORTED #define PNG_WRITE_gAMA_SUPPORTED #define PNG_WRITE_hIST_SUPPORTED #define PNG_WRITE_iCCP_SUPPORTED #define PNG_WRITE_iTXt_SUPPORTED #define PNG_WRITE_oFFs_SUPPORTED #define PNG_WRITE_pCAL_SUPPORTED #define PNG_WRITE_pHYs_SUPPORTED #define PNG_WRITE_sBIT_SUPPORTED #define PNG_WRITE_sCAL_SUPPORTED #define PNG_WRITE_sPLT_SUPPORTED #define PNG_WRITE_sRGB_SUPPORTED #define PNG_WRITE_tEXt_SUPPORTED #define PNG_WRITE_tIME_SUPPORTED #define PNG_WRITE_tRNS_SUPPORTED #define PNG_WRITE_zTXt_SUPPORTED #define PNG_bKGD_SUPPORTED #define PNG_cHRM_SUPPORTED #define PNG_gAMA_SUPPORTED #define PNG_hIST_SUPPORTED #define PNG_iCCP_SUPPORTED #define PNG_iTXt_SUPPORTED #define PNG_oFFs_SUPPORTED #define PNG_pCAL_SUPPORTED #define PNG_pHYs_SUPPORTED #define PNG_sBIT_SUPPORTED #define PNG_sCAL_SUPPORTED #define PNG_sPLT_SUPPORTED #define PNG_sRGB_SUPPORTED #define PNG_tEXt_SUPPORTED #define PNG_tIME_SUPPORTED #define PNG_tRNS_SUPPORTED #define PNG_zTXt_SUPPORTED /* end of options */ /* settings */ #define PNG_API_RULE 0 #define PNG_CALLOC_SUPPORTED #define PNG_COST_SHIFT 3 #define PNG_DEFAULT_READ_MACROS 1 #define PNG_GAMMA_THRESHOLD_FIXED 5000 #define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE #define PNG_INFLATE_BUF_SIZE 1024 #define PNG_MAX_GAMMA_8 11 #define PNG_QUANTIZE_BLUE_BITS 5 #define PNG_QUANTIZE_GREEN_BITS 5 #define PNG_QUANTIZE_RED_BITS 5 #define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1) #define PNG_TEXT_Z_DEFAULT_STRATEGY 0 #define PNG_WEIGHT_SHIFT 8 #define PNG_ZBUF_SIZE 8192 #define PNG_ZLIB_VERNUM 0 /* unknown */ #define PNG_Z_DEFAULT_COMPRESSION (-1) #define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0 #define PNG_Z_DEFAULT_STRATEGY 1 #define PNG_sCAL_PRECISION 5 #define PNG_sRGB_PROFILE_CHECKS 2 /* end of settings */ #endif /* PNGLCONF_H */ ================================================ FILE: Libraries/Core/RPi/Headers/png/pngpriv.h ================================================ /* pngpriv.h - private declarations for use inside libpng * * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.10 [March 6, 2014] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* The symbols declared in this file (including the functions declared * as extern) are PRIVATE. They are not part of the libpng public * interface, and are not recommended for use by regular applications. * Some of them may become public in the future; others may stay private, * change in an incompatible way, or even disappear. * Although the libpng users are not forbidden to include this header, * they should be well aware of the issues that may arise from doing so. */ #ifndef PNGPRIV_H #define PNGPRIV_H /* Feature Test Macros. The following are defined here to ensure that correctly * implemented libraries reveal the APIs libpng needs to build and hide those * that are not needed and potentially damaging to the compilation. * * Feature Test Macros must be defined before any system header is included (see * POSIX 1003.1 2.8.2 "POSIX Symbols." * * These macros only have an effect if the operating system supports either * POSIX 1003.1 or C99, or both. On other operating systems (particularly * Windows/Visual Studio) there is no effect; the OS specific tests below are * still required (as of 2011-05-02.) */ #define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */ #ifndef PNG_VERSION_INFO_ONLY /* Standard library headers not required by png.h: */ # include # include #endif #define PNGLIB_BUILD /*libpng is being built, not used*/ /* If HAVE_CONFIG_H is defined during the build then the build system must * provide an appropriate "config.h" file on the include path. The header file * must provide definitions as required below (search for "HAVE_CONFIG_H"); * see configure.ac for more details of the requirements. The macro * "PNG_NO_CONFIG_H" is provided for maintainers to test for dependencies on * 'configure'; define this macro to prevent the configure build including the * configure generated config.h. Libpng is expected to compile without *any* * special build system support on a reasonably ANSI-C compliant system. */ #if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) # include /* Pick up the definition of 'restrict' from config.h if it was read: */ # define PNG_RESTRICT restrict #endif /* To support symbol prefixing it is necessary to know *before* including png.h * whether the fixed point (and maybe other) APIs are exported, because if they * are not internal definitions may be required. This is handled below just * before png.h is included, but load the configuration now if it is available. */ #ifndef PNGLCONF_H # include "pnglibconf.h" #endif /* Local renames may change non-exported API functions from png.h */ #if defined(PNG_PREFIX) && !defined(PNGPREFIX_H) # include "pngprefix.h" #endif #ifdef PNG_USER_CONFIG # include "pngusr.h" /* These should have been defined in pngusr.h */ # ifndef PNG_USER_PRIVATEBUILD # define PNG_USER_PRIVATEBUILD "Custom libpng build" # endif # ifndef PNG_USER_DLLFNAME_POSTFIX # define PNG_USER_DLLFNAME_POSTFIX "Cb" # endif #endif /* Compile time options. * ===================== * In a multi-arch build the compiler may compile the code several times for the * same object module, producing different binaries for different architectures. * When this happens configure-time setting of the target host options cannot be * done and this interferes with the handling of the ARM NEON optimizations, and * possibly other similar optimizations. Put additional tests here; in general * this is needed when the same option can be changed at both compile time and * run time depending on the target OS (i.e. iOS vs Android.) * * NOTE: symbol prefixing does not pass $(CFLAGS) to the preprocessor, because * this is not possible with certain compilers (Oracle SUN OS CC), as a result * it is necessary to ensure that all extern functions that *might* be used * regardless of $(CFLAGS) get declared in this file. The test on __ARM_NEON__ * below is one example of this behavior because it is controlled by the * presence or not of -mfpu=neon on the GCC command line, it is possible to do * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely * do this. */ #ifndef PNG_ARM_NEON_OPT /* ARM NEON optimizations are being controlled by the compiler settings, * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon * with GCC) then the compiler will define __ARM_NEON__ and we can rely * unconditionally on NEON instructions not crashing, otherwise we must * disable use of NEON instructions. * * NOTE: at present these optimizations depend on 'ALIGNED_MEMORY', so they * can only be turned on automatically if that is supported too. If * PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail * to compile with an appropriate #error if ALIGNED_MEMORY has been turned * off. */ # if defined(__ARM_NEON__) && defined(PNG_ALIGNED_MEMORY_SUPPORTED) # define PNG_ARM_NEON_OPT 2 # else # define PNG_ARM_NEON_OPT 0 # endif #endif #if PNG_ARM_NEON_OPT > 0 /* NEON optimizations are to be at least considered by libpng, so enable the * callbacks to do this. */ # define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon /* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used * if possible - if __ARM_NEON__ is set and the compiler version is not known * to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can * be: * * 1 The intrinsics code (the default with __ARM_NEON__) * 2 The hand coded assembler (the default without __ARM_NEON__) * * It is possible to set PNG_ARM_NEON_IMPLEMENTATION in CPPFLAGS, however * this is *NOT* supported and may cease to work even after a minor revision * to libpng. It *is* valid to do this for testing purposes, e.g. speed * testing or a new compiler, but the results should be communicated to the * libpng implementation list for incorporation in the next minor release. */ # ifndef PNG_ARM_NEON_IMPLEMENTATION # ifdef __ARM_NEON__ # if defined(__clang__) /* At present it is unknown by the libpng developers which versions * of clang support the intrinsics, however some or perhaps all * versions do not work with the assembler so this may be * irrelevant, so just use the default (do nothing here.) */ # elif defined(__GNUC__) /* GCC 4.5.4 NEON support is known to be broken. 4.6.3 is known to * work, so if this *is* GCC, or G++, look for a version >4.5 */ # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) # define PNG_ARM_NEON_IMPLEMENTATION 2 # endif /* no GNUC support */ # endif /* __GNUC__ */ # else /* !defined __ARM_NEON__ */ /* The 'intrinsics' code simply won't compile without this -mfpu=neon: */ # define PNG_ARM_NEON_IMPLEMENTATION 2 # endif /* __ARM_NEON__ */ # endif /* !defined PNG_ARM_NEON_IMPLEMENTATION */ # ifndef PNG_ARM_NEON_IMPLEMENTATION /* Use the intrinsics code by default. */ # define PNG_ARM_NEON_IMPLEMENTATION 1 # endif #endif /* PNG_ARM_NEON_OPT > 0 */ /* Is this a build of a DLL where compilation of the object modules requires * different preprocessor settings to those required for a simple library? If * so PNG_BUILD_DLL must be set. * * If libpng is used inside a DLL but that DLL does not export the libpng APIs * PNG_BUILD_DLL must not be set. To avoid the code below kicking in build a * static library of libpng then link the DLL against that. */ #ifndef PNG_BUILD_DLL # ifdef DLL_EXPORT /* This is set by libtool when files are compiled for a DLL; libtool * always compiles twice, even on systems where it isn't necessary. Set * PNG_BUILD_DLL in case it is necessary: */ # define PNG_BUILD_DLL # else # ifdef _WINDLL /* This is set by the Microsoft Visual Studio IDE in projects that * build a DLL. It can't easily be removed from those projects (it * isn't visible in the Visual Studio UI) so it is a fairly reliable * indication that PNG_IMPEXP needs to be set to the DLL export * attributes. */ # define PNG_BUILD_DLL # else # ifdef __DLL__ /* This is set by the Borland C system when compiling for a DLL * (as above.) */ # define PNG_BUILD_DLL # else /* Add additional compiler cases here. */ # endif # endif # endif #endif /* Setting PNG_BUILD_DLL if required */ /* See pngconf.h for more details: the builder of the library may set this on * the command line to the right thing for the specific compilation system or it * may be automagically set above (at present we know of no system where it does * need to be set on the command line.) * * PNG_IMPEXP must be set here when building the library to prevent pngconf.h * setting it to the "import" setting for a DLL build. */ #ifndef PNG_IMPEXP # ifdef PNG_BUILD_DLL # define PNG_IMPEXP PNG_DLL_EXPORT # else /* Not building a DLL, or the DLL doesn't require specific export * definitions. */ # define PNG_IMPEXP # endif #endif /* No warnings for private or deprecated functions in the build: */ #ifndef PNG_DEPRECATED # define PNG_DEPRECATED #endif #ifndef PNG_PRIVATE # define PNG_PRIVATE #endif /* Symbol preprocessing support. * * To enable listing global, but internal, symbols the following macros should * always be used to declare an extern data or function object in this file. */ #ifndef PNG_INTERNAL_DATA # define PNG_INTERNAL_DATA(type, name, array) extern type name array #endif #ifndef PNG_INTERNAL_FUNCTION # define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\ extern PNG_FUNCTION(type, name, args, PNG_EMPTY attributes) #endif #ifndef PNG_INTERNAL_CALLBACK # define PNG_INTERNAL_CALLBACK(type, name, args, attributes)\ extern PNG_FUNCTION(type, (PNGCBAPI name), args, PNG_EMPTY attributes) #endif /* If floating or fixed point APIs are disabled they may still be compiled * internally. To handle this make sure they are declared as the appropriate * internal extern function (otherwise the symbol prefixing stuff won't work and * the functions will be used without definitions.) * * NOTE: although all the API functions are declared here they are not all * actually built! Because the declarations are still made it is necessary to * fake out types that they depend on. */ #ifndef PNG_FP_EXPORT # ifndef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); # ifndef PNG_VERSION_INFO_ONLY typedef struct png_incomplete png_double; typedef png_double* png_doublep; typedef const png_double* png_const_doublep; typedef png_double** png_doublepp; # endif # endif #endif #ifndef PNG_FIXED_EXPORT # ifndef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); # endif #endif #include "png.h" /* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */ #ifndef PNG_DLL_EXPORT # define PNG_DLL_EXPORT #endif /* SECURITY and SAFETY: * * By default libpng is built without any internal limits on image size, * individual heap (png_malloc) allocations or the total amount of memory used. * If PNG_SAFE_LIMITS_SUPPORTED is defined, however, the limits below are used * (unless individually overridden). These limits are believed to be fairly * safe, but builders of secure systems should verify the values against the * real system capabilities. */ #ifdef PNG_SAFE_LIMITS_SUPPORTED /* 'safe' limits */ # ifndef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 1000000 # endif # ifndef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 1000000 # endif # ifndef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 128 # endif # ifndef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 8000000 # endif #else /* values for no limits */ # ifndef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 0x7fffffff # endif # ifndef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 0x7fffffff # endif # ifndef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 0 # endif # ifndef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 0 # endif #endif /* Moved to pngpriv.h at libpng-1.5.0 */ /* NOTE: some of these may have been used in external applications as * these definitions were exposed in pngconf.h prior to 1.5. */ /* If you are running on a machine where you cannot allocate more * than 64K of memory at once, uncomment this. While libpng will not * normally need that much memory in a chunk (unless you load up a very * large file), zlib needs to know how big of a chunk it can use, and * libpng thus makes sure to check any memory allocation to verify it * will fit into memory. * * zlib provides 'MAXSEG_64K' which, if defined, indicates the * same limit and pngconf.h (already included) sets the limit * if certain operating systems are detected. */ #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) # define PNG_MAX_MALLOC_64K #endif #ifndef PNG_UNUSED /* Unused formal parameter warnings are silenced using the following macro * which is expected to have no bad effects on performance (optimizing * compilers will probably remove it entirely). Note that if you replace * it with something other than whitespace, you must include the terminating * semicolon. */ # define PNG_UNUSED(param) (void)param; #endif /* Just a little check that someone hasn't tried to define something * contradictory. */ #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) # undef PNG_ZBUF_SIZE # define PNG_ZBUF_SIZE 65536L #endif /* If warnings or errors are turned off the code is disabled or redirected here. * From 1.5.4 functions have been added to allow very limited formatting of * error and warning messages - this code will also be disabled here. */ #ifdef PNG_WARNINGS_SUPPORTED # define PNG_WARNING_PARAMETERS(p) png_warning_parameters p; #else # define png_warning_parameter(p,number,string) ((void)0) # define png_warning_parameter_unsigned(p,number,format,value) ((void)0) # define png_warning_parameter_signed(p,number,format,value) ((void)0) # define png_formatted_warning(pp,p,message) ((void)(pp)) # define PNG_WARNING_PARAMETERS(p) #endif #ifndef PNG_ERROR_TEXT_SUPPORTED # define png_fixed_error(s1,s2) png_err(s1) #endif /* C allows up-casts from (void*) to any pointer and (const void*) to any * pointer to a const object. C++ regards this as a type error and requires an * explicit, static, cast and provides the static_cast<> rune to ensure that * const is not cast away. */ #ifdef __cplusplus # define png_voidcast(type, value) static_cast(value) # define png_constcast(type, value) const_cast(value) # define png_aligncast(type, value) \ static_cast(static_cast(value)) # define png_aligncastconst(type, value) \ static_cast(static_cast(value)) #else # define png_voidcast(type, value) (value) # define png_constcast(type, value) ((type)(value)) # define png_aligncast(type, value) ((void*)(value)) # define png_aligncastconst(type, value) ((const void*)(value)) #endif /* __cplusplus */ /* Some fixed point APIs are still required even if not exported because * they get used by the corresponding floating point APIs. This magic * deals with this: */ #ifdef PNG_FIXED_POINT_SUPPORTED # define PNGFAPI PNGAPI #else # define PNGFAPI /* PRIVATE */ #endif #ifndef PNG_VERSION_INFO_ONLY /* Other defines specific to compilers can go here. Try to keep * them inside an appropriate ifdef/endif pair for portability. */ #if defined(PNG_FLOATING_POINT_SUPPORTED) ||\ defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) /* png.c requires the following ANSI-C constants if the conversion of * floating point to ASCII is implemented therein: * * DBL_DIG Maximum number of decimal digits (can be set to any constant) * DBL_MIN Smallest normalized fp number (can be set to an arbitrary value) * DBL_MAX Maximum floating point number (can be set to an arbitrary value) */ # include # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) /* We need to check that hasn't already been included earlier * as it seems it doesn't agree with , yet we should really use * if possible. */ # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) # include # endif # else # include # endif # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) /* Amiga SAS/C: We must include builtin FPU functions when compiling using * MATH=68881 */ # include # endif #endif /* This provides the non-ANSI (far) memory allocation routines. */ #if defined(__TURBOC__) && defined(__MSDOS__) # include # include #endif #if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \ defined(_WIN32) || defined(__WIN32__) # include /* defines _WINDOWS_ macro */ #endif #endif /* PNG_VERSION_INFO_ONLY */ /* Moved here around 1.5.0beta36 from pngconf.h */ /* Users may want to use these so they are not private. Any library * functions that are passed far data must be model-independent. */ /* Memory model/platform independent fns */ #ifndef PNG_ABORT # ifdef _WINDOWS_ # define PNG_ABORT() ExitProcess(0) # else # define PNG_ABORT() abort() # endif #endif /* These macros may need to be architecture dependent. */ #define PNG_ALIGN_NONE 0 /* do not use data alignment */ #define PNG_ALIGN_ALWAYS 1 /* assume unaligned accesses are OK */ #ifdef offsetof # define PNG_ALIGN_OFFSET 2 /* use offsetof to determine alignment */ #else # define PNG_ALIGN_OFFSET -1 /* prevent the use of this */ #endif #define PNG_ALIGN_SIZE 3 /* use sizeof to determine alignment */ #ifndef PNG_ALIGN_TYPE /* Default to using aligned access optimizations and requiring alignment to a * multiple of the data type size. Override in a compiler specific fashion * if necessary by inserting tests here: */ # define PNG_ALIGN_TYPE PNG_ALIGN_SIZE #endif #if PNG_ALIGN_TYPE == PNG_ALIGN_SIZE /* This is used because in some compiler implementations non-aligned * structure members are supported, so the offsetof approach below fails. * Set PNG_ALIGN_SIZE=0 for compiler combinations where unaligned access * is good for performance. Do not do this unless you have tested the result * and understand it. */ # define png_alignof(type) (sizeof (type)) #else # if PNG_ALIGN_TYPE == PNG_ALIGN_OFFSET # define png_alignof(type) offsetof(struct{char c; type t;}, t) # else # if PNG_ALIGN_TYPE == PNG_ALIGN_ALWAYS # define png_alignof(type) (1) # endif /* Else leave png_alignof undefined to prevent use thereof */ # endif #endif /* This implicitly assumes alignment is always to a power of 2. */ #ifdef png_alignof # define png_isaligned(ptr, type)\ ((((const char*)ptr-(const char*)0) & (png_alignof(type)-1)) == 0) #else # define png_isaligned(ptr, type) 0 #endif /* End of memory model/platform independent support */ /* End of 1.5.0beta36 move from pngconf.h */ /* CONSTANTS and UTILITY MACROS * These are used internally by libpng and not exposed in the API */ /* Various modes of operation. Note that after an init, mode is set to * zero automatically when the structure is created. Three of these * are defined in png.h because they need to be visible to applications * that call png_set_unknown_chunk(). */ /* #define PNG_HAVE_IHDR 0x01 (defined in png.h) */ /* #define PNG_HAVE_PLTE 0x02 (defined in png.h) */ #define PNG_HAVE_IDAT 0x04 /* #define PNG_AFTER_IDAT 0x08 (defined in png.h) */ #define PNG_HAVE_IEND 0x10 /* 0x20 (unused) */ /* 0x40 (unused) */ /* 0x80 (unused) */ #define PNG_HAVE_CHUNK_HEADER 0x100 #define PNG_WROTE_tIME 0x200 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400 #define PNG_BACKGROUND_IS_GRAY 0x800 #define PNG_HAVE_PNG_SIGNATURE 0x1000 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ /* 0x4000 (unused) */ #define PNG_IS_READ_STRUCT 0x8000 /* Else is a write struct */ /* Flags for the transformations the PNG library does on the image data */ #define PNG_BGR 0x0001 #define PNG_INTERLACE 0x0002 #define PNG_PACK 0x0004 #define PNG_SHIFT 0x0008 #define PNG_SWAP_BYTES 0x0010 #define PNG_INVERT_MONO 0x0020 #define PNG_QUANTIZE 0x0040 #define PNG_COMPOSE 0x0080 /* Was PNG_BACKGROUND */ #define PNG_BACKGROUND_EXPAND 0x0100 #define PNG_EXPAND_16 0x0200 /* Added to libpng 1.5.2 */ #define PNG_16_TO_8 0x0400 /* Becomes 'chop' in 1.5.4 */ #define PNG_RGBA 0x0800 #define PNG_EXPAND 0x1000 #define PNG_GAMMA 0x2000 #define PNG_GRAY_TO_RGB 0x4000 #define PNG_FILLER 0x8000 #define PNG_PACKSWAP 0x10000 #define PNG_SWAP_ALPHA 0x20000 #define PNG_STRIP_ALPHA 0x40000 #define PNG_INVERT_ALPHA 0x80000 #define PNG_USER_TRANSFORM 0x100000 #define PNG_RGB_TO_GRAY_ERR 0x200000 #define PNG_RGB_TO_GRAY_WARN 0x400000 #define PNG_RGB_TO_GRAY 0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */ #define PNG_ENCODE_ALPHA 0x800000 /* Added to libpng-1.5.4 */ #define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */ #define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */ #define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */ /* 0x8000000 unused */ /* 0x10000000 unused */ /* 0x20000000 unused */ /* 0x40000000 unused */ /* Flags for png_create_struct */ #define PNG_STRUCT_PNG 0x0001 #define PNG_STRUCT_INFO 0x0002 /* Scaling factor for filter heuristic weighting calculations */ #define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) #define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) /* Flags for the png_ptr->flags rather than declaring a byte for each one */ #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 #define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002 /* Added to libpng-1.6.0 */ /* 0x0004 unused */ #define PNG_FLAG_ZSTREAM_ENDED 0x0008 /* Added to libpng-1.6.0 */ /* 0x0010 unused */ /* 0x0020 unused */ #define PNG_FLAG_ROW_INIT 0x0040 #define PNG_FLAG_FILLER_AFTER 0x0080 #define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 #define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 #define PNG_FLAG_CRC_CRITICAL_USE 0x0400 #define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 #define PNG_FLAG_ASSUME_sRGB 0x1000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_OPTIMIZE_ALPHA 0x2000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_DETECT_UNINITIALIZED 0x4000 /* Added to libpng-1.5.4 */ /* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000 */ /* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000 */ #define PNG_FLAG_LIBRARY_MISMATCH 0x20000 #define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000 #define PNG_FLAG_STRIP_ERROR_TEXT 0x80000 #define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000 /* Added to libpng-1.4.0 */ #define PNG_FLAG_APP_WARNINGS_WARN 0x200000 /* Added to libpng-1.6.0 */ #define PNG_FLAG_APP_ERRORS_WARN 0x400000 /* Added to libpng-1.6.0 */ /* 0x800000 unused */ /* 0x1000000 unused */ /* 0x2000000 unused */ /* 0x4000000 unused */ /* 0x8000000 unused */ /* 0x10000000 unused */ /* 0x20000000 unused */ /* 0x40000000 unused */ #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ PNG_FLAG_CRC_ANCILLARY_NOWARN) #define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ PNG_FLAG_CRC_CRITICAL_IGNORE) #define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ PNG_FLAG_CRC_CRITICAL_MASK) /* Save typing and make code easier to understand */ #define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ abs((int)((c1).green) - (int)((c2).green)) + \ abs((int)((c1).blue) - (int)((c2).blue))) /* Added to libpng-1.6.0: scale a 16-bit value in the range 0..65535 to 0..255 * by dividing by 257 *with rounding*. This macro is exact for the given range. * See the discourse in pngrtran.c png_do_scale_16_to_8. The values in the * macro were established by experiment (modifying the added value). The macro * has a second variant that takes a value already scaled by 255 and divides by * 65535 - this has a maximum error of .502. Over the range 0..65535*65535 it * only gives off-by-one errors and only for 0.5% (1 in 200) of the values. */ #define PNG_DIV65535(v24) (((v24) + 32895) >> 16) #define PNG_DIV257(v16) PNG_DIV65535((png_uint_32)(v16) * 255) /* Added to libpng-1.2.6 JB */ #define PNG_ROWBYTES(pixel_bits, width) \ ((pixel_bits) >= 8 ? \ ((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \ (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) ) /* PNG_OUT_OF_RANGE returns true if value is outside the range * ideal-delta..ideal+delta. Each argument is evaluated twice. * "ideal" and "delta" should be constants, normally simple * integers, "value" a variable. Added to libpng-1.2.6 JB */ #define PNG_OUT_OF_RANGE(value, ideal, delta) \ ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) /* Conversions between fixed and floating point, only defined if * required (to make sure the code doesn't accidentally use float * when it is supposedly disabled.) */ #ifdef PNG_FLOATING_POINT_SUPPORTED /* The floating point conversion can't overflow, though it can and * does lose accuracy relative to the original fixed point value. * In practice this doesn't matter because png_fixed_point only * stores numbers with very low precision. The png_ptr and s * arguments are unused by default but are there in case error * checking becomes a requirement. */ #define png_float(png_ptr, fixed, s) (.00001 * (fixed)) /* The fixed point conversion performs range checking and evaluates * its argument multiple times, so must be used with care. The * range checking uses the PNG specification values for a signed * 32 bit fixed point value except that the values are deliberately * rounded-to-zero to an integral value - 21474 (21474.83 is roughly * (2^31-1) * 100000). 's' is a string that describes the value being * converted. * * NOTE: this macro will raise a png_error if the range check fails, * therefore it is normally only appropriate to use this on values * that come from API calls or other sources where an out of range * error indicates a programming error, not a data error! * * NOTE: by default this is off - the macro is not used - because the * function call saves a lot of code. */ #ifdef PNG_FIXED_POINT_MACRO_SUPPORTED #define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\ ((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0)) #endif /* else the corresponding function is defined below, inside the scope of the * cplusplus test. */ #endif /* Constants for known chunk types. If you need to add a chunk, define the name * here. For historical reasons these constants have the form png_; i.e. * the prefix is lower case. Please use decimal values as the parameters to * match the ISO PNG specification and to avoid relying on the C locale * interpretation of character values. * * Prior to 1.5.6 these constants were strings, as of 1.5.6 png_uint_32 values * are computed and a new macro (PNG_STRING_FROM_CHUNK) added to allow a string * to be generated if required. * * PNG_32b correctly produces a value shifted by up to 24 bits, even on * architectures where (int) is only 16 bits. */ #define PNG_32b(b,s) ((png_uint_32)(b) << (s)) #define PNG_U32(b1,b2,b3,b4) \ (PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0)) /* Constants for known chunk types. * * MAINTAINERS: If you need to add a chunk, define the name here. * For historical reasons these constants have the form png_; i.e. * the prefix is lower case. Please use decimal values as the parameters to * match the ISO PNG specification and to avoid relying on the C locale * interpretation of character values. Please keep the list sorted. * * Notice that PNG_U32 is used to define a 32-bit value for the 4 byte chunk * type. In fact the specification does not express chunk types this way, * however using a 32-bit value means that the chunk type can be read from the * stream using exactly the same code as used for a 32-bit unsigned value and * can be examined far more efficiently (using one arithmetic compare). * * Prior to 1.5.6 the chunk type constants were expressed as C strings. The * libpng API still uses strings for 'unknown' chunks and a macro, * PNG_STRING_FROM_CHUNK, allows a string to be generated if required. Notice * that for portable code numeric values must still be used; the string "IHDR" * is not portable and neither is PNG_U32('I', 'H', 'D', 'R'). * * In 1.7.0 the definitions will be made public in png.h to avoid having to * duplicate the same definitions in application code. */ #define png_IDAT PNG_U32( 73, 68, 65, 84) #define png_IEND PNG_U32( 73, 69, 78, 68) #define png_IHDR PNG_U32( 73, 72, 68, 82) #define png_PLTE PNG_U32( 80, 76, 84, 69) #define png_bKGD PNG_U32( 98, 75, 71, 68) #define png_cHRM PNG_U32( 99, 72, 82, 77) #define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */ #define png_gAMA PNG_U32(103, 65, 77, 65) #define png_gIFg PNG_U32(103, 73, 70, 103) #define png_gIFt PNG_U32(103, 73, 70, 116) /* deprecated */ #define png_gIFx PNG_U32(103, 73, 70, 120) #define png_hIST PNG_U32(104, 73, 83, 84) #define png_iCCP PNG_U32(105, 67, 67, 80) #define png_iTXt PNG_U32(105, 84, 88, 116) #define png_oFFs PNG_U32(111, 70, 70, 115) #define png_pCAL PNG_U32(112, 67, 65, 76) #define png_pHYs PNG_U32(112, 72, 89, 115) #define png_sBIT PNG_U32(115, 66, 73, 84) #define png_sCAL PNG_U32(115, 67, 65, 76) #define png_sPLT PNG_U32(115, 80, 76, 84) #define png_sRGB PNG_U32(115, 82, 71, 66) #define png_sTER PNG_U32(115, 84, 69, 82) #define png_tEXt PNG_U32(116, 69, 88, 116) #define png_tIME PNG_U32(116, 73, 77, 69) #define png_tRNS PNG_U32(116, 82, 78, 83) #define png_zTXt PNG_U32(122, 84, 88, 116) /* The following will work on (signed char*) strings, whereas the get_uint_32 * macro will fail on top-bit-set values because of the sign extension. */ #define PNG_CHUNK_FROM_STRING(s)\ PNG_U32(0xff&(s)[0], 0xff&(s)[1], 0xff&(s)[2], 0xff&(s)[3]) /* This uses (char), not (png_byte) to avoid warnings on systems where (char) is * signed and the argument is a (char[]) This macro will fail miserably on * systems where (char) is more than 8 bits. */ #define PNG_STRING_FROM_CHUNK(s,c)\ (void)(((char*)(s))[0]=(char)((c)>>24), ((char*)(s))[1]=(char)((c)>>16),\ ((char*)(s))[2]=(char)((c)>>8), ((char*)(s))[3]=(char)((c))) /* Do the same but terminate with a null character. */ #define PNG_CSTRING_FROM_CHUNK(s,c)\ (void)(PNG_STRING_FROM_CHUNK(s,c), ((char*)(s))[4] = 0) /* Test on flag values as defined in the spec (section 5.4): */ #define PNG_CHUNK_ANCILLARY(c) (1 & ((c) >> 29)) #define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c)) #define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21)) #define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13)) #define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5)) /* Gamma values (new at libpng-1.5.4): */ #define PNG_GAMMA_MAC_OLD 151724 /* Assume '1.8' is really 2.2/1.45! */ #define PNG_GAMMA_MAC_INVERSE 65909 #define PNG_GAMMA_sRGB_INVERSE 45455 /* Almost everything below is C specific; the #defines above can be used in * non-C code (so long as it is C-preprocessed) the rest of this stuff cannot. */ #ifndef PNG_VERSION_INFO_ONLY #include "pngstruct.h" #include "pnginfo.h" /* Validate the include paths - the include path used to generate pnglibconf.h * must match that used in the build, or we must be using pnglibconf.h.prebuilt: */ #if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM # error ZLIB_VERNUM != PNG_ZLIB_VERNUM \ "-I (include path) error: see the notes in pngpriv.h" /* This means that when pnglibconf.h was built the copy of zlib.h that it * used is not the same as the one being used here. Because the build of * libpng makes decisions to use inflateInit2 and inflateReset2 based on the * zlib version number and because this affects handling of certain broken * PNG files the -I directives must match. * * The most likely explanation is that you passed a -I in CFLAGS, this will * not work; all the preprocessor directories and in particular all the -I * directives must be in CPPFLAGS. */ #endif /* This is used for 16 bit gamma tables -- only the top level pointers are * const; this could be changed: */ typedef const png_uint_16p * png_const_uint_16pp; /* Added to libpng-1.5.7: sRGB conversion tables */ #if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) #ifdef PNG_SIMPLIFIED_READ_SUPPORTED PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]); /* Convert from an sRGB encoded value 0..255 to a 16-bit linear value, * 0..65535. This table gives the closest 16-bit answers (no errors). */ #endif PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]); PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]); #define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\ ((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8)) /* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB * encoded value with maximum error 0.646365. Note that the input is not a * 16-bit value; it has been multiplied by 255! */ #endif /* PNG_SIMPLIFIED_READ/WRITE */ /* Inhibit C++ name-mangling for libpng functions but not for system calls. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Internal functions; these are not exported from a DLL however because they * are used within several of the C source files they have to be C extern. * * All of these functions must be declared with PNG_INTERNAL_FUNCTION. */ /* Zlib support */ #define PNG_UNEXPECTED_ZLIB_RETURN (-7) PNG_INTERNAL_FUNCTION(void, png_zstream_error,(png_structrp png_ptr, int ret), PNG_EMPTY); /* Used by the zlib handling functions to ensure that z_stream::msg is always * set before they return. */ #ifdef PNG_WRITE_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_free_buffer_list,(png_structrp png_ptr, png_compression_bufferp *list),PNG_EMPTY); /* Free the buffer list used by the compressed write code. */ #endif #if defined(PNG_FLOATING_POINT_SUPPORTED) && \ !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \ (defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \ defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \ (defined(PNG_sCAL_SUPPORTED) && \ defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)) PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr, double fp, png_const_charp text),PNG_EMPTY); #endif /* Check the user version string for compatibility, returns false if the version * numbers aren't compatible. */ PNG_INTERNAL_FUNCTION(int,png_user_version_check,(png_structrp png_ptr, png_const_charp user_png_ver),PNG_EMPTY); /* Internal base allocator - no messages, NULL on failure to allocate. This * does, however, call the application provided allocator and that could call * png_error (although that would be a bug in the application implementation.) */ PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED); #if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\ defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) /* Internal array allocator, outputs no error or warning messages on failure, * just returns NULL. */ PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_array,(png_const_structrp png_ptr, int nelements, size_t element_size),PNG_ALLOCATED); /* The same but an existing array is extended by add_elements. This function * also memsets the new elements to 0 and copies the old elements. The old * array is not freed or altered. */ PNG_INTERNAL_FUNCTION(png_voidp,png_realloc_array,(png_const_structrp png_ptr, png_const_voidp array, int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED); #endif /* text, sPLT or unknown chunks */ /* Magic to create a struct when there is no struct to call the user supplied * memory allocators. Because error handling has not been set up the memory * handlers can't safely call png_error, but this is an obscure and undocumented * restriction so libpng has to assume that the 'free' handler, at least, might * call png_error. */ PNG_INTERNAL_FUNCTION(png_structp,png_create_png_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED); /* Free memory from internal libpng struct */ PNG_INTERNAL_FUNCTION(void,png_destroy_png_struct,(png_structrp png_ptr), PNG_EMPTY); /* Free an allocated jmp_buf (always succeeds) */ PNG_INTERNAL_FUNCTION(void,png_free_jmpbuf,(png_structrp png_ptr),PNG_EMPTY); /* Function to allocate memory for zlib. PNGAPI is disallowed. */ PNG_INTERNAL_FUNCTION(voidpf,png_zalloc,(voidpf png_ptr, uInt items, uInt size), PNG_ALLOCATED); /* Function to free memory for zlib. PNGAPI is disallowed. */ PNG_INTERNAL_FUNCTION(void,png_zfree,(voidpf png_ptr, voidpf ptr),PNG_EMPTY); /* Next four functions are used internally as callbacks. PNGCBAPI is required * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3, changed to * PNGCBAPI at 1.5.0 */ PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_read_data,(png_structp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_push_fill_buffer,(png_structp png_ptr, png_bytep buffer, png_size_t length),PNG_EMPTY); #endif PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_write_data,(png_structp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); #ifdef PNG_WRITE_FLUSH_SUPPORTED # ifdef PNG_STDIO_SUPPORTED PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_flush,(png_structp png_ptr), PNG_EMPTY); # endif #endif /* Reset the CRC variable */ PNG_INTERNAL_FUNCTION(void,png_reset_crc,(png_structrp png_ptr),PNG_EMPTY); /* Write the "data" buffer to whatever output you are using */ PNG_INTERNAL_FUNCTION(void,png_write_data,(png_structrp png_ptr, png_const_bytep data, png_size_t length),PNG_EMPTY); /* Read and check the PNG file signature */ PNG_INTERNAL_FUNCTION(void,png_read_sig,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); /* Read the chunk header (length + type name) */ PNG_INTERNAL_FUNCTION(png_uint_32,png_read_chunk_header,(png_structrp png_ptr), PNG_EMPTY); /* Read data from whatever input you are using into the "data" buffer */ PNG_INTERNAL_FUNCTION(void,png_read_data,(png_structrp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); /* Read bytes into buf, and update png_ptr->crc */ PNG_INTERNAL_FUNCTION(void,png_crc_read,(png_structrp png_ptr, png_bytep buf, png_uint_32 length),PNG_EMPTY); /* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ PNG_INTERNAL_FUNCTION(int,png_crc_finish,(png_structrp png_ptr, png_uint_32 skip),PNG_EMPTY); /* Read the CRC from the file and compare it to the libpng calculated CRC */ PNG_INTERNAL_FUNCTION(int,png_crc_error,(png_structrp png_ptr),PNG_EMPTY); /* Calculate the CRC over a section of data. Note that we are only * passing a maximum of 64K on systems that have this as a memory limit, * since this is the maximum buffer size we can specify. */ PNG_INTERNAL_FUNCTION(void,png_calculate_crc,(png_structrp png_ptr, png_const_bytep ptr, png_size_t length),PNG_EMPTY); #ifdef PNG_WRITE_FLUSH_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_flush,(png_structrp png_ptr),PNG_EMPTY); #endif /* Write various chunks */ /* Write the IHDR chunk, and update the png_struct with the necessary * information. */ PNG_INTERNAL_FUNCTION(void,png_write_IHDR,(png_structrp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int compression_method, int filter_method, int interlace_method),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_write_PLTE,(png_structrp png_ptr, png_const_colorp palette, png_uint_32 num_pal),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_compress_IDAT,(png_structrp png_ptr, png_const_bytep row_data, png_alloc_size_t row_data_length, int flush), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_write_IEND,(png_structrp png_ptr),PNG_EMPTY); #ifdef PNG_WRITE_gAMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_gAMA_fixed,(png_structrp png_ptr, png_fixed_point file_gamma),PNG_EMPTY); #endif #ifdef PNG_WRITE_sBIT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sBIT,(png_structrp png_ptr, png_const_color_8p sbit, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_cHRM_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr, const png_xy *xy), PNG_EMPTY); /* The xy value must have been previously validated */ #endif #ifdef PNG_WRITE_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr, int intent),PNG_EMPTY); #endif #ifdef PNG_WRITE_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr, png_const_charp name, png_const_bytep profile), PNG_EMPTY); /* The profile must have been previously validated for correctness, the * length comes from the first four bytes. Only the base, deflate, * compression is supported. */ #endif #ifdef PNG_WRITE_sPLT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sPLT,(png_structrp png_ptr, png_const_sPLT_tp palette),PNG_EMPTY); #endif #ifdef PNG_WRITE_tRNS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tRNS,(png_structrp png_ptr, png_const_bytep trans, png_const_color_16p values, int number, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_bKGD_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_bKGD,(png_structrp png_ptr, png_const_color_16p values, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_hIST_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_hIST,(png_structrp png_ptr, png_const_uint_16p hist, int num_hist),PNG_EMPTY); #endif /* Chunks that have keywords */ #ifdef PNG_WRITE_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len),PNG_EMPTY); #endif #ifdef PNG_WRITE_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len, int compression),PNG_EMPTY); #endif #ifdef PNG_WRITE_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_iTXt,(png_structrp png_ptr, int compression, png_const_charp key, png_const_charp lang, png_const_charp lang_key, png_const_charp text),PNG_EMPTY); #endif #ifdef PNG_TEXT_SUPPORTED /* Added at version 1.0.14 and 1.2.4 */ PNG_INTERNAL_FUNCTION(int,png_set_text_2,(png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text),PNG_EMPTY); #endif #ifdef PNG_WRITE_oFFs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_oFFs,(png_structrp png_ptr, png_int_32 x_offset, png_int_32 y_offset, int unit_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_pCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_pCAL,(png_structrp png_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params),PNG_EMPTY); #endif #ifdef PNG_WRITE_pHYs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_pHYs,(png_structrp png_ptr, png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, int unit_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_tIME_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tIME,(png_structrp png_ptr, png_const_timep mod_time),PNG_EMPTY); #endif #ifdef PNG_WRITE_sCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sCAL_s,(png_structrp png_ptr, int unit, png_const_charp width, png_const_charp height),PNG_EMPTY); #endif /* Called when finished processing a row of data */ PNG_INTERNAL_FUNCTION(void,png_write_finish_row,(png_structrp png_ptr), PNG_EMPTY); /* Internal use only. Called before first row of data */ PNG_INTERNAL_FUNCTION(void,png_write_start_row,(png_structrp png_ptr), PNG_EMPTY); /* Combine a row of data, dealing with alpha, etc. if requested. 'row' is an * array of png_ptr->width pixels. If the image is not interlaced or this * is the final pass this just does a memcpy, otherwise the "display" flag * is used to determine whether to copy pixels that are not in the current pass. * * Because 'png_do_read_interlace' (below) replicates pixels this allows this * function to achieve the documented 'blocky' appearance during interlaced read * if display is 1 and the 'sparkle' appearance, where existing pixels in 'row' * are not changed if they are not in the current pass, when display is 0. * * 'display' must be 0 or 1, otherwise the memcpy will be done regardless. * * The API always reads from the png_struct row buffer and always assumes that * it is full width (png_do_read_interlace has already been called.) * * This function is only ever used to write to row buffers provided by the * caller of the relevant libpng API and the row must have already been * transformed by the read transformations. * * The PNG_USE_COMPILE_TIME_MASKS option causes generation of pre-computed * bitmasks for use within the code, otherwise runtime generated masks are used. * The default is compile time masks. */ #ifndef PNG_USE_COMPILE_TIME_MASKS # define PNG_USE_COMPILE_TIME_MASKS 1 #endif PNG_INTERNAL_FUNCTION(void,png_combine_row,(png_const_structrp png_ptr, png_bytep row, int display),PNG_EMPTY); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Expand an interlaced row: the 'row_info' describes the pass data that has * been read in and must correspond to the pixels in 'row', the pixels are * expanded (moved apart) in 'row' to match the final layout, when doing this * the pixels are *replicated* to the intervening space. This is essential for * the correct operation of png_combine_row, above. */ PNG_INTERNAL_FUNCTION(void,png_do_read_interlace,(png_row_infop row_info, png_bytep row, int pass, png_uint_32 transformations),PNG_EMPTY); #endif /* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ #ifdef PNG_WRITE_INTERLACING_SUPPORTED /* Grab pixels out of a row for an interlaced pass */ PNG_INTERNAL_FUNCTION(void,png_do_write_interlace,(png_row_infop row_info, png_bytep row, int pass),PNG_EMPTY); #endif /* Unfilter a row: check the filter value before calling this, there is no point * calling it for PNG_FILTER_VALUE_NONE. */ PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); /* Choose the best filter to use and filter the row data */ PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr, png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY); /* Read 'avail_out' bytes of data from the IDAT stream. If the output buffer * is NULL the function checks, instead, for the end of the stream. In this * case a benign error will be issued if the stream end is not found or if * extra data has to be consumed. */ PNG_INTERNAL_FUNCTION(void,png_read_finish_IDAT,(png_structrp png_ptr), PNG_EMPTY); /* This cleans up when the IDAT LZ stream does not end when the last image * byte is read; there is still some pending input. */ PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr), PNG_EMPTY); /* Finish a row while reading, dealing with interlacing passes, etc. */ #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ /* Initialize the row buffers, etc. */ PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY); #ifdef PNG_READ_TRANSFORMS_SUPPORTED /* Optional call to update the users info structure */ PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); #endif /* Shared transform functions, defined in pngtran.c */ #if defined(PNG_WRITE_FILLER_SUPPORTED) || \ defined(PNG_READ_STRIP_ALPHA_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info, png_bytep row, int at_start),PNG_EMPTY); #endif #ifdef PNG_16BIT_SUPPORTED #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_swap,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_packswap,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif /* The following decodes the appropriate chunks, and does error correction, * then calls the appropriate callback for the chunk if it is valid. */ /* Decode the IHDR chunk */ PNG_INTERNAL_FUNCTION(void,png_handle_IHDR,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_PLTE,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_IEND,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #ifdef PNG_READ_bKGD_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_bKGD,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_cHRM_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_gAMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_hIST_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_hIST,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_iCCP,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif /* PNG_READ_iCCP_SUPPORTED */ #ifdef PNG_READ_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_iTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_oFFs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_oFFs,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_pCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_pCAL,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_pHYs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_pHYs,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sBIT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sBIT,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sCAL,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sPLT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sPLT,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif /* PNG_READ_sPLT_SUPPORTED */ #ifdef PNG_READ_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sRGB,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tEXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tIME_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tIME,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tRNS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tRNS,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY); /* This is the function that gets called for unknown chunks. The 'keep' * argument is either non-zero for a known chunk that has been set to be * handled as unknown or zero for an unknown chunk. By default the function * just skips the chunk or errors out if it is critical. */ #if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\ defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) PNG_INTERNAL_FUNCTION(int,png_chunk_unknown_handling, (png_const_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY); /* Exactly as the API png_handle_as_unknown() except that the argument is a * 32-bit chunk name, not a string. */ #endif /* READ_UNKNOWN_CHUNKS || HANDLE_AS_UNKNOWN */ /* Handle the transformations for reading and writing */ #ifdef PNG_READ_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_do_read_transformations,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_do_write_transformations,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #ifdef PNG_READ_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_init_read_transformations,(png_structrp png_ptr), PNG_EMPTY); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_read_chunk,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_sig,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_crc_skip,(png_structrp png_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_crc_finish,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr, png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_IDAT,(png_structrp png_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_process_IDAT_data,(png_structrp png_ptr, png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_handle_unknown,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr, png_bytep row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr), PNG_EMPTY); # ifdef PNG_READ_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_tEXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_tEXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif # ifdef PNG_READ_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_zTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_zTXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif # ifdef PNG_READ_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_iTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ /* Added at libpng version 1.6.0 */ #ifdef PNG_GAMMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_fixed_point gAMA), PNG_EMPTY); /* Set the colorspace gamma with a value provided by the application or by * the gAMA chunk on read. The value will override anything set by an ICC * profile. */ PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); /* Synchronize the info 'valid' flags with the colorspace */ PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); /* Copy the png_struct colorspace to the info_struct and call the above to * synchronize the flags. Checks for NULL info_ptr and does nothing. */ #endif /* Added at libpng version 1.4.0 */ #ifdef PNG_COLORSPACE_SUPPORTED /* These internal functions are for maintaining the colorspace structure within * a png_info or png_struct (or, indeed, both). */ PNG_INTERNAL_FUNCTION(int,png_colorspace_set_chromaticities, (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy, int preferred), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_colorspace_set_endpoints, (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_XYZ *XYZ, int preferred), PNG_EMPTY); #ifdef PNG_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(int,png_colorspace_set_sRGB,(png_const_structrp png_ptr, png_colorspacerp colorspace, int intent), PNG_EMPTY); /* This does set the colorspace gAMA and cHRM values too, but doesn't set the * flags to write them, if it returns false there was a problem and an error * message has already been output (but the colorspace may still need to be * synced to record the invalid flag). */ #endif /* sRGB */ #ifdef PNG_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, int color_type), PNG_EMPTY); /* The 'name' is used for information only */ /* Routines for checking parts of an ICC profile. */ PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile /* first 132 bytes only */, int color_type), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_icc_check_tag_table,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile /* header plus whole tag table */), PNG_EMPTY); #ifdef PNG_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_icc_set_sRGB,( png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_bytep profile, uLong adler), PNG_EMPTY); /* 'adler' is the Adler32 checksum of the uncompressed profile data. It may * be zero to indicate that it is not available. It is used, if provided, * as a fast check on the profile when checking to see if it is sRGB. */ #endif #endif /* iCCP */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_colorspace_set_rgb_coefficients, (png_structrp png_ptr), PNG_EMPTY); /* Set the rgb_to_gray coefficients from the colorspace Y values */ #endif /* READ_RGB_TO_GRAY */ #endif /* COLORSPACE */ /* Added at libpng version 1.4.0 */ PNG_INTERNAL_FUNCTION(void,png_check_IHDR,(png_const_structrp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type),PNG_EMPTY); /* Added at libpng version 1.5.10 */ #if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_check_palette_indexes, (png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN); #endif /* Puts 'string' into 'buffer' at buffer[pos], taking care never to overwrite * the end. Always leaves the buffer nul terminated. Never errors out (and * there is no error code.) */ PNG_INTERNAL_FUNCTION(size_t,png_safecat,(png_charp buffer, size_t bufsize, size_t pos, png_const_charp string),PNG_EMPTY); /* Various internal functions to handle formatted warning messages, currently * only implemented for warnings. */ #if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_TIME_RFC1123_SUPPORTED) /* Utility to dump an unsigned value into a buffer, given a start pointer and * and end pointer (which should point just *beyond* the end of the buffer!) * Returns the pointer to the start of the formatted string. This utility only * does unsigned values. */ PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start, png_charp end, int format, png_alloc_size_t number),PNG_EMPTY); /* Convenience macro that takes an array: */ #define PNG_FORMAT_NUMBER(buffer,format,number) \ png_format_number(buffer, buffer + (sizeof buffer), format, number) /* Suggested size for a number buffer (enough for 64 bits and a sign!) */ #define PNG_NUMBER_BUFFER_SIZE 24 /* These are the integer formats currently supported, the name is formed from * the standard printf(3) format string. */ #define PNG_NUMBER_FORMAT_u 1 /* chose unsigned API! */ #define PNG_NUMBER_FORMAT_02u 2 #define PNG_NUMBER_FORMAT_d 1 /* chose signed API! */ #define PNG_NUMBER_FORMAT_02d 2 #define PNG_NUMBER_FORMAT_x 3 #define PNG_NUMBER_FORMAT_02x 4 #define PNG_NUMBER_FORMAT_fixed 5 /* choose the signed API */ #endif #ifdef PNG_WARNINGS_SUPPORTED /* New defines and members adding in libpng-1.5.4 */ # define PNG_WARNING_PARAMETER_SIZE 32 # define PNG_WARNING_PARAMETER_COUNT 8 /* Maximum 9; see pngerror.c */ /* An l-value of this type has to be passed to the APIs below to cache the * values of the parameters to a formatted warning message. */ typedef char png_warning_parameters[PNG_WARNING_PARAMETER_COUNT][ PNG_WARNING_PARAMETER_SIZE]; PNG_INTERNAL_FUNCTION(void,png_warning_parameter,(png_warning_parameters p, int number, png_const_charp string),PNG_EMPTY); /* Parameters are limited in size to PNG_WARNING_PARAMETER_SIZE characters, * including the trailing '\0'. */ PNG_INTERNAL_FUNCTION(void,png_warning_parameter_unsigned, (png_warning_parameters p, int number, int format, png_alloc_size_t value), PNG_EMPTY); /* Use png_alloc_size_t because it is an unsigned type as big as any we * need to output. Use the following for a signed value. */ PNG_INTERNAL_FUNCTION(void,png_warning_parameter_signed, (png_warning_parameters p, int number, int format, png_int_32 value), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_formatted_warning,(png_const_structrp png_ptr, png_warning_parameters p, png_const_charp message),PNG_EMPTY); /* 'message' follows the X/Open approach of using @1, @2 to insert * parameters previously supplied using the above functions. Errors in * specifying the parameters will simply result in garbage substitutions. */ #endif #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Application errors (new in 1.6); use these functions (declared below) for * errors in the parameters or order of API function calls on read. The * 'warning' should be used for an error that can be handled completely; the * 'error' for one which can be handled safely but which may lose application * information or settings. * * By default these both result in a png_error call prior to release, while in a * released version the 'warning' is just a warning. However if the application * explicitly disables benign errors (explicitly permitting the code to lose * information) they both turn into warnings. * * If benign errors aren't supported they end up as the corresponding base call * (png_warning or png_error.) */ PNG_INTERNAL_FUNCTION(void,png_app_warning,(png_const_structrp png_ptr, png_const_charp message),PNG_EMPTY); /* The application provided invalid parameters to an API function or called * an API function at the wrong time, libpng can completely recover. */ PNG_INTERNAL_FUNCTION(void,png_app_error,(png_const_structrp png_ptr, png_const_charp message),PNG_EMPTY); /* As above but libpng will ignore the call, or attempt some other partial * recovery from the error. */ #else # define png_app_warning(pp,s) png_warning(pp,s) # define png_app_error(pp,s) png_error(pp,s) #endif PNG_INTERNAL_FUNCTION(void,png_chunk_report,(png_const_structrp png_ptr, png_const_charp message, int error),PNG_EMPTY); /* Report a recoverable issue in chunk data. On read this is used to report * a problem found while reading a particular chunk and the * png_chunk_benign_error or png_chunk_warning function is used as * appropriate. On write this is used to report an error that comes from * data set via an application call to a png_set_ API and png_app_error or * png_app_warning is used as appropriate. * * The 'error' parameter must have one of the following values: */ #define PNG_CHUNK_WARNING 0 /* never an error */ #define PNG_CHUNK_WRITE_ERROR 1 /* an error only on write */ #define PNG_CHUNK_ERROR 2 /* always an error */ /* ASCII to FP interfaces, currently only implemented if sCAL * support is required. */ #if defined(PNG_sCAL_SUPPORTED) /* MAX_DIGITS is actually the maximum number of characters in an sCAL * width or height, derived from the precision (number of significant * digits - a build time settable option) and assumptions about the * maximum ridiculous exponent. */ #define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/) #ifdef PNG_FLOATING_POINT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_ascii_from_fp,(png_const_structrp png_ptr, png_charp ascii, png_size_t size, double fp, unsigned int precision), PNG_EMPTY); #endif /* FLOATING_POINT */ #ifdef PNG_FIXED_POINT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr, png_charp ascii, png_size_t size, png_fixed_point fp),PNG_EMPTY); #endif /* FIXED_POINT */ #endif /* sCAL */ #if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) /* An internal API to validate the format of a floating point number. * The result is the index of the next character. If the number is * not valid it will be the index of a character in the supposed number. * * The format of a number is defined in the PNG extensions specification * and this API is strictly conformant to that spec, not anyone elses! * * The format as a regular expression is: * * [+-]?[0-9]+.?([Ee][+-]?[0-9]+)? * * or: * * [+-]?.[0-9]+(.[0-9]+)?([Ee][+-]?[0-9]+)? * * The complexity is that either integer or fraction must be present and the * fraction is permitted to have no digits only if the integer is present. * * NOTE: The dangling E problem. * There is a PNG valid floating point number in the following: * * PNG floating point numbers are not greedy. * * Working this out requires *TWO* character lookahead (because of the * sign), the parser does not do this - it will fail at the 'r' - this * doesn't matter for PNG sCAL chunk values, but it requires more care * if the value were ever to be embedded in something more complex. Use * ANSI-C strtod if you need the lookahead. */ /* State table for the parser. */ #define PNG_FP_INTEGER 0 /* before or in integer */ #define PNG_FP_FRACTION 1 /* before or in fraction */ #define PNG_FP_EXPONENT 2 /* before or in exponent */ #define PNG_FP_STATE 3 /* mask for the above */ #define PNG_FP_SAW_SIGN 4 /* Saw +/- in current state */ #define PNG_FP_SAW_DIGIT 8 /* Saw a digit in current state */ #define PNG_FP_SAW_DOT 16 /* Saw a dot in current state */ #define PNG_FP_SAW_E 32 /* Saw an E (or e) in current state */ #define PNG_FP_SAW_ANY 60 /* Saw any of the above 4 */ /* These three values don't affect the parser. They are set but not used. */ #define PNG_FP_WAS_VALID 64 /* Preceding substring is a valid fp number */ #define PNG_FP_NEGATIVE 128 /* A negative number, including "-0" */ #define PNG_FP_NONZERO 256 /* A non-zero value */ #define PNG_FP_STICKY 448 /* The above three flags */ /* This is available for the caller to store in 'state' if required. Do not * call the parser after setting it (the parser sometimes clears it.) */ #define PNG_FP_INVALID 512 /* Available for callers as a distinct value */ /* Result codes for the parser (boolean - true meants ok, false means * not ok yet.) */ #define PNG_FP_MAYBE 0 /* The number may be valid in the future */ #define PNG_FP_OK 1 /* The number is valid */ /* Tests on the sticky non-zero and negative flags. To pass these checks * the state must also indicate that the whole number is valid - this is * achieved by testing PNG_FP_SAW_DIGIT (see the implementation for why this * is equivalent to PNG_FP_OK above.) */ #define PNG_FP_NZ_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NEGATIVE | PNG_FP_NONZERO) /* NZ_MASK: the string is valid and a non-zero negative value */ #define PNG_FP_Z_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NONZERO) /* Z MASK: the string is valid and a non-zero value. */ /* PNG_FP_SAW_DIGIT: the string is valid. */ #define PNG_FP_IS_ZERO(state) (((state) & PNG_FP_Z_MASK) == PNG_FP_SAW_DIGIT) #define PNG_FP_IS_POSITIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_Z_MASK) #define PNG_FP_IS_NEGATIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_NZ_MASK) /* The actual parser. This can be called repeatedly. It updates * the index into the string and the state variable (which must * be initialized to 0). It returns a result code, as above. There * is no point calling the parser any more if it fails to advance to * the end of the string - it is stuck on an invalid character (or * terminated by '\0'). * * Note that the pointer will consume an E or even an E+ and then leave * a 'maybe' state even though a preceding integer.fraction is valid. * The PNG_FP_WAS_VALID flag indicates that a preceding substring was * a valid number. It's possible to recover from this by calling * the parser again (from the start, with state 0) but with a string * that omits the last character (i.e. set the size to the index of * the problem character.) This has not been tested within libpng. */ PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string, png_size_t size, int *statep, png_size_tp whereami),PNG_EMPTY); /* This is the same but it checks a complete string and returns true * only if it just contains a floating point number. As of 1.5.4 this * function also returns the state at the end of parsing the number if * it was valid (otherwise it returns 0.) This can be used for testing * for negative or zero values using the sticky flag. */ PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string, png_size_t size),PNG_EMPTY); #endif /* pCAL || sCAL */ #if defined(PNG_GAMMA_SUPPORTED) ||\ defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED) /* Added at libpng version 1.5.0 */ /* This is a utility to provide a*times/div (rounded) and indicate * if there is an overflow. The result is a boolean - false (0) * for overflow, true (1) if no overflow, in which case *res * holds the result. */ PNG_INTERNAL_FUNCTION(int,png_muldiv,(png_fixed_point_p res, png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY); #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED) /* Same deal, but issue a warning on overflow and return 0. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_muldiv_warn, (png_const_structrp png_ptr, png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY); #endif #ifdef PNG_GAMMA_SUPPORTED /* Calculate a reciprocal - used for gamma values. This returns * 0 if the argument is 0 in order to maintain an undefined value; * there are no warnings. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal,(png_fixed_point a), PNG_EMPTY); #ifdef PNG_READ_GAMMA_SUPPORTED /* The same but gives a reciprocal of the product of two fixed point * values. Accuracy is suitable for gamma calculations but this is * not exact - use png_muldiv for that. Only required at present on read. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal2,(png_fixed_point a, png_fixed_point b),PNG_EMPTY); #endif /* Return true if the gamma value is significantly different from 1.0 */ PNG_INTERNAL_FUNCTION(int,png_gamma_significant,(png_fixed_point gamma_value), PNG_EMPTY); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* Internal fixed point gamma correction. These APIs are called as * required to convert single values - they don't need to be fast, * they are not used when processing image pixel values. * * While the input is an 'unsigned' value it must actually be the * correct bit value - 0..255 or 0..65535 as required. */ PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_correct,(png_structrp png_ptr, unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_16bit_correct,(unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(png_byte,png_gamma_8bit_correct,(unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_destroy_gamma_table,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_build_gamma_table,(png_structrp png_ptr, int bit_depth),PNG_EMPTY); #endif /* SIMPLIFIED READ/WRITE SUPPORT */ #if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) /* The internal structure that png_image::opaque points to. */ typedef struct png_control { png_structp png_ptr; png_infop info_ptr; png_voidp error_buf; /* Always a jmp_buf at present. */ png_const_bytep memory; /* Memory buffer. */ png_size_t size; /* Size of the memory buffer. */ unsigned int for_write :1; /* Otherwise it is a read structure */ unsigned int owned_file :1; /* We own the file in io_ptr */ } png_control; /* Return the pointer to the jmp_buf from a png_control: necessary because C * does not reveal the type of the elements of jmp_buf. */ #ifdef __cplusplus # define png_control_jmp_buf(pc) (((jmp_buf*)((pc)->error_buf))[0]) #else # define png_control_jmp_buf(pc) ((pc)->error_buf) #endif /* Utility to safely execute a piece of libpng code catching and logging any * errors that might occur. Returns true on success, false on failure (either * of the function or as a result of a png_error.) */ PNG_INTERNAL_CALLBACK(void,png_safe_error,(png_structp png_ptr, png_const_charp error_message),PNG_NORETURN); #ifdef PNG_WARNINGS_SUPPORTED PNG_INTERNAL_CALLBACK(void,png_safe_warning,(png_structp png_ptr, png_const_charp warning_message),PNG_EMPTY); #else # define png_safe_warning 0/*dummy argument*/ #endif PNG_INTERNAL_FUNCTION(int,png_safe_execute,(png_imagep image, int (*function)(png_voidp), png_voidp arg),PNG_EMPTY); /* Utility to log an error; this also cleans up the png_image; the function * always returns 0 (false). */ PNG_INTERNAL_FUNCTION(int,png_image_error,(png_imagep image, png_const_charp error_message),PNG_EMPTY); #ifndef PNG_SIMPLIFIED_READ_SUPPORTED /* png_image_free is used by the write code but not exported */ PNG_INTERNAL_FUNCTION(void, png_image_free, (png_imagep image), PNG_EMPTY); #endif /* !SIMPLIFIED_READ */ #endif /* SIMPLIFIED READ/WRITE */ /* These are initialization functions for hardware specific PNG filter * optimizations; list these here then select the appropriate one at compile * time using the macro PNG_FILTER_OPTIMIZATIONS. If the macro is not defined * the generic code is used. */ #ifdef PNG_FILTER_OPTIMIZATIONS PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); /* Just declare the optimization that will be used */ #else /* List *all* the possible optimizations here - this branch is required if * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing. */ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); #endif /* Maintainer: Put new private prototypes here ^ */ #include "pngdebug.h" #ifdef __cplusplus } #endif #endif /* PNG_VERSION_INFO_ONLY */ #endif /* PNGPRIV_H */ ================================================ FILE: Libraries/Core/RPi/Headers/png/pngstruct.h ================================================ /* pngstruct.h - header file for PNG reference library * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.1 [March 28, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* The structure that holds the information to read and write PNG files. * The only people who need to care about what is inside of this are the * people who will be modifying the library for their own special needs. * It should NOT be accessed directly by an application. */ #ifndef PNGSTRUCT_H #define PNGSTRUCT_H /* zlib.h defines the structure z_stream, an instance of which is included * in this structure and is required for decompressing the LZ compressed * data in PNG files. */ #ifndef ZLIB_CONST /* We must ensure that zlib uses 'const' in declarations. */ # define ZLIB_CONST #endif #include "zlib.h" #ifdef const /* zlib.h sometimes #defines const to nothing, undo this. */ # undef const #endif /* zlib.h has mediocre z_const use before 1.2.6, this stuff is for compatibility * with older builds. */ #if ZLIB_VERNUM < 0x1260 # define PNGZ_MSG_CAST(s) png_constcast(char*,s) # define PNGZ_INPUT_CAST(b) png_constcast(png_bytep,b) #else # define PNGZ_MSG_CAST(s) (s) # define PNGZ_INPUT_CAST(b) (b) #endif /* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib * can handle at once. This type need be no larger than 16 bits (so maximum of * 65535), this define allows us to discover how big it is, but limited by the * maximuum for png_size_t. The value can be overriden in a library build * (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably * lower value (e.g. 255 works). A lower value may help memory usage (slightly) * and may even improve performance on some systems (and degrade it on others.) */ #ifndef ZLIB_IO_MAX # define ZLIB_IO_MAX ((uInt)-1) #endif #ifdef PNG_WRITE_SUPPORTED /* The type of a compression buffer list used by the write code. */ typedef struct png_compression_buffer { struct png_compression_buffer *next; png_byte output[1]; /* actually zbuf_size */ } png_compression_buffer, *png_compression_bufferp; #define PNG_COMPRESSION_BUFFER_SIZE(pp)\ (offsetof(png_compression_buffer, output) + (pp)->zbuffer_size) #endif /* Colorspace support; structures used in png_struct, png_info and in internal * functions to hold and communicate information about the color space. * * PNG_COLORSPACE_SUPPORTED is only required if the application will perform * colorspace corrections, otherwise all the colorspace information can be * skipped and the size of libpng can be reduced (significantly) by compiling * out the colorspace support. */ #ifdef PNG_COLORSPACE_SUPPORTED /* The chromaticities of the red, green and blue colorants and the chromaticity * of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)). */ typedef struct png_xy { png_fixed_point redx, redy; png_fixed_point greenx, greeny; png_fixed_point bluex, bluey; png_fixed_point whitex, whitey; } png_xy; /* The same data as above but encoded as CIE XYZ values. When this data comes * from chromaticities the sum of the Y values is assumed to be 1.0 */ typedef struct png_XYZ { png_fixed_point red_X, red_Y, red_Z; png_fixed_point green_X, green_Y, green_Z; png_fixed_point blue_X, blue_Y, blue_Z; } png_XYZ; #endif /* COLORSPACE */ #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) /* A colorspace is all the above plus, potentially, profile information, * however at present libpng does not use the profile internally so it is only * stored in the png_info struct (if iCCP is supported.) The rendering intent * is retained here and is checked. * * The file gamma encoding information is also stored here and gamma correction * is done by libpng, whereas color correction must currently be done by the * application. */ typedef struct png_colorspace { #ifdef PNG_GAMMA_SUPPORTED png_fixed_point gamma; /* File gamma */ #endif #ifdef PNG_COLORSPACE_SUPPORTED png_xy end_points_xy; /* End points as chromaticities */ png_XYZ end_points_XYZ; /* End points as CIE XYZ colorant values */ png_uint_16 rendering_intent; /* Rendering intent of a profile */ #endif /* Flags are always defined to simplify the code. */ png_uint_16 flags; /* As defined below */ } png_colorspace, * PNG_RESTRICT png_colorspacerp; typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp; /* General flags for the 'flags' field */ #define PNG_COLORSPACE_HAVE_GAMMA 0x0001 #define PNG_COLORSPACE_HAVE_ENDPOINTS 0x0002 #define PNG_COLORSPACE_HAVE_INTENT 0x0004 #define PNG_COLORSPACE_FROM_gAMA 0x0008 #define PNG_COLORSPACE_FROM_cHRM 0x0010 #define PNG_COLORSPACE_FROM_sRGB 0x0020 #define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040 #define PNG_COLORSPACE_MATCHES_sRGB 0x0080 /* exact match on profile */ #define PNG_COLORSPACE_INVALID 0x8000 #define PNG_COLORSPACE_CANCEL(flags) (0xffff ^ (flags)) #endif /* COLORSPACE || GAMMA */ struct png_struct_def { #ifdef PNG_SETJMP_SUPPORTED jmp_buf jmp_buf_local; /* New name in 1.6.0 for jmp_buf in png_struct */ png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */ jmp_buf *jmp_buf_ptr; /* passed to longjmp_fn */ size_t jmp_buf_size; /* size of the above, if allocated */ #endif png_error_ptr error_fn; /* function for printing errors and aborting */ #ifdef PNG_WARNINGS_SUPPORTED png_error_ptr warning_fn; /* function for printing warnings */ #endif png_voidp error_ptr; /* user supplied struct for error functions */ png_rw_ptr write_data_fn; /* function for writing output data */ png_rw_ptr read_data_fn; /* function for reading input data */ png_voidp io_ptr; /* ptr to application struct for I/O functions */ #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED png_user_transform_ptr read_user_transform_fn; /* user read transform */ #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED png_user_transform_ptr write_user_transform_fn; /* user write transform */ #endif /* These were added in libpng-1.0.2 */ #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) png_voidp user_transform_ptr; /* user supplied struct for user transform */ png_byte user_transform_depth; /* bit depth of user transformed pixels */ png_byte user_transform_channels; /* channels in user transformed pixels */ #endif #endif png_uint_32 mode; /* tells us where we are in the PNG file */ png_uint_32 flags; /* flags indicating various things to libpng */ png_uint_32 transformations; /* which transformations to perform */ png_uint_32 zowner; /* ID (chunk type) of zstream owner, 0 if none */ z_stream zstream; /* decompression structure */ #ifdef PNG_WRITE_SUPPORTED png_compression_bufferp zbuffer_list; /* Created on demand during write */ uInt zbuffer_size; /* size of the actual buffer */ int zlib_level; /* holds zlib compression level */ int zlib_method; /* holds zlib compression method */ int zlib_window_bits; /* holds zlib compression window bits */ int zlib_mem_level; /* holds zlib compression memory level */ int zlib_strategy; /* holds zlib compression strategy */ #endif /* Added at libpng 1.5.4 */ #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED int zlib_text_level; /* holds zlib compression level */ int zlib_text_method; /* holds zlib compression method */ int zlib_text_window_bits; /* holds zlib compression window bits */ int zlib_text_mem_level; /* holds zlib compression memory level */ int zlib_text_strategy; /* holds zlib compression strategy */ #endif /* End of material added at libpng 1.5.4 */ /* Added at libpng 1.6.0 */ #ifdef PNG_WRITE_SUPPORTED int zlib_set_level; /* Actual values set into the zstream on write */ int zlib_set_method; int zlib_set_window_bits; int zlib_set_mem_level; int zlib_set_strategy; #endif png_uint_32 width; /* width of image in pixels */ png_uint_32 height; /* height of image in pixels */ png_uint_32 num_rows; /* number of rows in current pass */ png_uint_32 usr_width; /* width of row at start of write */ png_size_t rowbytes; /* size of row in bytes */ png_uint_32 iwidth; /* width of current interlaced row in pixels */ png_uint_32 row_number; /* current row in interlace pass */ png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */ png_bytep prev_row; /* buffer to save previous (unfiltered) row. * This is a pointer into big_prev_row */ png_bytep row_buf; /* buffer to save current (unfiltered) row. * This is a pointer into big_row_buf */ #ifdef PNG_WRITE_SUPPORTED png_bytep sub_row; /* buffer to save "sub" row when filtering */ png_bytep up_row; /* buffer to save "up" row when filtering */ png_bytep avg_row; /* buffer to save "avg" row when filtering */ png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ #endif png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */ png_uint_32 idat_size; /* current IDAT size for read */ png_uint_32 crc; /* current chunk CRC value */ png_colorp palette; /* palette from the input file */ png_uint_16 num_palette; /* number of color entries in palette */ /* Added at libpng-1.5.10 */ #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED int num_palette_max; /* maximum palette index found in IDAT */ #endif png_uint_16 num_trans; /* number of transparency values */ png_byte compression; /* file compression type (always 0) */ png_byte filter; /* file filter type (always 0) */ png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ png_byte pass; /* current interlace pass (0 - 6) */ png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ png_byte color_type; /* color type of file */ png_byte bit_depth; /* bit depth of file */ png_byte usr_bit_depth; /* bit depth of users row: write only */ png_byte pixel_depth; /* number of bits per pixel */ png_byte channels; /* number of channels in file */ #ifdef PNG_WRITE_SUPPORTED png_byte usr_channels; /* channels at start of write: write only */ #endif png_byte sig_bytes; /* magic bytes read/written from start of file */ png_byte maximum_pixel_depth; /* pixel depth used for the row buffers */ png_byte transformed_pixel_depth; /* pixel depth after read/write transforms */ #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) png_uint_16 filler; /* filler bytes for pixel expansion */ #endif #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ defined(PNG_READ_ALPHA_MODE_SUPPORTED) png_byte background_gamma_type; png_fixed_point background_gamma; png_color_16 background; /* background color in screen gamma space */ #ifdef PNG_READ_GAMMA_SUPPORTED png_color_16 background_1; /* background normalized to gamma 1.0 */ #endif #endif /* PNG_bKGD_SUPPORTED */ #ifdef PNG_WRITE_FLUSH_SUPPORTED png_flush_ptr output_flush_fn; /* Function for flushing output */ png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ png_uint_32 flush_rows; /* number of rows written since last flush */ #endif #ifdef PNG_READ_GAMMA_SUPPORTED int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */ png_bytep gamma_table; /* gamma table for 8-bit depth files */ png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) png_bytep gamma_from_1; /* converts from 1.0 to screen */ png_bytep gamma_to_1; /* converts from file to 1.0 */ png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) png_color_8 sig_bit; /* significant bits in each available channel */ #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) png_color_8 shift; /* shift for significant bit tranformation */ #endif #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) png_bytep trans_alpha; /* alpha values for paletted files */ png_color_16 trans_color; /* transparent color for non-paletted files */ #endif png_read_status_ptr read_row_fn; /* called after each row is decoded */ png_write_status_ptr write_row_fn; /* called after each row is encoded */ #ifdef PNG_PROGRESSIVE_READ_SUPPORTED png_progressive_info_ptr info_fn; /* called after header data fully read */ png_progressive_row_ptr row_fn; /* called after a prog. row is decoded */ png_progressive_end_ptr end_fn; /* called after image is complete */ png_bytep save_buffer_ptr; /* current location in save_buffer */ png_bytep save_buffer; /* buffer for previously read data */ png_bytep current_buffer_ptr; /* current location in current_buffer */ png_bytep current_buffer; /* buffer for recently used data */ png_uint_32 push_length; /* size of current input chunk */ png_uint_32 skip_length; /* bytes to skip in input data */ png_size_t save_buffer_size; /* amount of data now in save_buffer */ png_size_t save_buffer_max; /* total size of save_buffer */ png_size_t buffer_size; /* total amount of available input data */ png_size_t current_buffer_size; /* amount of data now in current_buffer */ int process_mode; /* what push library is currently doing */ int cur_palette; /* current push library palette index */ #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) /* For the Borland special 64K segment handler */ png_bytepp offset_table_ptr; png_bytep offset_table; png_uint_16 offset_table_number; png_uint_16 offset_table_count; png_uint_16 offset_table_count_free; #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED png_bytep palette_lookup; /* lookup table for quantizing */ png_bytep quantize_index; /* index translation for palette files */ #endif #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED png_byte heuristic_method; /* heuristic for row filter selection */ png_byte num_prev_filters; /* number of weights for previous rows */ png_bytep prev_filters; /* filter type(s) of previous row(s) */ png_uint_16p filter_weights; /* weight(s) for previous line(s) */ png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ png_uint_16p filter_costs; /* relative filter calculation cost */ png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ #endif /* Options */ #ifdef PNG_SET_OPTION_SUPPORTED png_byte options; /* On/off state (up to 4 options) */ #endif #if PNG_LIBPNG_VER < 10700 /* To do: remove this from libpng-1.7 */ #ifdef PNG_TIME_RFC1123_SUPPORTED char time_buffer[29]; /* String to hold RFC 1123 time text */ #endif #endif /* New members added in libpng-1.0.6 */ png_uint_32 free_me; /* flags items libpng is responsible for freeing */ #ifdef PNG_USER_CHUNKS_SUPPORTED png_voidp user_chunk_ptr; #ifdef PNG_READ_USER_CHUNKS_SUPPORTED png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ #endif #endif #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED int unknown_default; /* As PNG_HANDLE_* */ unsigned int num_chunk_list; /* Number of entries in the list */ png_bytep chunk_list; /* List of png_byte[5]; the textual chunk name * followed by a PNG_HANDLE_* byte */ #endif /* New members added in libpng-1.0.3 */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED png_byte rgb_to_gray_status; /* Added in libpng 1.5.5 to record setting of coefficients: */ png_byte rgb_to_gray_coefficients_set; /* These were changed from png_byte in libpng-1.0.6 */ png_uint_16 rgb_to_gray_red_coeff; png_uint_16 rgb_to_gray_green_coeff; /* deleted in 1.5.5: rgb_to_gray_blue_coeff; */ #endif /* New member added in libpng-1.0.4 (renamed in 1.0.9) */ #if defined(PNG_MNG_FEATURES_SUPPORTED) /* Changed from png_byte to png_uint_32 at version 1.2.0 */ png_uint_32 mng_features_permitted; #endif /* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ #ifdef PNG_MNG_FEATURES_SUPPORTED png_byte filter_type; #endif /* New members added in libpng-1.2.0 */ /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ #ifdef PNG_USER_MEM_SUPPORTED png_voidp mem_ptr; /* user supplied struct for mem functions */ png_malloc_ptr malloc_fn; /* function for allocating memory */ png_free_ptr free_fn; /* function for freeing memory */ #endif /* New member added in libpng-1.0.13 and 1.2.0 */ png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ #ifdef PNG_READ_QUANTIZE_SUPPORTED /* The following three members were added at version 1.0.14 and 1.2.4 */ png_bytep quantize_sort; /* working sort array */ png_bytep index_to_palette; /* where the original index currently is in the palette */ png_bytep palette_to_index; /* which original index points to this palette color */ #endif /* New members added in libpng-1.0.16 and 1.2.6 */ png_byte compression_type; #ifdef PNG_USER_LIMITS_SUPPORTED png_uint_32 user_width_max; png_uint_32 user_height_max; /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown * chunks that can be stored (0 means unlimited). */ png_uint_32 user_chunk_cache_max; /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk * can occupy when decompressed. 0 means unlimited. */ png_alloc_size_t user_chunk_malloc_max; #endif /* New member added in libpng-1.0.25 and 1.2.17 */ #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED /* Temporary storage for unknown chunk that the library doesn't recognize, * used while reading the chunk. */ png_unknown_chunk unknown_chunk; #endif /* New member added in libpng-1.2.26 */ png_size_t old_big_row_buf_size; #ifdef PNG_READ_SUPPORTED /* New member added in libpng-1.2.30 */ png_bytep read_buffer; /* buffer for reading chunk data */ png_alloc_size_t read_buffer_size; /* current size of the buffer */ #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED uInt IDAT_read_size; /* limit on read buffer size for IDAT */ #endif #ifdef PNG_IO_STATE_SUPPORTED /* New member added in libpng-1.4.0 */ png_uint_32 io_state; #endif /* New member added in libpng-1.5.6 */ png_bytep big_prev_row; /* New member added in libpng-1.5.7 */ void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info, png_bytep row, png_const_bytep prev_row); #ifdef PNG_READ_SUPPORTED #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) png_colorspace colorspace; #endif #endif }; #endif /* PNGSTRUCT_H */ ================================================ FILE: Libraries/Core/RPi/Headers/rapidxml/rapidxml.hpp ================================================ #ifndef RAPIDXML_HPP_INCLUDED #define RAPIDXML_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml.hpp This file contains rapidxml parser and DOM implementation // If standard library is disabled, user must provide implementations of required functions and typedefs #if !defined(RAPIDXML_NO_STDLIB) #include // For std::size_t #include // For assert #include // For placement new #endif // On MSVC, disable "conditional expression is constant" warning (level 4). // This warning is almost impossible to avoid with certain types of templated code #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4127) // Conditional expression is constant #endif /////////////////////////////////////////////////////////////////////////// // RAPIDXML_PARSE_ERROR #if defined(RAPIDXML_NO_EXCEPTIONS) #define RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); } namespace rapidxml { //! When exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, //! this function is called to notify user about the error. //! It must be defined by the user. //!

//! This function cannot return. If it does, the results are undefined. //!

//! A very simple definition might look like that: //!
    //! void %rapidxml::%parse_error_handler(const char *what, void *where)
    //! {
    //!     std::cout << "Parse error: " << what << "\n";
    //!     std::abort();
    //! }
    //! 
//! \param what Human readable description of the error. //! \param where Pointer to character data where error was detected. void parse_error_handler(const char *what, void *where); } #else #include // For std::exception #define RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where) namespace rapidxml { //! Parse error exception. //! This exception is thrown by the parser when an error occurs. //! Use what() function to get human-readable error message. //! Use where() function to get a pointer to position within source text where error was detected. //!

//! If throwing exceptions by the parser is undesirable, //! it can be disabled by defining RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included. //! This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception. //! This function must be defined by the user. //!

//! This class derives from std::exception class. class parse_error: public std::exception { public: //! Constructs parse error parse_error(const char *what, void *where) : m_what(what) , m_where(where) { } //! Gets human readable description of error. //! \return Pointer to null terminated description of the error. virtual const char *what() const throw() { return m_what; } //! Gets pointer to character data where error happened. //! Ch should be the same as char type of xml_document that produced the error. //! \return Pointer to location within the parsed string where error occured. template Ch *where() const { return reinterpret_cast(m_where); } private: const char *m_what; void *m_where; }; } #endif /////////////////////////////////////////////////////////////////////////// // Pool sizes #ifndef RAPIDXML_STATIC_POOL_SIZE // Size of static memory block of memory_pool. // Define RAPIDXML_STATIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. // No dynamic memory allocations are performed by memory_pool until static memory is exhausted. #define RAPIDXML_STATIC_POOL_SIZE (64 * 1024) #endif #ifndef RAPIDXML_DYNAMIC_POOL_SIZE // Size of dynamic memory block of memory_pool. // Define RAPIDXML_DYNAMIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. // After the static block is exhausted, dynamic blocks with approximately this size are allocated by memory_pool. #define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024) #endif #ifndef RAPIDXML_ALIGNMENT // Memory allocation alignment. // Define RAPIDXML_ALIGNMENT before including rapidxml.hpp if you want to override the default value, which is the size of pointer. // All memory allocations for nodes, attributes and strings will be aligned to this value. // This must be a power of 2 and at least 1, otherwise memory_pool will not work. #define RAPIDXML_ALIGNMENT sizeof(void *) #endif namespace rapidxml { // Forward declarations template class xml_node; template class xml_attribute; template class xml_document; //! Enumeration listing all node types produced by the parser. //! Use xml_node::type() function to query node type. enum node_type { node_document, //!< A document node. Name and value are empty. node_element, //!< An element node. Name contains element name. Value contains text of first data node. node_data, //!< A data node. Name is empty. Value contains data text. node_cdata, //!< A CDATA node. Name is empty. Value contains data text. node_comment, //!< A comment node. Name is empty. Value contains comment text. node_declaration, //!< A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes. node_doctype, //!< A DOCTYPE node. Name is empty. Value contains DOCTYPE text. node_pi //!< A PI node. Name contains target. Value contains instructions. }; /////////////////////////////////////////////////////////////////////// // Parsing flags //! Parse flag instructing the parser to not create data nodes. //! Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_data_nodes = 0x1; //! Parse flag instructing the parser to not use text of first data node as a value of parent element. //! Can be combined with other flags by use of | operator. //! Note that child data nodes of element node take precendence over its value when printing. //! That is, if element has one or more child data nodes and a value, the value will be ignored. //! Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements. //!

//! See xml_document::parse() function. const int parse_no_element_values = 0x2; //! Parse flag instructing the parser to not place zero terminators after strings in the source text. //! By default zero terminators are placed, modifying source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_string_terminators = 0x4; //! Parse flag instructing the parser to not translate entities in the source text. //! By default entities are translated, modifying source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_entity_translation = 0x8; //! Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters. //! By default, UTF-8 handling is enabled. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_utf8 = 0x10; //! Parse flag instructing the parser to create XML declaration node. //! By default, declaration node is not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_declaration_node = 0x20; //! Parse flag instructing the parser to create comments nodes. //! By default, comment nodes are not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_comment_nodes = 0x40; //! Parse flag instructing the parser to create DOCTYPE node. //! By default, doctype node is not created. //! Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_doctype_node = 0x80; //! Parse flag instructing the parser to create PI nodes. //! By default, PI nodes are not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_pi_nodes = 0x100; //! Parse flag instructing the parser to validate closing tag names. //! If not set, name inside closing tag is irrelevant to the parser. //! By default, closing tags are not validated. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_validate_closing_tags = 0x200; //! Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes. //! By default, whitespace is not trimmed. //! This flag does not cause the parser to modify source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_trim_whitespace = 0x400; //! Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character. //! Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag. //! By default, whitespace is not normalized. //! If this flag is specified, source text will be modified. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_normalize_whitespace = 0x800; // Compound flags //! Parse flags which represent default behaviour of the parser. //! This is always equal to 0, so that all other flags can be simply ored together. //! Normally there is no need to inconveniently disable flags by anding with their negated (~) values. //! This also means that meaning of each flag is a negation of the default setting. //! For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is enabled by default, //! and using the flag will disable it. //!

//! See xml_document::parse() function. const int parse_default = 0; //! A combination of parse flags that forbids any modifications of the source text. //! This also results in faster parsing. However, note that the following will occur: //!
    //!
  • names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends
  • //!
  • entities will not be translated
  • //!
  • whitespace will not be normalized
  • //!
//! See xml_document::parse() function. const int parse_non_destructive = parse_no_string_terminators | parse_no_entity_translation; //! A combination of parse flags resulting in fastest possible parsing, without sacrificing important data. //!

//! See xml_document::parse() function. const int parse_fastest = parse_non_destructive | parse_no_data_nodes; //! A combination of parse flags resulting in largest amount of data being extracted. //! This usually results in slowest parsing. //!

//! See xml_document::parse() function. const int parse_full = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags; /////////////////////////////////////////////////////////////////////// // Internals //! \cond internal namespace internal { // Struct that contains lookup tables for the parser // It must be a template to allow correct linking (because it has static data members, which are defined in a header file). template struct lookup_tables { static const unsigned char lookup_whitespace[256]; // Whitespace table static const unsigned char lookup_node_name[256]; // Node name table static const unsigned char lookup_text[256]; // Text table static const unsigned char lookup_text_pure_no_ws[256]; // Text table static const unsigned char lookup_text_pure_with_ws[256]; // Text table static const unsigned char lookup_attribute_name[256]; // Attribute name table static const unsigned char lookup_attribute_data_1[256]; // Attribute data table with single quote static const unsigned char lookup_attribute_data_1_pure[256]; // Attribute data table with single quote static const unsigned char lookup_attribute_data_2[256]; // Attribute data table with double quotes static const unsigned char lookup_attribute_data_2_pure[256]; // Attribute data table with double quotes static const unsigned char lookup_digits[256]; // Digits static const unsigned char lookup_upcase[256]; // To uppercase conversion table for ASCII characters }; // Find length of the string template inline std::size_t measure(const Ch *p) { const Ch *tmp = p; while (*tmp) ++tmp; return tmp - p; } // Compare strings for equality template inline bool compare(const Ch *p1, std::size_t size1, const Ch *p2, std::size_t size2, bool case_sensitive) { if (size1 != size2) return false; if (case_sensitive) { for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) if (*p1 != *p2) return false; } else { for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) if (lookup_tables<0>::lookup_upcase[static_cast(*p1)] != lookup_tables<0>::lookup_upcase[static_cast(*p2)]) return false; } return true; } } //! \endcond /////////////////////////////////////////////////////////////////////// // Memory pool //! This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation. //! In most cases, you will not need to use this class directly. //! However, if you need to create nodes manually or modify names/values of nodes, //! you are encouraged to use memory_pool of relevant xml_document to allocate the memory. //! Not only is this faster than allocating them by using new operator, //! but also their lifetime will be tied to the lifetime of document, //! possibly simplyfing memory management. //!

//! Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. //! You can also call allocate_string() function to allocate strings. //! Such strings can then be used as names or values of nodes without worrying about their lifetime. //! Note that there is no free() function -- all allocations are freed at once when clear() function is called, //! or when the pool is destroyed. //!

//! It is also possible to create a standalone memory_pool, and use it //! to allocate nodes, whose lifetime will not be tied to any document. //!

//! Pool maintains RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. //! Until static memory is exhausted, no dynamic memory allocations are done. //! When static memory is exhausted, pool allocates additional blocks of memory of size RAPIDXML_DYNAMIC_POOL_SIZE each, //! by using global new[] and delete[] operators. //! This behaviour can be changed by setting custom allocation routines. //! Use set_allocator() function to set them. //!

//! Allocations for nodes, attributes and strings are aligned at RAPIDXML_ALIGNMENT bytes. //! This value defaults to the size of pointer on target architecture. //!

//! To obtain absolutely top performance from the parser, //! it is important that all nodes are allocated from a single, contiguous block of memory. //! Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably. //! If required, you can tweak RAPIDXML_STATIC_POOL_SIZE, RAPIDXML_DYNAMIC_POOL_SIZE and RAPIDXML_ALIGNMENT //! to obtain best wasted memory to performance compromise. //! To do it, define their values before rapidxml.hpp file is included. //! \param Ch Character type of created nodes. template class memory_pool { public: //! \cond internal typedef void *(rapidxml_alloc_func)(std::size_t); // Type of user-defined function used to allocate memory typedef void (free_func)(void *); // Type of user-defined function used to free memory //! \endcond //! Constructs empty pool with default allocator functions. memory_pool() : m_rapidxml_alloc_func(0) , m_free_func(0) { init(); } //! Destroys pool and frees all the memory. //! This causes memory occupied by nodes allocated by the pool to be freed. //! Nodes allocated from the pool are no longer valid. ~memory_pool() { clear(); } //! Allocates a new node from the pool, and optionally assigns name and value to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param type Type of node to create. //! \param name Name to assign to the node, or 0 to assign no name. //! \param value Value to assign to the node, or 0 to assign no value. //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. //! \return Pointer to allocated node. This pointer will never be NULL. xml_node *allocate_node(node_type type, const Ch *name = 0, const Ch *value = 0, std::size_t name_size = 0, std::size_t value_size = 0) { void *memory = allocate_aligned(sizeof(xml_node)); xml_node *node = new(memory) xml_node(type); if (name) { if (name_size > 0) node->name(name, name_size); else node->name(name); } if (value) { if (value_size > 0) node->value(value, value_size); else node->value(value); } return node; } //! Allocates a new attribute from the pool, and optionally assigns name and value to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param name Name to assign to the attribute, or 0 to assign no name. //! \param value Value to assign to the attribute, or 0 to assign no value. //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. //! \return Pointer to allocated attribute. This pointer will never be NULL. xml_attribute *allocate_attribute(const Ch *name = 0, const Ch *value = 0, std::size_t name_size = 0, std::size_t value_size = 0) { void *memory = allocate_aligned(sizeof(xml_attribute)); xml_attribute *attribute = new(memory) xml_attribute; if (name) { if (name_size > 0) attribute->name(name, name_size); else attribute->name(name); } if (value) { if (value_size > 0) attribute->value(value, value_size); else attribute->value(value); } return attribute; } //! Allocates a char array of given size from the pool, and optionally copies a given string to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param source String to initialize the allocated memory with, or 0 to not initialize it. //! \param size Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated. //! \return Pointer to allocated char array. This pointer will never be NULL. Ch *allocate_string(const Ch *source = 0, std::size_t size = 0) { assert(source || size); // Either source or size (or both) must be specified if (size == 0) size = internal::measure(source) + 1; Ch *result = static_cast(allocate_aligned(size * sizeof(Ch))); if (source) for (std::size_t i = 0; i < size; ++i) result[i] = source[i]; return result; } //! Clones an xml_node and its hierarchy of child nodes and attributes. //! Nodes and attributes are allocated from this memory pool. //! Names and values are not cloned, they are shared between the clone and the source. //! Result node can be optionally specified as a second parameter, //! in which case its contents will be replaced with cloned source node. //! This is useful when you want to clone entire document. //! \param source Node to clone. //! \param result Node to put results in, or 0 to automatically allocate result node //! \return Pointer to cloned node. This pointer will never be NULL. xml_node *clone_node(const xml_node *source, xml_node *result = 0) { // Prepare result node if (result) { result->remove_all_attributes(); result->remove_all_nodes(); result->type(source->type()); } else result = allocate_node(source->type()); // Clone name and value result->name(source->name(), source->name_size()); result->value(source->value(), source->value_size()); // Clone child nodes and attributes for (xml_node *child = source->first_node(); child; child = child->next_sibling()) result->append_node(clone_node(child)); for (xml_attribute *attr = source->first_attribute(); attr; attr = attr->next_attribute()) result->append_attribute(allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size())); return result; } //! Clears the pool. //! This causes memory occupied by nodes allocated by the pool to be freed. //! Any nodes or strings allocated from the pool will no longer be valid. void clear() { while (m_begin != m_static_memory) { char *previous_begin = reinterpret_cast
(align(m_begin))->previous_begin; if (m_free_func) m_free_func(m_begin); else delete[] m_begin; m_begin = previous_begin; } init(); } //! Sets or resets the user-defined memory allocation functions for the pool. //! This can only be called when no memory is allocated from the pool yet, otherwise results are undefined. //! Allocation function must not return invalid pointer on failure. It should either throw, //! stop the program, or use longjmp() function to pass control to other place of program. //! If it returns invalid pointer, results are undefined. //!

//! User defined allocation functions must have the following forms: //!
//!
void *allocate(std::size_t size); //!
void free(void *pointer); //!

//! \param af Allocation function, or 0 to restore default function //! \param ff Free function, or 0 to restore default function void set_allocator(rapidxml_alloc_func *af, free_func *ff) { assert(m_begin == m_static_memory && m_ptr == align(m_begin)); // Verify that no memory is allocated yet m_rapidxml_alloc_func = af; m_free_func = ff; } private: struct header { char *previous_begin; }; void init() { m_begin = m_static_memory; m_ptr = align(m_begin); m_end = m_static_memory + sizeof(m_static_memory); } char *align(char *ptr) { std::size_t alignment = ((RAPIDXML_ALIGNMENT - (std::size_t(ptr) & (RAPIDXML_ALIGNMENT - 1))) & (RAPIDXML_ALIGNMENT - 1)); return ptr + alignment; } char *allocate_raw(std::size_t size) { // Allocate void *memory; if (m_rapidxml_alloc_func) // Allocate memory using either user-specified allocation function or global operator new[] { memory = m_rapidxml_alloc_func(size); assert(memory); // Allocator is not allowed to return 0, on failure it must either throw, stop the program or use longjmp } else { memory = new char[size]; #ifdef RAPIDXML_NO_EXCEPTIONS if (!memory) // If exceptions are disabled, verify memory allocation, because new will not be able to throw bad_alloc RAPIDXML_PARSE_ERROR("out of memory", 0); #endif } return static_cast(memory); } void *allocate_aligned(std::size_t size) { // Calculate aligned pointer char *result = align(m_ptr); // If not enough memory left in current pool, allocate a new pool if (result + size > m_end) { // Calculate required pool size (may be bigger than RAPIDXML_DYNAMIC_POOL_SIZE) std::size_t pool_size = RAPIDXML_DYNAMIC_POOL_SIZE; if (pool_size < size) pool_size = size; // Allocate std::size_t alloc_size = sizeof(header) + (2 * RAPIDXML_ALIGNMENT - 2) + pool_size; // 2 alignments required in worst case: one for header, one for actual allocation char *raw_memory = allocate_raw(alloc_size); // Setup new pool in allocated memory char *pool = align(raw_memory); header *new_header = reinterpret_cast
(pool); new_header->previous_begin = m_begin; m_begin = raw_memory; m_ptr = pool + sizeof(header); m_end = raw_memory + alloc_size; // Calculate aligned pointer again using new pool result = align(m_ptr); } // Update pool and return aligned pointer m_ptr = result + size; return result; } char *m_begin; // Start of raw memory making up current pool char *m_ptr; // First free byte in current pool char *m_end; // One past last available byte in current pool char m_static_memory[RAPIDXML_STATIC_POOL_SIZE]; // Static raw memory rapidxml_alloc_func *m_rapidxml_alloc_func; // Allocator function, or 0 if default is to be used free_func *m_free_func; // Free function, or 0 if default is to be used }; /////////////////////////////////////////////////////////////////////////// // XML base //! Base class for xml_node and xml_attribute implementing common functions: //! name(), name_size(), value(), value_size() and parent(). //! \param Ch Character type to use template class xml_base { public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction // Construct a base with empty name, value and parent xml_base() : m_name(0) , m_value(0) , m_parent(0) { } /////////////////////////////////////////////////////////////////////////// // Node data access //! Gets name of the node. //! Interpretation of name depends on type of node. //! Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. //!

//! Use name_size() function to determine length of the name. //! \return Name of node, or empty string if node has no name. Ch *name() const { return m_name ? m_name : nullstr(); } //! Gets size of node name, not including terminator character. //! This function works correctly irrespective of whether name is or is not zero terminated. //! \return Size of node name, in characters. std::size_t name_size() const { return m_name ? m_name_size : 0; } //! Gets value of node. //! Interpretation of value depends on type of node. //! Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. //!

//! Use value_size() function to determine length of the value. //! \return Value of node, or empty string if node has no value. Ch *value() const { return m_value ? m_value : nullstr(); } //! Gets size of node value, not including terminator character. //! This function works correctly irrespective of whether value is or is not zero terminated. //! \return Size of node value, in characters. std::size_t value_size() const { return m_value ? m_value_size : 0; } /////////////////////////////////////////////////////////////////////////// // Node modification //! Sets name of node to a non zero-terminated string. //! See \ref ownership_of_strings. //!

//! Note that node does not own its name or value, it only stores a pointer to it. //! It will not delete or otherwise free the pointer on destruction. //! It is reponsibility of the user to properly manage lifetime of the string. //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - //! on destruction of the document the string will be automatically freed. //!

//! Size of name must be specified separately, because name does not have to be zero terminated. //! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated). //! \param name Name of node to set. Does not have to be zero terminated. //! \param size Size of name, in characters. This does not include zero terminator, if one is present. void name(const Ch *name, std::size_t size) { m_name = const_cast(name); m_name_size = size; } //! Sets name of node to a zero-terminated string. //! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t). //! \param name Name of node to set. Must be zero terminated. void name(const Ch *name) { this->name(name, internal::measure(name)); } //! Sets value of node to a non zero-terminated string. //! See \ref ownership_of_strings. //!

//! Note that node does not own its name or value, it only stores a pointer to it. //! It will not delete or otherwise free the pointer on destruction. //! It is reponsibility of the user to properly manage lifetime of the string. //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - //! on destruction of the document the string will be automatically freed. //!

//! Size of value must be specified separately, because it does not have to be zero terminated. //! Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated). //!

//! If an element has a child node of type node_data, it will take precedence over element value when printing. //! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser. //! \param value value of node to set. Does not have to be zero terminated. //! \param size Size of value, in characters. This does not include zero terminator, if one is present. void value(const Ch *value, std::size_t size) { m_value = const_cast(value); m_value_size = size; } //! Sets value of node to a zero-terminated string. //! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t). //! \param value Vame of node to set. Must be zero terminated. void value(const Ch *value) { this->value(value, internal::measure(value)); } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets node parent. //! \return Pointer to parent node, or 0 if there is no parent. xml_node *parent() const { return m_parent; } protected: // Return empty string static Ch *nullstr() { static Ch zero = Ch('\0'); return &zero; } Ch *m_name; // Name of node, or 0 if no name Ch *m_value; // Value of node, or 0 if no value std::size_t m_name_size; // Length of node name, or undefined of no name std::size_t m_value_size; // Length of node value, or undefined if no value xml_node *m_parent; // Pointer to parent node, or 0 if none }; //! Class representing attribute node of XML document. //! Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base). //! Note that after parse, both name and value of attribute will point to interior of source text used for parsing. //! Thus, this text must persist in memory for the lifetime of attribute. //! \param Ch Character type to use. template class xml_attribute: public xml_base { friend class xml_node; public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction //! Constructs an empty attribute with the specified type. //! Consider using memory_pool of appropriate xml_document if allocating attributes manually. xml_attribute() { } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets document of which attribute is a child. //! \return Pointer to document that contains this attribute, or 0 if there is no parent document. xml_document *document() const { if (xml_node *node = this->parent()) { while (node->parent()) node = node->parent(); return node->type() == node_document ? static_cast *>(node) : 0; } else return 0; } //! Gets previous attribute, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return this->m_parent ? m_prev_attribute : 0; } //! Gets next attribute, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *next_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return this->m_parent ? m_next_attribute : 0; } private: xml_attribute *m_prev_attribute; // Pointer to previous sibling of attribute, or 0 if none; only valid if parent is non-zero xml_attribute *m_next_attribute; // Pointer to next sibling of attribute, or 0 if none; only valid if parent is non-zero }; /////////////////////////////////////////////////////////////////////////// // XML node //! Class representing a node of XML document. //! Each node may have associated name and value strings, which are available through name() and value() functions. //! Interpretation of name and value depends on type of the node. //! Type of node can be determined by using type() function. //!

//! Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. //! Thus, this text must persist in the memory for the lifetime of node. //! \param Ch Character type to use. template class xml_node: public xml_base { public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction //! Constructs an empty node with the specified type. //! Consider using memory_pool of appropriate document to allocate nodes manually. //! \param type Type of node to construct. xml_node(node_type type) : m_type(type) , m_first_node(0) , m_first_attribute(0) { } /////////////////////////////////////////////////////////////////////////// // Node data access //! Gets type of node. //! \return Type of node. node_type type() const { return m_type; } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets document of which node is a child. //! \return Pointer to document that contains this node, or 0 if there is no parent document. xml_document *document() const { xml_node *node = const_cast *>(this); while (node->parent()) node = node->parent(); return node->type() == node_document ? static_cast *>(node) : 0; } //! Gets first child node, optionally matching node name. //! \param name Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found child, or 0 if not found. xml_node *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *child = m_first_node; child; child = child->next_sibling()) if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) return child; return 0; } else return m_first_node; } //! Gets last child node, optionally matching node name. //! Behaviour is undefined if node has no children. //! Use first_node() to test if node has children. //! \param name Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found child, or 0 if not found. xml_node *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(m_first_node); // Cannot query for last child if node has no children if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *child = m_last_node; child; child = child->previous_sibling()) if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) return child; return 0; } else return m_last_node; } //! Gets previous sibling node, optionally matching node name. //! Behaviour is undefined if node has no parent. //! Use parent() to test if node has a parent. //! \param name Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found sibling, or 0 if not found. xml_node *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(this->m_parent); // Cannot query for siblings if node has no parent if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling) if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) return sibling; return 0; } else return m_prev_sibling; } //! Gets next sibling node, optionally matching node name. //! Behaviour is undefined if node has no parent. //! Use parent() to test if node has a parent. //! \param name Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found sibling, or 0 if not found. xml_node *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(this->m_parent); // Cannot query for siblings if node has no parent if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling) if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) return sibling; return 0; } else return m_next_sibling; } //! Gets first attribute of node, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return m_first_attribute; } //! Gets last attribute of node, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return m_first_attribute ? m_last_attribute : 0; } /////////////////////////////////////////////////////////////////////////// // Node modification //! Sets type of node. //! \param type Type of node to set. void type(node_type type) { m_type = type; } /////////////////////////////////////////////////////////////////////////// // Node manipulation //! Prepends a new child node. //! The prepended child becomes the first child, and all existing children are moved one position back. //! \param child Node to prepend. void prepend_node(xml_node *child) { assert(child && !child->parent() && child->type() != node_document); if (first_node()) { child->m_next_sibling = m_first_node; m_first_node->m_prev_sibling = child; } else { child->m_next_sibling = 0; m_last_node = child; } m_first_node = child; child->m_parent = this; child->m_prev_sibling = 0; } //! Appends a new child node. //! The appended child becomes the last child. //! \param child Node to append. void append_node(xml_node *child) { assert(child && !child->parent() && child->type() != node_document); if (first_node()) { child->m_prev_sibling = m_last_node; m_last_node->m_next_sibling = child; } else { child->m_prev_sibling = 0; m_first_node = child; } m_last_node = child; child->m_parent = this; child->m_next_sibling = 0; } //! Inserts a new child node at specified place inside the node. //! All children after and including the specified node are moved one position back. //! \param where Place where to insert the child, or 0 to insert at the back. //! \param child Node to insert. void insert_node(xml_node *where, xml_node *child) { assert(!where || where->parent() == this); assert(child && !child->parent() && child->type() != node_document); if (where == m_first_node) prepend_node(child); else if (where == 0) append_node(child); else { child->m_prev_sibling = where->m_prev_sibling; child->m_next_sibling = where; where->m_prev_sibling->m_next_sibling = child; where->m_prev_sibling = child; child->m_parent = this; } } //! Removes first child node. //! If node has no children, behaviour is undefined. //! Use first_node() to test if node has children. void remove_first_node() { assert(first_node()); xml_node *child = m_first_node; m_first_node = child->m_next_sibling; if (child->m_next_sibling) child->m_next_sibling->m_prev_sibling = 0; else m_last_node = 0; child->m_parent = 0; } //! Removes last child of the node. //! If node has no children, behaviour is undefined. //! Use first_node() to test if node has children. void remove_last_node() { assert(first_node()); xml_node *child = m_last_node; if (child->m_prev_sibling) { m_last_node = child->m_prev_sibling; child->m_prev_sibling->m_next_sibling = 0; } else m_first_node = 0; child->m_parent = 0; } //! Removes specified child from the node // \param where Pointer to child to be removed. void remove_node(xml_node *where) { assert(where && where->parent() == this); assert(first_node()); if (where == m_first_node) remove_first_node(); else if (where == m_last_node) remove_last_node(); else { where->m_prev_sibling->m_next_sibling = where->m_next_sibling; where->m_next_sibling->m_prev_sibling = where->m_prev_sibling; where->m_parent = 0; } } //! Removes all child nodes (but not attributes). void remove_all_nodes() { for (xml_node *node = first_node(); node; node = node->m_next_sibling) node->m_parent = 0; m_first_node = 0; } //! Prepends a new attribute to the node. //! \param attribute Attribute to prepend. void prepend_attribute(xml_attribute *attribute) { assert(attribute && !attribute->parent()); if (first_attribute()) { attribute->m_next_attribute = m_first_attribute; m_first_attribute->m_prev_attribute = attribute; } else { attribute->m_next_attribute = 0; m_last_attribute = attribute; } m_first_attribute = attribute; attribute->m_parent = this; attribute->m_prev_attribute = 0; } //! Appends a new attribute to the node. //! \param attribute Attribute to append. void append_attribute(xml_attribute *attribute) { assert(attribute && !attribute->parent()); if (first_attribute()) { attribute->m_prev_attribute = m_last_attribute; m_last_attribute->m_next_attribute = attribute; } else { attribute->m_prev_attribute = 0; m_first_attribute = attribute; } m_last_attribute = attribute; attribute->m_parent = this; attribute->m_next_attribute = 0; } //! Inserts a new attribute at specified place inside the node. //! All attributes after and including the specified attribute are moved one position back. //! \param where Place where to insert the attribute, or 0 to insert at the back. //! \param attribute Attribute to insert. void insert_attribute(xml_attribute *where, xml_attribute *attribute) { assert(!where || where->parent() == this); assert(attribute && !attribute->parent()); if (where == m_first_attribute) prepend_attribute(attribute); else if (where == 0) append_attribute(attribute); else { attribute->m_prev_attribute = where->m_prev_attribute; attribute->m_next_attribute = where; where->m_prev_attribute->m_next_attribute = attribute; where->m_prev_attribute = attribute; attribute->m_parent = this; } } //! Removes first attribute of the node. //! If node has no attributes, behaviour is undefined. //! Use first_attribute() to test if node has attributes. void remove_first_attribute() { assert(first_attribute()); xml_attribute *attribute = m_first_attribute; if (attribute->m_next_attribute) { attribute->m_next_attribute->m_prev_attribute = 0; } else m_last_attribute = 0; attribute->m_parent = 0; m_first_attribute = attribute->m_next_attribute; } //! Removes last attribute of the node. //! If node has no attributes, behaviour is undefined. //! Use first_attribute() to test if node has attributes. void remove_last_attribute() { assert(first_attribute()); xml_attribute *attribute = m_last_attribute; if (attribute->m_prev_attribute) { attribute->m_prev_attribute->m_next_attribute = 0; m_last_attribute = attribute->m_prev_attribute; } else m_first_attribute = 0; attribute->m_parent = 0; } //! Removes specified attribute from node. //! \param where Pointer to attribute to be removed. void remove_attribute(xml_attribute *where) { assert(first_attribute() && where->parent() == this); if (where == m_first_attribute) remove_first_attribute(); else if (where == m_last_attribute) remove_last_attribute(); else { where->m_prev_attribute->m_next_attribute = where->m_next_attribute; where->m_next_attribute->m_prev_attribute = where->m_prev_attribute; where->m_parent = 0; } } //! Removes all attributes of node. void remove_all_attributes() { for (xml_attribute *attribute = first_attribute(); attribute; attribute = attribute->m_next_attribute) attribute->m_parent = 0; m_first_attribute = 0; } private: /////////////////////////////////////////////////////////////////////////// // Restrictions // No copying xml_node(const xml_node &); void operator =(const xml_node &); /////////////////////////////////////////////////////////////////////////// // Data members // Note that some of the pointers below have UNDEFINED values if certain other pointers are 0. // This is required for maximum performance, as it allows the parser to omit initialization of // unneded/redundant values. // // The rules are as follows: // 1. first_node and first_attribute contain valid pointers, or 0 if node has no children/attributes respectively // 2. last_node and last_attribute are valid only if node has at least one child/attribute respectively, otherwise they contain garbage // 3. prev_sibling and next_sibling are valid only if node has a parent, otherwise they contain garbage node_type m_type; // Type of node; always valid xml_node *m_first_node; // Pointer to first child node, or 0 if none; always valid xml_node *m_last_node; // Pointer to last child node, or 0 if none; this value is only valid if m_first_node is non-zero xml_attribute *m_first_attribute; // Pointer to first attribute of node, or 0 if none; always valid xml_attribute *m_last_attribute; // Pointer to last attribute of node, or 0 if none; this value is only valid if m_first_attribute is non-zero xml_node *m_prev_sibling; // Pointer to previous sibling of node, or 0 if none; this value is only valid if m_parent is non-zero xml_node *m_next_sibling; // Pointer to next sibling of node, or 0 if none; this value is only valid if m_parent is non-zero }; /////////////////////////////////////////////////////////////////////////// // XML document //! This class represents root of the DOM hierarchy. //! It is also an xml_node and a memory_pool through public inheritance. //! Use parse() function to build a DOM tree from a zero-terminated XML text string. //! parse() function allocates memory for nodes and attributes by using functions of xml_document, //! which are inherited from memory_pool. //! To access root node of the document, use the document itself, as if it was an xml_node. //! \param Ch Character type to use. template class xml_document: public xml_node, public memory_pool { public: //! Constructs empty XML document xml_document() : xml_node(node_document) { } //! Parses zero-terminated XML string according to given flags. //! Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. //! The string must persist for the lifetime of the document. //! In case of error, rapidxml::parse_error exception will be thrown. //!

//! If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. //! Make sure that data is zero-terminated. //!

//! Document can be parsed into multiple times. //! Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool. //! \param text XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser. template void parse(Ch *text) { assert(text); // Remove current contents this->remove_all_nodes(); this->remove_all_attributes(); // Parse BOM, if any parse_bom(text); // Parse children while (1) { // Skip whitespace before node skip(text); if (*text == 0) break; // Parse and append new child if (*text == Ch('<')) { ++text; // Skip '<' if (xml_node *node = parse_node(text)) this->append_node(node); } else RAPIDXML_PARSE_ERROR("expected <", text); } } //! Clears the document by deleting all nodes and clearing the memory pool. //! All nodes owned by document pool are destroyed. void clear() { this->remove_all_nodes(); this->remove_all_attributes(); memory_pool::clear(); } private: /////////////////////////////////////////////////////////////////////// // Internal character utility functions // Detect whitespace character struct whitespace_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_whitespace[static_cast(ch)]; } }; // Detect node name character struct node_name_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_node_name[static_cast(ch)]; } }; // Detect attribute name character struct attribute_name_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_attribute_name[static_cast(ch)]; } }; // Detect text character (PCDATA) struct text_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text[static_cast(ch)]; } }; // Detect text character (PCDATA) that does not require processing struct text_pure_no_ws_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text_pure_no_ws[static_cast(ch)]; } }; // Detect text character (PCDATA) that does not require processing struct text_pure_with_ws_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text_pure_with_ws[static_cast(ch)]; } }; // Detect attribute value character template struct attribute_value_pred { static unsigned char test(Ch ch) { if (Quote == Ch('\'')) return internal::lookup_tables<0>::lookup_attribute_data_1[static_cast(ch)]; if (Quote == Ch('\"')) return internal::lookup_tables<0>::lookup_attribute_data_2[static_cast(ch)]; return 0; // Should never be executed, to avoid warnings on Comeau } }; // Detect attribute value character template struct attribute_value_pure_pred { static unsigned char test(Ch ch) { if (Quote == Ch('\'')) return internal::lookup_tables<0>::lookup_attribute_data_1_pure[static_cast(ch)]; if (Quote == Ch('\"')) return internal::lookup_tables<0>::lookup_attribute_data_2_pure[static_cast(ch)]; return 0; // Should never be executed, to avoid warnings on Comeau } }; // Insert coded character, using UTF8 or 8-bit ASCII template static void insert_coded_character(Ch *&text, unsigned long code) { if (Flags & parse_no_utf8) { // Insert 8-bit ASCII character // Todo: possibly verify that code is less than 256 and use replacement char otherwise? text[0] = static_cast(code); text += 1; } else { // Insert UTF8 sequence if (code < 0x80) // 1 byte sequence { text[0] = static_cast(code); text += 1; } else if (code < 0x800) // 2 byte sequence { text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xC0); text += 2; } else if (code < 0x10000) // 3 byte sequence { text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xE0); text += 3; } else if (code < 0x110000) // 4 byte sequence { text[3] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xF0); text += 4; } else // Invalid, only codes up to 0x10FFFF are allowed in Unicode { RAPIDXML_PARSE_ERROR("invalid numeric character entity", text); } } } // Skip characters until predicate evaluates to true template static void skip(Ch *&text) { Ch *tmp = text; while (StopPred::test(*tmp)) ++tmp; text = tmp; } // Skip characters until predicate evaluates to true while doing the following: // - replacing XML character entity references with proper characters (' & " < > &#...;) // - condensing whitespace sequences to single space character template static Ch *skip_and_expand_character_refs(Ch *&text) { // If entity translation, whitespace condense and whitespace trimming is disabled, use plain skip if (Flags & parse_no_entity_translation && !(Flags & parse_normalize_whitespace) && !(Flags & parse_trim_whitespace)) { skip(text); return text; } // Use simple skip until first modification is detected skip(text); // Use translation skip Ch *src = text; Ch *dest = src; while (StopPred::test(*src)) { // If entity translation is enabled if (!(Flags & parse_no_entity_translation)) { // Test if replacement is needed if (src[0] == Ch('&')) { switch (src[1]) { // & ' case Ch('a'): if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';')) { *dest = Ch('&'); ++dest; src += 5; continue; } if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';')) { *dest = Ch('\''); ++dest; src += 6; continue; } break; // " case Ch('q'): if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';')) { *dest = Ch('"'); ++dest; src += 6; continue; } break; // > case Ch('g'): if (src[2] == Ch('t') && src[3] == Ch(';')) { *dest = Ch('>'); ++dest; src += 4; continue; } break; // < case Ch('l'): if (src[2] == Ch('t') && src[3] == Ch(';')) { *dest = Ch('<'); ++dest; src += 4; continue; } break; // &#...; - assumes ASCII case Ch('#'): if (src[2] == Ch('x')) { unsigned long code = 0; src += 3; // Skip &#x while (1) { unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; if (digit == 0xFF) break; code = code * 16 + digit; ++src; } insert_coded_character(dest, code); // Put character in output } else { unsigned long code = 0; src += 2; // Skip &# while (1) { unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; if (digit == 0xFF) break; code = code * 10 + digit; ++src; } insert_coded_character(dest, code); // Put character in output } if (*src == Ch(';')) ++src; else RAPIDXML_PARSE_ERROR("expected ;", src); continue; // Something else default: // Ignore, just copy '&' verbatim break; } } } // If whitespace condensing is enabled if (Flags & parse_normalize_whitespace) { // Test if condensing is needed if (whitespace_pred::test(*src)) { *dest = Ch(' '); ++dest; // Put single space in dest ++src; // Skip first whitespace char // Skip remaining whitespace chars while (whitespace_pred::test(*src)) ++src; continue; } } // No replacement, only copy character *dest++ = *src++; } // Return new end text = src; return dest; } /////////////////////////////////////////////////////////////////////// // Internal parsing functions // Parse BOM, if any template void parse_bom(Ch *&text) { // UTF-8? if (static_cast(text[0]) == 0xEF && static_cast(text[1]) == 0xBB && static_cast(text[2]) == 0xBF) { text += 3; // Skup utf-8 bom } } // Parse XML declaration ( xml_node *parse_xml_declaration(Ch *&text) { // If parsing of declaration is disabled if (!(Flags & parse_declaration_node)) { // Skip until end of declaration while (text[0] != Ch('?') || text[1] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 2; // Skip '?>' return 0; } // Create declaration xml_node *declaration = this->allocate_node(node_declaration); // Skip whitespace before attributes or ?> skip(text); // Parse declaration attributes parse_node_attributes(text, declaration); // Skip ?> if (text[0] != Ch('?') || text[1] != Ch('>')) RAPIDXML_PARSE_ERROR("expected ?>", text); text += 2; return declaration; } // Parse XML comment (' return 0; // Do not produce comment node } // Remember value start Ch *value = text; // Skip until end of comment while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Create comment node xml_node *comment = this->allocate_node(node_comment); comment->value(value, text - value); // Place zero terminator after comment value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 3; // Skip '-->' return comment; } // Parse DOCTYPE template xml_node *parse_doctype(Ch *&text) { // Remember value start Ch *value = text; // Skip to > while (*text != Ch('>')) { // Determine character type switch (*text) { // If '[' encountered, scan for matching ending ']' using naive algorithm with depth // This works for all W3C test files except for 2 most wicked case Ch('['): { ++text; // Skip '[' int depth = 1; while (depth > 0) { switch (*text) { case Ch('['): ++depth; break; case Ch(']'): --depth; break; case 0: RAPIDXML_PARSE_ERROR("unexpected end of data", text); } ++text; } break; } // Error on end of text case Ch('\0'): RAPIDXML_PARSE_ERROR("unexpected end of data", text); // Other character, skip it default: ++text; } } // If DOCTYPE nodes enabled if (Flags & parse_doctype_node) { // Create a new doctype node xml_node *doctype = this->allocate_node(node_doctype); doctype->value(value, text - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 1; // skip '>' return doctype; } else { text += 1; // skip '>' return 0; } } // Parse PI template xml_node *parse_pi(Ch *&text) { // If creation of PI nodes is enabled if (Flags & parse_pi_nodes) { // Create pi node xml_node *pi = this->allocate_node(node_pi); // Extract PI target name Ch *name = text; skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected PI target", text); pi->name(name, text - name); // Skip whitespace between pi target and pi skip(text); // Remember start of pi Ch *value = text; // Skip to '?>' while (text[0] != Ch('?') || text[1] != Ch('>')) { if (*text == Ch('\0')) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Set pi value (verbatim, no entity expansion or whitespace normalization) pi->value(value, text - value); // Place zero terminator after name and value if (!(Flags & parse_no_string_terminators)) { pi->name()[pi->name_size()] = Ch('\0'); pi->value()[pi->value_size()] = Ch('\0'); } text += 2; // Skip '?>' return pi; } else { // Skip to '?>' while (text[0] != Ch('?') || text[1] != Ch('>')) { if (*text == Ch('\0')) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 2; // Skip '?>' return 0; } } // Parse and append data // Return character that ends data. // This is necessary because this character might have been overwritten by a terminating 0 template Ch parse_and_append_data(xml_node *node, Ch *&text, Ch *contents_start) { // Backup to contents start if whitespace trimming is disabled if (!(Flags & parse_trim_whitespace)) text = contents_start; // Skip until end of data Ch *value = text, *end; if (Flags & parse_normalize_whitespace) end = skip_and_expand_character_refs(text); else end = skip_and_expand_character_refs(text); // Trim trailing whitespace if flag is set; leading was already trimmed by whitespace skip after > if (Flags & parse_trim_whitespace) { if (Flags & parse_normalize_whitespace) { // Whitespace is already condensed to single space characters by skipping function, so just trim 1 char off the end if (*(end - 1) == Ch(' ')) --end; } else { // Backup until non-whitespace character is found while (whitespace_pred::test(*(end - 1))) --end; } } // If characters are still left between end and value (this test is only necessary if normalization is enabled) // Create new data node if (!(Flags & parse_no_data_nodes)) { xml_node *data = this->allocate_node(node_data); data->value(value, end - value); node->append_node(data); } // Add data to parent node if no data exists yet if (!(Flags & parse_no_element_values)) if (*node->value() == Ch('\0')) node->value(value, end - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) { Ch ch = *text; *end = Ch('\0'); return ch; // Return character that ends data; this is required because zero terminator overwritten it } // Return character that ends data return *text; } // Parse CDATA template xml_node *parse_cdata(Ch *&text) { // If CDATA is disabled if (Flags & parse_no_data_nodes) { // Skip until end of cdata while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 3; // Skip ]]> return 0; // Do not produce CDATA node } // Skip until end of cdata Ch *value = text; while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Create new cdata node xml_node *cdata = this->allocate_node(node_cdata); cdata->value(value, text - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 3; // Skip ]]> return cdata; } // Parse element node template xml_node *parse_element(Ch *&text) { // Create element node xml_node *element = this->allocate_node(node_element); // Extract element name Ch *name = text; skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected element name", text); element->name(name, text - name); // Skip whitespace between element name and attributes or > skip(text); // Parse attributes, if any parse_node_attributes(text, element); // Determine ending type if (*text == Ch('>')) { ++text; parse_node_contents(text, element); } else if (*text == Ch('/')) { ++text; if (*text != Ch('>')) RAPIDXML_PARSE_ERROR("expected >", text); ++text; } else RAPIDXML_PARSE_ERROR("expected >", text); // Place zero terminator after name if (!(Flags & parse_no_string_terminators)) element->name()[element->name_size()] = Ch('\0'); // Return parsed element return element; } // Determine node type, and parse it template xml_node *parse_node(Ch *&text) { // Parse proper node type switch (text[0]) { // <... default: // Parse and append element node return parse_element(text); // (text); } else { // Parse PI return parse_pi(text); } // (text); } break; // (text); } break; // (text); } } // switch // Attempt to skip other, unrecognized node types starting with ')) { if (*text == 0) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } ++text; // Skip '>' return 0; // No node recognized } } // Parse contents of the node - children, data etc. template void parse_node_contents(Ch *&text, xml_node *node) { // For all children and text while (1) { // Skip whitespace between > and node contents Ch *contents_start = text; // Store start of node contents before whitespace is skipped skip(text); Ch next_char = *text; // After data nodes, instead of continuing the loop, control jumps here. // This is because zero termination inside parse_and_append_data() function // would wreak havoc with the above code. // Also, skipping whitespace after data nodes is unnecessary. after_data_node: // Determine what comes next: node closing, child node, data node, or 0? switch (next_char) { // Node closing or child node case Ch('<'): if (text[1] == Ch('/')) { // Node closing text += 2; // Skip '(text); if (!internal::compare(node->name(), node->name_size(), closing_name, text - closing_name, true)) RAPIDXML_PARSE_ERROR("invalid closing tag name", text); } else { // No validation, just skip name skip(text); } // Skip remaining whitespace after node name skip(text); if (*text != Ch('>')) RAPIDXML_PARSE_ERROR("expected >", text); ++text; // Skip '>' return; // Node closed, finished parsing contents } else { // Child node ++text; // Skip '<' if (xml_node *child = parse_node(text)) node->append_node(child); } break; // End of data - error case Ch('\0'): RAPIDXML_PARSE_ERROR("unexpected end of data", text); // Data node default: next_char = parse_and_append_data(node, text, contents_start); goto after_data_node; // Bypass regular processing after data nodes } } } // Parse XML attributes of the node template void parse_node_attributes(Ch *&text, xml_node *node) { // For all attributes while (attribute_name_pred::test(*text)) { // Extract attribute name Ch *name = text; ++text; // Skip first character of attribute name skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected attribute name", name); // Create new attribute xml_attribute *attribute = this->allocate_attribute(); attribute->name(name, text - name); node->append_attribute(attribute); // Skip whitespace after attribute name skip(text); // Skip = if (*text != Ch('=')) RAPIDXML_PARSE_ERROR("expected =", text); ++text; // Add terminating zero after name if (!(Flags & parse_no_string_terminators)) attribute->name()[attribute->name_size()] = 0; // Skip whitespace after = skip(text); // Skip quote and remember if it was ' or " Ch quote = *text; if (quote != Ch('\'') && quote != Ch('"')) RAPIDXML_PARSE_ERROR("expected ' or \"", text); ++text; // Extract attribute value and expand char refs in it Ch *value = text, *end; const int AttFlags = Flags & ~parse_normalize_whitespace; // No whitespace normalization in attributes if (quote == Ch('\'')) end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text); else end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text); // Set attribute value attribute->value(value, end - value); // Make sure that end quote is present if (*text != quote) RAPIDXML_PARSE_ERROR("expected ' or \"", text); ++text; // Skip quote // Add terminating zero after value if (!(Flags & parse_no_string_terminators)) attribute->value()[attribute->value_size()] = 0; // Skip whitespace after attribute value skip(text); } } }; //! \cond internal namespace internal { // Whitespace (space \n \r \t) template const unsigned char lookup_tables::lookup_whitespace[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 5 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 7 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // F }; // Node name (anything but space \n \r \t / > ? \0) template const unsigned char lookup_tables::lookup_node_name[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) (anything but < \0) template const unsigned char lookup_tables::lookup_text[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) that does not require processing when ws normalization is disabled // (anything but < \0 &) template const unsigned char lookup_tables::lookup_text_pure_no_ws[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) that does not require processing when ws normalizationis is enabled // (anything but < \0 & space \n \r \t) template const unsigned char lookup_tables::lookup_text_pure_with_ws[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute name (anything but space \n \r \t / < > = ? ! \0) template const unsigned char lookup_tables::lookup_attribute_name[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with single quote (anything but ' \0) template const unsigned char lookup_tables::lookup_attribute_data_1[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with single quote that does not require processing (anything but ' \0 &) template const unsigned char lookup_tables::lookup_attribute_data_1_pure[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with double quote (anything but " \0) template const unsigned char lookup_tables::lookup_attribute_data_2[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with double quote that does not require processing (anything but " \0 &) template const unsigned char lookup_tables::lookup_attribute_data_2_pure[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Digits (dec and hex, 255 denotes end of numeric character reference) template const unsigned char lookup_tables::lookup_digits[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 1 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, // 3 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 4 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 5 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 6 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 7 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 8 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 9 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // A 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // B 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // C 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // D 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // E 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 // F }; // Upper case conversion template const unsigned char lookup_tables::lookup_upcase[256] = { // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A B C D E F 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // 0 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, // 1 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, // 2 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, // 3 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 4 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, // 5 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 6 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127, // 7 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 8 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 9 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // A 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // B 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // C 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // D 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // E 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // F }; } //! \endcond } // Undefine internal macros #undef RAPIDXML_PARSE_ERROR // On MSVC, restore warnings state #ifdef _MSC_VER #pragma warning(pop) #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/rapidxml/rapidxml_iterators.hpp ================================================ #ifndef RAPIDXML_ITERATORS_HPP_INCLUDED #define RAPIDXML_ITERATORS_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_iterators.hpp This file contains rapidxml iterators #include "rapidxml.hpp" namespace rapidxml { //! Iterator of child nodes of xml_node template class node_iterator { public: typedef typename xml_node value_type; typedef typename xml_node &reference; typedef typename xml_node *pointer; typedef std::ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; node_iterator() : m_node(0) { } node_iterator(xml_node *node) : m_node(node->first_node()) { } reference operator *() const { assert(m_node); return *m_node; } pointer operator->() const { assert(m_node); return m_node; } node_iterator& operator++() { assert(m_node); m_node = m_node->next_sibling(); return *this; } node_iterator operator++(int) { node_iterator tmp = *this; ++this; return tmp; } node_iterator& operator--() { assert(m_node && m_node->previous_sibling()); m_node = m_node->previous_sibling(); return *this; } node_iterator operator--(int) { node_iterator tmp = *this; ++this; return tmp; } bool operator ==(const node_iterator &rhs) { return m_node == rhs.m_node; } bool operator !=(const node_iterator &rhs) { return m_node != rhs.m_node; } private: xml_node *m_node; }; //! Iterator of child attributes of xml_node template class attribute_iterator { public: typedef typename xml_attribute value_type; typedef typename xml_attribute &reference; typedef typename xml_attribute *pointer; typedef std::ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; attribute_iterator() : m_attribute(0) { } attribute_iterator(xml_node *node) : m_attribute(node->first_attribute()) { } reference operator *() const { assert(m_attribute); return *m_attribute; } pointer operator->() const { assert(m_attribute); return m_attribute; } attribute_iterator& operator++() { assert(m_attribute); m_attribute = m_attribute->next_attribute(); return *this; } attribute_iterator operator++(int) { attribute_iterator tmp = *this; ++this; return tmp; } attribute_iterator& operator--() { assert(m_attribute && m_attribute->previous_attribute()); m_attribute = m_attribute->previous_attribute(); return *this; } attribute_iterator operator--(int) { attribute_iterator tmp = *this; ++this; return tmp; } bool operator ==(const attribute_iterator &rhs) { return m_attribute == rhs.m_attribute; } bool operator !=(const attribute_iterator &rhs) { return m_attribute != rhs.m_attribute; } private: xml_attribute *m_attribute; }; } #endif ================================================ FILE: Libraries/Core/RPi/Headers/rapidxml/rapidxml_print.hpp ================================================ #ifndef RAPIDXML_PRINT_HPP_INCLUDED #define RAPIDXML_PRINT_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_print.hpp This file contains rapidxml printer implementation #include "rapidxml.hpp" // Only include streams if not disabled #ifndef RAPIDXML_NO_STREAMS #include #include #endif namespace rapidxml { /////////////////////////////////////////////////////////////////////// // Printing flags const int print_no_indenting = 0x1; //!< Printer flag instructing the printer to suppress indenting of XML. See print() function. /////////////////////////////////////////////////////////////////////// // Internal //! \cond internal namespace internal { /////////////////////////////////////////////////////////////////////////// // Function declarations template inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out); template inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out); template inline OutIt fill_chars(OutIt out, int n, Ch ch); template inline bool find_char(const Ch *begin, const Ch *end); template inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_attributes(OutIt out, const xml_node *node, int flags); template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent); /////////////////////////////////////////////////////////////////////////// // Internal character operations // Copy characters from given range to given output iterator template inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out) { while (begin != end) *out++ = *begin++; return out; } // Copy characters from given range to given output iterator and expand // characters into references (< > ' " &) template inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out) { while (begin != end) { if (*begin == noexpand) { *out++ = *begin; // No expansion, copy character } else { switch (*begin) { case Ch('<'): *out++ = Ch('&'); *out++ = Ch('l'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('>'): *out++ = Ch('&'); *out++ = Ch('g'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('\''): *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('p'); *out++ = Ch('o'); *out++ = Ch('s'); *out++ = Ch(';'); break; case Ch('"'): *out++ = Ch('&'); *out++ = Ch('q'); *out++ = Ch('u'); *out++ = Ch('o'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('&'): *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('m'); *out++ = Ch('p'); *out++ = Ch(';'); break; default: *out++ = *begin; // No expansion, copy character } } ++begin; // Step to next character } return out; } // Fill given output iterator with repetitions of the same character template inline OutIt fill_chars(OutIt out, int n, Ch ch) { for (int i = 0; i < n; ++i) *out++ = ch; return out; } // Find character template inline bool find_char(const Ch *begin, const Ch *end) { while (begin != end) if (*begin++ == ch) return true; return false; } /////////////////////////////////////////////////////////////////////////// // Internal printing operations // Print node template inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) { // Print proper node type switch (node->type()) { // Document case node_document: out = print_children(out, node, flags, indent); break; // Element case node_element: out = print_element_node(out, node, flags, indent); break; // Data case node_data: out = print_data_node(out, node, flags, indent); break; // CDATA case node_cdata: out = print_cdata_node(out, node, flags, indent); break; // Declaration case node_declaration: out = print_declaration_node(out, node, flags, indent); break; // Comment case node_comment: out = print_comment_node(out, node, flags, indent); break; // Doctype case node_doctype: out = print_doctype_node(out, node, flags, indent); break; // Pi case node_pi: out = print_pi_node(out, node, flags, indent); break; // Unknown default: assert(0); break; } // If indenting not disabled, add line break after node if (!(flags & print_no_indenting)) *out = Ch('\n'), ++out; // Return modified iterator return out; } // Print children of the node template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent) { for (xml_node *child = node->first_node(); child; child = child->next_sibling()) out = print_node(out, child, flags, indent); return out; } // Print attributes of the node template inline OutIt print_attributes(OutIt out, const xml_node *node, int flags) { for (xml_attribute *attribute = node->first_attribute(); attribute; attribute = attribute->next_attribute()) { if (attribute->name() && attribute->value()) { // Print attribute name *out = Ch(' '), ++out; out = copy_chars(attribute->name(), attribute->name() + attribute->name_size(), out); *out = Ch('='), ++out; // Print attribute value using appropriate quote type if (find_char(attribute->value(), attribute->value() + attribute->value_size())) { *out = Ch('\''), ++out; out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('"'), out); *out = Ch('\''), ++out; } else { *out = Ch('"'), ++out; out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('\''), out); *out = Ch('"'), ++out; } } } return out; } // Print data node template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_data); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); return out; } // Print data node template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_cdata); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'); ++out; *out = Ch('!'); ++out; *out = Ch('['); ++out; *out = Ch('C'); ++out; *out = Ch('D'); ++out; *out = Ch('A'); ++out; *out = Ch('T'); ++out; *out = Ch('A'); ++out; *out = Ch('['); ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch(']'); ++out; *out = Ch(']'); ++out; *out = Ch('>'); ++out; return out; } // Print element node template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_element); // Print element name and attributes, if any if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); out = print_attributes(out, node, flags); // If node is childless if (node->value_size() == 0 && !node->first_node()) { // Print childless node tag ending *out = Ch('/'), ++out; *out = Ch('>'), ++out; } else { // Print normal node tag ending *out = Ch('>'), ++out; // Test if node contains a single data node only (and no other nodes) xml_node *child = node->first_node(); if (!child) { // If node has no children, only print its value without indenting out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); } else if (child->next_sibling() == 0 && child->type() == node_data) { // If node has a sole data child, only print its value without indenting out = copy_and_expand_chars(child->value(), child->value() + child->value_size(), Ch(0), out); } else { // Print all children with full indenting if (!(flags & print_no_indenting)) *out = Ch('\n'), ++out; out = print_children(out, node, flags, indent + 1); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); } // Print node end *out = Ch('<'), ++out; *out = Ch('/'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); *out = Ch('>'), ++out; } return out; } // Print declaration node template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent) { // Print declaration start if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('?'), ++out; *out = Ch('x'), ++out; *out = Ch('m'), ++out; *out = Ch('l'), ++out; // Print attributes out = print_attributes(out, node, flags); // Print declaration end *out = Ch('?'), ++out; *out = Ch('>'), ++out; return out; } // Print comment node template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_comment); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('!'), ++out; *out = Ch('-'), ++out; *out = Ch('-'), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('-'), ++out; *out = Ch('-'), ++out; *out = Ch('>'), ++out; return out; } // Print doctype node template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_doctype); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('!'), ++out; *out = Ch('D'), ++out; *out = Ch('O'), ++out; *out = Ch('C'), ++out; *out = Ch('T'), ++out; *out = Ch('Y'), ++out; *out = Ch('P'), ++out; *out = Ch('E'), ++out; *out = Ch(' '), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('>'), ++out; return out; } // Print pi node template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_pi); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('?'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); *out = Ch(' '), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('?'), ++out; *out = Ch('>'), ++out; return out; } } //! \endcond /////////////////////////////////////////////////////////////////////////// // Printing //! Prints XML to given output iterator. //! \param out Output iterator to print to. //! \param node Node to be printed. Pass xml_document to print entire document. //! \param flags Flags controlling how XML is printed. //! \return Output iterator pointing to position immediately after last character of printed text. template inline OutIt print(OutIt out, const xml_node &node, int flags = 0) { return internal::print_node(out, &node, flags, 0); } #ifndef RAPIDXML_NO_STREAMS //! Prints XML to given output stream. //! \param out Output stream to print to. //! \param node Node to be printed. Pass xml_document to print entire document. //! \param flags Flags controlling how XML is printed. //! \return Output stream. template inline std::basic_ostream &print(std::basic_ostream &out, const xml_node &node, int flags = 0) { print(std::ostream_iterator(out), node, flags); return out; } //! Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process. //! \param out Output stream to print to. //! \param node Node to be printed. //! \return Output stream. template inline std::basic_ostream &operator <<(std::basic_ostream &out, const xml_node &node) { return print(out, node); } #endif } #endif ================================================ FILE: Libraries/Core/RPi/Headers/rapidxml/rapidxml_utils.hpp ================================================ #ifndef RAPIDXML_UTILS_HPP_INCLUDED #define RAPIDXML_UTILS_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_utils.hpp This file contains high-level rapidxml utilities that can be useful //! in certain simple scenarios. They should probably not be used if maximizing performance is the main objective. #include "rapidxml.hpp" #include #include #include #include namespace rapidxml { //! Represents data loaded from a file template class file { public: //! Loads file into the memory. Data will be automatically destroyed by the destructor. //! \param filename Filename to load. file(const char *filename) { using namespace std; // Open stream basic_ifstream stream(filename, ios::binary); if (!stream) throw runtime_error(string("cannot open file ") + filename); stream.unsetf(ios::skipws); // Determine stream size stream.seekg(0, ios::end); size_t size = stream.tellg(); stream.seekg(0); // Load data and add terminating 0 m_data.resize(size + 1); stream.read(&m_data.front(), static_cast(size)); m_data[size] = 0; } //! Loads file into the memory. Data will be automatically destroyed by the destructor //! \param stream Stream to load from file(std::basic_istream &stream) { using namespace std; // Load data and add terminating 0 stream.unsetf(ios::skipws); m_data.assign(istreambuf_iterator(stream), istreambuf_iterator()); if (stream.fail() || stream.bad()) throw runtime_error("error reading stream"); m_data.push_back(0); } //! Gets file data. //! \return Pointer to data of file. Ch *data() { return &m_data.front(); } //! Gets file data. //! \return Pointer to data of file. const Ch *data() const { return &m_data.front(); } //! Gets file data size. //! \return Size of file data, in characters. std::size_t size() const { return m_data.size(); } private: std::vector m_data; // File data }; //! Counts children of node. Time complexity is O(n). //! \return Number of children of node template inline std::size_t count_children(xml_node *node) { xml_node *child = node->first_node(); std::size_t count = 0; while (child) { ++count; child = child->next_sibling(); } return count; } //! Counts attributes of node. Time complexity is O(n). //! \return Number of attributes of node template inline std::size_t count_attributes(xml_node *node) { xml_attribute *attr = node->first_attribute(); std::size_t count = 0; while (attr) { ++count; attr = attr->next_attribute(); } return count; } } #endif ================================================ FILE: Libraries/Core/RPi/Headers/vcinclude/common.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __VC_INCLUDE_COMMON_H__ #define __VC_INCLUDE_COMMON_H__ #include "interface/vcos/vcos_stdint.h" #include "interface/vctypes/vc_image_types.h" #if defined(__HIGHC__) && defined(_VIDEOCORE) && !defined(_I386) // __HIGHC__ is only available with MW // The scvc plugins are compiled (bizarrely) on an x86 with _VIDEOCORE set! #include #endif #ifdef __COVERITY__ #ifndef _Rarely #define _Rarely(x) (x) #endif #ifndef _Usually #define _Usually(x) (x) #endif #endif #ifdef __cplusplus extern "C" { #endif #ifdef __SYMBIAN32__ # ifndef INLINE # define INLINE __inline # endif /* Align a pointer/integer by rounding up/down */ #define ALIGN_DOWN(p, n) ((uint32_t)(p) - ( (uint32_t)(p) % (uint32_t)(n) )) #define ALIGN_UP(p, n) ALIGN_DOWN((uint32_t)(p) + (uint32_t)(n) - 1, (n)) #elif defined (VCMODS_LCC) #include #elif !defined(__KERNEL__) #include #endif /*}}}*/ /* Fixed-point types */ typedef unsigned short uint8p8_t; typedef signed short sint8p8_t; typedef unsigned short uint4p12_t; typedef signed short sint4p12_t; typedef signed short sint0p16_t; typedef signed char sint8p0_t; typedef unsigned char uint0p8_t; typedef signed long int24p8_t; /*{{{ Common typedefs */ typedef enum bool_e { VC_FALSE = 0, VC_TRUE = 1, } VC_BOOL_T; #ifndef bool_t #define bool_t VC_BOOL_T #endif /*}}}*/ /*{{{ Common macros */ /* Align a pointer/integer by rounding up/down */ #define ALIGN_DOWN(p, n) ((uintptr_t)(p) - ( (uintptr_t)(p) % (uintptr_t)(n) )) #define ALIGN_UP(p, n) ALIGN_DOWN((uintptr_t)(p) + (uintptr_t)(n) - 1, (n)) #define CLIP(lower, n, upper) _min((upper), _max((lower), (n))) /*}}}*/ /*{{{ Debugging and profiling macros */ #if 0 /* There's already an assert_once in */ #ifdef DEBUG #define assert_once(x) \ { \ static uint8_t ignore = 0; \ if(!ignore) \ { \ assert(x); \ ignore++; \ } \ } #else #define assert_once(x) (void)0 #endif #endif /* 0 */ #if defined(__HIGHC__) && !defined(NDEBUG) /* HighC lacks a __FUNCTION__ preproc symbol... :( */ #define profile_rename(name) _ASM(".global " name "\n" name ":\n") #else #define profile_rename(name) (void)0 #endif /*}}}*/ #ifdef __cplusplus } #endif #endif /* __VCINCLUDE_COMMON_H__ */ ================================================ FILE: Libraries/Core/RPi/Headers/vcinclude/vc_image_types.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __VC_INCLUDE_IMAGE_TYPES_H__ #define __VC_INCLUDE_IMAGE_TYPES_H__ #include "interface/vctypes/vc_image_types.h" #endif /* __VC_INCLUDE_IMAGE_TYPES_H__ */ ================================================ FILE: Libraries/Core/RPi/Headers/vcinclude/vcore.h ================================================ /* Copyright (c) 2012, Broadcom Europe Ltd All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef VCORE_H #define VCORE_H #ifdef __VIDEOCORE__ #include "vc/intrinsics.h" #undef asm #define asm(x) _ASM(x) #undef min #define min(x,y) _min(x,y) #undef max #define max(x,y) _max(x,y) #ifndef abs #define abs(x) _abs(x) #endif #else #define _vasm asm #define _bkpt() do {asm(" bkpt");}while(0) #define _di() do{asm(" di");}while(0) #define _ei() do{asm(" ei");}while(0) #define _nop() do{asm(" nop");}while(0) #define _sleep() do{asm(" sleep");}while(0) #undef min #define min(x,y) ((x)<(y) ? (x):(y)) #undef max #define max(x,y) ((x)>(y) ? (x):(y)) #ifndef abs #define abs(x) ((x)>=0 ? (x):-(x)) #endif #endif #endif ================================================ FILE: Libraries/Core/RPi/Headers/zconf.h ================================================ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2010 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #ifndef ZCONF_H #define ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ /* all linked symbols */ # define _dist_code z__dist_code # define _length_code z__length_code # define _tr_align z__tr_align # define _tr_flush_block z__tr_flush_block # define _tr_init z__tr_init # define _tr_stored_block z__tr_stored_block # define _tr_tally z__tr_tally # define adler32 z_adler32 # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 # define compress z_compress # define compress2 z_compress2 # define compressBound z_compressBound # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 # define deflate z_deflate # define deflateBound z_deflateBound # define deflateCopy z_deflateCopy # define deflateEnd z_deflateEnd # define deflateInit2_ z_deflateInit2_ # define deflateInit_ z_deflateInit_ # define deflateParams z_deflateParams # define deflatePrime z_deflatePrime # define deflateReset z_deflateReset # define deflateSetDictionary z_deflateSetDictionary # define deflateSetHeader z_deflateSetHeader # define deflateTune z_deflateTune # define deflate_copyright z_deflate_copyright # define get_crc_table z_get_crc_table # define gz_error z_gz_error # define gz_intmax z_gz_intmax # define gz_strwinerror z_gz_strwinerror # define gzbuffer z_gzbuffer # define gzclearerr z_gzclearerr # define gzclose z_gzclose # define gzclose_r z_gzclose_r # define gzclose_w z_gzclose_w # define gzdirect z_gzdirect # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror # define gzflush z_gzflush # define gzgetc z_gzgetc # define gzgets z_gzgets # define gzoffset z_gzoffset # define gzoffset64 z_gzoffset64 # define gzopen z_gzopen # define gzopen64 z_gzopen64 # define gzprintf z_gzprintf # define gzputc z_gzputc # define gzputs z_gzputs # define gzread z_gzread # define gzrewind z_gzrewind # define gzseek z_gzseek # define gzseek64 z_gzseek64 # define gzsetparams z_gzsetparams # define gztell z_gztell # define gztell64 z_gztell64 # define gzungetc z_gzungetc # define gzwrite z_gzwrite # define inflate z_inflate # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd # define inflateBackInit_ z_inflateBackInit_ # define inflateCopy z_inflateCopy # define inflateEnd z_inflateEnd # define inflateGetHeader z_inflateGetHeader # define inflateInit2_ z_inflateInit2_ # define inflateInit_ z_inflateInit_ # define inflateMark z_inflateMark # define inflatePrime z_inflatePrime # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateSetDictionary z_inflateSetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table # define uncompress z_uncompress # define zError z_zError # define zcalloc z_zcalloc # define zcfree z_zcfree # define zlibCompileFlags z_zlibCompileFlags # define zlibVersion z_zlibVersion /* all zlib typedefs in zlib.h and zconf.h */ # define Byte z_Byte # define Bytef z_Bytef # define alloc_func z_alloc_func # define charf z_charf # define free_func z_free_func # define gzFile z_gzFile # define gz_header z_gz_header # define gz_headerp z_gz_headerp # define in_func z_in_func # define intf z_intf # define out_func z_out_func # define uInt z_uInt # define uIntf z_uIntf # define uLong z_uLong # define uLongf z_uLongf # define voidp z_voidp # define voidpc z_voidpc # define voidpf z_voidpf /* all zlib structs in zlib.h and zconf.h */ # define gz_header_s z_gz_header_s # define internal_state z_internal_state #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) # define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) # ifndef WIN32 # define WIN32 # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) # ifndef SYS16BIT # define SYS16BIT # endif # endif #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT # define MAXSEG_64K #endif #ifdef MSDOS # define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ # ifndef STDC # define STDC # endif # if __STDC_VERSION__ >= 199901L # ifndef STDC99 # define STDC99 # endif # endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) # define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) # define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) # define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) # define STDC #endif #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ # define STDC #endif #ifndef STDC # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # define const /* note: need a more gentle solution here */ # endif #endif /* Some Mac compilers merge all .h files incorrectly: */ #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) # define NO_DUMMY_DECL #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #ifdef SYS16BIT # if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER # define FAR _far # else # define FAR far # endif # endif # if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ # define SMALL_MEDIUM # ifdef __BORLANDC__ # define FAR _far # else # define FAR far # endif # endif #endif #if defined(WINDOWS) || defined(WIN32) /* If building or using zlib as a DLL, define ZLIB_DLL. * This is not mandatory, but it offers a little performance increase. */ # ifdef ZLIB_DLL # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) # ifdef ZLIB_INTERNAL # define ZEXTERN extern __declspec(dllexport) # else # define ZEXTERN extern __declspec(dllimport) # endif # endif # endif /* ZLIB_DLL */ /* If building or using zlib with the WINAPI/WINAPIV calling convention, * define ZLIB_WINAPI. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ # ifdef ZLIB_WINAPI # ifdef FAR # undef FAR # endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI # ifdef WIN32 # define ZEXPORTVA WINAPIV # else # define ZEXPORTVA FAR CDECL # endif # endif #endif #if defined (__BEOS__) # ifdef ZLIB_DLL # ifdef ZLIB_INTERNAL # define ZEXPORT __declspec(dllexport) # define ZEXPORTVA __declspec(dllexport) # else # define ZEXPORT __declspec(dllimport) # define ZEXPORTVA __declspec(dllimport) # endif # endif #endif #ifndef ZEXTERN # define ZEXTERN extern #endif #ifndef ZEXPORT # define ZEXPORT #endif #ifndef ZEXPORTVA # define ZEXPORTVA #endif #ifndef FAR # define FAR #endif #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ # define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif #ifdef STDC # include /* for off_t */ #endif /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even * though the former does not conform to the LFS document), but considering * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as * equivalently requesting no 64-bit operations */ #if -_LARGEFILE64_SOURCE - -1 == 1 # undef _LARGEFILE64_SOURCE #endif #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # include /* for SEEK_* and off_t */ # ifdef VMS # include /* for off_t */ # endif # ifndef z_off_t # define z_off_t off_t # endif #endif #ifndef SEEK_SET # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t # define z_off_t long #endif #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 # define z_off64_t off64_t #else # define z_off64_t z_off_t #endif #if defined(__OS400__) # define NO_vsnprintf #endif #if defined(__MVS__) # define NO_vsnprintf #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) #pragma map(deflateInit_,"DEIN") #pragma map(deflateInit2_,"DEIN2") #pragma map(deflateEnd,"DEEND") #pragma map(deflateBound,"DEBND") #pragma map(inflateInit_,"ININ") #pragma map(inflateInit2_,"ININ2") #pragma map(inflateEnd,"INEND") #pragma map(inflateSync,"INSY") #pragma map(inflateSetDictionary,"INSEDI") #pragma map(compressBound,"CMBND") #pragma map(inflate_table,"INTABL") #pragma map(inflate_fast,"INFA") #pragma map(inflate_copyright,"INCOPY") #endif #endif /* ZCONF_H */ ================================================ FILE: Libraries/Core/RPi/Headers/zlib.h ================================================ /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.5, April 19th, 2010 Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). */ #ifndef ZLIB_H #define ZLIB_H #include "zconf.h" #ifdef __cplusplus extern "C" { #endif #define ZLIB_VERSION "1.2.5" #define ZLIB_VERNUM 0x1250 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 #define ZLIB_VER_REVISION 5 #define ZLIB_VER_SUBREVISION 0 /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream interface. Compression can be done in a single step if the buffers are large enough, or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. The compressed data format used by default by the in-memory functions is the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. This library can optionally read and write gzip streams in memory as well. The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- file compression on file systems, has a larger header than zlib to maintain directory information, and uses a different, slower check method than zlib. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in case of corrupted input. */ typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total nb of input bytes read so far */ Bytef *next_out; /* next output byte should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total nb of bytes output so far */ char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: binary or text */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; /* gzip header information passed to and from zlib routines. See RFC 1952 for more details on the meanings of these fields. */ typedef struct gz_header_s { int text; /* true if compressed data believed to be text */ uLong time; /* modification time */ int xflags; /* extra flags (not used when writing a gzip file) */ int os; /* operating system */ Bytef *extra; /* pointer to extra field or Z_NULL if none */ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ uInt extra_max; /* space at extra (only when reading header) */ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ uInt name_max; /* space at name (only when reading header) */ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ uInt comm_max; /* space at comment (only when reading header) */ int hcrc; /* true if there was or will be a header crc */ int done; /* true when done reading gzip header (not used when writing a gzip file) */ } gz_header; typedef gz_header FAR *gz_headerp; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use in the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 #define Z_SYNC_FLUSH 2 #define Z_FULL_FLUSH 3 #define Z_FINISH 4 #define Z_BLOCK 5 #define Z_TREES 6 /* Allowed flush values; see deflate() and inflate() below for details */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 #define Z_FIXED 4 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 #define Z_TEXT 1 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 /* Possible values of the data_type field (though see inflate()) */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ /* basic functions */ ZEXTERN const char * ZEXPORT zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ /* ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default allocation functions. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if level is not a valid compression level, or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. deflate performs one or both of the following actions: - Compress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary (in interactive applications). Some output may be provided even if flush is not set. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to maximize compression. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block that is three bits plus filler bits to the next byte, followed by four bytes (00 00 ff ff). If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the output buffer, but the output is not aligned to a byte boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output in order for the decompressor to finish the block before the empty fixed code block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to seven bits of the current block are held to be written as the next byte after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next block to be emitted. This is for advanced applications that need to control the emission of deflate blocks. If flush is set to Z_FULL_FLUSH, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that avail_out is greater than six to avoid repeated flush markers due to avail_out == 0 on return. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space; if deflate returns with Z_OK, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. Z_FINISH can be used immediately after deflateInit if all the compression is to be done in a single step. In this case, avail_out must be at least the value returned by deflateBound (see below). If deflate does not return Z_STREAM_END, then it must be called again as described above. deflate() sets strm->adler to the adler32 checksum of all input read so far (that is, total_in bytes). deflate() may update strm->data_type if it can make a good guess about the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and deflate() can be called again with more input and more output space to continue compressing. */ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent, Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. If next_in is not Z_NULL and avail_in is large enough (the exact value depends on the compression method), inflateInit determines the compression method from the zlib header and allocates all data structures accordingly; otherwise the allocation will be deferred to the first call of inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in is updated and processing will resume at this point for the next call of inflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop if and when it gets to the next deflate block boundary. When decoding the zlib or gzip format, this will cause inflate() to return immediately after the header and before the first block. When doing a raw inflate, inflate() will go ahead and process the first block, and will return when it gets to the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. Also to assist in this, on return inflate() will set strm->data_type to the number of unused bits in the last byte taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or decoding the complete header up to just before the first byte of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of data_type is set, in which case the number of unused bits will be less than eight. data_type is set as noted here every time inflate() returns for all flush options, and so can be used to determine the amount of currently consumed input in bits. The Z_TREES option behaves as Z_BLOCK does, but it also returns when the end of each deflate block header is reached, before any actual data in that block is decoded. This allows the caller to determine the length of the deflate block header for later use in random access within a deflate block. 256 is added to the value of strm->data_type when inflate() returns immediately after reaching the end of the deflate block header. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all the uncompressed data. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The next operation on this stream must be inflateEnd to deallocate the decompression state. The use of Z_FINISH is never required, but can be used to inform inflate that a faster approach may be used for the single inflate() call. In this implementation, inflate() always flushes as much output as possible to the output buffer, and always uses the faster approach on the first call. So the only effect of the flush parameter in this implementation is on the return value of inflate(), as noted below, or when it returns early because Z_BLOCK or Z_TREES is used. If a preset dictionary is needed after this call (see inflateSetDictionary below), inflate sets strm->adler to the adler32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the adler32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed adler32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() can decompress and check either zlib-wrapped or gzip-wrapped deflate data. The header type is detected automatically, if requested when initializing with inflateInit2(). Any information contained in the gzip header is not retained, so applications that need that information should instead use raw inflate, see inflateInit2() below, or inflateBack() and perform their own processing of the gzip header and trailer. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect check value), Z_STREAM_ERROR if the stream structure was inconsistent (for example next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress is possible or if there was not enough room in the output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and inflate() can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync() to look for a good compression block if a partial recovery of the data is desired. */ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent. In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* Advanced functions */ /* The following functions are needed only in some special applications. */ /* ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy)); This is another version of deflateInit with more compression options. The fields next_in, zalloc, zfree and opaque must be initialized before by the caller. The method parameter is the compression method. It must be Z_DEFLATED in this version of the library. The windowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. windowBits can also be -8..-15 for raw deflate. In this case, -windowBits determines the window size. deflate() will then generate raw deflate data with no zlib header or trailer, and will not compute an adler32 check value. windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), no header crc, and the operating system will be set to 255 (unknown). If a gzip stream is being written, strm->adler is a crc32 instead of an adler32. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is slow and reduces compression ratio; memLevel=9 uses maximum memory for optimal speed. The default value is 8. See zconf.h for total memory usage as a function of windowBits and memLevel. The strategy parameter is used to tune the compression algorithm. Use the value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no string match), or Z_RLE to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of Z_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. This function must be called immediately after deflateInit, deflateInit2 or deflateReset, before any call of deflate. The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). The dictionary should consist of strings (byte sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be predicted with good accuracy; the data can then be compressed better than with the default empty dictionary. Depending on the size of the compression data structures selected by deflateInit or deflateInit2, a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size provided in deflateInit or deflateInit2. Thus the strings most likely to be useful should be put at the end of the dictionary, not at the front. In addition, the current implementation of deflate will use at most the window size minus 262 bytes of the provided dictionary. Upon return of this function, strm->adler is set to the adler32 value of the dictionary; the decompressor may later use this value to determine which dictionary has been used by the compressor. (The adler32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) If a raw deflate was requested, then the adler32 value is not computed and strm->adler is not set. deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent (for example if deflate has already been called for this stream or if the compression method is bsort). deflateSetDictionary does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter. The streams that will be discarded should then be freed by calling deflateEnd. Note that deflateCopy duplicates the internal compression state which can be quite large, so this strategy is slow and can consume lots of memory. deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate all the internal compression state. The stream will keep the same compression level and any other attributes that may have been set by deflateInit2. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, int level, int strategy)); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2. This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression level is changed, the input available so far is compressed with the old level (and may be flushed); the new level will take effect only at the next call of deflate(). Before the call of deflateParams, the stream state must be set as for a call of deflate(), since the currently available input may have to be compressed and flushed. In particular, strm->avail_out must be non-zero. deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if strm->avail_out was zero. */ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for searching for the best matching string, and even then only by the most fanatic optimizer trying to squeeze out the last compressed bit for their specific input data. Read the deflate.c source code for the meaning of the max_lazy, good_length, nice_length, and max_chain parameters. deflateTune() can be called after deflateInit() or deflateInit2(), and returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, uLong sourceLen)); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or deflateInit2(), and after deflateSetHeader(), if used. This would be used to allocate an output buffer for deflation in a single pass, and so would be called before deflate(). */ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, int bits, int value)); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits leftover from a previous deflate stream when appending to it. As such, this function can only be used for raw deflate, and must be used before the first deflate() call after a deflateInit2() or deflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the output. deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gz_headerp head)); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called after deflateInit2() or deflateReset() and before the first call of deflate(). The text, time, os, extra field, name, and comment information in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with a zero byte, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, the time set to zero, and os set to 255, with no extra, name, or comment fields. The gzip header is returned to the default state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, int windowBits)); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. The windowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. windowBits must be greater than or equal to the windowBits value provided to deflateInit2() while compressing, or it must be equal to 15 if deflateInit2() was not used. If a compressed stream with a larger window size is given as input, inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. windowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream. windowBits can also be -8..-15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. This is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is recommended that a check value such as an adler32 or a crc32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits. windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a crc32 instead of an adler32. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit2 does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit2() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the adler32 value returned by that call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). For raw inflate, this function can be called immediately after inflateInit2() or inflateReset() and before any call of inflate() to set the dictionary. The application must insure that the dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the expected one (incorrect adler32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until a full flush point (see above the description of deflate with Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when randomly accessing a large stream. The first pass through the stream can periodically record the inflate state, allowing restarting inflate at those points when randomly accessing the stream. inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, int windowBits)); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted the same as it is for inflateInit2. inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL), or if the windowBits parameter is invalid. */ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, int bits, int value)); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the middle of a byte. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the input. If bits is negative, then the input stream bit buffer is emptied. Then inflatePrime() can be called again to put bits in the buffer. This is used to clear out bits leftover after feeding inflate a block description prior to feeding inflate codes. inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the return value down 16 bits. If the upper value is -1 and the lower value is zero, then inflate() is currently decoding information outside of a block. If the upper value is -1 and the lower value is non-zero, then inflate is in the middle of a stored block, with the lower value equaling the number of bytes from the input remaining to copy. If the upper value is not -1, then it is the number of bits back from the current bit position in the input of the code (literal or length/distance pair) currently being processed. In that case the lower value is the number of bytes already emitted for that code. A code is being processed if inflate is waiting for more input to complete decoding of the code, or if it has completed decoding but is waiting for more output space to write the literal or match data. inflateMark() is used to mark locations in the input data for random access, which may be at bit positions, and to note those cases where the output of a code may span boundaries of random access blocks. The current location in the input stream can be determined from avail_in and data_type as noted in the description for the Z_BLOCK flush parameter for inflate. inflateMark returns the value noted above or -1 << 16 if the provided source stream state was inconsistent. */ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, gz_headerp head)); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after inflateInit2() or inflateReset(), and before the first call of inflate(). As inflate() processes the gzip stream, head->done is zero until the header is completed, at which time head->done is set to one. If a zlib stream is being decoded, then head->done is set to -1 to indicate that there will be no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be used to force inflate() to return immediately after header processing is complete and before any actual data is decompressed. The text, time, xflags, and os fields are filled in with the gzip header contents. hcrc is set to true if there is a header CRC. (The header CRC was valid if done is set to one.) If extra is not Z_NULL, then extra_max contains the maximum number of bytes to write to extra. Once done is true, extra_len contains the actual extra field length, and extra contains the extra field, or that field truncated if extra_max is less than extra_len. If name is not Z_NULL, then up to name_max characters are written there, terminated with a zero unless the length is greater than name_max. If comment is not Z_NULL, then up to comm_max characters are written there, terminated with a zero unless the length is greater than comm_max. When any of extra, name, or comment are not Z_NULL and the respective field is not present in the header, then that field is set to Z_NULL to signal its absence. This allows the use of deflateSetHeader() with the returned structure to duplicate the header. However if those fields are set to allocated memory, then the application will need to save those pointers elsewhere so that they can be eventually freed. If inflateGetHeader is not used, then the header information is simply discarded. The header is always checked for validity, including the header CRC if present. inflateReset() will reset the process to discard the header information. The application would need to call inflateGetHeader() again to retrieve the header from the next gzip stream. inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, unsigned char FAR *window)); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized before the call. If zalloc and zfree are Z_NULL, then the default library- derived memory allocation routines are used. windowBits is the base two logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 and a 32K byte window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of the paramaters are invalid, Z_MEM_ERROR if the internal state could not be allocated, or Z_VERSION_ERROR if the version of the library does not match the version of the header file. */ typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc)); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is more efficient than inflate() for file i/o applications in that it avoids copying between the output and the sliding window by simply making the window itself the output buffer. This function trusts the application to not change the output buffer passed by the output function, at least until inflateBack() returns. inflateBackInit() must be called first to allocate the internal state and to initialize the state with the user-provided window buffer. inflateBack() may then be used multiple times to inflate a complete, raw deflate stream with each call. inflateBackEnd() is then called to free the allocated state. A raw deflate stream is one with no zlib or gzip header or trailer. This routine would normally be used in a utility that reads zip or gzip files and writes out uncompressed files. The utility would decode the header and process the trailer on its own, hence this routine expects only the raw deflate stream to decompress. This is different from the normal behavior of inflate(), which expects either a zlib or gzip header and trailer around the deflate stream. inflateBack() uses two subroutines supplied by the caller that are then called by inflateBack() for input and output. inflateBack() calls those routines until it reads a complete deflate stream and writes out all of the uncompressed data, or until it encounters an error. The function's parameters and return types are defined above in the in_func and out_func typedefs. inflateBack() will call in(in_desc, &buf) which should return the number of bytes of provided input, and a pointer to that input in buf. If there is no input available, in() must return zero--buf is ignored in that case--and inflateBack() will return a buffer error. inflateBack() will call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() should return zero on success, or non-zero on failure. If out() returns non-zero, inflateBack() will return with an error. Neither in() nor out() are permitted to change the contents of the window provided to inflateBackInit(), which is also the buffer that out() uses to write from. The length written by out() will be at most the window size. Any non-zero amount of input may be provided by in(). For convenience, inflateBack() can be provided input on the first call by setting strm->next_in and strm->avail_in. If that input is exhausted, then in() will be called. Therefore strm->next_in must be initialized before calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in must also be initialized, and then if strm->avail_in is not zero, input will initially be taken from strm->next_in[0 .. strm->avail_in - 1]. The in_desc and out_desc parameters of inflateBack() is passed as the first parameter of in() and out() respectively when they are called. These descriptors can be optionally used to pass any information that the caller- supplied in() and out() functions need to do their job. On return, inflateBack() will set strm->next_in and strm->avail_in to pass back any unused input that was provided by the last in() call. The return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR if in() or out() returned an error, Z_DATA_ERROR if there was a format error in the deflate stream (in which case strm->msg is set to indicate the nature of the error), or Z_STREAM_ERROR if the stream was not properly initialized. In the case of Z_BUF_ERROR, an input or output error can be distinguished using strm->next_in which will be Z_NULL only if in() returned an error. If strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning non-zero. (in() will always be called before out(), so strm->next_in is assured to be defined if out() returns non-zero.) Note that inflateBack() cannot return Z_OK. */ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); /* All memory allocated by inflateBackInit() is freed. inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream state was inconsistent. */ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: 1.0: size of uInt 3.2: size of uLong 5.4: size of voidpf (pointer) 7.6: size of z_off_t Compiler, assembler, and debug options: 8: DEBUG 9: ASMV or ASMINF -- use ASM code 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 11: 0 (reserved) One-time table building (smaller code, but not thread-safe if true): 12: BUILDFIXED -- build static block decoding tables when needed 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed 14,15: 0 (reserved) Library content (indicates missing functionality): 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking deflate code when not needed) 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect and decode gzip streams (to avoid linking crc code) 18-19: 0 (reserved) Operation variations (changes in library functionality): 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate 21: FASTEST -- deflate algorithm with only one, lowest compression level 22,23: 0 (reserved) The sprintf variant used by gzprintf (zero is best): 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! 26: 0 = returns value, 1 = void -- 1 means inferred string length returned Remainder: 27-31: 0 (reserved) */ /* utility functions */ /* The following utility functions are implemented on top of the basic stream-oriented functions. To simplify the interface, some default options are assumed (compression level and memory usage, standard memory allocation functions). The source code of these utility functions can be modified if you need special options. */ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. compress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer. */ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library.) Upon exit, destLen is the actual size of the uncompressed buffer. uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. */ /* gzip file access functions */ /* This library supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio, using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. */ typedef voidp gzFile; /* opaque gzip file descriptor */ /* ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); Opens a gzip (.gz) file for reading or writing. The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression as in "wb9F". (See the description of deflateInit2 for more information about the strategy parameter.) Also "a" can be used instead of "w" to request that the gzip stream that will be written be appended to the file. "+" will result in an error, since reading and writing to the same gzip file is not supported. gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). errno can be checked to determine if the reason gzopen failed was that the file could not be opened. */ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); /* gzdopen associates a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has been previously opened with fopen). The mode parameter is as in gzopen. The next call of gzclose on the returned gzFile will also close the file descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, mode);. The duplicated descriptor should be saved to avoid a leak, since gzdopen does not close fd if it fails. gzdopen returns NULL if there was insufficient memory to allocate the gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided), or if fd is -1. The file descriptor is not used until the next gz* read, write, seek, or close operation, so gzdopen will not detect if fd is invalid (unless fd is -1). */ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); /* Set the internal buffer size used by this library's functions. The default buffer size is 8192 bytes. This function must be called after gzopen() or gzdopen(), and before any other calls that read or write the file. The buffer memory allocation is always deferred to the first read or write. Two buffers are allocated, either both of the specified size when writing, or one of the specified size and the other twice that size when reading. A larger buffer size of, for example, 64K or 128K bytes will noticeably increase the speed of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). gzbuffer() returns 0 on success, or -1 on failure, such as being called too late. */ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* Dynamically update the compression level or strategy. See the description of deflateInit2 for the meaning of these parameters. gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not opened for writing. */ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); /* Reads the given number of uncompressed bytes from the compressed file. If the input file was not in gzip format, gzread copies the given number of bytes into the buffer. After reaching the end of a gzip stream in the input, gzread will continue to read, looking for another gzip stream, or failing that, reading the rest of the input file directly without decompression. The entire input file will be read if gzread is called until it returns less than the requested len. gzread returns the number of uncompressed bytes actually read, less than len for end of file, or -1 for error. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); /* Writes the given number of uncompressed bytes into the compressed file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); /* Converts, formats, and writes the arguments to the compressed file under control of the format string, as in fprintf. gzprintf returns the number of uncompressed bytes actually written, or 0 in case of error. The number of uncompressed bytes written is limited to 8191, or one less than the buffer size given to gzbuffer(). The caller should assure that this limit is not exceeded. If it is exceeded, then gzprintf() will return an error (0) with nothing written. In this case, there may also be a buffer overflow with unpredictable consequences, which is possible only if zlib was compiled with the insecure functions sprintf() or vsprintf() because the secure snprintf() or vsnprintf() functions were not available. This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); /* Writes the given null-terminated string to the compressed file, excluding the terminating null character. gzputs returns the number of characters written, or -1 in case of error. */ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); /* Reads bytes from the compressed file until len-1 characters are read, or a newline character is read and transferred to buf, or an end-of-file condition is encountered. If any characters are read or if len == 1, the string is terminated with a null character. If no characters are read due to an end-of-file or len < 1, then the buffer is left untouched. gzgets returns buf which is a null-terminated string, or it returns NULL for end-of-file or in case of error. If there was an error, the contents at buf are indeterminate. */ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); /* Writes c, converted to an unsigned char, into the compressed file. gzputc returns the value that was written, or -1 in case of error. */ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* Reads one byte from the compressed file. gzgetc returns this byte or -1 in case of end of file or error. */ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); /* Push one character back onto the stream to be read as the first character on the next read. At least one character of push-back is allowed. gzungetc() returns the character pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if a character has been pushed but not read yet. If gzungetc is used immediately after gzopen or gzdopen, at least the output buffer size of pushed characters is allowed. (See gzbuffer above.) The pushed character will be discarded if the stream is repositioned with gzseek() or gzrewind(). */ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); /* Flushes all pending output into the compressed file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function gzerror below). gzflush is only permitted when writing. If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new gzip stream will be started in the output. gzread() is able to read such concatented gzip streams. gzflush should be called only when strictly necessary because it will degrade compression if called too often. */ /* ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, z_off_t offset, int whence)); Sets the starting position for the next gzread or gzwrite on the given compressed file. The offset represents a number of bytes in the uncompressed data stream. The whence parameter is defined as in lseek(2); the value SEEK_END is not supported. If the file is opened for reading, this function is emulated but can be extremely slow. If the file is opened for writing, only forward seeks are supported; gzseek then compresses a sequence of zeroes up to the new starting position. gzseek returns the resulting offset location as measured in bytes from the beginning of the uncompressed stream, or -1 in case of error, in particular if the file is opened for writing and the new starting position would be before the current position. */ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); /* Rewinds the given file. This function is supported only for reading. gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) */ /* ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); Returns the starting position for the next gzread or gzwrite on the given compressed file. This position represents a number of bytes in the uncompressed data stream, and is zero when starting, even if appending or reading a gzip stream from the middle of a file using gzdopen(). gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) */ /* ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); Returns the current offset in the file being read or written. This offset includes the count of bytes that precede the gzip stream, for example when appending or when using gzdopen() for reading. When reading, the offset does not include as yet unused buffered input. This information can be used for a progress indicator. On error, gzoffset() returns -1. */ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); /* Returns true (1) if the end-of-file indicator has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set only if the read tried to go past the end of the input, but came up short. Therefore, just like feof(), gzeof() may return false even if there is no more data to read, in the event that the last read request was for the exact number of bytes remaining in the input file. This will happen if the input file size is an exact multiple of the buffer size. If gzeof() returns true, then the read functions will return no more data, unless the end-of-file indicator is reset by gzclearerr() and the input file has grown since the previous end of file was detected. */ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); /* Returns true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. This state can change from false to true while reading the input file if the end of a gzip stream is reached, but is followed by data that is not another gzip stream. If the input file is empty, gzdirect() will return true, since the input does not contain a gzip stream. If gzdirect() is used immediately after gzopen() or gzdopen() it will cause buffers to be allocated to allow reading the file to determine if it is a gzip file. Therefore if gzbuffer() is used, it should be called before gzdirect(). */ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); /* Flushes all pending output if necessary, closes the compressed file and deallocates the (de)compression state. Note that once file is closed, you cannot call gzerror with file, since its structures have been deallocated. gzclose must not be called more than once on the same file, just as free must not be called more than once on the same allocation. gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a file operation error, or Z_OK on success. */ ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to using these instead of gzclose() is that they avoid linking in zlib compression or decompression code that is not used when only reading or only writing respectively. If gzclose() is used, then both compression and decompression code will be included the application when linking to a static zlib library. */ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. The application must not modify the returned string. Future calls to this function may invalidate the previously returned string. If file is closed, then the string previously returned by gzerror will no longer be available. gzerror() should be used to distinguish errors from end-of-file for those functions above that do not distinguish those cases in their return values. */ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); /* Clears the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip file that is being written concurrently. */ /* checksum functions */ /* These functions are not related to compression but are exported anyway because they might be useful in applications using the compression library. */ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. If buf is Z_NULL, this function returns the required initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster. Usage example: uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); */ /* ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, z_off_t len2)); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. */ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. If buf is Z_NULL, this function returns the required initial value for the for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application. Usage example: uLong crc = crc32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); } if (crc != original_crc) error(); */ /* ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and len2. */ /* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, const char *version, int stream_size)); ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, int stream_size)); #define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) #define inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, sizeof(z_stream)) #define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) #define inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, sizeof(z_stream)) /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if * both are true, the application gets the *64 functions, and the regular * functions are changed to 64 bits) -- in case these are set on systems * without large file support, _LFS64_LARGEFILE must also be true */ #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); #endif #if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 # define gzopen gzopen64 # define gzseek gzseek64 # define gztell gztell64 # define gzoffset gzoffset64 # define adler32_combine adler32_combine64 # define crc32_combine crc32_combine64 # ifdef _LARGEFILE64_SOURCE ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); # endif #else ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif /* hack for buggy compilers */ #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) struct internal_state {int dummy;}; #endif /* undocumented functions */ ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); #ifdef __cplusplus } #endif #endif /* ZLIB_H */ ================================================ FILE: Libraries/Core/Windows/Headers/GL/glew.h ================================================ /* ** The OpenGL Extension Wrangler Library ** Copyright (C) 2008-2015, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are met: ** ** * Redistributions of source code must retain the above copyright notice, ** this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright notice, ** this list of conditions and the following disclaimer in the documentation ** and/or other materials provided with the distribution. ** * The name of the author may be used to endorse or promote products ** derived from this software without specific prior written permission. ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ** THE POSSIBILITY OF SUCH DAMAGE. */ /* * Mesa 3-D graphics library * Version: 7.0 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* ** Copyright (c) 2007 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ #ifndef __glew_h__ #define __glew_h__ #define __GLEW_H__ #if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__X_GL_H) #error gl.h included before glew.h #endif #if defined(__gl2_h_) #error gl2.h included before glew.h #endif #if defined(__gltypes_h_) #error gltypes.h included before glew.h #endif #if defined(__REGAL_H__) #error Regal.h included before glew.h #endif #if defined(__glext_h_) || defined(__GLEXT_H_) #error glext.h included before glew.h #endif #if defined(__gl_ATI_h_) #error glATI.h included before glew.h #endif #define __gl_h_ #define __gl2_h_ #define __GL_H__ #define _GL_H #define __gltypes_h_ #define __REGAL_H__ #define __X_GL_H #define __glext_h_ #define __GLEXT_H_ #define __gl_ATI_h_ #if defined(_WIN32) /* * GLEW does not include to avoid name space pollution. * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t * defined properly. */ /* and */ #ifdef APIENTRY # ifndef GLAPIENTRY # define GLAPIENTRY APIENTRY # endif # ifndef GLEWAPIENTRY # define GLEWAPIENTRY APIENTRY # endif #else #define GLEW_APIENTRY_DEFINED # if defined(__MINGW32__) || defined(__CYGWIN__) || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) # define APIENTRY __stdcall # ifndef GLAPIENTRY # define GLAPIENTRY __stdcall # endif # ifndef GLEWAPIENTRY # define GLEWAPIENTRY __stdcall # endif # else # define APIENTRY # endif #endif #ifndef GLAPI # if defined(__MINGW32__) || defined(__CYGWIN__) # define GLAPI extern # endif #endif /* */ #ifndef CALLBACK #define GLEW_CALLBACK_DEFINED # if defined(__MINGW32__) || defined(__CYGWIN__) # define CALLBACK __attribute__ ((__stdcall__)) # elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) # define CALLBACK __stdcall # else # define CALLBACK # endif #endif /* and */ #ifndef WINGDIAPI #define GLEW_WINGDIAPI_DEFINED #define WINGDIAPI __declspec(dllimport) #endif /* */ #if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) typedef unsigned short wchar_t; # define _WCHAR_T_DEFINED #endif /* */ #if !defined(_W64) # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 # define _W64 __w64 # else # define _W64 # endif #endif #if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) # ifdef _WIN64 typedef __int64 ptrdiff_t; # else typedef _W64 int ptrdiff_t; # endif # define _PTRDIFF_T_DEFINED # define _PTRDIFF_T_ #endif #ifndef GLAPI # if defined(__MINGW32__) || defined(__CYGWIN__) # define GLAPI extern # else # define GLAPI WINGDIAPI # endif #endif /* * GLEW_STATIC is defined for static library. * GLEW_BUILD is defined for building the DLL library. */ #ifdef GLEW_STATIC # define GLEWAPI extern #else # ifdef GLEW_BUILD # define GLEWAPI extern __declspec(dllexport) # else # define GLEWAPI extern __declspec(dllimport) # endif #endif #else /* _UNIX */ /* * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO * C. On my system, this amounts to _3 lines_ of included code, all of * them pretty much harmless. If you know of a way of detecting 32 vs * 64 _targets_ at compile time you are free to replace this with * something that's portable. For now, _this_ is the portable solution. * (mem, 2004-01-04) */ #include /* SGI MIPSPro doesn't like stdint.h in C++ mode */ /* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */ #if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__) #include #else #include #endif #define GLEW_APIENTRY_DEFINED #define APIENTRY /* * GLEW_STATIC is defined for static library. */ #ifdef GLEW_STATIC # define GLEWAPI extern #else # if defined(__GNUC__) && __GNUC__>=4 # define GLEWAPI extern __attribute__ ((visibility("default"))) # elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) # define GLEWAPI extern __global # else # define GLEWAPI extern # endif #endif /* */ #ifndef GLAPI #define GLAPI extern #endif #endif /* _WIN32 */ #ifndef GLAPIENTRY #define GLAPIENTRY #endif #ifndef GLEWAPIENTRY #define GLEWAPIENTRY #endif #ifdef __cplusplus extern "C" { #endif /* ----------------------------- GL_VERSION_1_1 ---------------------------- */ #ifndef GL_VERSION_1_1 #define GL_VERSION_1_1 1 typedef unsigned int GLenum; typedef unsigned int GLbitfield; typedef unsigned int GLuint; typedef int GLint; typedef int GLsizei; typedef unsigned char GLboolean; typedef signed char GLbyte; typedef short GLshort; typedef unsigned char GLubyte; typedef unsigned short GLushort; typedef unsigned long GLulong; typedef float GLfloat; typedef float GLclampf; typedef double GLdouble; typedef double GLclampd; typedef void GLvoid; #if defined(_MSC_VER) && _MSC_VER < 1400 typedef __int64 GLint64EXT; typedef unsigned __int64 GLuint64EXT; #elif defined(_MSC_VER) || defined(__BORLANDC__) typedef signed long long GLint64EXT; typedef unsigned long long GLuint64EXT; #else # if defined(__MINGW32__) || defined(__CYGWIN__) #include # endif typedef int64_t GLint64EXT; typedef uint64_t GLuint64EXT; #endif typedef GLint64EXT GLint64; typedef GLuint64EXT GLuint64; typedef struct __GLsync *GLsync; typedef char GLchar; #define GL_ZERO 0 #define GL_FALSE 0 #define GL_LOGIC_OP 0x0BF1 #define GL_NONE 0 #define GL_TEXTURE_COMPONENTS 0x1003 #define GL_NO_ERROR 0 #define GL_POINTS 0x0000 #define GL_CURRENT_BIT 0x00000001 #define GL_TRUE 1 #define GL_ONE 1 #define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 #define GL_LINES 0x0001 #define GL_LINE_LOOP 0x0002 #define GL_POINT_BIT 0x00000002 #define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 #define GL_LINE_STRIP 0x0003 #define GL_LINE_BIT 0x00000004 #define GL_TRIANGLES 0x0004 #define GL_TRIANGLE_STRIP 0x0005 #define GL_TRIANGLE_FAN 0x0006 #define GL_QUADS 0x0007 #define GL_QUAD_STRIP 0x0008 #define GL_POLYGON_BIT 0x00000008 #define GL_POLYGON 0x0009 #define GL_POLYGON_STIPPLE_BIT 0x00000010 #define GL_PIXEL_MODE_BIT 0x00000020 #define GL_LIGHTING_BIT 0x00000040 #define GL_FOG_BIT 0x00000080 #define GL_DEPTH_BUFFER_BIT 0x00000100 #define GL_ACCUM 0x0100 #define GL_LOAD 0x0101 #define GL_RETURN 0x0102 #define GL_MULT 0x0103 #define GL_ADD 0x0104 #define GL_NEVER 0x0200 #define GL_ACCUM_BUFFER_BIT 0x00000200 #define GL_LESS 0x0201 #define GL_EQUAL 0x0202 #define GL_LEQUAL 0x0203 #define GL_GREATER 0x0204 #define GL_NOTEQUAL 0x0205 #define GL_GEQUAL 0x0206 #define GL_ALWAYS 0x0207 #define GL_SRC_COLOR 0x0300 #define GL_ONE_MINUS_SRC_COLOR 0x0301 #define GL_SRC_ALPHA 0x0302 #define GL_ONE_MINUS_SRC_ALPHA 0x0303 #define GL_DST_ALPHA 0x0304 #define GL_ONE_MINUS_DST_ALPHA 0x0305 #define GL_DST_COLOR 0x0306 #define GL_ONE_MINUS_DST_COLOR 0x0307 #define GL_SRC_ALPHA_SATURATE 0x0308 #define GL_STENCIL_BUFFER_BIT 0x00000400 #define GL_FRONT_LEFT 0x0400 #define GL_FRONT_RIGHT 0x0401 #define GL_BACK_LEFT 0x0402 #define GL_BACK_RIGHT 0x0403 #define GL_FRONT 0x0404 #define GL_BACK 0x0405 #define GL_LEFT 0x0406 #define GL_RIGHT 0x0407 #define GL_FRONT_AND_BACK 0x0408 #define GL_AUX0 0x0409 #define GL_AUX1 0x040A #define GL_AUX2 0x040B #define GL_AUX3 0x040C #define GL_INVALID_ENUM 0x0500 #define GL_INVALID_VALUE 0x0501 #define GL_INVALID_OPERATION 0x0502 #define GL_STACK_OVERFLOW 0x0503 #define GL_STACK_UNDERFLOW 0x0504 #define GL_OUT_OF_MEMORY 0x0505 #define GL_2D 0x0600 #define GL_3D 0x0601 #define GL_3D_COLOR 0x0602 #define GL_3D_COLOR_TEXTURE 0x0603 #define GL_4D_COLOR_TEXTURE 0x0604 #define GL_PASS_THROUGH_TOKEN 0x0700 #define GL_POINT_TOKEN 0x0701 #define GL_LINE_TOKEN 0x0702 #define GL_POLYGON_TOKEN 0x0703 #define GL_BITMAP_TOKEN 0x0704 #define GL_DRAW_PIXEL_TOKEN 0x0705 #define GL_COPY_PIXEL_TOKEN 0x0706 #define GL_LINE_RESET_TOKEN 0x0707 #define GL_EXP 0x0800 #define GL_VIEWPORT_BIT 0x00000800 #define GL_EXP2 0x0801 #define GL_CW 0x0900 #define GL_CCW 0x0901 #define GL_COEFF 0x0A00 #define GL_ORDER 0x0A01 #define GL_DOMAIN 0x0A02 #define GL_CURRENT_COLOR 0x0B00 #define GL_CURRENT_INDEX 0x0B01 #define GL_CURRENT_NORMAL 0x0B02 #define GL_CURRENT_TEXTURE_COORDS 0x0B03 #define GL_CURRENT_RASTER_COLOR 0x0B04 #define GL_CURRENT_RASTER_INDEX 0x0B05 #define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 #define GL_CURRENT_RASTER_POSITION 0x0B07 #define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 #define GL_CURRENT_RASTER_DISTANCE 0x0B09 #define GL_POINT_SMOOTH 0x0B10 #define GL_POINT_SIZE 0x0B11 #define GL_POINT_SIZE_RANGE 0x0B12 #define GL_POINT_SIZE_GRANULARITY 0x0B13 #define GL_LINE_SMOOTH 0x0B20 #define GL_LINE_WIDTH 0x0B21 #define GL_LINE_WIDTH_RANGE 0x0B22 #define GL_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_LINE_STIPPLE 0x0B24 #define GL_LINE_STIPPLE_PATTERN 0x0B25 #define GL_LINE_STIPPLE_REPEAT 0x0B26 #define GL_LIST_MODE 0x0B30 #define GL_MAX_LIST_NESTING 0x0B31 #define GL_LIST_BASE 0x0B32 #define GL_LIST_INDEX 0x0B33 #define GL_POLYGON_MODE 0x0B40 #define GL_POLYGON_SMOOTH 0x0B41 #define GL_POLYGON_STIPPLE 0x0B42 #define GL_EDGE_FLAG 0x0B43 #define GL_CULL_FACE 0x0B44 #define GL_CULL_FACE_MODE 0x0B45 #define GL_FRONT_FACE 0x0B46 #define GL_LIGHTING 0x0B50 #define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 #define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 #define GL_LIGHT_MODEL_AMBIENT 0x0B53 #define GL_SHADE_MODEL 0x0B54 #define GL_COLOR_MATERIAL_FACE 0x0B55 #define GL_COLOR_MATERIAL_PARAMETER 0x0B56 #define GL_COLOR_MATERIAL 0x0B57 #define GL_FOG 0x0B60 #define GL_FOG_INDEX 0x0B61 #define GL_FOG_DENSITY 0x0B62 #define GL_FOG_START 0x0B63 #define GL_FOG_END 0x0B64 #define GL_FOG_MODE 0x0B65 #define GL_FOG_COLOR 0x0B66 #define GL_DEPTH_RANGE 0x0B70 #define GL_DEPTH_TEST 0x0B71 #define GL_DEPTH_WRITEMASK 0x0B72 #define GL_DEPTH_CLEAR_VALUE 0x0B73 #define GL_DEPTH_FUNC 0x0B74 #define GL_ACCUM_CLEAR_VALUE 0x0B80 #define GL_STENCIL_TEST 0x0B90 #define GL_STENCIL_CLEAR_VALUE 0x0B91 #define GL_STENCIL_FUNC 0x0B92 #define GL_STENCIL_VALUE_MASK 0x0B93 #define GL_STENCIL_FAIL 0x0B94 #define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 #define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 #define GL_STENCIL_REF 0x0B97 #define GL_STENCIL_WRITEMASK 0x0B98 #define GL_MATRIX_MODE 0x0BA0 #define GL_NORMALIZE 0x0BA1 #define GL_VIEWPORT 0x0BA2 #define GL_MODELVIEW_STACK_DEPTH 0x0BA3 #define GL_PROJECTION_STACK_DEPTH 0x0BA4 #define GL_TEXTURE_STACK_DEPTH 0x0BA5 #define GL_MODELVIEW_MATRIX 0x0BA6 #define GL_PROJECTION_MATRIX 0x0BA7 #define GL_TEXTURE_MATRIX 0x0BA8 #define GL_ATTRIB_STACK_DEPTH 0x0BB0 #define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 #define GL_ALPHA_TEST 0x0BC0 #define GL_ALPHA_TEST_FUNC 0x0BC1 #define GL_ALPHA_TEST_REF 0x0BC2 #define GL_DITHER 0x0BD0 #define GL_BLEND_DST 0x0BE0 #define GL_BLEND_SRC 0x0BE1 #define GL_BLEND 0x0BE2 #define GL_LOGIC_OP_MODE 0x0BF0 #define GL_INDEX_LOGIC_OP 0x0BF1 #define GL_COLOR_LOGIC_OP 0x0BF2 #define GL_AUX_BUFFERS 0x0C00 #define GL_DRAW_BUFFER 0x0C01 #define GL_READ_BUFFER 0x0C02 #define GL_SCISSOR_BOX 0x0C10 #define GL_SCISSOR_TEST 0x0C11 #define GL_INDEX_CLEAR_VALUE 0x0C20 #define GL_INDEX_WRITEMASK 0x0C21 #define GL_COLOR_CLEAR_VALUE 0x0C22 #define GL_COLOR_WRITEMASK 0x0C23 #define GL_INDEX_MODE 0x0C30 #define GL_RGBA_MODE 0x0C31 #define GL_DOUBLEBUFFER 0x0C32 #define GL_STEREO 0x0C33 #define GL_RENDER_MODE 0x0C40 #define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 #define GL_POINT_SMOOTH_HINT 0x0C51 #define GL_LINE_SMOOTH_HINT 0x0C52 #define GL_POLYGON_SMOOTH_HINT 0x0C53 #define GL_FOG_HINT 0x0C54 #define GL_TEXTURE_GEN_S 0x0C60 #define GL_TEXTURE_GEN_T 0x0C61 #define GL_TEXTURE_GEN_R 0x0C62 #define GL_TEXTURE_GEN_Q 0x0C63 #define GL_PIXEL_MAP_I_TO_I 0x0C70 #define GL_PIXEL_MAP_S_TO_S 0x0C71 #define GL_PIXEL_MAP_I_TO_R 0x0C72 #define GL_PIXEL_MAP_I_TO_G 0x0C73 #define GL_PIXEL_MAP_I_TO_B 0x0C74 #define GL_PIXEL_MAP_I_TO_A 0x0C75 #define GL_PIXEL_MAP_R_TO_R 0x0C76 #define GL_PIXEL_MAP_G_TO_G 0x0C77 #define GL_PIXEL_MAP_B_TO_B 0x0C78 #define GL_PIXEL_MAP_A_TO_A 0x0C79 #define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 #define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 #define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 #define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 #define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 #define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 #define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 #define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 #define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 #define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 #define GL_UNPACK_SWAP_BYTES 0x0CF0 #define GL_UNPACK_LSB_FIRST 0x0CF1 #define GL_UNPACK_ROW_LENGTH 0x0CF2 #define GL_UNPACK_SKIP_ROWS 0x0CF3 #define GL_UNPACK_SKIP_PIXELS 0x0CF4 #define GL_UNPACK_ALIGNMENT 0x0CF5 #define GL_PACK_SWAP_BYTES 0x0D00 #define GL_PACK_LSB_FIRST 0x0D01 #define GL_PACK_ROW_LENGTH 0x0D02 #define GL_PACK_SKIP_ROWS 0x0D03 #define GL_PACK_SKIP_PIXELS 0x0D04 #define GL_PACK_ALIGNMENT 0x0D05 #define GL_MAP_COLOR 0x0D10 #define GL_MAP_STENCIL 0x0D11 #define GL_INDEX_SHIFT 0x0D12 #define GL_INDEX_OFFSET 0x0D13 #define GL_RED_SCALE 0x0D14 #define GL_RED_BIAS 0x0D15 #define GL_ZOOM_X 0x0D16 #define GL_ZOOM_Y 0x0D17 #define GL_GREEN_SCALE 0x0D18 #define GL_GREEN_BIAS 0x0D19 #define GL_BLUE_SCALE 0x0D1A #define GL_BLUE_BIAS 0x0D1B #define GL_ALPHA_SCALE 0x0D1C #define GL_ALPHA_BIAS 0x0D1D #define GL_DEPTH_SCALE 0x0D1E #define GL_DEPTH_BIAS 0x0D1F #define GL_MAX_EVAL_ORDER 0x0D30 #define GL_MAX_LIGHTS 0x0D31 #define GL_MAX_CLIP_PLANES 0x0D32 #define GL_MAX_TEXTURE_SIZE 0x0D33 #define GL_MAX_PIXEL_MAP_TABLE 0x0D34 #define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 #define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 #define GL_MAX_NAME_STACK_DEPTH 0x0D37 #define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 #define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 #define GL_MAX_VIEWPORT_DIMS 0x0D3A #define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B #define GL_SUBPIXEL_BITS 0x0D50 #define GL_INDEX_BITS 0x0D51 #define GL_RED_BITS 0x0D52 #define GL_GREEN_BITS 0x0D53 #define GL_BLUE_BITS 0x0D54 #define GL_ALPHA_BITS 0x0D55 #define GL_DEPTH_BITS 0x0D56 #define GL_STENCIL_BITS 0x0D57 #define GL_ACCUM_RED_BITS 0x0D58 #define GL_ACCUM_GREEN_BITS 0x0D59 #define GL_ACCUM_BLUE_BITS 0x0D5A #define GL_ACCUM_ALPHA_BITS 0x0D5B #define GL_NAME_STACK_DEPTH 0x0D70 #define GL_AUTO_NORMAL 0x0D80 #define GL_MAP1_COLOR_4 0x0D90 #define GL_MAP1_INDEX 0x0D91 #define GL_MAP1_NORMAL 0x0D92 #define GL_MAP1_TEXTURE_COORD_1 0x0D93 #define GL_MAP1_TEXTURE_COORD_2 0x0D94 #define GL_MAP1_TEXTURE_COORD_3 0x0D95 #define GL_MAP1_TEXTURE_COORD_4 0x0D96 #define GL_MAP1_VERTEX_3 0x0D97 #define GL_MAP1_VERTEX_4 0x0D98 #define GL_MAP2_COLOR_4 0x0DB0 #define GL_MAP2_INDEX 0x0DB1 #define GL_MAP2_NORMAL 0x0DB2 #define GL_MAP2_TEXTURE_COORD_1 0x0DB3 #define GL_MAP2_TEXTURE_COORD_2 0x0DB4 #define GL_MAP2_TEXTURE_COORD_3 0x0DB5 #define GL_MAP2_TEXTURE_COORD_4 0x0DB6 #define GL_MAP2_VERTEX_3 0x0DB7 #define GL_MAP2_VERTEX_4 0x0DB8 #define GL_MAP1_GRID_DOMAIN 0x0DD0 #define GL_MAP1_GRID_SEGMENTS 0x0DD1 #define GL_MAP2_GRID_DOMAIN 0x0DD2 #define GL_MAP2_GRID_SEGMENTS 0x0DD3 #define GL_TEXTURE_1D 0x0DE0 #define GL_TEXTURE_2D 0x0DE1 #define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 #define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 #define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 #define GL_SELECTION_BUFFER_POINTER 0x0DF3 #define GL_SELECTION_BUFFER_SIZE 0x0DF4 #define GL_TEXTURE_WIDTH 0x1000 #define GL_TRANSFORM_BIT 0x00001000 #define GL_TEXTURE_HEIGHT 0x1001 #define GL_TEXTURE_INTERNAL_FORMAT 0x1003 #define GL_TEXTURE_BORDER_COLOR 0x1004 #define GL_TEXTURE_BORDER 0x1005 #define GL_DONT_CARE 0x1100 #define GL_FASTEST 0x1101 #define GL_NICEST 0x1102 #define GL_AMBIENT 0x1200 #define GL_DIFFUSE 0x1201 #define GL_SPECULAR 0x1202 #define GL_POSITION 0x1203 #define GL_SPOT_DIRECTION 0x1204 #define GL_SPOT_EXPONENT 0x1205 #define GL_SPOT_CUTOFF 0x1206 #define GL_CONSTANT_ATTENUATION 0x1207 #define GL_LINEAR_ATTENUATION 0x1208 #define GL_QUADRATIC_ATTENUATION 0x1209 #define GL_COMPILE 0x1300 #define GL_COMPILE_AND_EXECUTE 0x1301 #define GL_BYTE 0x1400 #define GL_UNSIGNED_BYTE 0x1401 #define GL_SHORT 0x1402 #define GL_UNSIGNED_SHORT 0x1403 #define GL_INT 0x1404 #define GL_UNSIGNED_INT 0x1405 #define GL_FLOAT 0x1406 #define GL_2_BYTES 0x1407 #define GL_3_BYTES 0x1408 #define GL_4_BYTES 0x1409 #define GL_DOUBLE 0x140A #define GL_CLEAR 0x1500 #define GL_AND 0x1501 #define GL_AND_REVERSE 0x1502 #define GL_COPY 0x1503 #define GL_AND_INVERTED 0x1504 #define GL_NOOP 0x1505 #define GL_XOR 0x1506 #define GL_OR 0x1507 #define GL_NOR 0x1508 #define GL_EQUIV 0x1509 #define GL_INVERT 0x150A #define GL_OR_REVERSE 0x150B #define GL_COPY_INVERTED 0x150C #define GL_OR_INVERTED 0x150D #define GL_NAND 0x150E #define GL_SET 0x150F #define GL_EMISSION 0x1600 #define GL_SHININESS 0x1601 #define GL_AMBIENT_AND_DIFFUSE 0x1602 #define GL_COLOR_INDEXES 0x1603 #define GL_MODELVIEW 0x1700 #define GL_PROJECTION 0x1701 #define GL_TEXTURE 0x1702 #define GL_COLOR 0x1800 #define GL_DEPTH 0x1801 #define GL_STENCIL 0x1802 #define GL_COLOR_INDEX 0x1900 #define GL_STENCIL_INDEX 0x1901 #define GL_DEPTH_COMPONENT 0x1902 #define GL_RED 0x1903 #define GL_GREEN 0x1904 #define GL_BLUE 0x1905 #define GL_ALPHA 0x1906 #define GL_RGB 0x1907 #define GL_RGBA 0x1908 #define GL_LUMINANCE 0x1909 #define GL_LUMINANCE_ALPHA 0x190A #define GL_BITMAP 0x1A00 #define GL_POINT 0x1B00 #define GL_LINE 0x1B01 #define GL_FILL 0x1B02 #define GL_RENDER 0x1C00 #define GL_FEEDBACK 0x1C01 #define GL_SELECT 0x1C02 #define GL_FLAT 0x1D00 #define GL_SMOOTH 0x1D01 #define GL_KEEP 0x1E00 #define GL_REPLACE 0x1E01 #define GL_INCR 0x1E02 #define GL_DECR 0x1E03 #define GL_VENDOR 0x1F00 #define GL_RENDERER 0x1F01 #define GL_VERSION 0x1F02 #define GL_EXTENSIONS 0x1F03 #define GL_S 0x2000 #define GL_ENABLE_BIT 0x00002000 #define GL_T 0x2001 #define GL_R 0x2002 #define GL_Q 0x2003 #define GL_MODULATE 0x2100 #define GL_DECAL 0x2101 #define GL_TEXTURE_ENV_MODE 0x2200 #define GL_TEXTURE_ENV_COLOR 0x2201 #define GL_TEXTURE_ENV 0x2300 #define GL_EYE_LINEAR 0x2400 #define GL_OBJECT_LINEAR 0x2401 #define GL_SPHERE_MAP 0x2402 #define GL_TEXTURE_GEN_MODE 0x2500 #define GL_OBJECT_PLANE 0x2501 #define GL_EYE_PLANE 0x2502 #define GL_NEAREST 0x2600 #define GL_LINEAR 0x2601 #define GL_NEAREST_MIPMAP_NEAREST 0x2700 #define GL_LINEAR_MIPMAP_NEAREST 0x2701 #define GL_NEAREST_MIPMAP_LINEAR 0x2702 #define GL_LINEAR_MIPMAP_LINEAR 0x2703 #define GL_TEXTURE_MAG_FILTER 0x2800 #define GL_TEXTURE_MIN_FILTER 0x2801 #define GL_TEXTURE_WRAP_S 0x2802 #define GL_TEXTURE_WRAP_T 0x2803 #define GL_CLAMP 0x2900 #define GL_REPEAT 0x2901 #define GL_POLYGON_OFFSET_UNITS 0x2A00 #define GL_POLYGON_OFFSET_POINT 0x2A01 #define GL_POLYGON_OFFSET_LINE 0x2A02 #define GL_R3_G3_B2 0x2A10 #define GL_V2F 0x2A20 #define GL_V3F 0x2A21 #define GL_C4UB_V2F 0x2A22 #define GL_C4UB_V3F 0x2A23 #define GL_C3F_V3F 0x2A24 #define GL_N3F_V3F 0x2A25 #define GL_C4F_N3F_V3F 0x2A26 #define GL_T2F_V3F 0x2A27 #define GL_T4F_V4F 0x2A28 #define GL_T2F_C4UB_V3F 0x2A29 #define GL_T2F_C3F_V3F 0x2A2A #define GL_T2F_N3F_V3F 0x2A2B #define GL_T2F_C4F_N3F_V3F 0x2A2C #define GL_T4F_C4F_N3F_V4F 0x2A2D #define GL_CLIP_PLANE0 0x3000 #define GL_CLIP_PLANE1 0x3001 #define GL_CLIP_PLANE2 0x3002 #define GL_CLIP_PLANE3 0x3003 #define GL_CLIP_PLANE4 0x3004 #define GL_CLIP_PLANE5 0x3005 #define GL_LIGHT0 0x4000 #define GL_COLOR_BUFFER_BIT 0x00004000 #define GL_LIGHT1 0x4001 #define GL_LIGHT2 0x4002 #define GL_LIGHT3 0x4003 #define GL_LIGHT4 0x4004 #define GL_LIGHT5 0x4005 #define GL_LIGHT6 0x4006 #define GL_LIGHT7 0x4007 #define GL_HINT_BIT 0x00008000 #define GL_POLYGON_OFFSET_FILL 0x8037 #define GL_POLYGON_OFFSET_FACTOR 0x8038 #define GL_ALPHA4 0x803B #define GL_ALPHA8 0x803C #define GL_ALPHA12 0x803D #define GL_ALPHA16 0x803E #define GL_LUMINANCE4 0x803F #define GL_LUMINANCE8 0x8040 #define GL_LUMINANCE12 0x8041 #define GL_LUMINANCE16 0x8042 #define GL_LUMINANCE4_ALPHA4 0x8043 #define GL_LUMINANCE6_ALPHA2 0x8044 #define GL_LUMINANCE8_ALPHA8 0x8045 #define GL_LUMINANCE12_ALPHA4 0x8046 #define GL_LUMINANCE12_ALPHA12 0x8047 #define GL_LUMINANCE16_ALPHA16 0x8048 #define GL_INTENSITY 0x8049 #define GL_INTENSITY4 0x804A #define GL_INTENSITY8 0x804B #define GL_INTENSITY12 0x804C #define GL_INTENSITY16 0x804D #define GL_RGB4 0x804F #define GL_RGB5 0x8050 #define GL_RGB8 0x8051 #define GL_RGB10 0x8052 #define GL_RGB12 0x8053 #define GL_RGB16 0x8054 #define GL_RGBA2 0x8055 #define GL_RGBA4 0x8056 #define GL_RGB5_A1 0x8057 #define GL_RGBA8 0x8058 #define GL_RGB10_A2 0x8059 #define GL_RGBA12 0x805A #define GL_RGBA16 0x805B #define GL_TEXTURE_RED_SIZE 0x805C #define GL_TEXTURE_GREEN_SIZE 0x805D #define GL_TEXTURE_BLUE_SIZE 0x805E #define GL_TEXTURE_ALPHA_SIZE 0x805F #define GL_TEXTURE_LUMINANCE_SIZE 0x8060 #define GL_TEXTURE_INTENSITY_SIZE 0x8061 #define GL_PROXY_TEXTURE_1D 0x8063 #define GL_PROXY_TEXTURE_2D 0x8064 #define GL_TEXTURE_PRIORITY 0x8066 #define GL_TEXTURE_RESIDENT 0x8067 #define GL_TEXTURE_BINDING_1D 0x8068 #define GL_TEXTURE_BINDING_2D 0x8069 #define GL_VERTEX_ARRAY 0x8074 #define GL_NORMAL_ARRAY 0x8075 #define GL_COLOR_ARRAY 0x8076 #define GL_INDEX_ARRAY 0x8077 #define GL_TEXTURE_COORD_ARRAY 0x8078 #define GL_EDGE_FLAG_ARRAY 0x8079 #define GL_VERTEX_ARRAY_SIZE 0x807A #define GL_VERTEX_ARRAY_TYPE 0x807B #define GL_VERTEX_ARRAY_STRIDE 0x807C #define GL_NORMAL_ARRAY_TYPE 0x807E #define GL_NORMAL_ARRAY_STRIDE 0x807F #define GL_COLOR_ARRAY_SIZE 0x8081 #define GL_COLOR_ARRAY_TYPE 0x8082 #define GL_COLOR_ARRAY_STRIDE 0x8083 #define GL_INDEX_ARRAY_TYPE 0x8085 #define GL_INDEX_ARRAY_STRIDE 0x8086 #define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 #define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 #define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A #define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C #define GL_VERTEX_ARRAY_POINTER 0x808E #define GL_NORMAL_ARRAY_POINTER 0x808F #define GL_COLOR_ARRAY_POINTER 0x8090 #define GL_INDEX_ARRAY_POINTER 0x8091 #define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 #define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 #define GL_COLOR_INDEX1_EXT 0x80E2 #define GL_COLOR_INDEX2_EXT 0x80E3 #define GL_COLOR_INDEX4_EXT 0x80E4 #define GL_COLOR_INDEX8_EXT 0x80E5 #define GL_COLOR_INDEX12_EXT 0x80E6 #define GL_COLOR_INDEX16_EXT 0x80E7 #define GL_EVAL_BIT 0x00010000 #define GL_LIST_BIT 0x00020000 #define GL_TEXTURE_BIT 0x00040000 #define GL_SCISSOR_BIT 0x00080000 #define GL_ALL_ATTRIB_BITS 0x000fffff #define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); GLAPI void GLAPIENTRY glArrayElement (GLint i); GLAPI void GLAPIENTRY glBegin (GLenum mode); GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); GLAPI void GLAPIENTRY glCallList (GLuint list); GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const void *lists); GLAPI void GLAPIENTRY glClear (GLbitfield mask); GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); GLAPI void GLAPIENTRY glClearIndex (GLfloat c); GLAPI void GLAPIENTRY glClearStencil (GLint s); GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); GLAPI void GLAPIENTRY glColor3iv (const GLint *v); GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); GLAPI void GLAPIENTRY glColor4iv (const GLint *v); GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); GLAPI void GLAPIENTRY glCullFace (GLenum mode); GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); GLAPI void GLAPIENTRY glDepthFunc (GLenum func); GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); GLAPI void GLAPIENTRY glDisable (GLenum cap); GLAPI void GLAPIENTRY glDisableClientState (GLenum array); GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices); GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); GLAPI void GLAPIENTRY glEnable (GLenum cap); GLAPI void GLAPIENTRY glEnableClientState (GLenum array); GLAPI void GLAPIENTRY glEnd (void); GLAPI void GLAPIENTRY glEndList (void); GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); GLAPI void GLAPIENTRY glFinish (void); GLAPI void GLAPIENTRY glFlush (void); GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glFrontFace (GLenum mode); GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); GLAPI GLenum GLAPIENTRY glGetError (void); GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, void* *params); GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, void *pixels); GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); GLAPI void GLAPIENTRY glIndexMask (GLuint mask); GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glIndexd (GLdouble c); GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); GLAPI void GLAPIENTRY glIndexf (GLfloat c); GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); GLAPI void GLAPIENTRY glIndexi (GLint c); GLAPI void GLAPIENTRY glIndexiv (const GLint *c); GLAPI void GLAPIENTRY glIndexs (GLshort c); GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); GLAPI void GLAPIENTRY glIndexub (GLubyte c); GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); GLAPI void GLAPIENTRY glInitNames (void); GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const void *pointer); GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); GLAPI void GLAPIENTRY glLineWidth (GLfloat width); GLAPI void GLAPIENTRY glListBase (GLuint base); GLAPI void GLAPIENTRY glLoadIdentity (void); GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); GLAPI void GLAPIENTRY glLoadName (GLuint name); GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); GLAPI void GLAPIENTRY glPassThrough (GLfloat token); GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); GLAPI void GLAPIENTRY glPointSize (GLfloat size); GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); GLAPI void GLAPIENTRY glPopAttrib (void); GLAPI void GLAPIENTRY glPopClientAttrib (void); GLAPI void GLAPIENTRY glPopMatrix (void); GLAPI void GLAPIENTRY glPopName (void); GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); GLAPI void GLAPIENTRY glPushMatrix (void); GLAPI void GLAPIENTRY glPushName (GLuint name); GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels); GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); GLAPI void GLAPIENTRY glShadeModel (GLenum mode); GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); GLAPI void GLAPIENTRY glStencilMask (GLuint mask); GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); GLAPI void GLAPIENTRY glTexCoord1i (GLint s); GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const void *pointer); GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); #define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) #endif /* GL_VERSION_1_1 */ /* ---------------------------------- GLU ---------------------------------- */ #ifndef GLEW_NO_GLU # ifdef __APPLE__ # include # if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) # define GLEW_NO_GLU # endif # endif #endif #ifndef GLEW_NO_GLU /* this is where we can safely include GLU */ # if defined(__APPLE__) && defined(__MACH__) # include # else # include # endif #endif /* ----------------------------- GL_VERSION_1_2 ---------------------------- */ #ifndef GL_VERSION_1_2 #define GL_VERSION_1_2 1 #define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 #define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 #define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 #define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 #define GL_UNSIGNED_BYTE_3_3_2 0x8032 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_INT_8_8_8_8 0x8035 #define GL_UNSIGNED_INT_10_10_10_2 0x8036 #define GL_RESCALE_NORMAL 0x803A #define GL_TEXTURE_BINDING_3D 0x806A #define GL_PACK_SKIP_IMAGES 0x806B #define GL_PACK_IMAGE_HEIGHT 0x806C #define GL_UNPACK_SKIP_IMAGES 0x806D #define GL_UNPACK_IMAGE_HEIGHT 0x806E #define GL_TEXTURE_3D 0x806F #define GL_PROXY_TEXTURE_3D 0x8070 #define GL_TEXTURE_DEPTH 0x8071 #define GL_TEXTURE_WRAP_R 0x8072 #define GL_MAX_3D_TEXTURE_SIZE 0x8073 #define GL_BGR 0x80E0 #define GL_BGRA 0x80E1 #define GL_MAX_ELEMENTS_VERTICES 0x80E8 #define GL_MAX_ELEMENTS_INDICES 0x80E9 #define GL_CLAMP_TO_EDGE 0x812F #define GL_TEXTURE_MIN_LOD 0x813A #define GL_TEXTURE_MAX_LOD 0x813B #define GL_TEXTURE_BASE_LEVEL 0x813C #define GL_TEXTURE_MAX_LEVEL 0x813D #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 #define GL_SINGLE_COLOR 0x81F9 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA #define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 #define GL_UNSIGNED_SHORT_5_6_5 0x8363 #define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 #define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 #define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 #define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 #define GL_ALIASED_POINT_SIZE_RANGE 0x846D #define GL_ALIASED_LINE_WIDTH_RANGE 0x846E typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); #define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) #define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) #define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) #define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) #define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) #endif /* GL_VERSION_1_2 */ /* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ #ifndef GL_VERSION_1_2_1 #define GL_VERSION_1_2_1 1 #define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) #endif /* GL_VERSION_1_2_1 */ /* ----------------------------- GL_VERSION_1_3 ---------------------------- */ #ifndef GL_VERSION_1_3 #define GL_VERSION_1_3 1 #define GL_MULTISAMPLE 0x809D #define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E #define GL_SAMPLE_ALPHA_TO_ONE 0x809F #define GL_SAMPLE_COVERAGE 0x80A0 #define GL_SAMPLE_BUFFERS 0x80A8 #define GL_SAMPLES 0x80A9 #define GL_SAMPLE_COVERAGE_VALUE 0x80AA #define GL_SAMPLE_COVERAGE_INVERT 0x80AB #define GL_CLAMP_TO_BORDER 0x812D #define GL_TEXTURE0 0x84C0 #define GL_TEXTURE1 0x84C1 #define GL_TEXTURE2 0x84C2 #define GL_TEXTURE3 0x84C3 #define GL_TEXTURE4 0x84C4 #define GL_TEXTURE5 0x84C5 #define GL_TEXTURE6 0x84C6 #define GL_TEXTURE7 0x84C7 #define GL_TEXTURE8 0x84C8 #define GL_TEXTURE9 0x84C9 #define GL_TEXTURE10 0x84CA #define GL_TEXTURE11 0x84CB #define GL_TEXTURE12 0x84CC #define GL_TEXTURE13 0x84CD #define GL_TEXTURE14 0x84CE #define GL_TEXTURE15 0x84CF #define GL_TEXTURE16 0x84D0 #define GL_TEXTURE17 0x84D1 #define GL_TEXTURE18 0x84D2 #define GL_TEXTURE19 0x84D3 #define GL_TEXTURE20 0x84D4 #define GL_TEXTURE21 0x84D5 #define GL_TEXTURE22 0x84D6 #define GL_TEXTURE23 0x84D7 #define GL_TEXTURE24 0x84D8 #define GL_TEXTURE25 0x84D9 #define GL_TEXTURE26 0x84DA #define GL_TEXTURE27 0x84DB #define GL_TEXTURE28 0x84DC #define GL_TEXTURE29 0x84DD #define GL_TEXTURE30 0x84DE #define GL_TEXTURE31 0x84DF #define GL_ACTIVE_TEXTURE 0x84E0 #define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 #define GL_MAX_TEXTURE_UNITS 0x84E2 #define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 #define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 #define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 #define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 #define GL_SUBTRACT 0x84E7 #define GL_COMPRESSED_ALPHA 0x84E9 #define GL_COMPRESSED_LUMINANCE 0x84EA #define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB #define GL_COMPRESSED_INTENSITY 0x84EC #define GL_COMPRESSED_RGB 0x84ED #define GL_COMPRESSED_RGBA 0x84EE #define GL_TEXTURE_COMPRESSION_HINT 0x84EF #define GL_NORMAL_MAP 0x8511 #define GL_REFLECTION_MAP 0x8512 #define GL_TEXTURE_CUBE_MAP 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A #define GL_PROXY_TEXTURE_CUBE_MAP 0x851B #define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C #define GL_COMBINE 0x8570 #define GL_COMBINE_RGB 0x8571 #define GL_COMBINE_ALPHA 0x8572 #define GL_RGB_SCALE 0x8573 #define GL_ADD_SIGNED 0x8574 #define GL_INTERPOLATE 0x8575 #define GL_CONSTANT 0x8576 #define GL_PRIMARY_COLOR 0x8577 #define GL_PREVIOUS 0x8578 #define GL_SOURCE0_RGB 0x8580 #define GL_SOURCE1_RGB 0x8581 #define GL_SOURCE2_RGB 0x8582 #define GL_SOURCE0_ALPHA 0x8588 #define GL_SOURCE1_ALPHA 0x8589 #define GL_SOURCE2_ALPHA 0x858A #define GL_OPERAND0_RGB 0x8590 #define GL_OPERAND1_RGB 0x8591 #define GL_OPERAND2_RGB 0x8592 #define GL_OPERAND0_ALPHA 0x8598 #define GL_OPERAND1_ALPHA 0x8599 #define GL_OPERAND2_ALPHA 0x859A #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 #define GL_TEXTURE_COMPRESSED 0x86A1 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 #define GL_DOT3_RGB 0x86AE #define GL_DOT3_RGBA 0x86AF #define GL_MULTISAMPLE_BIT 0x20000000 typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, void *img); typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); #define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) #define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) #define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) #define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) #define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) #define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) #define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) #define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) #define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) #define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) #define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) #define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) #define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) #define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) #define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) #define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) #define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) #define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) #define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) #define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) #define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) #define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) #define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) #define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) #define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) #define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) #define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) #define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) #define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) #define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) #define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) #define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) #define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) #define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) #define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) #define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) #define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) #define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) #define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) #define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) #define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) #define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) #define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) #define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) #define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) #define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) #define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) #endif /* GL_VERSION_1_3 */ /* ----------------------------- GL_VERSION_1_4 ---------------------------- */ #ifndef GL_VERSION_1_4 #define GL_VERSION_1_4 1 #define GL_BLEND_DST_RGB 0x80C8 #define GL_BLEND_SRC_RGB 0x80C9 #define GL_BLEND_DST_ALPHA 0x80CA #define GL_BLEND_SRC_ALPHA 0x80CB #define GL_POINT_SIZE_MIN 0x8126 #define GL_POINT_SIZE_MAX 0x8127 #define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 #define GL_POINT_DISTANCE_ATTENUATION 0x8129 #define GL_GENERATE_MIPMAP 0x8191 #define GL_GENERATE_MIPMAP_HINT 0x8192 #define GL_DEPTH_COMPONENT16 0x81A5 #define GL_DEPTH_COMPONENT24 0x81A6 #define GL_DEPTH_COMPONENT32 0x81A7 #define GL_MIRRORED_REPEAT 0x8370 #define GL_FOG_COORDINATE_SOURCE 0x8450 #define GL_FOG_COORDINATE 0x8451 #define GL_FRAGMENT_DEPTH 0x8452 #define GL_CURRENT_FOG_COORDINATE 0x8453 #define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 #define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 #define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 #define GL_FOG_COORDINATE_ARRAY 0x8457 #define GL_COLOR_SUM 0x8458 #define GL_CURRENT_SECONDARY_COLOR 0x8459 #define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A #define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B #define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C #define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D #define GL_SECONDARY_COLOR_ARRAY 0x845E #define GL_MAX_TEXTURE_LOD_BIAS 0x84FD #define GL_TEXTURE_FILTER_CONTROL 0x8500 #define GL_TEXTURE_LOD_BIAS 0x8501 #define GL_INCR_WRAP 0x8507 #define GL_DECR_WRAP 0x8508 #define GL_TEXTURE_DEPTH_SIZE 0x884A #define GL_DEPTH_TEXTURE_MODE 0x884B #define GL_TEXTURE_COMPARE_MODE 0x884C #define GL_TEXTURE_COMPARE_FUNC 0x884D #define GL_COMPARE_R_TO_TEXTURE 0x884E typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const* indices, GLsizei drawcount); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); #define glBlendColor GLEW_GET_FUN(__glewBlendColor) #define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) #define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) #define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) #define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) #define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) #define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) #define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) #define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) #define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) #define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) #define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) #define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) #define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) #define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) #define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) #define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) #define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) #define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) #define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) #define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) #define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) #define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) #define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) #define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) #define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) #define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) #define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) #define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) #define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) #define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) #define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) #define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) #define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) #define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) #define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) #define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) #define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) #define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) #define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) #define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) #define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) #define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) #define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) #define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) #define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) #define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) #define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) #endif /* GL_VERSION_1_4 */ /* ----------------------------- GL_VERSION_1_5 ---------------------------- */ #ifndef GL_VERSION_1_5 #define GL_VERSION_1_5 1 #define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE #define GL_FOG_COORD GL_FOG_COORDINATE #define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY #define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING #define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER #define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE #define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE #define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE #define GL_SRC0_ALPHA GL_SOURCE0_ALPHA #define GL_SRC0_RGB GL_SOURCE0_RGB #define GL_SRC1_ALPHA GL_SOURCE1_ALPHA #define GL_SRC1_RGB GL_SOURCE1_RGB #define GL_SRC2_ALPHA GL_SOURCE2_ALPHA #define GL_SRC2_RGB GL_SOURCE2_RGB #define GL_BUFFER_SIZE 0x8764 #define GL_BUFFER_USAGE 0x8765 #define GL_QUERY_COUNTER_BITS 0x8864 #define GL_CURRENT_QUERY 0x8865 #define GL_QUERY_RESULT 0x8866 #define GL_QUERY_RESULT_AVAILABLE 0x8867 #define GL_ARRAY_BUFFER 0x8892 #define GL_ELEMENT_ARRAY_BUFFER 0x8893 #define GL_ARRAY_BUFFER_BINDING 0x8894 #define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 #define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 #define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 #define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 #define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D #define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F #define GL_READ_ONLY 0x88B8 #define GL_WRITE_ONLY 0x88B9 #define GL_READ_WRITE 0x88BA #define GL_BUFFER_ACCESS 0x88BB #define GL_BUFFER_MAPPED 0x88BC #define GL_BUFFER_MAP_POINTER 0x88BD #define GL_STREAM_DRAW 0x88E0 #define GL_STREAM_READ 0x88E1 #define GL_STREAM_COPY 0x88E2 #define GL_STATIC_DRAW 0x88E4 #define GL_STATIC_READ 0x88E5 #define GL_STATIC_COPY 0x88E6 #define GL_DYNAMIC_DRAW 0x88E8 #define GL_DYNAMIC_READ 0x88E9 #define GL_DYNAMIC_COPY 0x88EA #define GL_SAMPLES_PASSED 0x8914 typedef ptrdiff_t GLintptr; typedef ptrdiff_t GLsizeiptr; typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void* data, GLenum usage); typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data); typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, void** params); typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, void* data); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); typedef void* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); #define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) #define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) #define glBufferData GLEW_GET_FUN(__glewBufferData) #define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) #define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) #define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) #define glEndQuery GLEW_GET_FUN(__glewEndQuery) #define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) #define glGenQueries GLEW_GET_FUN(__glewGenQueries) #define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) #define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) #define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) #define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) #define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) #define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) #define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) #define glIsQuery GLEW_GET_FUN(__glewIsQuery) #define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) #define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) #define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) #endif /* GL_VERSION_1_5 */ /* ----------------------------- GL_VERSION_2_0 ---------------------------- */ #ifndef GL_VERSION_2_0 #define GL_VERSION_2_0 1 #define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION #define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 #define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 #define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 #define GL_CURRENT_VERTEX_ATTRIB 0x8626 #define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 #define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 #define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 #define GL_STENCIL_BACK_FUNC 0x8800 #define GL_STENCIL_BACK_FAIL 0x8801 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 #define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 #define GL_MAX_DRAW_BUFFERS 0x8824 #define GL_DRAW_BUFFER0 0x8825 #define GL_DRAW_BUFFER1 0x8826 #define GL_DRAW_BUFFER2 0x8827 #define GL_DRAW_BUFFER3 0x8828 #define GL_DRAW_BUFFER4 0x8829 #define GL_DRAW_BUFFER5 0x882A #define GL_DRAW_BUFFER6 0x882B #define GL_DRAW_BUFFER7 0x882C #define GL_DRAW_BUFFER8 0x882D #define GL_DRAW_BUFFER9 0x882E #define GL_DRAW_BUFFER10 0x882F #define GL_DRAW_BUFFER11 0x8830 #define GL_DRAW_BUFFER12 0x8831 #define GL_DRAW_BUFFER13 0x8832 #define GL_DRAW_BUFFER14 0x8833 #define GL_DRAW_BUFFER15 0x8834 #define GL_BLEND_EQUATION_ALPHA 0x883D #define GL_POINT_SPRITE 0x8861 #define GL_COORD_REPLACE 0x8862 #define GL_MAX_VERTEX_ATTRIBS 0x8869 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A #define GL_MAX_TEXTURE_COORDS 0x8871 #define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 #define GL_FRAGMENT_SHADER 0x8B30 #define GL_VERTEX_SHADER 0x8B31 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A #define GL_MAX_VARYING_FLOATS 0x8B4B #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D #define GL_SHADER_TYPE 0x8B4F #define GL_FLOAT_VEC2 0x8B50 #define GL_FLOAT_VEC3 0x8B51 #define GL_FLOAT_VEC4 0x8B52 #define GL_INT_VEC2 0x8B53 #define GL_INT_VEC3 0x8B54 #define GL_INT_VEC4 0x8B55 #define GL_BOOL 0x8B56 #define GL_BOOL_VEC2 0x8B57 #define GL_BOOL_VEC3 0x8B58 #define GL_BOOL_VEC4 0x8B59 #define GL_FLOAT_MAT2 0x8B5A #define GL_FLOAT_MAT3 0x8B5B #define GL_FLOAT_MAT4 0x8B5C #define GL_SAMPLER_1D 0x8B5D #define GL_SAMPLER_2D 0x8B5E #define GL_SAMPLER_3D 0x8B5F #define GL_SAMPLER_CUBE 0x8B60 #define GL_SAMPLER_1D_SHADOW 0x8B61 #define GL_SAMPLER_2D_SHADOW 0x8B62 #define GL_DELETE_STATUS 0x8B80 #define GL_COMPILE_STATUS 0x8B81 #define GL_LINK_STATUS 0x8B82 #define GL_VALIDATE_STATUS 0x8B83 #define GL_INFO_LOG_LENGTH 0x8B84 #define GL_ATTACHED_SHADERS 0x8B85 #define GL_ACTIVE_UNIFORMS 0x8B86 #define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 #define GL_SHADER_SOURCE_LENGTH 0x8B88 #define GL_ACTIVE_ATTRIBUTES 0x8B89 #define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B #define GL_SHADING_LANGUAGE_VERSION 0x8B8C #define GL_CURRENT_PROGRAM 0x8B8D #define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 #define GL_LOWER_LEFT 0x8CA1 #define GL_UPPER_LEFT 0x8CA2 #define GL_STENCIL_BACK_REF 0x8CA3 #define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 #define GL_STENCIL_BACK_WRITEMASK 0x8CA5 typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void** pointer); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const* string, const GLint* length); typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); #define glAttachShader GLEW_GET_FUN(__glewAttachShader) #define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) #define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) #define glCompileShader GLEW_GET_FUN(__glewCompileShader) #define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) #define glCreateShader GLEW_GET_FUN(__glewCreateShader) #define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) #define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) #define glDetachShader GLEW_GET_FUN(__glewDetachShader) #define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) #define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) #define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) #define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) #define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) #define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) #define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) #define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) #define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) #define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) #define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) #define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) #define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) #define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) #define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) #define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) #define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) #define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) #define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) #define glIsProgram GLEW_GET_FUN(__glewIsProgram) #define glIsShader GLEW_GET_FUN(__glewIsShader) #define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) #define glShaderSource GLEW_GET_FUN(__glewShaderSource) #define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) #define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) #define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) #define glUniform1f GLEW_GET_FUN(__glewUniform1f) #define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) #define glUniform1i GLEW_GET_FUN(__glewUniform1i) #define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) #define glUniform2f GLEW_GET_FUN(__glewUniform2f) #define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) #define glUniform2i GLEW_GET_FUN(__glewUniform2i) #define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) #define glUniform3f GLEW_GET_FUN(__glewUniform3f) #define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) #define glUniform3i GLEW_GET_FUN(__glewUniform3i) #define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) #define glUniform4f GLEW_GET_FUN(__glewUniform4f) #define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) #define glUniform4i GLEW_GET_FUN(__glewUniform4i) #define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) #define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) #define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) #define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) #define glUseProgram GLEW_GET_FUN(__glewUseProgram) #define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) #define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) #define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) #define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) #define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) #define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) #define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) #define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) #define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) #define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) #define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) #define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) #define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) #define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) #define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) #define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) #define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) #define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) #define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) #define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) #define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) #define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) #define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) #define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) #define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) #define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) #define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) #define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) #define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) #define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) #define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) #define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) #define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) #define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) #define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) #define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) #define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) #define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) #define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) #endif /* GL_VERSION_2_0 */ /* ----------------------------- GL_VERSION_2_1 ---------------------------- */ #ifndef GL_VERSION_2_1 #define GL_VERSION_2_1 1 #define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F #define GL_PIXEL_PACK_BUFFER 0x88EB #define GL_PIXEL_UNPACK_BUFFER 0x88EC #define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED #define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF #define GL_FLOAT_MAT2x3 0x8B65 #define GL_FLOAT_MAT2x4 0x8B66 #define GL_FLOAT_MAT3x2 0x8B67 #define GL_FLOAT_MAT3x4 0x8B68 #define GL_FLOAT_MAT4x2 0x8B69 #define GL_FLOAT_MAT4x3 0x8B6A #define GL_SRGB 0x8C40 #define GL_SRGB8 0x8C41 #define GL_SRGB_ALPHA 0x8C42 #define GL_SRGB8_ALPHA8 0x8C43 #define GL_SLUMINANCE_ALPHA 0x8C44 #define GL_SLUMINANCE8_ALPHA8 0x8C45 #define GL_SLUMINANCE 0x8C46 #define GL_SLUMINANCE8 0x8C47 #define GL_COMPRESSED_SRGB 0x8C48 #define GL_COMPRESSED_SRGB_ALPHA 0x8C49 #define GL_COMPRESSED_SLUMINANCE 0x8C4A #define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); #define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) #define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) #define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) #define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) #define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) #define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) #define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) #endif /* GL_VERSION_2_1 */ /* ----------------------------- GL_VERSION_3_0 ---------------------------- */ #ifndef GL_VERSION_3_0 #define GL_VERSION_3_0 1 #define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 #define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 #define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 #define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 #define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 #define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 #define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB #define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES #define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS #define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 #define GL_MAJOR_VERSION 0x821B #define GL_MINOR_VERSION 0x821C #define GL_NUM_EXTENSIONS 0x821D #define GL_CONTEXT_FLAGS 0x821E #define GL_DEPTH_BUFFER 0x8223 #define GL_STENCIL_BUFFER 0x8224 #define GL_RGBA32F 0x8814 #define GL_RGB32F 0x8815 #define GL_RGBA16F 0x881A #define GL_RGB16F 0x881B #define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD #define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF #define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 #define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 #define GL_CLAMP_VERTEX_COLOR 0x891A #define GL_CLAMP_FRAGMENT_COLOR 0x891B #define GL_CLAMP_READ_COLOR 0x891C #define GL_FIXED_ONLY 0x891D #define GL_TEXTURE_RED_TYPE 0x8C10 #define GL_TEXTURE_GREEN_TYPE 0x8C11 #define GL_TEXTURE_BLUE_TYPE 0x8C12 #define GL_TEXTURE_ALPHA_TYPE 0x8C13 #define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 #define GL_TEXTURE_INTENSITY_TYPE 0x8C15 #define GL_TEXTURE_DEPTH_TYPE 0x8C16 #define GL_TEXTURE_1D_ARRAY 0x8C18 #define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 #define GL_TEXTURE_2D_ARRAY 0x8C1A #define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B #define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C #define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D #define GL_R11F_G11F_B10F 0x8C3A #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B #define GL_RGB9_E5 0x8C3D #define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E #define GL_TEXTURE_SHARED_SIZE 0x8C3F #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 #define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 #define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 #define GL_PRIMITIVES_GENERATED 0x8C87 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 #define GL_RASTERIZER_DISCARD 0x8C89 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B #define GL_INTERLEAVED_ATTRIBS 0x8C8C #define GL_SEPARATE_ATTRIBS 0x8C8D #define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F #define GL_RGBA32UI 0x8D70 #define GL_RGB32UI 0x8D71 #define GL_RGBA16UI 0x8D76 #define GL_RGB16UI 0x8D77 #define GL_RGBA8UI 0x8D7C #define GL_RGB8UI 0x8D7D #define GL_RGBA32I 0x8D82 #define GL_RGB32I 0x8D83 #define GL_RGBA16I 0x8D88 #define GL_RGB16I 0x8D89 #define GL_RGBA8I 0x8D8E #define GL_RGB8I 0x8D8F #define GL_RED_INTEGER 0x8D94 #define GL_GREEN_INTEGER 0x8D95 #define GL_BLUE_INTEGER 0x8D96 #define GL_ALPHA_INTEGER 0x8D97 #define GL_RGB_INTEGER 0x8D98 #define GL_RGBA_INTEGER 0x8D99 #define GL_BGR_INTEGER 0x8D9A #define GL_BGRA_INTEGER 0x8D9B #define GL_SAMPLER_1D_ARRAY 0x8DC0 #define GL_SAMPLER_2D_ARRAY 0x8DC1 #define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 #define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 #define GL_SAMPLER_CUBE_SHADOW 0x8DC5 #define GL_UNSIGNED_INT_VEC2 0x8DC6 #define GL_UNSIGNED_INT_VEC3 0x8DC7 #define GL_UNSIGNED_INT_VEC4 0x8DC8 #define GL_INT_SAMPLER_1D 0x8DC9 #define GL_INT_SAMPLER_2D 0x8DCA #define GL_INT_SAMPLER_3D 0x8DCB #define GL_INT_SAMPLER_CUBE 0x8DCC #define GL_INT_SAMPLER_1D_ARRAY 0x8DCE #define GL_INT_SAMPLER_2D_ARRAY 0x8DCF #define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 #define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 #define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 #define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 #define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 #define GL_QUERY_WAIT 0x8E13 #define GL_QUERY_NO_WAIT 0x8E14 #define GL_QUERY_BY_REGION_WAIT 0x8E15 #define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint colorNumber, const GLchar* name); typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawBuffer, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawBuffer, const GLint* value); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawBuffer, const GLuint* value); typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint buf, GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum cap, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum cap, GLuint index); typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum pname, GLuint index, GLboolean* data); typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar* name); typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint* params); typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum cap, GLuint index); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar *const* varyings, GLenum bufferMode); typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint v0, GLint v1); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint v0, GLuint v1); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint v0, GLint v1, GLint v2); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort* v0); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void*pointer); #define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) #define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) #define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) #define glClampColor GLEW_GET_FUN(__glewClampColor) #define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) #define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) #define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) #define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) #define glColorMaski GLEW_GET_FUN(__glewColorMaski) #define glDisablei GLEW_GET_FUN(__glewDisablei) #define glEnablei GLEW_GET_FUN(__glewEnablei) #define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) #define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) #define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) #define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) #define glGetStringi GLEW_GET_FUN(__glewGetStringi) #define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) #define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) #define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) #define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) #define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) #define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) #define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) #define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) #define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) #define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) #define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) #define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) #define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) #define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) #define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) #define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) #define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) #define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) #define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) #define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) #define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) #define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) #define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) #define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) #define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) #define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) #define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) #define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) #define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) #define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) #define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) #define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) #define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) #define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) #define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) #define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) #define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) #define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) #define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) #define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) #endif /* GL_VERSION_3_0 */ /* ----------------------------- GL_VERSION_3_1 ---------------------------- */ #ifndef GL_VERSION_3_1 #define GL_VERSION_3_1 1 #define GL_TEXTURE_RECTANGLE 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 #define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 #define GL_SAMPLER_2D_RECT 0x8B63 #define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 #define GL_TEXTURE_BUFFER 0x8C2A #define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B #define GL_TEXTURE_BINDING_BUFFER 0x8C2C #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D #define GL_TEXTURE_BUFFER_FORMAT 0x8C2E #define GL_SAMPLER_BUFFER 0x8DC2 #define GL_INT_SAMPLER_2D_RECT 0x8DCD #define GL_INT_SAMPLER_BUFFER 0x8DD0 #define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 #define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 #define GL_RED_SNORM 0x8F90 #define GL_RG_SNORM 0x8F91 #define GL_RGB_SNORM 0x8F92 #define GL_RGBA_SNORM 0x8F93 #define GL_R8_SNORM 0x8F94 #define GL_RG8_SNORM 0x8F95 #define GL_RGB8_SNORM 0x8F96 #define GL_RGBA8_SNORM 0x8F97 #define GL_R16_SNORM 0x8F98 #define GL_RG16_SNORM 0x8F99 #define GL_RGB16_SNORM 0x8F9A #define GL_RGBA16_SNORM 0x8F9B #define GL_SIGNED_NORMALIZED 0x8F9C #define GL_PRIMITIVE_RESTART 0x8F9D #define GL_PRIMITIVE_RESTART_INDEX 0x8F9E #define GL_BUFFER_ACCESS_FLAGS 0x911F #define GL_BUFFER_MAP_LENGTH 0x9120 #define GL_BUFFER_MAP_OFFSET 0x9121 typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalFormat, GLuint buffer); #define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) #define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) #define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) #define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) #define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) #endif /* GL_VERSION_3_1 */ /* ----------------------------- GL_VERSION_3_2 ---------------------------- */ #ifndef GL_VERSION_3_2 #define GL_VERSION_3_2 1 #define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 #define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 #define GL_LINES_ADJACENCY 0x000A #define GL_LINE_STRIP_ADJACENCY 0x000B #define GL_TRIANGLES_ADJACENCY 0x000C #define GL_TRIANGLE_STRIP_ADJACENCY 0x000D #define GL_PROGRAM_POINT_SIZE 0x8642 #define GL_GEOMETRY_VERTICES_OUT 0x8916 #define GL_GEOMETRY_INPUT_TYPE 0x8917 #define GL_GEOMETRY_OUTPUT_TYPE 0x8918 #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 #define GL_GEOMETRY_SHADER 0x8DD9 #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF #define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 #define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 #define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 #define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 #define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 #define GL_CONTEXT_PROFILE_MASK 0x9126 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum value, GLint64 * data); typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum pname, GLuint index, GLint64 * data); #define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) #define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) #define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) #define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) #endif /* GL_VERSION_3_2 */ /* ----------------------------- GL_VERSION_3_3 ---------------------------- */ #ifndef GL_VERSION_3_3 #define GL_VERSION_3_3 1 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE #define GL_RGB10_A2UI 0x906F typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); #define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) #define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) #endif /* GL_VERSION_3_3 */ /* ----------------------------- GL_VERSION_4_0 ---------------------------- */ #ifndef GL_VERSION_4_0 #define GL_VERSION_4_0 1 #define GL_SAMPLE_SHADING 0x8C36 #define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 #define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E #define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F #define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F #define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 #define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A #define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B #define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D #define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E #define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); #define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) #define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) #define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) #define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) #define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) #define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) #endif /* GL_VERSION_4_0 */ /* ----------------------------- GL_VERSION_4_1 ---------------------------- */ #ifndef GL_VERSION_4_1 #define GL_VERSION_4_1 1 #define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) #endif /* GL_VERSION_4_1 */ /* ----------------------------- GL_VERSION_4_2 ---------------------------- */ #ifndef GL_VERSION_4_2 #define GL_VERSION_4_2 1 #define GL_TRANSFORM_FEEDBACK_PAUSED 0x8E23 #define GL_TRANSFORM_FEEDBACK_ACTIVE 0x8E24 #define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F #define GL_COPY_READ_BUFFER_BINDING 0x8F36 #define GL_COPY_WRITE_BUFFER_BINDING 0x8F37 #define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2) #endif /* GL_VERSION_4_2 */ /* ----------------------------- GL_VERSION_4_3 ---------------------------- */ #ifndef GL_VERSION_4_3 #define GL_VERSION_4_3 1 #define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9 #define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E #define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3) #endif /* GL_VERSION_4_3 */ /* ----------------------------- GL_VERSION_4_4 ---------------------------- */ #ifndef GL_VERSION_4_4 #define GL_VERSION_4_4 1 #define GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED 0x8221 #define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5 #define GL_TEXTURE_BUFFER_BINDING 0x8C2A #define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4) #endif /* GL_VERSION_4_4 */ /* ----------------------------- GL_VERSION_4_5 ---------------------------- */ #ifndef GL_VERSION_4_5 #define GL_VERSION_4_5 1 #define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004 typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSPROC) (void); typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *pixels); typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEPROC) (GLenum tex, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); #define glGetGraphicsResetStatus GLEW_GET_FUN(__glewGetGraphicsResetStatus) #define glGetnCompressedTexImage GLEW_GET_FUN(__glewGetnCompressedTexImage) #define glGetnTexImage GLEW_GET_FUN(__glewGetnTexImage) #define glGetnUniformdv GLEW_GET_FUN(__glewGetnUniformdv) #define GLEW_VERSION_4_5 GLEW_GET_VAR(__GLEW_VERSION_4_5) #endif /* GL_VERSION_4_5 */ /* -------------------------- GL_3DFX_multisample -------------------------- */ #ifndef GL_3DFX_multisample #define GL_3DFX_multisample 1 #define GL_MULTISAMPLE_3DFX 0x86B2 #define GL_SAMPLE_BUFFERS_3DFX 0x86B3 #define GL_SAMPLES_3DFX 0x86B4 #define GL_MULTISAMPLE_BIT_3DFX 0x20000000 #define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) #endif /* GL_3DFX_multisample */ /* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ #ifndef GL_3DFX_tbuffer #define GL_3DFX_tbuffer 1 typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); #define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) #define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) #endif /* GL_3DFX_tbuffer */ /* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ #ifndef GL_3DFX_texture_compression_FXT1 #define GL_3DFX_texture_compression_FXT1 1 #define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 #define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 #define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) #endif /* GL_3DFX_texture_compression_FXT1 */ /* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */ #ifndef GL_AMD_blend_minmax_factor #define GL_AMD_blend_minmax_factor 1 #define GL_FACTOR_MIN_AMD 0x901C #define GL_FACTOR_MAX_AMD 0x901D #define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor) #endif /* GL_AMD_blend_minmax_factor */ /* ----------------------- GL_AMD_conservative_depth ----------------------- */ #ifndef GL_AMD_conservative_depth #define GL_AMD_conservative_depth 1 #define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) #endif /* GL_AMD_conservative_depth */ /* -------------------------- GL_AMD_debug_output -------------------------- */ #ifndef GL_AMD_debug_output #define GL_AMD_debug_output 1 #define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 #define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 #define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 #define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 #define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 #define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 #define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 #define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A #define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B #define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C #define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D #define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E #define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F #define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 typedef void (GLAPIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, void* userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void *userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf); typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message); #define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) #define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) #define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) #define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) #define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) #endif /* GL_AMD_debug_output */ /* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ #ifndef GL_AMD_depth_clamp_separate #define GL_AMD_depth_clamp_separate 1 #define GL_DEPTH_CLAMP_NEAR_AMD 0x901E #define GL_DEPTH_CLAMP_FAR_AMD 0x901F #define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) #endif /* GL_AMD_depth_clamp_separate */ /* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ #ifndef GL_AMD_draw_buffers_blend #define GL_AMD_draw_buffers_blend 1 typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); #define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) #define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) #define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) #define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) #define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) #endif /* GL_AMD_draw_buffers_blend */ /* --------------------------- GL_AMD_gcn_shader --------------------------- */ #ifndef GL_AMD_gcn_shader #define GL_AMD_gcn_shader 1 #define GLEW_AMD_gcn_shader GLEW_GET_VAR(__GLEW_AMD_gcn_shader) #endif /* GL_AMD_gcn_shader */ /* ------------------------ GL_AMD_gpu_shader_int64 ------------------------ */ #ifndef GL_AMD_gpu_shader_int64 #define GL_AMD_gpu_shader_int64 1 #define GLEW_AMD_gpu_shader_int64 GLEW_GET_VAR(__GLEW_AMD_gpu_shader_int64) #endif /* GL_AMD_gpu_shader_int64 */ /* ---------------------- GL_AMD_interleaved_elements ---------------------- */ #ifndef GL_AMD_interleaved_elements #define GL_AMD_interleaved_elements 1 #define GL_RED 0x1903 #define GL_GREEN 0x1904 #define GL_BLUE 0x1905 #define GL_ALPHA 0x1906 #define GL_RG8UI 0x8238 #define GL_RG16UI 0x823A #define GL_RGBA8UI 0x8D7C #define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4 #define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5 typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param); #define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD) #define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements) #endif /* GL_AMD_interleaved_elements */ /* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */ #ifndef GL_AMD_multi_draw_indirect #define GL_AMD_multi_draw_indirect 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); #define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD) #define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD) #define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect) #endif /* GL_AMD_multi_draw_indirect */ /* ------------------------- GL_AMD_name_gen_delete ------------------------ */ #ifndef GL_AMD_name_gen_delete #define GL_AMD_name_gen_delete 1 #define GL_DATA_BUFFER_AMD 0x9151 #define GL_PERFORMANCE_MONITOR_AMD 0x9152 #define GL_QUERY_OBJECT_AMD 0x9153 #define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 #define GL_SAMPLER_OBJECT_AMD 0x9155 typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); #define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) #define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) #define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) #define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) #endif /* GL_AMD_name_gen_delete */ /* ---------------------- GL_AMD_occlusion_query_event --------------------- */ #ifndef GL_AMD_occlusion_query_event #define GL_AMD_occlusion_query_event 1 #define GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD 0x00000001 #define GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD 0x00000002 #define GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD 0x00000004 #define GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD 0x00000008 #define GL_OCCLUSION_QUERY_EVENT_MASK_AMD 0x874F #define GL_QUERY_ALL_EVENT_BITS_AMD 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLQUERYOBJECTPARAMETERUIAMDPROC) (GLenum target, GLuint id, GLenum pname, GLuint param); #define glQueryObjectParameteruiAMD GLEW_GET_FUN(__glewQueryObjectParameteruiAMD) #define GLEW_AMD_occlusion_query_event GLEW_GET_VAR(__GLEW_AMD_occlusion_query_event) #endif /* GL_AMD_occlusion_query_event */ /* ----------------------- GL_AMD_performance_monitor ---------------------- */ #ifndef GL_AMD_performance_monitor #define GL_AMD_performance_monitor 1 #define GL_COUNTER_TYPE_AMD 0x8BC0 #define GL_COUNTER_RANGE_AMD 0x8BC1 #define GL_UNSIGNED_INT64_AMD 0x8BC2 #define GL_PERCENTAGE_AMD 0x8BC3 #define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 #define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 #define GL_PERFMON_RESULT_AMD 0x8BC6 typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void *data); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString); typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); #define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) #define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) #define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) #define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) #define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) #define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) #define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) #define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) #define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) #define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) #define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) #define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) #endif /* GL_AMD_performance_monitor */ /* -------------------------- GL_AMD_pinned_memory ------------------------- */ #ifndef GL_AMD_pinned_memory #define GL_AMD_pinned_memory 1 #define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160 #define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory) #endif /* GL_AMD_pinned_memory */ /* ----------------------- GL_AMD_query_buffer_object ---------------------- */ #ifndef GL_AMD_query_buffer_object #define GL_AMD_query_buffer_object 1 #define GL_QUERY_BUFFER_AMD 0x9192 #define GL_QUERY_BUFFER_BINDING_AMD 0x9193 #define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194 #define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object) #endif /* GL_AMD_query_buffer_object */ /* ------------------------ GL_AMD_sample_positions ------------------------ */ #ifndef GL_AMD_sample_positions #define GL_AMD_sample_positions 1 #define GL_SUBSAMPLE_DISTANCE_AMD 0x883F typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val); #define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD) #define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions) #endif /* GL_AMD_sample_positions */ /* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ #ifndef GL_AMD_seamless_cubemap_per_texture #define GL_AMD_seamless_cubemap_per_texture 1 #define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F #define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) #endif /* GL_AMD_seamless_cubemap_per_texture */ /* -------------------- GL_AMD_shader_atomic_counter_ops ------------------- */ #ifndef GL_AMD_shader_atomic_counter_ops #define GL_AMD_shader_atomic_counter_ops 1 #define GLEW_AMD_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_AMD_shader_atomic_counter_ops) #endif /* GL_AMD_shader_atomic_counter_ops */ /* ---------------------- GL_AMD_shader_stencil_export --------------------- */ #ifndef GL_AMD_shader_stencil_export #define GL_AMD_shader_stencil_export 1 #define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) #endif /* GL_AMD_shader_stencil_export */ /* ------------------- GL_AMD_shader_stencil_value_export ------------------ */ #ifndef GL_AMD_shader_stencil_value_export #define GL_AMD_shader_stencil_value_export 1 #define GLEW_AMD_shader_stencil_value_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_value_export) #endif /* GL_AMD_shader_stencil_value_export */ /* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */ #ifndef GL_AMD_shader_trinary_minmax #define GL_AMD_shader_trinary_minmax 1 #define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax) #endif /* GL_AMD_shader_trinary_minmax */ /* ------------------------- GL_AMD_sparse_texture ------------------------- */ #ifndef GL_AMD_sparse_texture #define GL_AMD_sparse_texture 1 #define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001 #define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195 #define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196 #define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197 #define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198 #define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199 #define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A #define GL_MIN_SPARSE_LEVEL_AMD 0x919B #define GL_MIN_LOD_WARNING_AMD 0x919C typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags); #define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD) #define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD) #define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture) #endif /* GL_AMD_sparse_texture */ /* ------------------- GL_AMD_stencil_operation_extended ------------------- */ #ifndef GL_AMD_stencil_operation_extended #define GL_AMD_stencil_operation_extended 1 #define GL_SET_AMD 0x874A #define GL_REPLACE_VALUE_AMD 0x874B #define GL_STENCIL_OP_VALUE_AMD 0x874C #define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value); #define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD) #define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended) #endif /* GL_AMD_stencil_operation_extended */ /* ------------------------ GL_AMD_texture_texture4 ------------------------ */ #ifndef GL_AMD_texture_texture4 #define GL_AMD_texture_texture4 1 #define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) #endif /* GL_AMD_texture_texture4 */ /* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ #ifndef GL_AMD_transform_feedback3_lines_triangles #define GL_AMD_transform_feedback3_lines_triangles 1 #define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) #endif /* GL_AMD_transform_feedback3_lines_triangles */ /* ----------------------- GL_AMD_transform_feedback4 ---------------------- */ #ifndef GL_AMD_transform_feedback4 #define GL_AMD_transform_feedback4 1 #define GL_STREAM_RASTERIZATION_AMD 0x91A0 #define GLEW_AMD_transform_feedback4 GLEW_GET_VAR(__GLEW_AMD_transform_feedback4) #endif /* GL_AMD_transform_feedback4 */ /* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */ #ifndef GL_AMD_vertex_shader_layer #define GL_AMD_vertex_shader_layer 1 #define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer) #endif /* GL_AMD_vertex_shader_layer */ /* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ #ifndef GL_AMD_vertex_shader_tessellator #define GL_AMD_vertex_shader_tessellator 1 #define GL_SAMPLER_BUFFER_AMD 0x9001 #define GL_INT_SAMPLER_BUFFER_AMD 0x9002 #define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 #define GL_TESSELLATION_MODE_AMD 0x9004 #define GL_TESSELLATION_FACTOR_AMD 0x9005 #define GL_DISCRETE_AMD 0x9006 #define GL_CONTINUOUS_AMD 0x9007 typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); #define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) #define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) #define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) #endif /* GL_AMD_vertex_shader_tessellator */ /* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */ #ifndef GL_AMD_vertex_shader_viewport_index #define GL_AMD_vertex_shader_viewport_index 1 #define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index) #endif /* GL_AMD_vertex_shader_viewport_index */ /* ------------------------- GL_ANGLE_depth_texture ------------------------ */ #ifndef GL_ANGLE_depth_texture #define GL_ANGLE_depth_texture 1 #define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture) #endif /* GL_ANGLE_depth_texture */ /* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */ #ifndef GL_ANGLE_framebuffer_blit #define GL_ANGLE_framebuffer_blit 1 #define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 #define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 #define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 #define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE) #define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit) #endif /* GL_ANGLE_framebuffer_blit */ /* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */ #ifndef GL_ANGLE_framebuffer_multisample #define GL_ANGLE_framebuffer_multisample 1 #define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 #define GL_MAX_SAMPLES_ANGLE 0x8D57 typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE) #define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample) #endif /* GL_ANGLE_framebuffer_multisample */ /* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */ #ifndef GL_ANGLE_instanced_arrays #define GL_ANGLE_instanced_arrays 1 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor); #define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE) #define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE) #define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE) #define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays) #endif /* GL_ANGLE_instanced_arrays */ /* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */ #ifndef GL_ANGLE_pack_reverse_row_order #define GL_ANGLE_pack_reverse_row_order 1 #define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 #define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order) #endif /* GL_ANGLE_pack_reverse_row_order */ /* ------------------------ GL_ANGLE_program_binary ------------------------ */ #ifndef GL_ANGLE_program_binary #define GL_ANGLE_program_binary 1 #define GL_PROGRAM_BINARY_ANGLE 0x93A6 #define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary) #endif /* GL_ANGLE_program_binary */ /* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */ #ifndef GL_ANGLE_texture_compression_dxt1 #define GL_ANGLE_texture_compression_dxt1 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 #define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1) #endif /* GL_ANGLE_texture_compression_dxt1 */ /* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */ #ifndef GL_ANGLE_texture_compression_dxt3 #define GL_ANGLE_texture_compression_dxt3 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 #define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3) #endif /* GL_ANGLE_texture_compression_dxt3 */ /* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */ #ifndef GL_ANGLE_texture_compression_dxt5 #define GL_ANGLE_texture_compression_dxt5 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3 #define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5) #endif /* GL_ANGLE_texture_compression_dxt5 */ /* ------------------------- GL_ANGLE_texture_usage ------------------------ */ #ifndef GL_ANGLE_texture_usage #define GL_ANGLE_texture_usage 1 #define GL_TEXTURE_USAGE_ANGLE 0x93A2 #define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3 #define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage) #endif /* GL_ANGLE_texture_usage */ /* -------------------------- GL_ANGLE_timer_query ------------------------- */ #ifndef GL_ANGLE_timer_query #define GL_ANGLE_timer_query 1 #define GL_QUERY_COUNTER_BITS_ANGLE 0x8864 #define GL_CURRENT_QUERY_ANGLE 0x8865 #define GL_QUERY_RESULT_ANGLE 0x8866 #define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867 #define GL_TIME_ELAPSED_ANGLE 0x88BF #define GL_TIMESTAMP_ANGLE 0x8E28 typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target); #define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE) #define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE) #define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE) #define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE) #define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE) #define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE) #define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE) #define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE) #define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE) #define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE) #define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE) #define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query) #endif /* GL_ANGLE_timer_query */ /* ------------------- GL_ANGLE_translated_shader_source ------------------- */ #ifndef GL_ANGLE_translated_shader_source #define GL_ANGLE_translated_shader_source 1 #define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source); #define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE) #define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source) #endif /* GL_ANGLE_translated_shader_source */ /* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ #ifndef GL_APPLE_aux_depth_stencil #define GL_APPLE_aux_depth_stencil 1 #define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 #define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) #endif /* GL_APPLE_aux_depth_stencil */ /* ------------------------ GL_APPLE_client_storage ------------------------ */ #ifndef GL_APPLE_client_storage #define GL_APPLE_client_storage 1 #define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 #define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) #endif /* GL_APPLE_client_storage */ /* ------------------------- GL_APPLE_element_array ------------------------ */ #ifndef GL_APPLE_element_array #define GL_APPLE_element_array 1 #define GL_ELEMENT_ARRAY_APPLE 0x8A0C #define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D #define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void *pointer); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); #define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) #define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) #define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) #define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) #define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) #define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) #endif /* GL_APPLE_element_array */ /* ----------------------------- GL_APPLE_fence ---------------------------- */ #ifndef GL_APPLE_fence #define GL_APPLE_fence 1 #define GL_DRAW_PIXELS_APPLE 0x8A0A #define GL_FENCE_APPLE 0x8A0B typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); #define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) #define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) #define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) #define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) #define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) #define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) #define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) #define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) #define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) #endif /* GL_APPLE_fence */ /* ------------------------- GL_APPLE_float_pixels ------------------------- */ #ifndef GL_APPLE_float_pixels #define GL_APPLE_float_pixels 1 #define GL_HALF_APPLE 0x140B #define GL_RGBA_FLOAT32_APPLE 0x8814 #define GL_RGB_FLOAT32_APPLE 0x8815 #define GL_ALPHA_FLOAT32_APPLE 0x8816 #define GL_INTENSITY_FLOAT32_APPLE 0x8817 #define GL_LUMINANCE_FLOAT32_APPLE 0x8818 #define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 #define GL_RGBA_FLOAT16_APPLE 0x881A #define GL_RGB_FLOAT16_APPLE 0x881B #define GL_ALPHA_FLOAT16_APPLE 0x881C #define GL_INTENSITY_FLOAT16_APPLE 0x881D #define GL_LUMINANCE_FLOAT16_APPLE 0x881E #define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F #define GL_COLOR_FLOAT_APPLE 0x8A0F #define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) #endif /* GL_APPLE_float_pixels */ /* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ #ifndef GL_APPLE_flush_buffer_range #define GL_APPLE_flush_buffer_range 1 #define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 #define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); #define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) #define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) #define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) #endif /* GL_APPLE_flush_buffer_range */ /* ----------------------- GL_APPLE_object_purgeable ----------------------- */ #ifndef GL_APPLE_object_purgeable #define GL_APPLE_object_purgeable 1 #define GL_BUFFER_OBJECT_APPLE 0x85B3 #define GL_RELEASED_APPLE 0x8A19 #define GL_VOLATILE_APPLE 0x8A1A #define GL_RETAINED_APPLE 0x8A1B #define GL_UNDEFINED_APPLE 0x8A1C #define GL_PURGEABLE_APPLE 0x8A1D typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); #define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) #define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) #define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) #define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) #endif /* GL_APPLE_object_purgeable */ /* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ #ifndef GL_APPLE_pixel_buffer #define GL_APPLE_pixel_buffer 1 #define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 #define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) #endif /* GL_APPLE_pixel_buffer */ /* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ #ifndef GL_APPLE_rgb_422 #define GL_APPLE_rgb_422 1 #define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA #define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB #define GL_RGB_422_APPLE 0x8A1F #define GL_RGB_RAW_422_APPLE 0x8A51 #define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) #endif /* GL_APPLE_rgb_422 */ /* --------------------------- GL_APPLE_row_bytes -------------------------- */ #ifndef GL_APPLE_row_bytes #define GL_APPLE_row_bytes 1 #define GL_PACK_ROW_BYTES_APPLE 0x8A15 #define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 #define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) #endif /* GL_APPLE_row_bytes */ /* ------------------------ GL_APPLE_specular_vector ----------------------- */ #ifndef GL_APPLE_specular_vector #define GL_APPLE_specular_vector 1 #define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 #define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) #endif /* GL_APPLE_specular_vector */ /* ------------------------- GL_APPLE_texture_range ------------------------ */ #ifndef GL_APPLE_texture_range #define GL_APPLE_texture_range 1 #define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 #define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 #define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC #define GL_STORAGE_PRIVATE_APPLE 0x85BD #define GL_STORAGE_CACHED_APPLE 0x85BE #define GL_STORAGE_SHARED_APPLE 0x85BF typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, void **params); typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, void *pointer); #define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) #define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) #define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) #endif /* GL_APPLE_texture_range */ /* ------------------------ GL_APPLE_transform_hint ------------------------ */ #ifndef GL_APPLE_transform_hint #define GL_APPLE_transform_hint 1 #define GL_TRANSFORM_HINT_APPLE 0x85B1 #define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) #endif /* GL_APPLE_transform_hint */ /* ---------------------- GL_APPLE_vertex_array_object --------------------- */ #ifndef GL_APPLE_vertex_array_object #define GL_APPLE_vertex_array_object 1 #define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); #define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) #define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) #define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) #define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) #define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) #endif /* GL_APPLE_vertex_array_object */ /* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ #ifndef GL_APPLE_vertex_array_range #define GL_APPLE_vertex_array_range 1 #define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D #define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E #define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F #define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 #define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 #define GL_STORAGE_CLIENT_APPLE 0x85B4 #define GL_STORAGE_CACHED_APPLE 0x85BE #define GL_STORAGE_SHARED_APPLE 0x85BF typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void *pointer); #define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) #define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) #define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) #define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) #endif /* GL_APPLE_vertex_array_range */ /* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ #ifndef GL_APPLE_vertex_program_evaluators #define GL_APPLE_vertex_program_evaluators 1 #define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 #define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 #define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 #define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 #define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 #define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 #define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 #define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 #define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 #define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); #define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) #define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) #define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) #define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) #define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) #define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) #define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) #define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) #endif /* GL_APPLE_vertex_program_evaluators */ /* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ #ifndef GL_APPLE_ycbcr_422 #define GL_APPLE_ycbcr_422 1 #define GL_YCBCR_422_APPLE 0x85B9 #define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) #endif /* GL_APPLE_ycbcr_422 */ /* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ #ifndef GL_ARB_ES2_compatibility #define GL_ARB_ES2_compatibility 1 #define GL_FIXED 0x140C #define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B #define GL_RGB565 0x8D62 #define GL_LOW_FLOAT 0x8DF0 #define GL_MEDIUM_FLOAT 0x8DF1 #define GL_HIGH_FLOAT 0x8DF2 #define GL_LOW_INT 0x8DF3 #define GL_MEDIUM_INT 0x8DF4 #define GL_HIGH_INT 0x8DF5 #define GL_SHADER_BINARY_FORMATS 0x8DF8 #define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 #define GL_SHADER_COMPILER 0x8DFA #define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB #define GL_MAX_VARYING_VECTORS 0x8DFC #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD typedef int GLfixed; typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const void*binary, GLsizei length); #define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) #define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) #define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) #define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) #define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) #define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) #endif /* GL_ARB_ES2_compatibility */ /* ----------------------- GL_ARB_ES3_1_compatibility ---------------------- */ #ifndef GL_ARB_ES3_1_compatibility #define GL_ARB_ES3_1_compatibility 1 typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERBYREGIONPROC) (GLbitfield barriers); #define glMemoryBarrierByRegion GLEW_GET_FUN(__glewMemoryBarrierByRegion) #define GLEW_ARB_ES3_1_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_1_compatibility) #endif /* GL_ARB_ES3_1_compatibility */ /* ----------------------- GL_ARB_ES3_2_compatibility ---------------------- */ #ifndef GL_ARB_ES3_2_compatibility #define GL_ARB_ES3_2_compatibility 1 #define GL_PRIMITIVE_BOUNDING_BOX_ARB 0x92BE #define GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB 0x9381 #define GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB 0x9382 typedef void (GLAPIENTRY * PFNGLPRIMITIVEBOUNDINGBOXARBPROC) (GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW); #define glPrimitiveBoundingBoxARB GLEW_GET_FUN(__glewPrimitiveBoundingBoxARB) #define GLEW_ARB_ES3_2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_2_compatibility) #endif /* GL_ARB_ES3_2_compatibility */ /* ------------------------ GL_ARB_ES3_compatibility ----------------------- */ #ifndef GL_ARB_ES3_compatibility #define GL_ARB_ES3_compatibility 1 #define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF #define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69 #define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A #define GL_MAX_ELEMENT_INDEX 0x8D6B #define GL_COMPRESSED_R11_EAC 0x9270 #define GL_COMPRESSED_SIGNED_R11_EAC 0x9271 #define GL_COMPRESSED_RG11_EAC 0x9272 #define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273 #define GL_COMPRESSED_RGB8_ETC2 0x9274 #define GL_COMPRESSED_SRGB8_ETC2 0x9275 #define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276 #define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277 #define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278 #define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279 #define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility) #endif /* GL_ARB_ES3_compatibility */ /* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */ #ifndef GL_ARB_arrays_of_arrays #define GL_ARB_arrays_of_arrays 1 #define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays) #endif /* GL_ARB_arrays_of_arrays */ /* -------------------------- GL_ARB_base_instance ------------------------- */ #ifndef GL_ARB_base_instance #define GL_ARB_base_instance 1 typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance); #define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance) #define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance) #define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance) #define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance) #endif /* GL_ARB_base_instance */ /* ------------------------ GL_ARB_bindless_texture ------------------------ */ #ifndef GL_ARB_bindless_texture #define GL_ARB_bindless_texture 1 #define GL_UNSIGNED_INT64_ARB 0x140F typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture); typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params); typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle); typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access); typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value); typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v); #define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB) #define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB) #define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB) #define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB) #define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB) #define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB) #define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB) #define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB) #define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB) #define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB) #define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB) #define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB) #define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB) #define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB) #define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB) #define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB) #define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture) #endif /* GL_ARB_bindless_texture */ /* ----------------------- GL_ARB_blend_func_extended ---------------------- */ #ifndef GL_ARB_blend_func_extended #define GL_ARB_blend_func_extended 1 #define GL_SRC1_COLOR 0x88F9 #define GL_ONE_MINUS_SRC1_COLOR 0x88FA #define GL_ONE_MINUS_SRC1_ALPHA 0x88FB #define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name); typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name); #define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) #define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) #define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) #endif /* GL_ARB_blend_func_extended */ /* ------------------------- GL_ARB_buffer_storage ------------------------- */ #ifndef GL_ARB_buffer_storage #define GL_ARB_buffer_storage 1 #define GL_MAP_READ_BIT 0x0001 #define GL_MAP_WRITE_BIT 0x0002 #define GL_MAP_PERSISTENT_BIT 0x00000040 #define GL_MAP_COHERENT_BIT 0x00000080 #define GL_DYNAMIC_STORAGE_BIT 0x0100 #define GL_CLIENT_STORAGE_BIT 0x0200 #define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000 #define GL_BUFFER_IMMUTABLE_STORAGE 0x821F #define GL_BUFFER_STORAGE_FLAGS 0x8220 typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const void *data, GLbitfield flags); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); #define glBufferStorage GLEW_GET_FUN(__glewBufferStorage) #define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT) #define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage) #endif /* GL_ARB_buffer_storage */ /* ---------------------------- GL_ARB_cl_event ---------------------------- */ #ifndef GL_ARB_cl_event #define GL_ARB_cl_event 1 #define GL_SYNC_CL_EVENT_ARB 0x8240 #define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 typedef struct _cl_context *cl_context; typedef struct _cl_event *cl_event; typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); #define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) #define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) #endif /* GL_ARB_cl_event */ /* ----------------------- GL_ARB_clear_buffer_object ---------------------- */ #ifndef GL_ARB_clear_buffer_object #define GL_ARB_clear_buffer_object 1 typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); #define glClearBufferData GLEW_GET_FUN(__glewClearBufferData) #define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData) #define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT) #define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT) #define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object) #endif /* GL_ARB_clear_buffer_object */ /* -------------------------- GL_ARB_clear_texture ------------------------- */ #ifndef GL_ARB_clear_texture #define GL_ARB_clear_texture 1 #define GL_CLEAR_TEXTURE 0x9365 typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); #define glClearTexImage GLEW_GET_FUN(__glewClearTexImage) #define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage) #define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture) #endif /* GL_ARB_clear_texture */ /* -------------------------- GL_ARB_clip_control -------------------------- */ #ifndef GL_ARB_clip_control #define GL_ARB_clip_control 1 #define GL_LOWER_LEFT 0x8CA1 #define GL_UPPER_LEFT 0x8CA2 #define GL_CLIP_ORIGIN 0x935C #define GL_CLIP_DEPTH_MODE 0x935D #define GL_NEGATIVE_ONE_TO_ONE 0x935E #define GL_ZERO_TO_ONE 0x935F typedef void (GLAPIENTRY * PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth); #define glClipControl GLEW_GET_FUN(__glewClipControl) #define GLEW_ARB_clip_control GLEW_GET_VAR(__GLEW_ARB_clip_control) #endif /* GL_ARB_clip_control */ /* ----------------------- GL_ARB_color_buffer_float ----------------------- */ #ifndef GL_ARB_color_buffer_float #define GL_ARB_color_buffer_float 1 #define GL_RGBA_FLOAT_MODE_ARB 0x8820 #define GL_CLAMP_VERTEX_COLOR_ARB 0x891A #define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B #define GL_CLAMP_READ_COLOR_ARB 0x891C #define GL_FIXED_ONLY_ARB 0x891D typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); #define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) #define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) #endif /* GL_ARB_color_buffer_float */ /* -------------------------- GL_ARB_compatibility ------------------------- */ #ifndef GL_ARB_compatibility #define GL_ARB_compatibility 1 #define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) #endif /* GL_ARB_compatibility */ /* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */ #ifndef GL_ARB_compressed_texture_pixel_storage #define GL_ARB_compressed_texture_pixel_storage 1 #define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127 #define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128 #define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129 #define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A #define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B #define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C #define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D #define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E #define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage) #endif /* GL_ARB_compressed_texture_pixel_storage */ /* ------------------------- GL_ARB_compute_shader ------------------------- */ #ifndef GL_ARB_compute_shader #define GL_ARB_compute_shader 1 #define GL_COMPUTE_SHADER_BIT 0x00000020 #define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262 #define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263 #define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264 #define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265 #define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266 #define GL_COMPUTE_WORK_GROUP_SIZE 0x8267 #define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB #define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED #define GL_DISPATCH_INDIRECT_BUFFER 0x90EE #define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF #define GL_COMPUTE_SHADER 0x91B9 #define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB #define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC #define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD #define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE #define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z); typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect); #define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute) #define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect) #define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader) #endif /* GL_ARB_compute_shader */ /* ------------------- GL_ARB_compute_variable_group_size ------------------ */ #ifndef GL_ARB_compute_variable_group_size #define GL_ARB_compute_variable_group_size 1 #define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB #define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF #define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344 #define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345 typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z); #define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB) #define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size) #endif /* GL_ARB_compute_variable_group_size */ /* ------------------- GL_ARB_conditional_render_inverted ------------------ */ #ifndef GL_ARB_conditional_render_inverted #define GL_ARB_conditional_render_inverted 1 #define GL_QUERY_WAIT_INVERTED 0x8E17 #define GL_QUERY_NO_WAIT_INVERTED 0x8E18 #define GL_QUERY_BY_REGION_WAIT_INVERTED 0x8E19 #define GL_QUERY_BY_REGION_NO_WAIT_INVERTED 0x8E1A #define GLEW_ARB_conditional_render_inverted GLEW_GET_VAR(__GLEW_ARB_conditional_render_inverted) #endif /* GL_ARB_conditional_render_inverted */ /* ----------------------- GL_ARB_conservative_depth ----------------------- */ #ifndef GL_ARB_conservative_depth #define GL_ARB_conservative_depth 1 #define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth) #endif /* GL_ARB_conservative_depth */ /* --------------------------- GL_ARB_copy_buffer -------------------------- */ #ifndef GL_ARB_copy_buffer #define GL_ARB_copy_buffer 1 #define GL_COPY_READ_BUFFER 0x8F36 #define GL_COPY_WRITE_BUFFER 0x8F37 typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); #define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) #define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) #endif /* GL_ARB_copy_buffer */ /* --------------------------- GL_ARB_copy_image --------------------------- */ #ifndef GL_ARB_copy_image #define GL_ARB_copy_image 1 typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth); #define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData) #define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image) #endif /* GL_ARB_copy_image */ /* -------------------------- GL_ARB_cull_distance ------------------------- */ #ifndef GL_ARB_cull_distance #define GL_ARB_cull_distance 1 #define GL_MAX_CULL_DISTANCES 0x82F9 #define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES 0x82FA #define GLEW_ARB_cull_distance GLEW_GET_VAR(__GLEW_ARB_cull_distance) #endif /* GL_ARB_cull_distance */ /* -------------------------- GL_ARB_debug_output -------------------------- */ #ifndef GL_ARB_debug_output #define GL_ARB_debug_output 1 #define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 #define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 #define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 #define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 #define GL_DEBUG_SOURCE_API_ARB 0x8246 #define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 #define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 #define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 #define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A #define GL_DEBUG_SOURCE_OTHER_ARB 0x824B #define GL_DEBUG_TYPE_ERROR_ARB 0x824C #define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D #define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E #define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F #define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 #define GL_DEBUG_TYPE_OTHER_ARB 0x8251 #define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 #define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 #define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 #define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 #define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 #define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 typedef void (GLAPIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const void *userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); #define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) #define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) #define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) #define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) #define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) #endif /* GL_ARB_debug_output */ /* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ #ifndef GL_ARB_depth_buffer_float #define GL_ARB_depth_buffer_float 1 #define GL_DEPTH_COMPONENT32F 0x8CAC #define GL_DEPTH32F_STENCIL8 0x8CAD #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD #define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) #endif /* GL_ARB_depth_buffer_float */ /* --------------------------- GL_ARB_depth_clamp -------------------------- */ #ifndef GL_ARB_depth_clamp #define GL_ARB_depth_clamp 1 #define GL_DEPTH_CLAMP 0x864F #define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) #endif /* GL_ARB_depth_clamp */ /* -------------------------- GL_ARB_depth_texture ------------------------- */ #ifndef GL_ARB_depth_texture #define GL_ARB_depth_texture 1 #define GL_DEPTH_COMPONENT16_ARB 0x81A5 #define GL_DEPTH_COMPONENT24_ARB 0x81A6 #define GL_DEPTH_COMPONENT32_ARB 0x81A7 #define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A #define GL_DEPTH_TEXTURE_MODE_ARB 0x884B #define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) #endif /* GL_ARB_depth_texture */ /* ----------------------- GL_ARB_derivative_control ----------------------- */ #ifndef GL_ARB_derivative_control #define GL_ARB_derivative_control 1 #define GLEW_ARB_derivative_control GLEW_GET_VAR(__GLEW_ARB_derivative_control) #endif /* GL_ARB_derivative_control */ /* ----------------------- GL_ARB_direct_state_access ---------------------- */ #ifndef GL_ARB_direct_state_access #define GL_ARB_direct_state_access 1 #define GL_TEXTURE_TARGET 0x1006 #define GL_QUERY_TARGET 0x82EA typedef void (GLAPIENTRY * PFNGLBINDTEXTUREUNITPROC) (GLuint unit, GLuint texture); typedef void (GLAPIENTRY * PFNGLBLITNAMEDFRAMEBUFFERPROC) (GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC) (GLuint framebuffer, GLenum target); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFIPROC) (GLuint framebuffer, GLenum buffer, GLfloat depth, GLint stencil); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERFVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint* value); typedef void (GLAPIENTRY * PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC) (GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint* value); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOPYNAMEDBUFFERSUBDATAPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint* buffers); typedef void (GLAPIENTRY * PFNGLCREATEFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLCREATEPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); typedef void (GLAPIENTRY * PFNGLCREATEQUERIESPROC) (GLenum target, GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLCREATERENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLCREATESAMPLERSPROC) (GLsizei n, GLuint* samplers); typedef void (GLAPIENTRY * PFNGLCREATETEXTURESPROC) (GLenum target, GLsizei n, GLuint* textures); typedef void (GLAPIENTRY * PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLCREATEVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBPROC) (GLuint vaobj, GLuint index); typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPPROC) (GLuint texture); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLsizei bufSize, void *pixels); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERI64VPROC) (GLuint buffer, GLenum pname, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVPROC) (GLuint buffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVPROC) (GLuint buffer, GLenum pname, void** params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC) (GLuint framebuffer, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC) (GLuint renderbuffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTI64VPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTIVPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUI64VPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); typedef void (GLAPIENTRY * PFNGLGETQUERYBUFFEROBJECTUIVPROC) (GLuint id,GLuint buffer,GLenum pname,GLintptr offset); typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, void *pixels); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVPROC) (GLuint texture, GLint level, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVPROC) (GLuint texture, GLint level, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64* param); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint* param); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXED64IVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint64* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINDEXEDIVPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYIVPROC) (GLuint vaobj, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments); typedef void (GLAPIENTRY * PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC) (GLuint framebuffer, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERPROC) (GLuint buffer, GLenum access); typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC) (GLuint framebuffer, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERPROC) (GLuint texture, GLenum internalformat, GLuint buffer); typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEPROC) (GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVPROC) (GLuint texture, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVPROC) (GLuint texture, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFPROC) (GLuint texture, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVPROC) (GLuint texture, GLenum pname, const GLfloat* param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIPROC) (GLuint texture, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVPROC) (GLuint texture, GLenum pname, const GLint* param); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DPROC) (GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC) (GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DPROC) (GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFERPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBBINDINGPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBIFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYATTRIBLFORMATPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDINGDIVISORPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYELEMENTBUFFERPROC) (GLuint vaobj, GLuint buffer); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBUFFERSPROC) (GLuint vaobj, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); #define glBindTextureUnit GLEW_GET_FUN(__glewBindTextureUnit) #define glBlitNamedFramebuffer GLEW_GET_FUN(__glewBlitNamedFramebuffer) #define glCheckNamedFramebufferStatus GLEW_GET_FUN(__glewCheckNamedFramebufferStatus) #define glClearNamedBufferData GLEW_GET_FUN(__glewClearNamedBufferData) #define glClearNamedBufferSubData GLEW_GET_FUN(__glewClearNamedBufferSubData) #define glClearNamedFramebufferfi GLEW_GET_FUN(__glewClearNamedFramebufferfi) #define glClearNamedFramebufferfv GLEW_GET_FUN(__glewClearNamedFramebufferfv) #define glClearNamedFramebufferiv GLEW_GET_FUN(__glewClearNamedFramebufferiv) #define glClearNamedFramebufferuiv GLEW_GET_FUN(__glewClearNamedFramebufferuiv) #define glCompressedTextureSubImage1D GLEW_GET_FUN(__glewCompressedTextureSubImage1D) #define glCompressedTextureSubImage2D GLEW_GET_FUN(__glewCompressedTextureSubImage2D) #define glCompressedTextureSubImage3D GLEW_GET_FUN(__glewCompressedTextureSubImage3D) #define glCopyNamedBufferSubData GLEW_GET_FUN(__glewCopyNamedBufferSubData) #define glCopyTextureSubImage1D GLEW_GET_FUN(__glewCopyTextureSubImage1D) #define glCopyTextureSubImage2D GLEW_GET_FUN(__glewCopyTextureSubImage2D) #define glCopyTextureSubImage3D GLEW_GET_FUN(__glewCopyTextureSubImage3D) #define glCreateBuffers GLEW_GET_FUN(__glewCreateBuffers) #define glCreateFramebuffers GLEW_GET_FUN(__glewCreateFramebuffers) #define glCreateProgramPipelines GLEW_GET_FUN(__glewCreateProgramPipelines) #define glCreateQueries GLEW_GET_FUN(__glewCreateQueries) #define glCreateRenderbuffers GLEW_GET_FUN(__glewCreateRenderbuffers) #define glCreateSamplers GLEW_GET_FUN(__glewCreateSamplers) #define glCreateTextures GLEW_GET_FUN(__glewCreateTextures) #define glCreateTransformFeedbacks GLEW_GET_FUN(__glewCreateTransformFeedbacks) #define glCreateVertexArrays GLEW_GET_FUN(__glewCreateVertexArrays) #define glDisableVertexArrayAttrib GLEW_GET_FUN(__glewDisableVertexArrayAttrib) #define glEnableVertexArrayAttrib GLEW_GET_FUN(__glewEnableVertexArrayAttrib) #define glFlushMappedNamedBufferRange GLEW_GET_FUN(__glewFlushMappedNamedBufferRange) #define glGenerateTextureMipmap GLEW_GET_FUN(__glewGenerateTextureMipmap) #define glGetCompressedTextureImage GLEW_GET_FUN(__glewGetCompressedTextureImage) #define glGetNamedBufferParameteri64v GLEW_GET_FUN(__glewGetNamedBufferParameteri64v) #define glGetNamedBufferParameteriv GLEW_GET_FUN(__glewGetNamedBufferParameteriv) #define glGetNamedBufferPointerv GLEW_GET_FUN(__glewGetNamedBufferPointerv) #define glGetNamedBufferSubData GLEW_GET_FUN(__glewGetNamedBufferSubData) #define glGetNamedFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameteriv) #define glGetNamedFramebufferParameteriv GLEW_GET_FUN(__glewGetNamedFramebufferParameteriv) #define glGetNamedRenderbufferParameteriv GLEW_GET_FUN(__glewGetNamedRenderbufferParameteriv) #define glGetQueryBufferObjecti64v GLEW_GET_FUN(__glewGetQueryBufferObjecti64v) #define glGetQueryBufferObjectiv GLEW_GET_FUN(__glewGetQueryBufferObjectiv) #define glGetQueryBufferObjectui64v GLEW_GET_FUN(__glewGetQueryBufferObjectui64v) #define glGetQueryBufferObjectuiv GLEW_GET_FUN(__glewGetQueryBufferObjectuiv) #define glGetTextureImage GLEW_GET_FUN(__glewGetTextureImage) #define glGetTextureLevelParameterfv GLEW_GET_FUN(__glewGetTextureLevelParameterfv) #define glGetTextureLevelParameteriv GLEW_GET_FUN(__glewGetTextureLevelParameteriv) #define glGetTextureParameterIiv GLEW_GET_FUN(__glewGetTextureParameterIiv) #define glGetTextureParameterIuiv GLEW_GET_FUN(__glewGetTextureParameterIuiv) #define glGetTextureParameterfv GLEW_GET_FUN(__glewGetTextureParameterfv) #define glGetTextureParameteriv GLEW_GET_FUN(__glewGetTextureParameteriv) #define glGetTransformFeedbacki64_v GLEW_GET_FUN(__glewGetTransformFeedbacki64_v) #define glGetTransformFeedbacki_v GLEW_GET_FUN(__glewGetTransformFeedbacki_v) #define glGetTransformFeedbackiv GLEW_GET_FUN(__glewGetTransformFeedbackiv) #define glGetVertexArrayIndexed64iv GLEW_GET_FUN(__glewGetVertexArrayIndexed64iv) #define glGetVertexArrayIndexediv GLEW_GET_FUN(__glewGetVertexArrayIndexediv) #define glGetVertexArrayiv GLEW_GET_FUN(__glewGetVertexArrayiv) #define glInvalidateNamedFramebufferData GLEW_GET_FUN(__glewInvalidateNamedFramebufferData) #define glInvalidateNamedFramebufferSubData GLEW_GET_FUN(__glewInvalidateNamedFramebufferSubData) #define glMapNamedBuffer GLEW_GET_FUN(__glewMapNamedBuffer) #define glMapNamedBufferRange GLEW_GET_FUN(__glewMapNamedBufferRange) #define glNamedBufferData GLEW_GET_FUN(__glewNamedBufferData) #define glNamedBufferStorage GLEW_GET_FUN(__glewNamedBufferStorage) #define glNamedBufferSubData GLEW_GET_FUN(__glewNamedBufferSubData) #define glNamedFramebufferDrawBuffer GLEW_GET_FUN(__glewNamedFramebufferDrawBuffer) #define glNamedFramebufferDrawBuffers GLEW_GET_FUN(__glewNamedFramebufferDrawBuffers) #define glNamedFramebufferParameteri GLEW_GET_FUN(__glewNamedFramebufferParameteri) #define glNamedFramebufferReadBuffer GLEW_GET_FUN(__glewNamedFramebufferReadBuffer) #define glNamedFramebufferRenderbuffer GLEW_GET_FUN(__glewNamedFramebufferRenderbuffer) #define glNamedFramebufferTexture GLEW_GET_FUN(__glewNamedFramebufferTexture) #define glNamedFramebufferTextureLayer GLEW_GET_FUN(__glewNamedFramebufferTextureLayer) #define glNamedRenderbufferStorage GLEW_GET_FUN(__glewNamedRenderbufferStorage) #define glNamedRenderbufferStorageMultisample GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisample) #define glTextureBuffer GLEW_GET_FUN(__glewTextureBuffer) #define glTextureBufferRange GLEW_GET_FUN(__glewTextureBufferRange) #define glTextureParameterIiv GLEW_GET_FUN(__glewTextureParameterIiv) #define glTextureParameterIuiv GLEW_GET_FUN(__glewTextureParameterIuiv) #define glTextureParameterf GLEW_GET_FUN(__glewTextureParameterf) #define glTextureParameterfv GLEW_GET_FUN(__glewTextureParameterfv) #define glTextureParameteri GLEW_GET_FUN(__glewTextureParameteri) #define glTextureParameteriv GLEW_GET_FUN(__glewTextureParameteriv) #define glTextureStorage1D GLEW_GET_FUN(__glewTextureStorage1D) #define glTextureStorage2D GLEW_GET_FUN(__glewTextureStorage2D) #define glTextureStorage2DMultisample GLEW_GET_FUN(__glewTextureStorage2DMultisample) #define glTextureStorage3D GLEW_GET_FUN(__glewTextureStorage3D) #define glTextureStorage3DMultisample GLEW_GET_FUN(__glewTextureStorage3DMultisample) #define glTextureSubImage1D GLEW_GET_FUN(__glewTextureSubImage1D) #define glTextureSubImage2D GLEW_GET_FUN(__glewTextureSubImage2D) #define glTextureSubImage3D GLEW_GET_FUN(__glewTextureSubImage3D) #define glTransformFeedbackBufferBase GLEW_GET_FUN(__glewTransformFeedbackBufferBase) #define glTransformFeedbackBufferRange GLEW_GET_FUN(__glewTransformFeedbackBufferRange) #define glUnmapNamedBuffer GLEW_GET_FUN(__glewUnmapNamedBuffer) #define glVertexArrayAttribBinding GLEW_GET_FUN(__glewVertexArrayAttribBinding) #define glVertexArrayAttribFormat GLEW_GET_FUN(__glewVertexArrayAttribFormat) #define glVertexArrayAttribIFormat GLEW_GET_FUN(__glewVertexArrayAttribIFormat) #define glVertexArrayAttribLFormat GLEW_GET_FUN(__glewVertexArrayAttribLFormat) #define glVertexArrayBindingDivisor GLEW_GET_FUN(__glewVertexArrayBindingDivisor) #define glVertexArrayElementBuffer GLEW_GET_FUN(__glewVertexArrayElementBuffer) #define glVertexArrayVertexBuffer GLEW_GET_FUN(__glewVertexArrayVertexBuffer) #define glVertexArrayVertexBuffers GLEW_GET_FUN(__glewVertexArrayVertexBuffers) #define GLEW_ARB_direct_state_access GLEW_GET_VAR(__GLEW_ARB_direct_state_access) #endif /* GL_ARB_direct_state_access */ /* -------------------------- GL_ARB_draw_buffers -------------------------- */ #ifndef GL_ARB_draw_buffers #define GL_ARB_draw_buffers 1 #define GL_MAX_DRAW_BUFFERS_ARB 0x8824 #define GL_DRAW_BUFFER0_ARB 0x8825 #define GL_DRAW_BUFFER1_ARB 0x8826 #define GL_DRAW_BUFFER2_ARB 0x8827 #define GL_DRAW_BUFFER3_ARB 0x8828 #define GL_DRAW_BUFFER4_ARB 0x8829 #define GL_DRAW_BUFFER5_ARB 0x882A #define GL_DRAW_BUFFER6_ARB 0x882B #define GL_DRAW_BUFFER7_ARB 0x882C #define GL_DRAW_BUFFER8_ARB 0x882D #define GL_DRAW_BUFFER9_ARB 0x882E #define GL_DRAW_BUFFER10_ARB 0x882F #define GL_DRAW_BUFFER11_ARB 0x8830 #define GL_DRAW_BUFFER12_ARB 0x8831 #define GL_DRAW_BUFFER13_ARB 0x8832 #define GL_DRAW_BUFFER14_ARB 0x8833 #define GL_DRAW_BUFFER15_ARB 0x8834 typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); #define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) #define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) #endif /* GL_ARB_draw_buffers */ /* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ #ifndef GL_ARB_draw_buffers_blend #define GL_ARB_draw_buffers_blend 1 typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); #define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) #define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) #define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) #define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) #define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) #endif /* GL_ARB_draw_buffers_blend */ /* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ #ifndef GL_ARB_draw_elements_base_vertex #define GL_ARB_draw_elements_base_vertex 1 typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount, const GLint *basevertex); #define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) #define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) #define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) #define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) #define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) #endif /* GL_ARB_draw_elements_base_vertex */ /* -------------------------- GL_ARB_draw_indirect ------------------------- */ #ifndef GL_ARB_draw_indirect #define GL_ARB_draw_indirect 1 #define GL_DRAW_INDIRECT_BUFFER 0x8F3F #define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect); #define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) #define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) #define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) #endif /* GL_ARB_draw_indirect */ /* ------------------------- GL_ARB_draw_instanced ------------------------- */ #ifndef GL_ARB_draw_instanced #define GL_ARB_draw_instanced 1 #define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) #endif /* GL_ARB_draw_instanced */ /* ------------------------ GL_ARB_enhanced_layouts ------------------------ */ #ifndef GL_ARB_enhanced_layouts #define GL_ARB_enhanced_layouts 1 #define GL_LOCATION_COMPONENT 0x934A #define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B #define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C #define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts) #endif /* GL_ARB_enhanced_layouts */ /* -------------------- GL_ARB_explicit_attrib_location -------------------- */ #ifndef GL_ARB_explicit_attrib_location #define GL_ARB_explicit_attrib_location 1 #define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) #endif /* GL_ARB_explicit_attrib_location */ /* -------------------- GL_ARB_explicit_uniform_location ------------------- */ #ifndef GL_ARB_explicit_uniform_location #define GL_ARB_explicit_uniform_location 1 #define GL_MAX_UNIFORM_LOCATIONS 0x826E #define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location) #endif /* GL_ARB_explicit_uniform_location */ /* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ #ifndef GL_ARB_fragment_coord_conventions #define GL_ARB_fragment_coord_conventions 1 #define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) #endif /* GL_ARB_fragment_coord_conventions */ /* --------------------- GL_ARB_fragment_layer_viewport -------------------- */ #ifndef GL_ARB_fragment_layer_viewport #define GL_ARB_fragment_layer_viewport 1 #define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport) #endif /* GL_ARB_fragment_layer_viewport */ /* ------------------------ GL_ARB_fragment_program ------------------------ */ #ifndef GL_ARB_fragment_program #define GL_ARB_fragment_program 1 #define GL_FRAGMENT_PROGRAM_ARB 0x8804 #define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 #define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 #define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 #define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 #define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 #define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A #define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B #define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C #define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D #define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E #define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F #define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 #define GL_MAX_TEXTURE_COORDS_ARB 0x8871 #define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 #define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) #endif /* GL_ARB_fragment_program */ /* --------------------- GL_ARB_fragment_program_shadow -------------------- */ #ifndef GL_ARB_fragment_program_shadow #define GL_ARB_fragment_program_shadow 1 #define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) #endif /* GL_ARB_fragment_program_shadow */ /* ------------------------- GL_ARB_fragment_shader ------------------------ */ #ifndef GL_ARB_fragment_shader #define GL_ARB_fragment_shader 1 #define GL_FRAGMENT_SHADER_ARB 0x8B30 #define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 #define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B #define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) #endif /* GL_ARB_fragment_shader */ /* -------------------- GL_ARB_fragment_shader_interlock ------------------- */ #ifndef GL_ARB_fragment_shader_interlock #define GL_ARB_fragment_shader_interlock 1 #define GLEW_ARB_fragment_shader_interlock GLEW_GET_VAR(__GLEW_ARB_fragment_shader_interlock) #endif /* GL_ARB_fragment_shader_interlock */ /* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */ #ifndef GL_ARB_framebuffer_no_attachments #define GL_ARB_framebuffer_no_attachments 1 #define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310 #define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311 #define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312 #define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313 #define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314 #define GL_MAX_FRAMEBUFFER_WIDTH 0x9315 #define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316 #define GL_MAX_FRAMEBUFFER_LAYERS 0x9317 #define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param); #define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri) #define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv) #define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT) #define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT) #define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments) #endif /* GL_ARB_framebuffer_no_attachments */ /* ----------------------- GL_ARB_framebuffer_object ----------------------- */ #ifndef GL_ARB_framebuffer_object #define GL_ARB_framebuffer_object 1 #define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 #define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 #define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 #define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 #define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 #define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 #define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 #define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 #define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 #define GL_FRAMEBUFFER_DEFAULT 0x8218 #define GL_FRAMEBUFFER_UNDEFINED 0x8219 #define GL_DEPTH_STENCIL_ATTACHMENT 0x821A #define GL_INDEX 0x8222 #define GL_MAX_RENDERBUFFER_SIZE 0x84E8 #define GL_DEPTH_STENCIL 0x84F9 #define GL_UNSIGNED_INT_24_8 0x84FA #define GL_DEPTH24_STENCIL8 0x88F0 #define GL_TEXTURE_STENCIL_SIZE 0x88F1 #define GL_UNSIGNED_NORMALIZED 0x8C17 #define GL_SRGB 0x8C40 #define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 #define GL_FRAMEBUFFER_BINDING 0x8CA6 #define GL_RENDERBUFFER_BINDING 0x8CA7 #define GL_READ_FRAMEBUFFER 0x8CA8 #define GL_DRAW_FRAMEBUFFER 0x8CA9 #define GL_READ_FRAMEBUFFER_BINDING 0x8CAA #define GL_RENDERBUFFER_SAMPLES 0x8CAB #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 #define GL_FRAMEBUFFER_COMPLETE 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC #define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD #define GL_MAX_COLOR_ATTACHMENTS 0x8CDF #define GL_COLOR_ATTACHMENT0 0x8CE0 #define GL_COLOR_ATTACHMENT1 0x8CE1 #define GL_COLOR_ATTACHMENT2 0x8CE2 #define GL_COLOR_ATTACHMENT3 0x8CE3 #define GL_COLOR_ATTACHMENT4 0x8CE4 #define GL_COLOR_ATTACHMENT5 0x8CE5 #define GL_COLOR_ATTACHMENT6 0x8CE6 #define GL_COLOR_ATTACHMENT7 0x8CE7 #define GL_COLOR_ATTACHMENT8 0x8CE8 #define GL_COLOR_ATTACHMENT9 0x8CE9 #define GL_COLOR_ATTACHMENT10 0x8CEA #define GL_COLOR_ATTACHMENT11 0x8CEB #define GL_COLOR_ATTACHMENT12 0x8CEC #define GL_COLOR_ATTACHMENT13 0x8CED #define GL_COLOR_ATTACHMENT14 0x8CEE #define GL_COLOR_ATTACHMENT15 0x8CEF #define GL_DEPTH_ATTACHMENT 0x8D00 #define GL_STENCIL_ATTACHMENT 0x8D20 #define GL_FRAMEBUFFER 0x8D40 #define GL_RENDERBUFFER 0x8D41 #define GL_RENDERBUFFER_WIDTH 0x8D42 #define GL_RENDERBUFFER_HEIGHT 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 #define GL_STENCIL_INDEX1 0x8D46 #define GL_STENCIL_INDEX4 0x8D47 #define GL_STENCIL_INDEX8 0x8D48 #define GL_STENCIL_INDEX16 0x8D49 #define GL_RENDERBUFFER_RED_SIZE 0x8D50 #define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 #define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 #define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 #define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 #define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 #define GL_MAX_SAMPLES 0x8D57 typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) #define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) #define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) #define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) #define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) #define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) #define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) #define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) #define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) #define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) #define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) #define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) #define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) #define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) #define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) #define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) #define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) #define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) #define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) #define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) #define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) #endif /* GL_ARB_framebuffer_object */ /* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ #ifndef GL_ARB_framebuffer_sRGB #define GL_ARB_framebuffer_sRGB 1 #define GL_FRAMEBUFFER_SRGB 0x8DB9 #define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) #endif /* GL_ARB_framebuffer_sRGB */ /* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ #ifndef GL_ARB_geometry_shader4 #define GL_ARB_geometry_shader4 1 #define GL_LINES_ADJACENCY_ARB 0xA #define GL_LINE_STRIP_ADJACENCY_ARB 0xB #define GL_TRIANGLES_ADJACENCY_ARB 0xC #define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD #define GL_PROGRAM_POINT_SIZE_ARB 0x8642 #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 #define GL_GEOMETRY_SHADER_ARB 0x8DD9 #define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA #define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB #define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC #define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD #define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF #define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); #define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) #define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) #define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) #define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) #define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) #endif /* GL_ARB_geometry_shader4 */ /* ----------------------- GL_ARB_get_program_binary ----------------------- */ #ifndef GL_ARB_get_program_binary #define GL_ARB_get_program_binary 1 #define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 #define GL_PROGRAM_BINARY_LENGTH 0x8741 #define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE #define GL_PROGRAM_BINARY_FORMATS 0x87FF typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, void*binary); typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void *binary, GLsizei length); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); #define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) #define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) #define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) #define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) #endif /* GL_ARB_get_program_binary */ /* ---------------------- GL_ARB_get_texture_sub_image --------------------- */ #ifndef GL_ARB_get_texture_sub_image #define GL_ARB_get_texture_sub_image 1 typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, void *pixels); typedef void (GLAPIENTRY * PFNGLGETTEXTURESUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, void *pixels); #define glGetCompressedTextureSubImage GLEW_GET_FUN(__glewGetCompressedTextureSubImage) #define glGetTextureSubImage GLEW_GET_FUN(__glewGetTextureSubImage) #define GLEW_ARB_get_texture_sub_image GLEW_GET_VAR(__GLEW_ARB_get_texture_sub_image) #endif /* GL_ARB_get_texture_sub_image */ /* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ #ifndef GL_ARB_gpu_shader5 #define GL_ARB_gpu_shader5 1 #define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F #define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A #define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B #define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C #define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D #define GL_MAX_VERTEX_STREAMS 0x8E71 #define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) #endif /* GL_ARB_gpu_shader5 */ /* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ #ifndef GL_ARB_gpu_shader_fp64 #define GL_ARB_gpu_shader_fp64 1 #define GL_DOUBLE_MAT2 0x8F46 #define GL_DOUBLE_MAT3 0x8F47 #define GL_DOUBLE_MAT4 0x8F48 #define GL_DOUBLE_MAT2x3 0x8F49 #define GL_DOUBLE_MAT2x4 0x8F4A #define GL_DOUBLE_MAT3x2 0x8F4B #define GL_DOUBLE_MAT3x4 0x8F4C #define GL_DOUBLE_MAT4x2 0x8F4D #define GL_DOUBLE_MAT4x3 0x8F4E #define GL_DOUBLE_VEC2 0x8FFC #define GL_DOUBLE_VEC3 0x8FFD #define GL_DOUBLE_VEC4 0x8FFE typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); #define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) #define glUniform1d GLEW_GET_FUN(__glewUniform1d) #define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) #define glUniform2d GLEW_GET_FUN(__glewUniform2d) #define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) #define glUniform3d GLEW_GET_FUN(__glewUniform3d) #define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) #define glUniform4d GLEW_GET_FUN(__glewUniform4d) #define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) #define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) #define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) #define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) #define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) #define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) #define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) #define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) #define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) #define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) #define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) #endif /* GL_ARB_gpu_shader_fp64 */ /* ------------------------ GL_ARB_gpu_shader_int64 ------------------------ */ #ifndef GL_ARB_gpu_shader_int64 #define GL_ARB_gpu_shader_int64 1 #define GL_INT64_ARB 0x140E #define GL_UNSIGNED_INT64_ARB 0x140F #define GL_INT64_VEC2_ARB 0x8FE9 #define GL_INT64_VEC3_ARB 0x8FEA #define GL_INT64_VEC4_ARB 0x8FEB #define GL_UNSIGNED_INT64_VEC2_ARB 0x8FF5 #define GL_UNSIGNED_INT64_VEC3_ARB 0x8FF6 #define GL_UNSIGNED_INT64_VEC4_ARB 0x8FF7 typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VARBPROC) (GLuint program, GLint location, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLuint64* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUI64VARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint64* params); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64ARBPROC) (GLuint program, GLint location, GLint64 x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64ARBPROC) (GLuint program, GLint location, GLuint64 x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64ARBPROC) (GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64ARBPROC) (GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1I64ARBPROC) (GLint location, GLint64 x); typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64ARBPROC) (GLint location, GLuint64 x); typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2I64ARBPROC) (GLint location, GLint64 x, GLint64 y); typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y); typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z); typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z); typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4I64ARBPROC) (GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w); typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VARBPROC) (GLint location, GLsizei count, const GLint64* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64ARBPROC) (GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w); typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value); #define glGetUniformi64vARB GLEW_GET_FUN(__glewGetUniformi64vARB) #define glGetUniformui64vARB GLEW_GET_FUN(__glewGetUniformui64vARB) #define glGetnUniformi64vARB GLEW_GET_FUN(__glewGetnUniformi64vARB) #define glGetnUniformui64vARB GLEW_GET_FUN(__glewGetnUniformui64vARB) #define glProgramUniform1i64ARB GLEW_GET_FUN(__glewProgramUniform1i64ARB) #define glProgramUniform1i64vARB GLEW_GET_FUN(__glewProgramUniform1i64vARB) #define glProgramUniform1ui64ARB GLEW_GET_FUN(__glewProgramUniform1ui64ARB) #define glProgramUniform1ui64vARB GLEW_GET_FUN(__glewProgramUniform1ui64vARB) #define glProgramUniform2i64ARB GLEW_GET_FUN(__glewProgramUniform2i64ARB) #define glProgramUniform2i64vARB GLEW_GET_FUN(__glewProgramUniform2i64vARB) #define glProgramUniform2ui64ARB GLEW_GET_FUN(__glewProgramUniform2ui64ARB) #define glProgramUniform2ui64vARB GLEW_GET_FUN(__glewProgramUniform2ui64vARB) #define glProgramUniform3i64ARB GLEW_GET_FUN(__glewProgramUniform3i64ARB) #define glProgramUniform3i64vARB GLEW_GET_FUN(__glewProgramUniform3i64vARB) #define glProgramUniform3ui64ARB GLEW_GET_FUN(__glewProgramUniform3ui64ARB) #define glProgramUniform3ui64vARB GLEW_GET_FUN(__glewProgramUniform3ui64vARB) #define glProgramUniform4i64ARB GLEW_GET_FUN(__glewProgramUniform4i64ARB) #define glProgramUniform4i64vARB GLEW_GET_FUN(__glewProgramUniform4i64vARB) #define glProgramUniform4ui64ARB GLEW_GET_FUN(__glewProgramUniform4ui64ARB) #define glProgramUniform4ui64vARB GLEW_GET_FUN(__glewProgramUniform4ui64vARB) #define glUniform1i64ARB GLEW_GET_FUN(__glewUniform1i64ARB) #define glUniform1i64vARB GLEW_GET_FUN(__glewUniform1i64vARB) #define glUniform1ui64ARB GLEW_GET_FUN(__glewUniform1ui64ARB) #define glUniform1ui64vARB GLEW_GET_FUN(__glewUniform1ui64vARB) #define glUniform2i64ARB GLEW_GET_FUN(__glewUniform2i64ARB) #define glUniform2i64vARB GLEW_GET_FUN(__glewUniform2i64vARB) #define glUniform2ui64ARB GLEW_GET_FUN(__glewUniform2ui64ARB) #define glUniform2ui64vARB GLEW_GET_FUN(__glewUniform2ui64vARB) #define glUniform3i64ARB GLEW_GET_FUN(__glewUniform3i64ARB) #define glUniform3i64vARB GLEW_GET_FUN(__glewUniform3i64vARB) #define glUniform3ui64ARB GLEW_GET_FUN(__glewUniform3ui64ARB) #define glUniform3ui64vARB GLEW_GET_FUN(__glewUniform3ui64vARB) #define glUniform4i64ARB GLEW_GET_FUN(__glewUniform4i64ARB) #define glUniform4i64vARB GLEW_GET_FUN(__glewUniform4i64vARB) #define glUniform4ui64ARB GLEW_GET_FUN(__glewUniform4ui64ARB) #define glUniform4ui64vARB GLEW_GET_FUN(__glewUniform4ui64vARB) #define GLEW_ARB_gpu_shader_int64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_int64) #endif /* GL_ARB_gpu_shader_int64 */ /* ------------------------ GL_ARB_half_float_pixel ------------------------ */ #ifndef GL_ARB_half_float_pixel #define GL_ARB_half_float_pixel 1 #define GL_HALF_FLOAT_ARB 0x140B #define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) #endif /* GL_ARB_half_float_pixel */ /* ------------------------ GL_ARB_half_float_vertex ----------------------- */ #ifndef GL_ARB_half_float_vertex #define GL_ARB_half_float_vertex 1 #define GL_HALF_FLOAT 0x140B #define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) #endif /* GL_ARB_half_float_vertex */ /* ----------------------------- GL_ARB_imaging ---------------------------- */ #ifndef GL_ARB_imaging #define GL_ARB_imaging 1 #define GL_CONSTANT_COLOR 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 #define GL_CONSTANT_ALPHA 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 #define GL_BLEND_COLOR 0x8005 #define GL_FUNC_ADD 0x8006 #define GL_MIN 0x8007 #define GL_MAX 0x8008 #define GL_BLEND_EQUATION 0x8009 #define GL_FUNC_SUBTRACT 0x800A #define GL_FUNC_REVERSE_SUBTRACT 0x800B #define GL_CONVOLUTION_1D 0x8010 #define GL_CONVOLUTION_2D 0x8011 #define GL_SEPARABLE_2D 0x8012 #define GL_CONVOLUTION_BORDER_MODE 0x8013 #define GL_CONVOLUTION_FILTER_SCALE 0x8014 #define GL_CONVOLUTION_FILTER_BIAS 0x8015 #define GL_REDUCE 0x8016 #define GL_CONVOLUTION_FORMAT 0x8017 #define GL_CONVOLUTION_WIDTH 0x8018 #define GL_CONVOLUTION_HEIGHT 0x8019 #define GL_MAX_CONVOLUTION_WIDTH 0x801A #define GL_MAX_CONVOLUTION_HEIGHT 0x801B #define GL_POST_CONVOLUTION_RED_SCALE 0x801C #define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D #define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E #define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F #define GL_POST_CONVOLUTION_RED_BIAS 0x8020 #define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 #define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 #define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 #define GL_HISTOGRAM 0x8024 #define GL_PROXY_HISTOGRAM 0x8025 #define GL_HISTOGRAM_WIDTH 0x8026 #define GL_HISTOGRAM_FORMAT 0x8027 #define GL_HISTOGRAM_RED_SIZE 0x8028 #define GL_HISTOGRAM_GREEN_SIZE 0x8029 #define GL_HISTOGRAM_BLUE_SIZE 0x802A #define GL_HISTOGRAM_ALPHA_SIZE 0x802B #define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C #define GL_HISTOGRAM_SINK 0x802D #define GL_MINMAX 0x802E #define GL_MINMAX_FORMAT 0x802F #define GL_MINMAX_SINK 0x8030 #define GL_TABLE_TOO_LARGE 0x8031 #define GL_COLOR_MATRIX 0x80B1 #define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 #define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 #define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 #define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 #define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 #define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 #define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 #define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 #define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA #define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB #define GL_COLOR_TABLE 0x80D0 #define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 #define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 #define GL_PROXY_COLOR_TABLE 0x80D3 #define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 #define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 #define GL_COLOR_TABLE_SCALE 0x80D6 #define GL_COLOR_TABLE_BIAS 0x80D7 #define GL_COLOR_TABLE_FORMAT 0x80D8 #define GL_COLOR_TABLE_WIDTH 0x80D9 #define GL_COLOR_TABLE_RED_SIZE 0x80DA #define GL_COLOR_TABLE_GREEN_SIZE 0x80DB #define GL_COLOR_TABLE_BLUE_SIZE 0x80DC #define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF #define GL_IGNORE_BORDER 0x8150 #define GL_CONSTANT_BORDER 0x8151 #define GL_WRAP_BORDER 0x8152 #define GL_REPLICATE_BORDER 0x8153 #define GL_CONVOLUTION_BORDER_COLOR 0x8154 typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, void *table); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, void *image); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, void *values); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); #define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) #define glColorTable GLEW_GET_FUN(__glewColorTable) #define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) #define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) #define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) #define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) #define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) #define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) #define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) #define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) #define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) #define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) #define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) #define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) #define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) #define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) #define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) #define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) #define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) #define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) #define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) #define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) #define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) #define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) #define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) #define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) #define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) #define glHistogram GLEW_GET_FUN(__glewHistogram) #define glMinmax GLEW_GET_FUN(__glewMinmax) #define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) #define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) #define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) #define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) #endif /* GL_ARB_imaging */ /* ----------------------- GL_ARB_indirect_parameters ---------------------- */ #ifndef GL_ARB_indirect_parameters #define GL_ARB_indirect_parameters 1 #define GL_PARAMETER_BUFFER_ARB 0x80EE #define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride); #define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB) #define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB) #define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters) #endif /* GL_ARB_indirect_parameters */ /* ------------------------ GL_ARB_instanced_arrays ------------------------ */ #ifndef GL_ARB_instanced_arrays #define GL_ARB_instanced_arrays 1 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); #define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) #define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) #define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) #define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) #endif /* GL_ARB_instanced_arrays */ /* ---------------------- GL_ARB_internalformat_query ---------------------- */ #ifndef GL_ARB_internalformat_query #define GL_ARB_internalformat_query 1 #define GL_NUM_SAMPLE_COUNTS 0x9380 typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params); #define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ) #define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query) #endif /* GL_ARB_internalformat_query */ /* ---------------------- GL_ARB_internalformat_query2 --------------------- */ #ifndef GL_ARB_internalformat_query2 #define GL_ARB_internalformat_query2 1 #define GL_INTERNALFORMAT_SUPPORTED 0x826F #define GL_INTERNALFORMAT_PREFERRED 0x8270 #define GL_INTERNALFORMAT_RED_SIZE 0x8271 #define GL_INTERNALFORMAT_GREEN_SIZE 0x8272 #define GL_INTERNALFORMAT_BLUE_SIZE 0x8273 #define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274 #define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275 #define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276 #define GL_INTERNALFORMAT_SHARED_SIZE 0x8277 #define GL_INTERNALFORMAT_RED_TYPE 0x8278 #define GL_INTERNALFORMAT_GREEN_TYPE 0x8279 #define GL_INTERNALFORMAT_BLUE_TYPE 0x827A #define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B #define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C #define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D #define GL_MAX_WIDTH 0x827E #define GL_MAX_HEIGHT 0x827F #define GL_MAX_DEPTH 0x8280 #define GL_MAX_LAYERS 0x8281 #define GL_MAX_COMBINED_DIMENSIONS 0x8282 #define GL_COLOR_COMPONENTS 0x8283 #define GL_DEPTH_COMPONENTS 0x8284 #define GL_STENCIL_COMPONENTS 0x8285 #define GL_COLOR_RENDERABLE 0x8286 #define GL_DEPTH_RENDERABLE 0x8287 #define GL_STENCIL_RENDERABLE 0x8288 #define GL_FRAMEBUFFER_RENDERABLE 0x8289 #define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A #define GL_FRAMEBUFFER_BLEND 0x828B #define GL_READ_PIXELS 0x828C #define GL_READ_PIXELS_FORMAT 0x828D #define GL_READ_PIXELS_TYPE 0x828E #define GL_TEXTURE_IMAGE_FORMAT 0x828F #define GL_TEXTURE_IMAGE_TYPE 0x8290 #define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291 #define GL_GET_TEXTURE_IMAGE_TYPE 0x8292 #define GL_MIPMAP 0x8293 #define GL_MANUAL_GENERATE_MIPMAP 0x8294 #define GL_AUTO_GENERATE_MIPMAP 0x8295 #define GL_COLOR_ENCODING 0x8296 #define GL_SRGB_READ 0x8297 #define GL_SRGB_WRITE 0x8298 #define GL_SRGB_DECODE_ARB 0x8299 #define GL_FILTER 0x829A #define GL_VERTEX_TEXTURE 0x829B #define GL_TESS_CONTROL_TEXTURE 0x829C #define GL_TESS_EVALUATION_TEXTURE 0x829D #define GL_GEOMETRY_TEXTURE 0x829E #define GL_FRAGMENT_TEXTURE 0x829F #define GL_COMPUTE_TEXTURE 0x82A0 #define GL_TEXTURE_SHADOW 0x82A1 #define GL_TEXTURE_GATHER 0x82A2 #define GL_TEXTURE_GATHER_SHADOW 0x82A3 #define GL_SHADER_IMAGE_LOAD 0x82A4 #define GL_SHADER_IMAGE_STORE 0x82A5 #define GL_SHADER_IMAGE_ATOMIC 0x82A6 #define GL_IMAGE_TEXEL_SIZE 0x82A7 #define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8 #define GL_IMAGE_PIXEL_FORMAT 0x82A9 #define GL_IMAGE_PIXEL_TYPE 0x82AA #define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC #define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD #define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE #define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF #define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1 #define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2 #define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3 #define GL_CLEAR_BUFFER 0x82B4 #define GL_TEXTURE_VIEW 0x82B5 #define GL_VIEW_COMPATIBILITY_CLASS 0x82B6 #define GL_FULL_SUPPORT 0x82B7 #define GL_CAVEAT_SUPPORT 0x82B8 #define GL_IMAGE_CLASS_4_X_32 0x82B9 #define GL_IMAGE_CLASS_2_X_32 0x82BA #define GL_IMAGE_CLASS_1_X_32 0x82BB #define GL_IMAGE_CLASS_4_X_16 0x82BC #define GL_IMAGE_CLASS_2_X_16 0x82BD #define GL_IMAGE_CLASS_1_X_16 0x82BE #define GL_IMAGE_CLASS_4_X_8 0x82BF #define GL_IMAGE_CLASS_2_X_8 0x82C0 #define GL_IMAGE_CLASS_1_X_8 0x82C1 #define GL_IMAGE_CLASS_11_11_10 0x82C2 #define GL_IMAGE_CLASS_10_10_10_2 0x82C3 #define GL_VIEW_CLASS_128_BITS 0x82C4 #define GL_VIEW_CLASS_96_BITS 0x82C5 #define GL_VIEW_CLASS_64_BITS 0x82C6 #define GL_VIEW_CLASS_48_BITS 0x82C7 #define GL_VIEW_CLASS_32_BITS 0x82C8 #define GL_VIEW_CLASS_24_BITS 0x82C9 #define GL_VIEW_CLASS_16_BITS 0x82CA #define GL_VIEW_CLASS_8_BITS 0x82CB #define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC #define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD #define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE #define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF #define GL_VIEW_CLASS_RGTC1_RED 0x82D0 #define GL_VIEW_CLASS_RGTC2_RG 0x82D1 #define GL_VIEW_CLASS_BPTC_UNORM 0x82D2 #define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3 typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params); #define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v) #define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2) #endif /* GL_ARB_internalformat_query2 */ /* ----------------------- GL_ARB_invalidate_subdata ----------------------- */ #ifndef GL_ARB_invalidate_subdata #define GL_ARB_invalidate_subdata 1 typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments); typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth); #define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData) #define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData) #define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer) #define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer) #define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage) #define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage) #define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata) #endif /* GL_ARB_invalidate_subdata */ /* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */ #ifndef GL_ARB_map_buffer_alignment #define GL_ARB_map_buffer_alignment 1 #define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC #define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment) #endif /* GL_ARB_map_buffer_alignment */ /* ------------------------ GL_ARB_map_buffer_range ------------------------ */ #ifndef GL_ARB_map_buffer_range #define GL_ARB_map_buffer_range 1 #define GL_MAP_READ_BIT 0x0001 #define GL_MAP_WRITE_BIT 0x0002 #define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 #define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 #define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 #define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); typedef void * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); #define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) #define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) #define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) #endif /* GL_ARB_map_buffer_range */ /* ------------------------- GL_ARB_matrix_palette ------------------------- */ #ifndef GL_ARB_matrix_palette #define GL_ARB_matrix_palette 1 #define GL_MATRIX_PALETTE_ARB 0x8840 #define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 #define GL_MAX_PALETTE_MATRICES_ARB 0x8842 #define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 #define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 #define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 #define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 #define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 #define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 #define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); #define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) #define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) #define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) #define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) #define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) #define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) #endif /* GL_ARB_matrix_palette */ /* --------------------------- GL_ARB_multi_bind --------------------------- */ #ifndef GL_ARB_multi_bind #define GL_ARB_multi_bind 1 typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers); typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes); typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers); typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures); typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides); #define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase) #define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange) #define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures) #define glBindSamplers GLEW_GET_FUN(__glewBindSamplers) #define glBindTextures GLEW_GET_FUN(__glewBindTextures) #define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers) #define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind) #endif /* GL_ARB_multi_bind */ /* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */ #ifndef GL_ARB_multi_draw_indirect #define GL_ARB_multi_draw_indirect 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei primcount, GLsizei stride); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei primcount, GLsizei stride); #define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect) #define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect) #define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect) #endif /* GL_ARB_multi_draw_indirect */ /* --------------------------- GL_ARB_multisample -------------------------- */ #ifndef GL_ARB_multisample #define GL_ARB_multisample 1 #define GL_MULTISAMPLE_ARB 0x809D #define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E #define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F #define GL_SAMPLE_COVERAGE_ARB 0x80A0 #define GL_SAMPLE_BUFFERS_ARB 0x80A8 #define GL_SAMPLES_ARB 0x80A9 #define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA #define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB #define GL_MULTISAMPLE_BIT_ARB 0x20000000 typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); #define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) #define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) #endif /* GL_ARB_multisample */ /* -------------------------- GL_ARB_multitexture -------------------------- */ #ifndef GL_ARB_multitexture #define GL_ARB_multitexture 1 #define GL_TEXTURE0_ARB 0x84C0 #define GL_TEXTURE1_ARB 0x84C1 #define GL_TEXTURE2_ARB 0x84C2 #define GL_TEXTURE3_ARB 0x84C3 #define GL_TEXTURE4_ARB 0x84C4 #define GL_TEXTURE5_ARB 0x84C5 #define GL_TEXTURE6_ARB 0x84C6 #define GL_TEXTURE7_ARB 0x84C7 #define GL_TEXTURE8_ARB 0x84C8 #define GL_TEXTURE9_ARB 0x84C9 #define GL_TEXTURE10_ARB 0x84CA #define GL_TEXTURE11_ARB 0x84CB #define GL_TEXTURE12_ARB 0x84CC #define GL_TEXTURE13_ARB 0x84CD #define GL_TEXTURE14_ARB 0x84CE #define GL_TEXTURE15_ARB 0x84CF #define GL_TEXTURE16_ARB 0x84D0 #define GL_TEXTURE17_ARB 0x84D1 #define GL_TEXTURE18_ARB 0x84D2 #define GL_TEXTURE19_ARB 0x84D3 #define GL_TEXTURE20_ARB 0x84D4 #define GL_TEXTURE21_ARB 0x84D5 #define GL_TEXTURE22_ARB 0x84D6 #define GL_TEXTURE23_ARB 0x84D7 #define GL_TEXTURE24_ARB 0x84D8 #define GL_TEXTURE25_ARB 0x84D9 #define GL_TEXTURE26_ARB 0x84DA #define GL_TEXTURE27_ARB 0x84DB #define GL_TEXTURE28_ARB 0x84DC #define GL_TEXTURE29_ARB 0x84DD #define GL_TEXTURE30_ARB 0x84DE #define GL_TEXTURE31_ARB 0x84DF #define GL_ACTIVE_TEXTURE_ARB 0x84E0 #define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 #define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); #define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) #define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) #define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) #define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) #define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) #define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) #define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) #define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) #define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) #define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) #define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) #define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) #define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) #define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) #define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) #define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) #define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) #define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) #define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) #define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) #define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) #define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) #define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) #define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) #define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) #define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) #define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) #define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) #define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) #define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) #define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) #define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) #define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) #define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) #define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) #endif /* GL_ARB_multitexture */ /* ------------------------- GL_ARB_occlusion_query ------------------------ */ #ifndef GL_ARB_occlusion_query #define GL_ARB_occlusion_query 1 #define GL_QUERY_COUNTER_BITS_ARB 0x8864 #define GL_CURRENT_QUERY_ARB 0x8865 #define GL_QUERY_RESULT_ARB 0x8866 #define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 #define GL_SAMPLES_PASSED_ARB 0x8914 typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); #define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) #define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) #define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) #define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) #define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) #define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) #define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) #define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) #define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) #endif /* GL_ARB_occlusion_query */ /* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ #ifndef GL_ARB_occlusion_query2 #define GL_ARB_occlusion_query2 1 #define GL_ANY_SAMPLES_PASSED 0x8C2F #define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) #endif /* GL_ARB_occlusion_query2 */ /* --------------------- GL_ARB_parallel_shader_compile -------------------- */ #ifndef GL_ARB_parallel_shader_compile #define GL_ARB_parallel_shader_compile 1 #define GL_MAX_SHADER_COMPILER_THREADS_ARB 0x91B0 #define GL_COMPLETION_STATUS_ARB 0x91B1 typedef void (GLAPIENTRY * PFNGLMAXSHADERCOMPILERTHREADSARBPROC) (GLuint count); #define glMaxShaderCompilerThreadsARB GLEW_GET_FUN(__glewMaxShaderCompilerThreadsARB) #define GLEW_ARB_parallel_shader_compile GLEW_GET_VAR(__GLEW_ARB_parallel_shader_compile) #endif /* GL_ARB_parallel_shader_compile */ /* -------------------- GL_ARB_pipeline_statistics_query ------------------- */ #ifndef GL_ARB_pipeline_statistics_query #define GL_ARB_pipeline_statistics_query 1 #define GL_VERTICES_SUBMITTED_ARB 0x82EE #define GL_PRIMITIVES_SUBMITTED_ARB 0x82EF #define GL_VERTEX_SHADER_INVOCATIONS_ARB 0x82F0 #define GL_TESS_CONTROL_SHADER_PATCHES_ARB 0x82F1 #define GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB 0x82F2 #define GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB 0x82F3 #define GL_FRAGMENT_SHADER_INVOCATIONS_ARB 0x82F4 #define GL_COMPUTE_SHADER_INVOCATIONS_ARB 0x82F5 #define GL_CLIPPING_INPUT_PRIMITIVES_ARB 0x82F6 #define GL_CLIPPING_OUTPUT_PRIMITIVES_ARB 0x82F7 #define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F #define GLEW_ARB_pipeline_statistics_query GLEW_GET_VAR(__GLEW_ARB_pipeline_statistics_query) #endif /* GL_ARB_pipeline_statistics_query */ /* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ #ifndef GL_ARB_pixel_buffer_object #define GL_ARB_pixel_buffer_object 1 #define GL_PIXEL_PACK_BUFFER_ARB 0x88EB #define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC #define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED #define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF #define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) #endif /* GL_ARB_pixel_buffer_object */ /* ------------------------ GL_ARB_point_parameters ------------------------ */ #ifndef GL_ARB_point_parameters #define GL_ARB_point_parameters 1 #define GL_POINT_SIZE_MIN_ARB 0x8126 #define GL_POINT_SIZE_MAX_ARB 0x8127 #define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 #define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); #define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) #define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) #define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) #endif /* GL_ARB_point_parameters */ /* -------------------------- GL_ARB_point_sprite -------------------------- */ #ifndef GL_ARB_point_sprite #define GL_ARB_point_sprite 1 #define GL_POINT_SPRITE_ARB 0x8861 #define GL_COORD_REPLACE_ARB 0x8862 #define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) #endif /* GL_ARB_point_sprite */ /* ----------------------- GL_ARB_post_depth_coverage ---------------------- */ #ifndef GL_ARB_post_depth_coverage #define GL_ARB_post_depth_coverage 1 #define GLEW_ARB_post_depth_coverage GLEW_GET_VAR(__GLEW_ARB_post_depth_coverage) #endif /* GL_ARB_post_depth_coverage */ /* --------------------- GL_ARB_program_interface_query -------------------- */ #ifndef GL_ARB_program_interface_query #define GL_ARB_program_interface_query 1 #define GL_UNIFORM 0x92E1 #define GL_UNIFORM_BLOCK 0x92E2 #define GL_PROGRAM_INPUT 0x92E3 #define GL_PROGRAM_OUTPUT 0x92E4 #define GL_BUFFER_VARIABLE 0x92E5 #define GL_SHADER_STORAGE_BLOCK 0x92E6 #define GL_IS_PER_PATCH 0x92E7 #define GL_VERTEX_SUBROUTINE 0x92E8 #define GL_TESS_CONTROL_SUBROUTINE 0x92E9 #define GL_TESS_EVALUATION_SUBROUTINE 0x92EA #define GL_GEOMETRY_SUBROUTINE 0x92EB #define GL_FRAGMENT_SUBROUTINE 0x92EC #define GL_COMPUTE_SUBROUTINE 0x92ED #define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE #define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF #define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0 #define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1 #define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2 #define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3 #define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4 #define GL_ACTIVE_RESOURCES 0x92F5 #define GL_MAX_NAME_LENGTH 0x92F6 #define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7 #define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8 #define GL_NAME_LENGTH 0x92F9 #define GL_TYPE 0x92FA #define GL_ARRAY_SIZE 0x92FB #define GL_OFFSET 0x92FC #define GL_BLOCK_INDEX 0x92FD #define GL_ARRAY_STRIDE 0x92FE #define GL_MATRIX_STRIDE 0x92FF #define GL_IS_ROW_MAJOR 0x9300 #define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301 #define GL_BUFFER_BINDING 0x9302 #define GL_BUFFER_DATA_SIZE 0x9303 #define GL_NUM_ACTIVE_VARIABLES 0x9304 #define GL_ACTIVE_VARIABLES 0x9305 #define GL_REFERENCED_BY_VERTEX_SHADER 0x9306 #define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307 #define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308 #define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309 #define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A #define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B #define GL_TOP_LEVEL_ARRAY_SIZE 0x930C #define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D #define GL_LOCATION 0x930E #define GL_LOCATION_INDEX 0x930F typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params); typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name); typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name); typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params); #define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv) #define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex) #define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation) #define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex) #define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName) #define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv) #define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query) #endif /* GL_ARB_program_interface_query */ /* ------------------------ GL_ARB_provoking_vertex ------------------------ */ #ifndef GL_ARB_provoking_vertex #define GL_ARB_provoking_vertex 1 #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C #define GL_FIRST_VERTEX_CONVENTION 0x8E4D #define GL_LAST_VERTEX_CONVENTION 0x8E4E #define GL_PROVOKING_VERTEX 0x8E4F typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); #define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) #define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) #endif /* GL_ARB_provoking_vertex */ /* ----------------------- GL_ARB_query_buffer_object ---------------------- */ #ifndef GL_ARB_query_buffer_object #define GL_ARB_query_buffer_object 1 #define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000 #define GL_QUERY_BUFFER 0x9192 #define GL_QUERY_BUFFER_BINDING 0x9193 #define GL_QUERY_RESULT_NO_WAIT 0x9194 #define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object) #endif /* GL_ARB_query_buffer_object */ /* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */ #ifndef GL_ARB_robust_buffer_access_behavior #define GL_ARB_robust_buffer_access_behavior 1 #define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior) #endif /* GL_ARB_robust_buffer_access_behavior */ /* --------------------------- GL_ARB_robustness --------------------------- */ #ifndef GL_ARB_robustness #define GL_ARB_robustness 1 #define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 #define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 #define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 #define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 #define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 #define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 #define GL_NO_RESET_NOTIFICATION_ARB 0x8261 typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, void*column, void*span); typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); #define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB) #define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) #define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) #define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) #define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) #define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) #define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) #define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) #define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) #define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) #define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) #define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) #define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) #define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) #define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) #define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) #define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) #define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) #define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) #define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) #define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) #endif /* GL_ARB_robustness */ /* ---------------- GL_ARB_robustness_application_isolation ---------------- */ #ifndef GL_ARB_robustness_application_isolation #define GL_ARB_robustness_application_isolation 1 #define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation) #endif /* GL_ARB_robustness_application_isolation */ /* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */ #ifndef GL_ARB_robustness_share_group_isolation #define GL_ARB_robustness_share_group_isolation 1 #define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation) #endif /* GL_ARB_robustness_share_group_isolation */ /* ------------------------ GL_ARB_sample_locations ------------------------ */ #ifndef GL_ARB_sample_locations #define GL_ARB_sample_locations 1 #define GL_SAMPLE_LOCATION_ARB 0x8E50 #define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB 0x933D #define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB 0x933E #define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB 0x933F #define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB 0x9340 #define GL_PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 #define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB 0x9342 #define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB 0x9343 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); #define glFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewFramebufferSampleLocationsfvARB) #define glNamedFramebufferSampleLocationsfvARB GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvARB) #define GLEW_ARB_sample_locations GLEW_GET_VAR(__GLEW_ARB_sample_locations) #endif /* GL_ARB_sample_locations */ /* ------------------------- GL_ARB_sample_shading ------------------------- */ #ifndef GL_ARB_sample_shading #define GL_ARB_sample_shading 1 #define GL_SAMPLE_SHADING_ARB 0x8C36 #define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); #define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) #define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) #endif /* GL_ARB_sample_shading */ /* ------------------------- GL_ARB_sampler_objects ------------------------ */ #ifndef GL_ARB_sampler_objects #define GL_ARB_sampler_objects 1 #define GL_SAMPLER_BINDING 0x8919 typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); #define glBindSampler GLEW_GET_FUN(__glewBindSampler) #define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) #define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) #define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) #define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) #define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) #define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) #define glIsSampler GLEW_GET_FUN(__glewIsSampler) #define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) #define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) #define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) #define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) #define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) #define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) #define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) #endif /* GL_ARB_sampler_objects */ /* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ #ifndef GL_ARB_seamless_cube_map #define GL_ARB_seamless_cube_map 1 #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F #define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) #endif /* GL_ARB_seamless_cube_map */ /* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */ #ifndef GL_ARB_seamless_cubemap_per_texture #define GL_ARB_seamless_cubemap_per_texture 1 #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F #define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture) #endif /* GL_ARB_seamless_cubemap_per_texture */ /* --------------------- GL_ARB_separate_shader_objects -------------------- */ #ifndef GL_ARB_separate_shader_objects #define GL_ARB_separate_shader_objects 1 #define GL_VERTEX_SHADER_BIT 0x00000001 #define GL_FRAGMENT_SHADER_BIT 0x00000002 #define GL_GEOMETRY_SHADER_BIT 0x00000004 #define GL_TESS_CONTROL_SHADER_BIT 0x00000008 #define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 #define GL_PROGRAM_SEPARABLE 0x8258 #define GL_ACTIVE_PROGRAM 0x8259 #define GL_PROGRAM_PIPELINE_BINDING 0x825A #define GL_ALL_SHADER_BITS 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar * const * strings); typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog); typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); #define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) #define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) #define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) #define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) #define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) #define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) #define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) #define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) #define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) #define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) #define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) #define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) #define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) #define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) #define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) #define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) #define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) #define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) #define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) #define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) #define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) #define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) #define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) #define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) #define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) #define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) #define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) #define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) #define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) #define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) #define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) #define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) #define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) #define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) #define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) #define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) #define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) #define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) #define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) #define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) #define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) #define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) #define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) #define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) #define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) #define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) #define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) #define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) #define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) #define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) #define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) #define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) #define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) #define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) #define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) #define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) #define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) #define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) #define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) #define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) #define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) #endif /* GL_ARB_separate_shader_objects */ /* -------------------- GL_ARB_shader_atomic_counter_ops ------------------- */ #ifndef GL_ARB_shader_atomic_counter_ops #define GL_ARB_shader_atomic_counter_ops 1 #define GLEW_ARB_shader_atomic_counter_ops GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counter_ops) #endif /* GL_ARB_shader_atomic_counter_ops */ /* --------------------- GL_ARB_shader_atomic_counters --------------------- */ #ifndef GL_ARB_shader_atomic_counters #define GL_ARB_shader_atomic_counters 1 #define GL_ATOMIC_COUNTER_BUFFER 0x92C0 #define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1 #define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2 #define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3 #define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4 #define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5 #define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6 #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7 #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8 #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9 #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA #define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB #define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC #define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD #define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE #define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF #define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0 #define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1 #define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2 #define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3 #define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4 #define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5 #define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6 #define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7 #define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8 #define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9 #define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA #define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB #define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params); #define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv) #define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters) #endif /* GL_ARB_shader_atomic_counters */ /* -------------------------- GL_ARB_shader_ballot ------------------------- */ #ifndef GL_ARB_shader_ballot #define GL_ARB_shader_ballot 1 #define GLEW_ARB_shader_ballot GLEW_GET_VAR(__GLEW_ARB_shader_ballot) #endif /* GL_ARB_shader_ballot */ /* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ #ifndef GL_ARB_shader_bit_encoding #define GL_ARB_shader_bit_encoding 1 #define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) #endif /* GL_ARB_shader_bit_encoding */ /* -------------------------- GL_ARB_shader_clock -------------------------- */ #ifndef GL_ARB_shader_clock #define GL_ARB_shader_clock 1 #define GLEW_ARB_shader_clock GLEW_GET_VAR(__GLEW_ARB_shader_clock) #endif /* GL_ARB_shader_clock */ /* --------------------- GL_ARB_shader_draw_parameters --------------------- */ #ifndef GL_ARB_shader_draw_parameters #define GL_ARB_shader_draw_parameters 1 #define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters) #endif /* GL_ARB_shader_draw_parameters */ /* ------------------------ GL_ARB_shader_group_vote ----------------------- */ #ifndef GL_ARB_shader_group_vote #define GL_ARB_shader_group_vote 1 #define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote) #endif /* GL_ARB_shader_group_vote */ /* --------------------- GL_ARB_shader_image_load_store -------------------- */ #ifndef GL_ARB_shader_image_load_store #define GL_ARB_shader_image_load_store 1 #define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001 #define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002 #define GL_UNIFORM_BARRIER_BIT 0x00000004 #define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008 #define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020 #define GL_COMMAND_BARRIER_BIT 0x00000040 #define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080 #define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100 #define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200 #define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400 #define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800 #define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000 #define GL_MAX_IMAGE_UNITS 0x8F38 #define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39 #define GL_IMAGE_BINDING_NAME 0x8F3A #define GL_IMAGE_BINDING_LEVEL 0x8F3B #define GL_IMAGE_BINDING_LAYERED 0x8F3C #define GL_IMAGE_BINDING_LAYER 0x8F3D #define GL_IMAGE_BINDING_ACCESS 0x8F3E #define GL_IMAGE_1D 0x904C #define GL_IMAGE_2D 0x904D #define GL_IMAGE_3D 0x904E #define GL_IMAGE_2D_RECT 0x904F #define GL_IMAGE_CUBE 0x9050 #define GL_IMAGE_BUFFER 0x9051 #define GL_IMAGE_1D_ARRAY 0x9052 #define GL_IMAGE_2D_ARRAY 0x9053 #define GL_IMAGE_CUBE_MAP_ARRAY 0x9054 #define GL_IMAGE_2D_MULTISAMPLE 0x9055 #define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056 #define GL_INT_IMAGE_1D 0x9057 #define GL_INT_IMAGE_2D 0x9058 #define GL_INT_IMAGE_3D 0x9059 #define GL_INT_IMAGE_2D_RECT 0x905A #define GL_INT_IMAGE_CUBE 0x905B #define GL_INT_IMAGE_BUFFER 0x905C #define GL_INT_IMAGE_1D_ARRAY 0x905D #define GL_INT_IMAGE_2D_ARRAY 0x905E #define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F #define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060 #define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061 #define GL_UNSIGNED_INT_IMAGE_1D 0x9062 #define GL_UNSIGNED_INT_IMAGE_2D 0x9063 #define GL_UNSIGNED_INT_IMAGE_3D 0x9064 #define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065 #define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066 #define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067 #define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068 #define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069 #define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C #define GL_MAX_IMAGE_SAMPLES 0x906D #define GL_IMAGE_BINDING_FORMAT 0x906E #define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7 #define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8 #define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9 #define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA #define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB #define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC #define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD #define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE #define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF #define GL_ALL_BARRIER_BITS 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format); typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers); #define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture) #define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier) #define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store) #endif /* GL_ARB_shader_image_load_store */ /* ------------------------ GL_ARB_shader_image_size ----------------------- */ #ifndef GL_ARB_shader_image_size #define GL_ARB_shader_image_size 1 #define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size) #endif /* GL_ARB_shader_image_size */ /* ------------------------- GL_ARB_shader_objects ------------------------- */ #ifndef GL_ARB_shader_objects #define GL_ARB_shader_objects 1 #define GL_PROGRAM_OBJECT_ARB 0x8B40 #define GL_SHADER_OBJECT_ARB 0x8B48 #define GL_OBJECT_TYPE_ARB 0x8B4E #define GL_OBJECT_SUBTYPE_ARB 0x8B4F #define GL_FLOAT_VEC2_ARB 0x8B50 #define GL_FLOAT_VEC3_ARB 0x8B51 #define GL_FLOAT_VEC4_ARB 0x8B52 #define GL_INT_VEC2_ARB 0x8B53 #define GL_INT_VEC3_ARB 0x8B54 #define GL_INT_VEC4_ARB 0x8B55 #define GL_BOOL_ARB 0x8B56 #define GL_BOOL_VEC2_ARB 0x8B57 #define GL_BOOL_VEC3_ARB 0x8B58 #define GL_BOOL_VEC4_ARB 0x8B59 #define GL_FLOAT_MAT2_ARB 0x8B5A #define GL_FLOAT_MAT3_ARB 0x8B5B #define GL_FLOAT_MAT4_ARB 0x8B5C #define GL_SAMPLER_1D_ARB 0x8B5D #define GL_SAMPLER_2D_ARB 0x8B5E #define GL_SAMPLER_3D_ARB 0x8B5F #define GL_SAMPLER_CUBE_ARB 0x8B60 #define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 #define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 #define GL_SAMPLER_2D_RECT_ARB 0x8B63 #define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 #define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 #define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 #define GL_OBJECT_LINK_STATUS_ARB 0x8B82 #define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 #define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 #define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 #define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 #define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 #define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 typedef char GLcharARB; typedef unsigned int GLhandleARB; typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); #define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) #define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) #define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) #define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) #define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) #define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) #define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) #define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) #define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) #define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) #define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) #define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) #define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) #define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) #define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) #define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) #define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) #define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) #define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) #define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) #define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) #define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) #define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) #define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) #define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) #define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) #define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) #define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) #define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) #define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) #define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) #define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) #define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) #define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) #define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) #define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) #define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) #define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) #define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) #define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) #endif /* GL_ARB_shader_objects */ /* ------------------------ GL_ARB_shader_precision ------------------------ */ #ifndef GL_ARB_shader_precision #define GL_ARB_shader_precision 1 #define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) #endif /* GL_ARB_shader_precision */ /* ---------------------- GL_ARB_shader_stencil_export --------------------- */ #ifndef GL_ARB_shader_stencil_export #define GL_ARB_shader_stencil_export 1 #define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) #endif /* GL_ARB_shader_stencil_export */ /* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */ #ifndef GL_ARB_shader_storage_buffer_object #define GL_ARB_shader_storage_buffer_object 1 #define GL_SHADER_STORAGE_BARRIER_BIT 0x2000 #define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39 #define GL_SHADER_STORAGE_BUFFER 0x90D2 #define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3 #define GL_SHADER_STORAGE_BUFFER_START 0x90D4 #define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5 #define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6 #define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7 #define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8 #define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9 #define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA #define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB #define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC #define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD #define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE #define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding); #define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding) #define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object) #endif /* GL_ARB_shader_storage_buffer_object */ /* ------------------------ GL_ARB_shader_subroutine ----------------------- */ #ifndef GL_ARB_shader_subroutine #define GL_ARB_shader_subroutine 1 #define GL_ACTIVE_SUBROUTINES 0x8DE5 #define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 #define GL_MAX_SUBROUTINES 0x8DE7 #define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 #define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 #define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 #define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 #define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A #define GL_COMPATIBLE_SUBROUTINES 0x8E4B typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name); typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name); typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); #define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) #define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) #define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) #define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) #define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) #define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) #define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) #define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) #define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) #endif /* GL_ARB_shader_subroutine */ /* ------------------ GL_ARB_shader_texture_image_samples ------------------ */ #ifndef GL_ARB_shader_texture_image_samples #define GL_ARB_shader_texture_image_samples 1 #define GLEW_ARB_shader_texture_image_samples GLEW_GET_VAR(__GLEW_ARB_shader_texture_image_samples) #endif /* GL_ARB_shader_texture_image_samples */ /* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ #ifndef GL_ARB_shader_texture_lod #define GL_ARB_shader_texture_lod 1 #define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) #endif /* GL_ARB_shader_texture_lod */ /* ------------------- GL_ARB_shader_viewport_layer_array ------------------ */ #ifndef GL_ARB_shader_viewport_layer_array #define GL_ARB_shader_viewport_layer_array 1 #define GLEW_ARB_shader_viewport_layer_array GLEW_GET_VAR(__GLEW_ARB_shader_viewport_layer_array) #endif /* GL_ARB_shader_viewport_layer_array */ /* ---------------------- GL_ARB_shading_language_100 ---------------------- */ #ifndef GL_ARB_shading_language_100 #define GL_ARB_shading_language_100 1 #define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C #define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) #endif /* GL_ARB_shading_language_100 */ /* -------------------- GL_ARB_shading_language_420pack -------------------- */ #ifndef GL_ARB_shading_language_420pack #define GL_ARB_shading_language_420pack 1 #define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack) #endif /* GL_ARB_shading_language_420pack */ /* -------------------- GL_ARB_shading_language_include -------------------- */ #ifndef GL_ARB_shading_language_include #define GL_ARB_shading_language_include 1 #define GL_SHADER_INCLUDE_ARB 0x8DAE #define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 #define GL_NAMED_STRING_TYPE_ARB 0x8DEA typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length); typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string); typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params); typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name); typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string); #define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) #define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) #define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) #define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) #define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) #define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) #define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) #endif /* GL_ARB_shading_language_include */ /* -------------------- GL_ARB_shading_language_packing -------------------- */ #ifndef GL_ARB_shading_language_packing #define GL_ARB_shading_language_packing 1 #define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing) #endif /* GL_ARB_shading_language_packing */ /* ----------------------------- GL_ARB_shadow ----------------------------- */ #ifndef GL_ARB_shadow #define GL_ARB_shadow 1 #define GL_TEXTURE_COMPARE_MODE_ARB 0x884C #define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D #define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E #define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) #endif /* GL_ARB_shadow */ /* ------------------------- GL_ARB_shadow_ambient ------------------------- */ #ifndef GL_ARB_shadow_ambient #define GL_ARB_shadow_ambient 1 #define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF #define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) #endif /* GL_ARB_shadow_ambient */ /* -------------------------- GL_ARB_sparse_buffer ------------------------- */ #ifndef GL_ARB_sparse_buffer #define GL_ARB_sparse_buffer 1 #define GL_SPARSE_STORAGE_BIT_ARB 0x0400 #define GL_SPARSE_BUFFER_PAGE_SIZE_ARB 0x82F8 typedef void (GLAPIENTRY * PFNGLBUFFERPAGECOMMITMENTARBPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit); #define glBufferPageCommitmentARB GLEW_GET_FUN(__glewBufferPageCommitmentARB) #define GLEW_ARB_sparse_buffer GLEW_GET_VAR(__GLEW_ARB_sparse_buffer) #endif /* GL_ARB_sparse_buffer */ /* ------------------------- GL_ARB_sparse_texture ------------------------- */ #ifndef GL_ARB_sparse_texture #define GL_ARB_sparse_texture 1 #define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195 #define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196 #define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197 #define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198 #define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199 #define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A #define GL_TEXTURE_SPARSE_ARB 0x91A6 #define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7 #define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8 #define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9 #define GL_NUM_SPARSE_LEVELS_ARB 0x91AA typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit); #define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB) #define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT) #define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture) #endif /* GL_ARB_sparse_texture */ /* ------------------------- GL_ARB_sparse_texture2 ------------------------ */ #ifndef GL_ARB_sparse_texture2 #define GL_ARB_sparse_texture2 1 #define GLEW_ARB_sparse_texture2 GLEW_GET_VAR(__GLEW_ARB_sparse_texture2) #endif /* GL_ARB_sparse_texture2 */ /* ---------------------- GL_ARB_sparse_texture_clamp ---------------------- */ #ifndef GL_ARB_sparse_texture_clamp #define GL_ARB_sparse_texture_clamp 1 #define GLEW_ARB_sparse_texture_clamp GLEW_GET_VAR(__GLEW_ARB_sparse_texture_clamp) #endif /* GL_ARB_sparse_texture_clamp */ /* ------------------------ GL_ARB_stencil_texturing ----------------------- */ #ifndef GL_ARB_stencil_texturing #define GL_ARB_stencil_texturing 1 #define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA #define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing) #endif /* GL_ARB_stencil_texturing */ /* ------------------------------ GL_ARB_sync ------------------------------ */ #ifndef GL_ARB_sync #define GL_ARB_sync 1 #define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 #define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 #define GL_OBJECT_TYPE 0x9112 #define GL_SYNC_CONDITION 0x9113 #define GL_SYNC_STATUS 0x9114 #define GL_SYNC_FLAGS 0x9115 #define GL_SYNC_FENCE 0x9116 #define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 #define GL_UNSIGNALED 0x9118 #define GL_SIGNALED 0x9119 #define GL_ALREADY_SIGNALED 0x911A #define GL_TIMEOUT_EXPIRED 0x911B #define GL_CONDITION_SATISFIED 0x911C #define GL_WAIT_FAILED 0x911D #define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); #define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) #define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) #define glFenceSync GLEW_GET_FUN(__glewFenceSync) #define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) #define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) #define glIsSync GLEW_GET_FUN(__glewIsSync) #define glWaitSync GLEW_GET_FUN(__glewWaitSync) #define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) #endif /* GL_ARB_sync */ /* ----------------------- GL_ARB_tessellation_shader ---------------------- */ #ifndef GL_ARB_tessellation_shader #define GL_ARB_tessellation_shader 1 #define GL_PATCHES 0xE #define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 #define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 #define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C #define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D #define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E #define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F #define GL_PATCH_VERTICES 0x8E72 #define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 #define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 #define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 #define GL_TESS_GEN_MODE 0x8E76 #define GL_TESS_GEN_SPACING 0x8E77 #define GL_TESS_GEN_VERTEX_ORDER 0x8E78 #define GL_TESS_GEN_POINT_MODE 0x8E79 #define GL_ISOLINES 0x8E7A #define GL_FRACTIONAL_ODD 0x8E7B #define GL_FRACTIONAL_EVEN 0x8E7C #define GL_MAX_PATCH_VERTICES 0x8E7D #define GL_MAX_TESS_GEN_LEVEL 0x8E7E #define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F #define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 #define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 #define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 #define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 #define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 #define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 #define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 #define GL_TESS_EVALUATION_SHADER 0x8E87 #define GL_TESS_CONTROL_SHADER 0x8E88 #define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 #define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); #define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) #define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) #define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) #endif /* GL_ARB_tessellation_shader */ /* ------------------------- GL_ARB_texture_barrier ------------------------ */ #ifndef GL_ARB_texture_barrier #define GL_ARB_texture_barrier 1 typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERPROC) (void); #define glTextureBarrier GLEW_GET_FUN(__glewTextureBarrier) #define GLEW_ARB_texture_barrier GLEW_GET_VAR(__GLEW_ARB_texture_barrier) #endif /* GL_ARB_texture_barrier */ /* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ #ifndef GL_ARB_texture_border_clamp #define GL_ARB_texture_border_clamp 1 #define GL_CLAMP_TO_BORDER_ARB 0x812D #define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) #endif /* GL_ARB_texture_border_clamp */ /* ---------------------- GL_ARB_texture_buffer_object --------------------- */ #ifndef GL_ARB_texture_buffer_object #define GL_ARB_texture_buffer_object 1 #define GL_TEXTURE_BUFFER_ARB 0x8C2A #define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B #define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D #define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); #define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) #define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) #endif /* GL_ARB_texture_buffer_object */ /* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ #ifndef GL_ARB_texture_buffer_object_rgb32 #define GL_ARB_texture_buffer_object_rgb32 1 #define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) #endif /* GL_ARB_texture_buffer_object_rgb32 */ /* ---------------------- GL_ARB_texture_buffer_range ---------------------- */ #ifndef GL_ARB_texture_buffer_range #define GL_ARB_texture_buffer_range 1 #define GL_TEXTURE_BUFFER_OFFSET 0x919D #define GL_TEXTURE_BUFFER_SIZE 0x919E #define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size); #define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange) #define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT) #define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range) #endif /* GL_ARB_texture_buffer_range */ /* ----------------------- GL_ARB_texture_compression ---------------------- */ #ifndef GL_ARB_texture_compression #define GL_ARB_texture_compression 1 #define GL_COMPRESSED_ALPHA_ARB 0x84E9 #define GL_COMPRESSED_LUMINANCE_ARB 0x84EA #define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB #define GL_COMPRESSED_INTENSITY_ARB 0x84EC #define GL_COMPRESSED_RGB_ARB 0x84ED #define GL_COMPRESSED_RGBA_ARB 0x84EE #define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF #define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 #define GL_TEXTURE_COMPRESSED_ARB 0x86A1 #define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 #define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void *img); #define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) #define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) #define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) #define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) #define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) #define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) #define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) #define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) #endif /* GL_ARB_texture_compression */ /* -------------------- GL_ARB_texture_compression_bptc -------------------- */ #ifndef GL_ARB_texture_compression_bptc #define GL_ARB_texture_compression_bptc 1 #define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F #define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) #endif /* GL_ARB_texture_compression_bptc */ /* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ #ifndef GL_ARB_texture_compression_rgtc #define GL_ARB_texture_compression_rgtc 1 #define GL_COMPRESSED_RED_RGTC1 0x8DBB #define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC #define GL_COMPRESSED_RG_RGTC2 0x8DBD #define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE #define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) #endif /* GL_ARB_texture_compression_rgtc */ /* ------------------------ GL_ARB_texture_cube_map ------------------------ */ #ifndef GL_ARB_texture_cube_map #define GL_ARB_texture_cube_map 1 #define GL_NORMAL_MAP_ARB 0x8511 #define GL_REFLECTION_MAP_ARB 0x8512 #define GL_TEXTURE_CUBE_MAP_ARB 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A #define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C #define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) #endif /* GL_ARB_texture_cube_map */ /* --------------------- GL_ARB_texture_cube_map_array --------------------- */ #ifndef GL_ARB_texture_cube_map_array #define GL_ARB_texture_cube_map_array 1 #define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 #define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A #define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B #define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D #define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E #define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F #define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) #endif /* GL_ARB_texture_cube_map_array */ /* ------------------------- GL_ARB_texture_env_add ------------------------ */ #ifndef GL_ARB_texture_env_add #define GL_ARB_texture_env_add 1 #define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) #endif /* GL_ARB_texture_env_add */ /* ----------------------- GL_ARB_texture_env_combine ---------------------- */ #ifndef GL_ARB_texture_env_combine #define GL_ARB_texture_env_combine 1 #define GL_SUBTRACT_ARB 0x84E7 #define GL_COMBINE_ARB 0x8570 #define GL_COMBINE_RGB_ARB 0x8571 #define GL_COMBINE_ALPHA_ARB 0x8572 #define GL_RGB_SCALE_ARB 0x8573 #define GL_ADD_SIGNED_ARB 0x8574 #define GL_INTERPOLATE_ARB 0x8575 #define GL_CONSTANT_ARB 0x8576 #define GL_PRIMARY_COLOR_ARB 0x8577 #define GL_PREVIOUS_ARB 0x8578 #define GL_SOURCE0_RGB_ARB 0x8580 #define GL_SOURCE1_RGB_ARB 0x8581 #define GL_SOURCE2_RGB_ARB 0x8582 #define GL_SOURCE0_ALPHA_ARB 0x8588 #define GL_SOURCE1_ALPHA_ARB 0x8589 #define GL_SOURCE2_ALPHA_ARB 0x858A #define GL_OPERAND0_RGB_ARB 0x8590 #define GL_OPERAND1_RGB_ARB 0x8591 #define GL_OPERAND2_RGB_ARB 0x8592 #define GL_OPERAND0_ALPHA_ARB 0x8598 #define GL_OPERAND1_ALPHA_ARB 0x8599 #define GL_OPERAND2_ALPHA_ARB 0x859A #define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) #endif /* GL_ARB_texture_env_combine */ /* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ #ifndef GL_ARB_texture_env_crossbar #define GL_ARB_texture_env_crossbar 1 #define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) #endif /* GL_ARB_texture_env_crossbar */ /* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ #ifndef GL_ARB_texture_env_dot3 #define GL_ARB_texture_env_dot3 1 #define GL_DOT3_RGB_ARB 0x86AE #define GL_DOT3_RGBA_ARB 0x86AF #define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) #endif /* GL_ARB_texture_env_dot3 */ /* ---------------------- GL_ARB_texture_filter_minmax --------------------- */ #ifndef GL_ARB_texture_filter_minmax #define GL_ARB_texture_filter_minmax 1 #define GL_TEXTURE_REDUCTION_MODE_ARB 0x9366 #define GL_WEIGHTED_AVERAGE_ARB 0x9367 #define GLEW_ARB_texture_filter_minmax GLEW_GET_VAR(__GLEW_ARB_texture_filter_minmax) #endif /* GL_ARB_texture_filter_minmax */ /* -------------------------- GL_ARB_texture_float ------------------------- */ #ifndef GL_ARB_texture_float #define GL_ARB_texture_float 1 #define GL_RGBA32F_ARB 0x8814 #define GL_RGB32F_ARB 0x8815 #define GL_ALPHA32F_ARB 0x8816 #define GL_INTENSITY32F_ARB 0x8817 #define GL_LUMINANCE32F_ARB 0x8818 #define GL_LUMINANCE_ALPHA32F_ARB 0x8819 #define GL_RGBA16F_ARB 0x881A #define GL_RGB16F_ARB 0x881B #define GL_ALPHA16F_ARB 0x881C #define GL_INTENSITY16F_ARB 0x881D #define GL_LUMINANCE16F_ARB 0x881E #define GL_LUMINANCE_ALPHA16F_ARB 0x881F #define GL_TEXTURE_RED_TYPE_ARB 0x8C10 #define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 #define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 #define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 #define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 #define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 #define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 #define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 #define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) #endif /* GL_ARB_texture_float */ /* ------------------------- GL_ARB_texture_gather ------------------------- */ #ifndef GL_ARB_texture_gather #define GL_ARB_texture_gather 1 #define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E #define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F #define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F #define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) #endif /* GL_ARB_texture_gather */ /* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */ #ifndef GL_ARB_texture_mirror_clamp_to_edge #define GL_ARB_texture_mirror_clamp_to_edge 1 #define GL_MIRROR_CLAMP_TO_EDGE 0x8743 #define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge) #endif /* GL_ARB_texture_mirror_clamp_to_edge */ /* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ #ifndef GL_ARB_texture_mirrored_repeat #define GL_ARB_texture_mirrored_repeat 1 #define GL_MIRRORED_REPEAT_ARB 0x8370 #define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) #endif /* GL_ARB_texture_mirrored_repeat */ /* ----------------------- GL_ARB_texture_multisample ---------------------- */ #ifndef GL_ARB_texture_multisample #define GL_ARB_texture_multisample 1 #define GL_SAMPLE_POSITION 0x8E50 #define GL_SAMPLE_MASK 0x8E51 #define GL_SAMPLE_MASK_VALUE 0x8E52 #define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 #define GL_TEXTURE_2D_MULTISAMPLE 0x9100 #define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 #define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 #define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 #define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 #define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 #define GL_TEXTURE_SAMPLES 0x9106 #define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 #define GL_SAMPLER_2D_MULTISAMPLE 0x9108 #define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A #define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B #define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C #define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D #define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E #define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F #define GL_MAX_INTEGER_SAMPLES 0x9110 typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); #define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) #define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) #define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) #define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) #define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) #endif /* GL_ARB_texture_multisample */ /* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ #ifndef GL_ARB_texture_non_power_of_two #define GL_ARB_texture_non_power_of_two 1 #define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) #endif /* GL_ARB_texture_non_power_of_two */ /* ---------------------- GL_ARB_texture_query_levels ---------------------- */ #ifndef GL_ARB_texture_query_levels #define GL_ARB_texture_query_levels 1 #define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels) #endif /* GL_ARB_texture_query_levels */ /* ------------------------ GL_ARB_texture_query_lod ----------------------- */ #ifndef GL_ARB_texture_query_lod #define GL_ARB_texture_query_lod 1 #define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) #endif /* GL_ARB_texture_query_lod */ /* ------------------------ GL_ARB_texture_rectangle ----------------------- */ #ifndef GL_ARB_texture_rectangle #define GL_ARB_texture_rectangle 1 #define GL_TEXTURE_RECTANGLE_ARB 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 #define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 #define GL_SAMPLER_2D_RECT_ARB 0x8B63 #define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 #define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) #endif /* GL_ARB_texture_rectangle */ /* --------------------------- GL_ARB_texture_rg --------------------------- */ #ifndef GL_ARB_texture_rg #define GL_ARB_texture_rg 1 #define GL_COMPRESSED_RED 0x8225 #define GL_COMPRESSED_RG 0x8226 #define GL_RG 0x8227 #define GL_RG_INTEGER 0x8228 #define GL_R8 0x8229 #define GL_R16 0x822A #define GL_RG8 0x822B #define GL_RG16 0x822C #define GL_R16F 0x822D #define GL_R32F 0x822E #define GL_RG16F 0x822F #define GL_RG32F 0x8230 #define GL_R8I 0x8231 #define GL_R8UI 0x8232 #define GL_R16I 0x8233 #define GL_R16UI 0x8234 #define GL_R32I 0x8235 #define GL_R32UI 0x8236 #define GL_RG8I 0x8237 #define GL_RG8UI 0x8238 #define GL_RG16I 0x8239 #define GL_RG16UI 0x823A #define GL_RG32I 0x823B #define GL_RG32UI 0x823C #define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) #endif /* GL_ARB_texture_rg */ /* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ #ifndef GL_ARB_texture_rgb10_a2ui #define GL_ARB_texture_rgb10_a2ui 1 #define GL_RGB10_A2UI 0x906F #define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) #endif /* GL_ARB_texture_rgb10_a2ui */ /* ------------------------ GL_ARB_texture_stencil8 ------------------------ */ #ifndef GL_ARB_texture_stencil8 #define GL_ARB_texture_stencil8 1 #define GL_STENCIL_INDEX 0x1901 #define GL_STENCIL_INDEX8 0x8D48 #define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8) #endif /* GL_ARB_texture_stencil8 */ /* ------------------------- GL_ARB_texture_storage ------------------------ */ #ifndef GL_ARB_texture_storage #define GL_ARB_texture_storage 1 #define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth); #define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D) #define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D) #define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D) #define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT) #define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT) #define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT) #define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage) #endif /* GL_ARB_texture_storage */ /* ------------------- GL_ARB_texture_storage_multisample ------------------ */ #ifndef GL_ARB_texture_storage_multisample #define GL_ARB_texture_storage_multisample 1 typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); #define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample) #define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample) #define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT) #define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT) #define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample) #endif /* GL_ARB_texture_storage_multisample */ /* ------------------------- GL_ARB_texture_swizzle ------------------------ */ #ifndef GL_ARB_texture_swizzle #define GL_ARB_texture_swizzle 1 #define GL_TEXTURE_SWIZZLE_R 0x8E42 #define GL_TEXTURE_SWIZZLE_G 0x8E43 #define GL_TEXTURE_SWIZZLE_B 0x8E44 #define GL_TEXTURE_SWIZZLE_A 0x8E45 #define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 #define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) #endif /* GL_ARB_texture_swizzle */ /* -------------------------- GL_ARB_texture_view -------------------------- */ #ifndef GL_ARB_texture_view #define GL_ARB_texture_view 1 #define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB #define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC #define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD #define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE #define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers); #define glTextureView GLEW_GET_FUN(__glewTextureView) #define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view) #endif /* GL_ARB_texture_view */ /* --------------------------- GL_ARB_timer_query -------------------------- */ #ifndef GL_ARB_timer_query #define GL_ARB_timer_query 1 #define GL_TIME_ELAPSED 0x88BF #define GL_TIMESTAMP 0x8E28 typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); #define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) #define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) #define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) #define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) #endif /* GL_ARB_timer_query */ /* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ #ifndef GL_ARB_transform_feedback2 #define GL_ARB_transform_feedback2 1 #define GL_TRANSFORM_FEEDBACK 0x8E22 #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 #define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); #define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) #define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) #define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) #define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) #define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) #define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) #define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) #define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) #endif /* GL_ARB_transform_feedback2 */ /* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ #ifndef GL_ARB_transform_feedback3 #define GL_ARB_transform_feedback3 1 #define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 #define GL_MAX_VERTEX_STREAMS 0x8E71 typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); #define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) #define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) #define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) #define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) #define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) #endif /* GL_ARB_transform_feedback3 */ /* ------------------ GL_ARB_transform_feedback_instanced ------------------ */ #ifndef GL_ARB_transform_feedback_instanced #define GL_ARB_transform_feedback_instanced 1 typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount); #define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced) #define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced) #define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced) #endif /* GL_ARB_transform_feedback_instanced */ /* ---------------- GL_ARB_transform_feedback_overflow_query --------------- */ #ifndef GL_ARB_transform_feedback_overflow_query #define GL_ARB_transform_feedback_overflow_query 1 #define GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB 0x82EC #define GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB 0x82ED #define GLEW_ARB_transform_feedback_overflow_query GLEW_GET_VAR(__GLEW_ARB_transform_feedback_overflow_query) #endif /* GL_ARB_transform_feedback_overflow_query */ /* ------------------------ GL_ARB_transpose_matrix ------------------------ */ #ifndef GL_ARB_transpose_matrix #define GL_ARB_transpose_matrix 1 #define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 #define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 #define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 #define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); #define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) #define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) #define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) #define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) #define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) #endif /* GL_ARB_transpose_matrix */ /* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ #ifndef GL_ARB_uniform_buffer_object #define GL_ARB_uniform_buffer_object 1 #define GL_UNIFORM_BUFFER 0x8A11 #define GL_UNIFORM_BUFFER_BINDING 0x8A28 #define GL_UNIFORM_BUFFER_START 0x8A29 #define GL_UNIFORM_BUFFER_SIZE 0x8A2A #define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B #define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C #define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D #define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E #define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F #define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 #define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 #define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 #define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 #define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 #define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 #define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 #define GL_UNIFORM_TYPE 0x8A37 #define GL_UNIFORM_SIZE 0x8A38 #define GL_UNIFORM_NAME_LENGTH 0x8A39 #define GL_UNIFORM_BLOCK_INDEX 0x8A3A #define GL_UNIFORM_OFFSET 0x8A3B #define GL_UNIFORM_ARRAY_STRIDE 0x8A3C #define GL_UNIFORM_MATRIX_STRIDE 0x8A3D #define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E #define GL_UNIFORM_BLOCK_BINDING 0x8A3F #define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 #define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 #define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 #define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 #define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 #define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 #define GL_INVALID_INDEX 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName); typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName); typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* const * uniformNames, GLuint* uniformIndices); typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); #define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) #define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) #define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) #define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) #define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) #define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) #define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) #define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) #define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) #define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) #define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) #endif /* GL_ARB_uniform_buffer_object */ /* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ #ifndef GL_ARB_vertex_array_bgra #define GL_ARB_vertex_array_bgra 1 #define GL_BGRA 0x80E1 #define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) #endif /* GL_ARB_vertex_array_bgra */ /* ----------------------- GL_ARB_vertex_array_object ---------------------- */ #ifndef GL_ARB_vertex_array_object #define GL_ARB_vertex_array_object 1 #define GL_VERTEX_ARRAY_BINDING 0x85B5 typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); #define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) #define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) #define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) #define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) #define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) #endif /* GL_ARB_vertex_array_object */ /* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ #ifndef GL_ARB_vertex_attrib_64bit #define GL_ARB_vertex_attrib_64bit 1 typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); #define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) #define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) #define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) #define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) #define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) #define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) #define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) #define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) #define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) #define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) #define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) #endif /* GL_ARB_vertex_attrib_64bit */ /* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */ #ifndef GL_ARB_vertex_attrib_binding #define GL_ARB_vertex_attrib_binding 1 #define GL_VERTEX_ATTRIB_BINDING 0x82D4 #define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5 #define GL_VERTEX_BINDING_DIVISOR 0x82D6 #define GL_VERTEX_BINDING_OFFSET 0x82D7 #define GL_VERTEX_BINDING_STRIDE 0x82D8 #define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9 #define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA #define GL_VERTEX_BINDING_BUFFER 0x8F4F typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC) (GLuint vaobj, GLuint attribindex, GLuint bindingindex); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC) (GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC) (GLuint vaobj, GLuint bindingindex, GLuint divisor); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset); typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor); #define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer) #define glVertexArrayBindVertexBufferEXT GLEW_GET_FUN(__glewVertexArrayBindVertexBufferEXT) #define glVertexArrayVertexAttribBindingEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribBindingEXT) #define glVertexArrayVertexAttribFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribFormatEXT) #define glVertexArrayVertexAttribIFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIFormatEXT) #define glVertexArrayVertexAttribLFormatEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLFormatEXT) #define glVertexArrayVertexBindingDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexBindingDivisorEXT) #define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding) #define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat) #define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat) #define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat) #define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor) #define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding) #endif /* GL_ARB_vertex_attrib_binding */ /* -------------------------- GL_ARB_vertex_blend -------------------------- */ #ifndef GL_ARB_vertex_blend #define GL_ARB_vertex_blend 1 #define GL_MODELVIEW0_ARB 0x1700 #define GL_MODELVIEW1_ARB 0x850A #define GL_MAX_VERTEX_UNITS_ARB 0x86A4 #define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 #define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 #define GL_VERTEX_BLEND_ARB 0x86A7 #define GL_CURRENT_WEIGHT_ARB 0x86A8 #define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 #define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA #define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB #define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC #define GL_WEIGHT_ARRAY_ARB 0x86AD #define GL_MODELVIEW2_ARB 0x8722 #define GL_MODELVIEW3_ARB 0x8723 #define GL_MODELVIEW4_ARB 0x8724 #define GL_MODELVIEW5_ARB 0x8725 #define GL_MODELVIEW6_ARB 0x8726 #define GL_MODELVIEW7_ARB 0x8727 #define GL_MODELVIEW8_ARB 0x8728 #define GL_MODELVIEW9_ARB 0x8729 #define GL_MODELVIEW10_ARB 0x872A #define GL_MODELVIEW11_ARB 0x872B #define GL_MODELVIEW12_ARB 0x872C #define GL_MODELVIEW13_ARB 0x872D #define GL_MODELVIEW14_ARB 0x872E #define GL_MODELVIEW15_ARB 0x872F #define GL_MODELVIEW16_ARB 0x8730 #define GL_MODELVIEW17_ARB 0x8731 #define GL_MODELVIEW18_ARB 0x8732 #define GL_MODELVIEW19_ARB 0x8733 #define GL_MODELVIEW20_ARB 0x8734 #define GL_MODELVIEW21_ARB 0x8735 #define GL_MODELVIEW22_ARB 0x8736 #define GL_MODELVIEW23_ARB 0x8737 #define GL_MODELVIEW24_ARB 0x8738 #define GL_MODELVIEW25_ARB 0x8739 #define GL_MODELVIEW26_ARB 0x873A #define GL_MODELVIEW27_ARB 0x873B #define GL_MODELVIEW28_ARB 0x873C #define GL_MODELVIEW29_ARB 0x873D #define GL_MODELVIEW30_ARB 0x873E #define GL_MODELVIEW31_ARB 0x873F typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); #define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) #define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) #define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) #define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) #define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) #define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) #define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) #define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) #define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) #define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) #define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) #endif /* GL_ARB_vertex_blend */ /* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ #ifndef GL_ARB_vertex_buffer_object #define GL_ARB_vertex_buffer_object 1 #define GL_BUFFER_SIZE_ARB 0x8764 #define GL_BUFFER_USAGE_ARB 0x8765 #define GL_ARRAY_BUFFER_ARB 0x8892 #define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 #define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 #define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 #define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 #define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 #define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 #define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 #define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A #define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B #define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C #define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D #define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E #define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F #define GL_READ_ONLY_ARB 0x88B8 #define GL_WRITE_ONLY_ARB 0x88B9 #define GL_READ_WRITE_ARB 0x88BA #define GL_BUFFER_ACCESS_ARB 0x88BB #define GL_BUFFER_MAPPED_ARB 0x88BC #define GL_BUFFER_MAP_POINTER_ARB 0x88BD #define GL_STREAM_DRAW_ARB 0x88E0 #define GL_STREAM_READ_ARB 0x88E1 #define GL_STREAM_COPY_ARB 0x88E2 #define GL_STATIC_DRAW_ARB 0x88E4 #define GL_STATIC_READ_ARB 0x88E5 #define GL_STATIC_COPY_ARB 0x88E6 #define GL_DYNAMIC_DRAW_ARB 0x88E8 #define GL_DYNAMIC_READ_ARB 0x88E9 #define GL_DYNAMIC_COPY_ARB 0x88EA typedef ptrdiff_t GLintptrARB; typedef ptrdiff_t GLsizeiptrARB; typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const void *data, GLenum usage); typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const void *data); typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, void** params); typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, void *data); typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); typedef void * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); #define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) #define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) #define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) #define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) #define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) #define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) #define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) #define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) #define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) #define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) #define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) #define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) #endif /* GL_ARB_vertex_buffer_object */ /* ------------------------- GL_ARB_vertex_program ------------------------- */ #ifndef GL_ARB_vertex_program #define GL_ARB_vertex_program 1 #define GL_COLOR_SUM_ARB 0x8458 #define GL_VERTEX_PROGRAM_ARB 0x8620 #define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 #define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 #define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 #define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 #define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 #define GL_PROGRAM_LENGTH_ARB 0x8627 #define GL_PROGRAM_STRING_ARB 0x8628 #define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E #define GL_MAX_PROGRAM_MATRICES_ARB 0x862F #define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 #define GL_CURRENT_MATRIX_ARB 0x8641 #define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 #define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 #define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 #define GL_PROGRAM_ERROR_POSITION_ARB 0x864B #define GL_PROGRAM_BINDING_ARB 0x8677 #define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 #define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A #define GL_PROGRAM_ERROR_STRING_ARB 0x8874 #define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 #define GL_PROGRAM_FORMAT_ARB 0x8876 #define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 #define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 #define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 #define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 #define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 #define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 #define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 #define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 #define GL_PROGRAM_PARAMETERS_ARB 0x88A8 #define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 #define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA #define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB #define GL_PROGRAM_ATTRIBS_ARB 0x88AC #define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD #define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE #define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF #define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 #define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 #define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 #define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 #define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 #define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 #define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 #define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 #define GL_MATRIX0_ARB 0x88C0 #define GL_MATRIX1_ARB 0x88C1 #define GL_MATRIX2_ARB 0x88C2 #define GL_MATRIX3_ARB 0x88C3 #define GL_MATRIX4_ARB 0x88C4 #define GL_MATRIX5_ARB 0x88C5 #define GL_MATRIX6_ARB 0x88C6 #define GL_MATRIX7_ARB 0x88C7 #define GL_MATRIX8_ARB 0x88C8 #define GL_MATRIX9_ARB 0x88C9 #define GL_MATRIX10_ARB 0x88CA #define GL_MATRIX11_ARB 0x88CB #define GL_MATRIX12_ARB 0x88CC #define GL_MATRIX13_ARB 0x88CD #define GL_MATRIX14_ARB 0x88CE #define GL_MATRIX15_ARB 0x88CF #define GL_MATRIX16_ARB 0x88D0 #define GL_MATRIX17_ARB 0x88D1 #define GL_MATRIX18_ARB 0x88D2 #define GL_MATRIX19_ARB 0x88D3 #define GL_MATRIX20_ARB 0x88D4 #define GL_MATRIX21_ARB 0x88D5 #define GL_MATRIX22_ARB 0x88D6 #define GL_MATRIX23_ARB 0x88D7 #define GL_MATRIX24_ARB 0x88D8 #define GL_MATRIX25_ARB 0x88D9 #define GL_MATRIX26_ARB 0x88DA #define GL_MATRIX27_ARB 0x88DB #define GL_MATRIX28_ARB 0x88DC #define GL_MATRIX29_ARB 0x88DD #define GL_MATRIX30_ARB 0x88DE #define GL_MATRIX31_ARB 0x88DF typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void *string); typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, void** pointer); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void *string); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer); #define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) #define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) #define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) #define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) #define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) #define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) #define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) #define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) #define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) #define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) #define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) #define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) #define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) #define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) #define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) #define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) #define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) #define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) #define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) #define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) #define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) #define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) #define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) #define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) #define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) #define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) #define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) #define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) #define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) #define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) #define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) #define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) #define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) #define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) #define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) #define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) #define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) #define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) #define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) #define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) #define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) #define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) #define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) #define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) #define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) #define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) #define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) #define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) #define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) #define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) #define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) #define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) #define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) #define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) #define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) #define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) #define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) #define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) #define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) #define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) #define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) #define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) #define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) #endif /* GL_ARB_vertex_program */ /* -------------------------- GL_ARB_vertex_shader ------------------------- */ #ifndef GL_ARB_vertex_shader #define GL_ARB_vertex_shader 1 #define GL_VERTEX_SHADER_ARB 0x8B31 #define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A #define GL_MAX_VARYING_FLOATS_ARB 0x8B4B #define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C #define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D #define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 #define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); #define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) #define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) #define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) #define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) #endif /* GL_ARB_vertex_shader */ /* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */ #ifndef GL_ARB_vertex_type_10f_11f_11f_rev #define GL_ARB_vertex_type_10f_11f_11f_rev 1 #define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B #define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev) #endif /* GL_ARB_vertex_type_10f_11f_11f_rev */ /* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ #ifndef GL_ARB_vertex_type_2_10_10_10_rev #define GL_ARB_vertex_type_2_10_10_10_rev 1 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 #define GL_INT_2_10_10_10_REV 0x8D9F typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); #define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) #define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) #define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) #define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) #define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) #define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) #define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) #define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) #define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) #define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) #define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) #define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) #define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) #define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) #define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) #define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) #define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) #define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) #define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) #define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) #define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) #define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) #define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) #define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) #define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) #define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) #define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) #define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) #define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) #define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) #define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) #define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) #define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) #define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) #define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) #define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) #define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) #define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) #define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) #endif /* GL_ARB_vertex_type_2_10_10_10_rev */ /* ------------------------- GL_ARB_viewport_array ------------------------- */ #ifndef GL_ARB_viewport_array #define GL_ARB_viewport_array 1 #define GL_DEPTH_RANGE 0x0B70 #define GL_VIEWPORT 0x0BA2 #define GL_SCISSOR_BOX 0x0C10 #define GL_SCISSOR_TEST 0x0C11 #define GL_MAX_VIEWPORTS 0x825B #define GL_VIEWPORT_SUBPIXEL_BITS 0x825C #define GL_VIEWPORT_BOUNDS_RANGE 0x825D #define GL_LAYER_PROVOKING_VERTEX 0x825E #define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F #define GL_UNDEFINED_VERTEX 0x8260 #define GL_FIRST_VERTEX_CONVENTION 0x8E4D #define GL_LAST_VERTEX_CONVENTION 0x8E4E #define GL_PROVOKING_VERTEX 0x8E4F typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); #define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) #define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) #define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) #define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) #define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) #define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) #define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) #define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) #define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) #define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) #define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) #endif /* GL_ARB_viewport_array */ /* --------------------------- GL_ARB_window_pos --------------------------- */ #ifndef GL_ARB_window_pos #define GL_ARB_window_pos 1 typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); #define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) #define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) #define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) #define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) #define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) #define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) #define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) #define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) #define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) #define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) #define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) #define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) #define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) #define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) #define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) #define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) #define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) #endif /* GL_ARB_window_pos */ /* ------------------------- GL_ATIX_point_sprites ------------------------- */ #ifndef GL_ATIX_point_sprites #define GL_ATIX_point_sprites 1 #define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 #define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 #define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 #define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 #define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 #define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 #define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) #endif /* GL_ATIX_point_sprites */ /* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ #ifndef GL_ATIX_texture_env_combine3 #define GL_ATIX_texture_env_combine3 1 #define GL_MODULATE_ADD_ATIX 0x8744 #define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 #define GL_MODULATE_SUBTRACT_ATIX 0x8746 #define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) #endif /* GL_ATIX_texture_env_combine3 */ /* ----------------------- GL_ATIX_texture_env_route ----------------------- */ #ifndef GL_ATIX_texture_env_route #define GL_ATIX_texture_env_route 1 #define GL_SECONDARY_COLOR_ATIX 0x8747 #define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 #define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 #define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) #endif /* GL_ATIX_texture_env_route */ /* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ #ifndef GL_ATIX_vertex_shader_output_point_size #define GL_ATIX_vertex_shader_output_point_size 1 #define GL_OUTPUT_POINT_SIZE_ATIX 0x610E #define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) #endif /* GL_ATIX_vertex_shader_output_point_size */ /* -------------------------- GL_ATI_draw_buffers -------------------------- */ #ifndef GL_ATI_draw_buffers #define GL_ATI_draw_buffers 1 #define GL_MAX_DRAW_BUFFERS_ATI 0x8824 #define GL_DRAW_BUFFER0_ATI 0x8825 #define GL_DRAW_BUFFER1_ATI 0x8826 #define GL_DRAW_BUFFER2_ATI 0x8827 #define GL_DRAW_BUFFER3_ATI 0x8828 #define GL_DRAW_BUFFER4_ATI 0x8829 #define GL_DRAW_BUFFER5_ATI 0x882A #define GL_DRAW_BUFFER6_ATI 0x882B #define GL_DRAW_BUFFER7_ATI 0x882C #define GL_DRAW_BUFFER8_ATI 0x882D #define GL_DRAW_BUFFER9_ATI 0x882E #define GL_DRAW_BUFFER10_ATI 0x882F #define GL_DRAW_BUFFER11_ATI 0x8830 #define GL_DRAW_BUFFER12_ATI 0x8831 #define GL_DRAW_BUFFER13_ATI 0x8832 #define GL_DRAW_BUFFER14_ATI 0x8833 #define GL_DRAW_BUFFER15_ATI 0x8834 typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); #define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) #define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) #endif /* GL_ATI_draw_buffers */ /* -------------------------- GL_ATI_element_array ------------------------- */ #ifndef GL_ATI_element_array #define GL_ATI_element_array 1 #define GL_ELEMENT_ARRAY_ATI 0x8768 #define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 #define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void *pointer); #define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) #define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) #define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) #define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) #endif /* GL_ATI_element_array */ /* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ #ifndef GL_ATI_envmap_bumpmap #define GL_ATI_envmap_bumpmap 1 #define GL_BUMP_ROT_MATRIX_ATI 0x8775 #define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 #define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 #define GL_BUMP_TEX_UNITS_ATI 0x8778 #define GL_DUDV_ATI 0x8779 #define GL_DU8DV8_ATI 0x877A #define GL_BUMP_ENVMAP_ATI 0x877B #define GL_BUMP_TARGET_ATI 0x877C typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); #define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) #define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) #define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) #define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) #define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) #endif /* GL_ATI_envmap_bumpmap */ /* ------------------------- GL_ATI_fragment_shader ------------------------ */ #ifndef GL_ATI_fragment_shader #define GL_ATI_fragment_shader 1 #define GL_2X_BIT_ATI 0x00000001 #define GL_RED_BIT_ATI 0x00000001 #define GL_4X_BIT_ATI 0x00000002 #define GL_COMP_BIT_ATI 0x00000002 #define GL_GREEN_BIT_ATI 0x00000002 #define GL_8X_BIT_ATI 0x00000004 #define GL_BLUE_BIT_ATI 0x00000004 #define GL_NEGATE_BIT_ATI 0x00000004 #define GL_BIAS_BIT_ATI 0x00000008 #define GL_HALF_BIT_ATI 0x00000008 #define GL_QUARTER_BIT_ATI 0x00000010 #define GL_EIGHTH_BIT_ATI 0x00000020 #define GL_SATURATE_BIT_ATI 0x00000040 #define GL_FRAGMENT_SHADER_ATI 0x8920 #define GL_REG_0_ATI 0x8921 #define GL_REG_1_ATI 0x8922 #define GL_REG_2_ATI 0x8923 #define GL_REG_3_ATI 0x8924 #define GL_REG_4_ATI 0x8925 #define GL_REG_5_ATI 0x8926 #define GL_CON_0_ATI 0x8941 #define GL_CON_1_ATI 0x8942 #define GL_CON_2_ATI 0x8943 #define GL_CON_3_ATI 0x8944 #define GL_CON_4_ATI 0x8945 #define GL_CON_5_ATI 0x8946 #define GL_CON_6_ATI 0x8947 #define GL_CON_7_ATI 0x8948 #define GL_MOV_ATI 0x8961 #define GL_ADD_ATI 0x8963 #define GL_MUL_ATI 0x8964 #define GL_SUB_ATI 0x8965 #define GL_DOT3_ATI 0x8966 #define GL_DOT4_ATI 0x8967 #define GL_MAD_ATI 0x8968 #define GL_LERP_ATI 0x8969 #define GL_CND_ATI 0x896A #define GL_CND0_ATI 0x896B #define GL_DOT2_ADD_ATI 0x896C #define GL_SECONDARY_INTERPOLATOR_ATI 0x896D #define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E #define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F #define GL_NUM_PASSES_ATI 0x8970 #define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 #define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 #define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 #define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 #define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 #define GL_SWIZZLE_STR_ATI 0x8976 #define GL_SWIZZLE_STQ_ATI 0x8977 #define GL_SWIZZLE_STR_DR_ATI 0x8978 #define GL_SWIZZLE_STQ_DQ_ATI 0x8979 #define GL_SWIZZLE_STRQ_ATI 0x897A #define GL_SWIZZLE_STRQ_DQ_ATI 0x897B typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); #define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) #define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) #define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) #define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) #define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) #define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) #define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) #define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) #define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) #define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) #define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) #define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) #define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) #define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) #define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) #endif /* GL_ATI_fragment_shader */ /* ------------------------ GL_ATI_map_object_buffer ----------------------- */ #ifndef GL_ATI_map_object_buffer #define GL_ATI_map_object_buffer 1 typedef void * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); #define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) #define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) #define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) #endif /* GL_ATI_map_object_buffer */ /* ----------------------------- GL_ATI_meminfo ---------------------------- */ #ifndef GL_ATI_meminfo #define GL_ATI_meminfo 1 #define GL_VBO_FREE_MEMORY_ATI 0x87FB #define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC #define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD #define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) #endif /* GL_ATI_meminfo */ /* -------------------------- GL_ATI_pn_triangles -------------------------- */ #ifndef GL_ATI_pn_triangles #define GL_ATI_pn_triangles 1 #define GL_PN_TRIANGLES_ATI 0x87F0 #define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 #define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 #define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 #define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 #define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 #define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 #define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 #define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); #define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI) #define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI) #define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) #endif /* GL_ATI_pn_triangles */ /* ------------------------ GL_ATI_separate_stencil ------------------------ */ #ifndef GL_ATI_separate_stencil #define GL_ATI_separate_stencil 1 #define GL_STENCIL_BACK_FUNC_ATI 0x8800 #define GL_STENCIL_BACK_FAIL_ATI 0x8801 #define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 #define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); #define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) #define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) #define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) #endif /* GL_ATI_separate_stencil */ /* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ #ifndef GL_ATI_shader_texture_lod #define GL_ATI_shader_texture_lod 1 #define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) #endif /* GL_ATI_shader_texture_lod */ /* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ #ifndef GL_ATI_text_fragment_shader #define GL_ATI_text_fragment_shader 1 #define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 #define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) #endif /* GL_ATI_text_fragment_shader */ /* --------------------- GL_ATI_texture_compression_3dc -------------------- */ #ifndef GL_ATI_texture_compression_3dc #define GL_ATI_texture_compression_3dc 1 #define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 #define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) #endif /* GL_ATI_texture_compression_3dc */ /* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ #ifndef GL_ATI_texture_env_combine3 #define GL_ATI_texture_env_combine3 1 #define GL_MODULATE_ADD_ATI 0x8744 #define GL_MODULATE_SIGNED_ADD_ATI 0x8745 #define GL_MODULATE_SUBTRACT_ATI 0x8746 #define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) #endif /* GL_ATI_texture_env_combine3 */ /* -------------------------- GL_ATI_texture_float ------------------------- */ #ifndef GL_ATI_texture_float #define GL_ATI_texture_float 1 #define GL_RGBA_FLOAT32_ATI 0x8814 #define GL_RGB_FLOAT32_ATI 0x8815 #define GL_ALPHA_FLOAT32_ATI 0x8816 #define GL_INTENSITY_FLOAT32_ATI 0x8817 #define GL_LUMINANCE_FLOAT32_ATI 0x8818 #define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 #define GL_RGBA_FLOAT16_ATI 0x881A #define GL_RGB_FLOAT16_ATI 0x881B #define GL_ALPHA_FLOAT16_ATI 0x881C #define GL_INTENSITY_FLOAT16_ATI 0x881D #define GL_LUMINANCE_FLOAT16_ATI 0x881E #define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F #define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) #endif /* GL_ATI_texture_float */ /* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ #ifndef GL_ATI_texture_mirror_once #define GL_ATI_texture_mirror_once 1 #define GL_MIRROR_CLAMP_ATI 0x8742 #define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 #define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) #endif /* GL_ATI_texture_mirror_once */ /* ----------------------- GL_ATI_vertex_array_object ---------------------- */ #ifndef GL_ATI_vertex_array_object #define GL_ATI_vertex_array_object 1 #define GL_STATIC_ATI 0x8760 #define GL_DYNAMIC_ATI 0x8761 #define GL_PRESERVE_ATI 0x8762 #define GL_DISCARD_ATI 0x8763 #define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 #define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 #define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 #define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void *pointer, GLenum usage); typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void *pointer, GLenum preserve); typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); #define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) #define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) #define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) #define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) #define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) #define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) #define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) #define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) #define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) #define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) #define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) #define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) #define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) #endif /* GL_ATI_vertex_array_object */ /* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ #ifndef GL_ATI_vertex_attrib_array_object #define GL_ATI_vertex_attrib_array_object 1 typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); #define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) #define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) #define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) #define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) #endif /* GL_ATI_vertex_attrib_array_object */ /* ------------------------- GL_ATI_vertex_streams ------------------------- */ #ifndef GL_ATI_vertex_streams #define GL_ATI_vertex_streams 1 #define GL_MAX_VERTEX_STREAMS_ATI 0x876B #define GL_VERTEX_SOURCE_ATI 0x876C #define GL_VERTEX_STREAM0_ATI 0x876D #define GL_VERTEX_STREAM1_ATI 0x876E #define GL_VERTEX_STREAM2_ATI 0x876F #define GL_VERTEX_STREAM3_ATI 0x8770 #define GL_VERTEX_STREAM4_ATI 0x8771 #define GL_VERTEX_STREAM5_ATI 0x8772 #define GL_VERTEX_STREAM6_ATI 0x8773 #define GL_VERTEX_STREAM7_ATI 0x8774 typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); #define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) #define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) #define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) #define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) #define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) #define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) #define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) #define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) #define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) #define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) #define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) #define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) #define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) #define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI) #define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI) #define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI) #define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI) #define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI) #define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI) #define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI) #define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI) #define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) #define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) #define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) #define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) #define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) #define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) #define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) #define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) #define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) #define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) #define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) #define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) #define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) #define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) #define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) #define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) #define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) #define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) #define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) #define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) #define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) #define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) #define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) #define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) #define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) #endif /* GL_ATI_vertex_streams */ /* --------------------------- GL_EXT_422_pixels --------------------------- */ #ifndef GL_EXT_422_pixels #define GL_EXT_422_pixels 1 #define GL_422_EXT 0x80CC #define GL_422_REV_EXT 0x80CD #define GL_422_AVERAGE_EXT 0x80CE #define GL_422_REV_AVERAGE_EXT 0x80CF #define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) #endif /* GL_EXT_422_pixels */ /* ---------------------------- GL_EXT_Cg_shader --------------------------- */ #ifndef GL_EXT_Cg_shader #define GL_EXT_Cg_shader 1 #define GL_CG_VERTEX_SHADER_EXT 0x890E #define GL_CG_FRAGMENT_SHADER_EXT 0x890F #define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) #endif /* GL_EXT_Cg_shader */ /* ------------------------------ GL_EXT_abgr ------------------------------ */ #ifndef GL_EXT_abgr #define GL_EXT_abgr 1 #define GL_ABGR_EXT 0x8000 #define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) #endif /* GL_EXT_abgr */ /* ------------------------------ GL_EXT_bgra ------------------------------ */ #ifndef GL_EXT_bgra #define GL_EXT_bgra 1 #define GL_BGR_EXT 0x80E0 #define GL_BGRA_EXT 0x80E1 #define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) #endif /* GL_EXT_bgra */ /* ------------------------ GL_EXT_bindable_uniform ------------------------ */ #ifndef GL_EXT_bindable_uniform #define GL_EXT_bindable_uniform 1 #define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 #define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 #define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 #define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED #define GL_UNIFORM_BUFFER_EXT 0x8DEE #define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); #define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) #define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) #define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) #define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) #endif /* GL_EXT_bindable_uniform */ /* --------------------------- GL_EXT_blend_color -------------------------- */ #ifndef GL_EXT_blend_color #define GL_EXT_blend_color 1 #define GL_CONSTANT_COLOR_EXT 0x8001 #define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 #define GL_CONSTANT_ALPHA_EXT 0x8003 #define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 #define GL_BLEND_COLOR_EXT 0x8005 typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); #define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) #define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) #endif /* GL_EXT_blend_color */ /* --------------------- GL_EXT_blend_equation_separate -------------------- */ #ifndef GL_EXT_blend_equation_separate #define GL_EXT_blend_equation_separate 1 #define GL_BLEND_EQUATION_RGB_EXT 0x8009 #define GL_BLEND_EQUATION_ALPHA_EXT 0x883D typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); #define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) #define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) #endif /* GL_EXT_blend_equation_separate */ /* ----------------------- GL_EXT_blend_func_separate ---------------------- */ #ifndef GL_EXT_blend_func_separate #define GL_EXT_blend_func_separate 1 #define GL_BLEND_DST_RGB_EXT 0x80C8 #define GL_BLEND_SRC_RGB_EXT 0x80C9 #define GL_BLEND_DST_ALPHA_EXT 0x80CA #define GL_BLEND_SRC_ALPHA_EXT 0x80CB typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); #define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) #define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) #endif /* GL_EXT_blend_func_separate */ /* ------------------------- GL_EXT_blend_logic_op ------------------------- */ #ifndef GL_EXT_blend_logic_op #define GL_EXT_blend_logic_op 1 #define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) #endif /* GL_EXT_blend_logic_op */ /* -------------------------- GL_EXT_blend_minmax -------------------------- */ #ifndef GL_EXT_blend_minmax #define GL_EXT_blend_minmax 1 #define GL_FUNC_ADD_EXT 0x8006 #define GL_MIN_EXT 0x8007 #define GL_MAX_EXT 0x8008 #define GL_BLEND_EQUATION_EXT 0x8009 typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); #define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) #define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) #endif /* GL_EXT_blend_minmax */ /* ------------------------- GL_EXT_blend_subtract ------------------------- */ #ifndef GL_EXT_blend_subtract #define GL_EXT_blend_subtract 1 #define GL_FUNC_SUBTRACT_EXT 0x800A #define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B #define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) #endif /* GL_EXT_blend_subtract */ /* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ #ifndef GL_EXT_clip_volume_hint #define GL_EXT_clip_volume_hint 1 #define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 #define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) #endif /* GL_EXT_clip_volume_hint */ /* ------------------------------ GL_EXT_cmyka ----------------------------- */ #ifndef GL_EXT_cmyka #define GL_EXT_cmyka 1 #define GL_CMYK_EXT 0x800C #define GL_CMYKA_EXT 0x800D #define GL_PACK_CMYK_HINT_EXT 0x800E #define GL_UNPACK_CMYK_HINT_EXT 0x800F #define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) #endif /* GL_EXT_cmyka */ /* ------------------------- GL_EXT_color_subtable ------------------------- */ #ifndef GL_EXT_color_subtable #define GL_EXT_color_subtable 1 typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); #define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) #define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) #define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) #endif /* GL_EXT_color_subtable */ /* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ #ifndef GL_EXT_compiled_vertex_array #define GL_EXT_compiled_vertex_array 1 #define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 #define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); #define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) #define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) #define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) #endif /* GL_EXT_compiled_vertex_array */ /* --------------------------- GL_EXT_convolution -------------------------- */ #ifndef GL_EXT_convolution #define GL_EXT_convolution 1 #define GL_CONVOLUTION_1D_EXT 0x8010 #define GL_CONVOLUTION_2D_EXT 0x8011 #define GL_SEPARABLE_2D_EXT 0x8012 #define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 #define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 #define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 #define GL_REDUCE_EXT 0x8016 #define GL_CONVOLUTION_FORMAT_EXT 0x8017 #define GL_CONVOLUTION_WIDTH_EXT 0x8018 #define GL_CONVOLUTION_HEIGHT_EXT 0x8019 #define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A #define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B #define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C #define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D #define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E #define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F #define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 #define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 #define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 #define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *image); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *image); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void *row, void *column, void *span); typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *row, const void *column); #define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) #define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) #define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) #define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) #define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) #define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) #define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) #define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) #define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) #define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) #define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) #define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) #define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) #define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) #endif /* GL_EXT_convolution */ /* ------------------------ GL_EXT_coordinate_frame ------------------------ */ #ifndef GL_EXT_coordinate_frame #define GL_EXT_coordinate_frame 1 #define GL_TANGENT_ARRAY_EXT 0x8439 #define GL_BINORMAL_ARRAY_EXT 0x843A #define GL_CURRENT_TANGENT_EXT 0x843B #define GL_CURRENT_BINORMAL_EXT 0x843C #define GL_TANGENT_ARRAY_TYPE_EXT 0x843E #define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F #define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 #define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 #define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 #define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 #define GL_MAP1_TANGENT_EXT 0x8444 #define GL_MAP2_TANGENT_EXT 0x8445 #define GL_MAP1_BINORMAL_EXT 0x8446 #define GL_MAP2_BINORMAL_EXT 0x8447 typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void *pointer); #define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) #define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) #define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) #endif /* GL_EXT_coordinate_frame */ /* -------------------------- GL_EXT_copy_texture -------------------------- */ #ifndef GL_EXT_copy_texture #define GL_EXT_copy_texture 1 typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); #define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) #define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) #define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) #define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) #define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) #define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) #endif /* GL_EXT_copy_texture */ /* --------------------------- GL_EXT_cull_vertex -------------------------- */ #ifndef GL_EXT_cull_vertex #define GL_EXT_cull_vertex 1 #define GL_CULL_VERTEX_EXT 0x81AA #define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB #define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); #define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) #define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) #define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) #endif /* GL_EXT_cull_vertex */ /* --------------------------- GL_EXT_debug_label -------------------------- */ #ifndef GL_EXT_debug_label #define GL_EXT_debug_label 1 #define GL_PROGRAM_PIPELINE_OBJECT_EXT 0x8A4F #define GL_PROGRAM_OBJECT_EXT 0x8B40 #define GL_SHADER_OBJECT_EXT 0x8B48 #define GL_BUFFER_OBJECT_EXT 0x9151 #define GL_QUERY_OBJECT_EXT 0x9153 #define GL_VERTEX_ARRAY_OBJECT_EXT 0x9154 typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELEXTPROC) (GLenum type, GLuint object, GLsizei bufSize, GLsizei* length, GLchar *label); typedef void (GLAPIENTRY * PFNGLLABELOBJECTEXTPROC) (GLenum type, GLuint object, GLsizei length, const GLchar* label); #define glGetObjectLabelEXT GLEW_GET_FUN(__glewGetObjectLabelEXT) #define glLabelObjectEXT GLEW_GET_FUN(__glewLabelObjectEXT) #define GLEW_EXT_debug_label GLEW_GET_VAR(__GLEW_EXT_debug_label) #endif /* GL_EXT_debug_label */ /* -------------------------- GL_EXT_debug_marker -------------------------- */ #ifndef GL_EXT_debug_marker #define GL_EXT_debug_marker 1 typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker); typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void); typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker); #define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT) #define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT) #define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT) #define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker) #endif /* GL_EXT_debug_marker */ /* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ #ifndef GL_EXT_depth_bounds_test #define GL_EXT_depth_bounds_test 1 #define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 #define GL_DEPTH_BOUNDS_EXT 0x8891 typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); #define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) #define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) #endif /* GL_EXT_depth_bounds_test */ /* ----------------------- GL_EXT_direct_state_access ---------------------- */ #ifndef GL_EXT_direct_state_access #define GL_EXT_direct_state_access 1 #define GL_PROGRAM_MATRIX_EXT 0x8E2D #define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E #define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void *data); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void *img); typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void *img); typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void *data); typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void *string); typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, void** params); typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, void** params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void *pixels); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, void** param); typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, void** param); typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); typedef void * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage); typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data); typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void *string); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC) (GLuint vaobj, GLuint index, GLuint divisor); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); #define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) #define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) #define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) #define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) #define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) #define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) #define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) #define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) #define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) #define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) #define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) #define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) #define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) #define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) #define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) #define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) #define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) #define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) #define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) #define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) #define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) #define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) #define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) #define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) #define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) #define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) #define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) #define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) #define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) #define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) #define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) #define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) #define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) #define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) #define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) #define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) #define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) #define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) #define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) #define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) #define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) #define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) #define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) #define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) #define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) #define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) #define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) #define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) #define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) #define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) #define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) #define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) #define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) #define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) #define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) #define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) #define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) #define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) #define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) #define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) #define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) #define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) #define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) #define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) #define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) #define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) #define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) #define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) #define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) #define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) #define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) #define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) #define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) #define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) #define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) #define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) #define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) #define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) #define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) #define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) #define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) #define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) #define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) #define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) #define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) #define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) #define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) #define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) #define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) #define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) #define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) #define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) #define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) #define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) #define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) #define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) #define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) #define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) #define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) #define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) #define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) #define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) #define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) #define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) #define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) #define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) #define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) #define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) #define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) #define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) #define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) #define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) #define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) #define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) #define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) #define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) #define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) #define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) #define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) #define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) #define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) #define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) #define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) #define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) #define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) #define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) #define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) #define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) #define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) #define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) #define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) #define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) #define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) #define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) #define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) #define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) #define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) #define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) #define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) #define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) #define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) #define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) #define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) #define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) #define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) #define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) #define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) #define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) #define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) #define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) #define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) #define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) #define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) #define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) #define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) #define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) #define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) #define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) #define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) #define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) #define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) #define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) #define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) #define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) #define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) #define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) #define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) #define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) #define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) #define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) #define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) #define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) #define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) #define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) #define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) #define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) #define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) #define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) #define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) #define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) #define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) #define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) #define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) #define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) #define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) #define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) #define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) #define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) #define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) #define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) #define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) #define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) #define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) #define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) #define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) #define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) #define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) #define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) #define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) #define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) #define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) #define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) #define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) #define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) #define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) #define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) #define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) #define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) #define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) #define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) #define glVertexArrayVertexAttribDivisorEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribDivisorEXT) #define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) #define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) #define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) #define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) #endif /* GL_EXT_direct_state_access */ /* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ #ifndef GL_EXT_draw_buffers2 #define GL_EXT_draw_buffers2 1 typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); #define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) #define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) #define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) #define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) #define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) #define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) #define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) #endif /* GL_EXT_draw_buffers2 */ /* ------------------------- GL_EXT_draw_instanced ------------------------- */ #ifndef GL_EXT_draw_instanced #define GL_EXT_draw_instanced 1 typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount); #define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) #define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) #define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) #endif /* GL_EXT_draw_instanced */ /* ----------------------- GL_EXT_draw_range_elements ---------------------- */ #ifndef GL_EXT_draw_range_elements #define GL_EXT_draw_range_elements 1 #define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 #define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices); #define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) #define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) #endif /* GL_EXT_draw_range_elements */ /* ---------------------------- GL_EXT_fog_coord --------------------------- */ #ifndef GL_EXT_fog_coord #define GL_EXT_fog_coord 1 #define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 #define GL_FOG_COORDINATE_EXT 0x8451 #define GL_FRAGMENT_DEPTH_EXT 0x8452 #define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 #define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 #define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 #define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 #define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); #define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) #define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) #define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) #define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) #define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) #define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) #endif /* GL_EXT_fog_coord */ /* ------------------------ GL_EXT_fragment_lighting ----------------------- */ #ifndef GL_EXT_fragment_lighting #define GL_EXT_fragment_lighting 1 #define GL_FRAGMENT_LIGHTING_EXT 0x8400 #define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 #define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 #define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 #define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 #define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 #define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 #define GL_LIGHT_ENV_MODE_EXT 0x8407 #define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 #define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 #define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A #define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B #define GL_FRAGMENT_LIGHT0_EXT 0x840C #define GL_FRAGMENT_LIGHT7_EXT 0x8413 typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); #define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) #define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) #define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) #define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) #define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) #define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) #define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) #define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) #define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) #define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) #define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) #define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) #define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) #define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) #define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) #define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) #define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) #define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) #define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) #endif /* GL_EXT_fragment_lighting */ /* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ #ifndef GL_EXT_framebuffer_blit #define GL_EXT_framebuffer_blit 1 #define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 #define GL_READ_FRAMEBUFFER_EXT 0x8CA8 #define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 #define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); #define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) #define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) #endif /* GL_EXT_framebuffer_blit */ /* --------------------- GL_EXT_framebuffer_multisample -------------------- */ #ifndef GL_EXT_framebuffer_multisample #define GL_EXT_framebuffer_multisample 1 #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 #define GL_MAX_SAMPLES_EXT 0x8D57 typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); #define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) #define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) #endif /* GL_EXT_framebuffer_multisample */ /* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */ #ifndef GL_EXT_framebuffer_multisample_blit_scaled #define GL_EXT_framebuffer_multisample_blit_scaled 1 #define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA #define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB #define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled) #endif /* GL_EXT_framebuffer_multisample_blit_scaled */ /* ----------------------- GL_EXT_framebuffer_object ----------------------- */ #ifndef GL_EXT_framebuffer_object #define GL_EXT_framebuffer_object 1 #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC #define GL_COLOR_ATTACHMENT13_EXT 0x8CED #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF #define GL_DEPTH_ATTACHMENT_EXT 0x8D00 #define GL_STENCIL_ATTACHMENT_EXT 0x8D20 #define GL_FRAMEBUFFER_EXT 0x8D40 #define GL_RENDERBUFFER_EXT 0x8D41 #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 #define GL_STENCIL_INDEX1_EXT 0x8D46 #define GL_STENCIL_INDEX4_EXT 0x8D47 #define GL_STENCIL_INDEX8_EXT 0x8D48 #define GL_STENCIL_INDEX16_EXT 0x8D49 #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); #define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) #define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) #define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) #define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) #define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) #define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) #define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) #define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) #define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) #define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) #define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) #define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) #define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) #define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) #define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) #define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) #define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) #define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) #endif /* GL_EXT_framebuffer_object */ /* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ #ifndef GL_EXT_framebuffer_sRGB #define GL_EXT_framebuffer_sRGB 1 #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 #define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA #define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) #endif /* GL_EXT_framebuffer_sRGB */ /* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ #ifndef GL_EXT_geometry_shader4 #define GL_EXT_geometry_shader4 1 #define GL_LINES_ADJACENCY_EXT 0xA #define GL_LINE_STRIP_ADJACENCY_EXT 0xB #define GL_TRIANGLES_ADJACENCY_EXT 0xC #define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD #define GL_PROGRAM_POINT_SIZE_EXT 0x8642 #define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B #define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 #define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 #define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 #define GL_GEOMETRY_SHADER_EXT 0x8DD9 #define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA #define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB #define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC #define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD #define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE #define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF #define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 #define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); #define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) #define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) #define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) #define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) #endif /* GL_EXT_geometry_shader4 */ /* --------------------- GL_EXT_gpu_program_parameters --------------------- */ #ifndef GL_EXT_gpu_program_parameters #define GL_EXT_gpu_program_parameters 1 typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); #define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) #define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) #define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) #endif /* GL_EXT_gpu_program_parameters */ /* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ #ifndef GL_EXT_gpu_shader4 #define GL_EXT_gpu_shader4 1 #define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD #define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 #define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 #define GL_SAMPLER_BUFFER_EXT 0x8DC2 #define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 #define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 #define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 #define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 #define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 #define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 #define GL_INT_SAMPLER_1D_EXT 0x8DC9 #define GL_INT_SAMPLER_2D_EXT 0x8DCA #define GL_INT_SAMPLER_3D_EXT 0x8DCB #define GL_INT_SAMPLER_CUBE_EXT 0x8DCC #define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD #define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE #define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF #define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 #define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 #define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 #define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 #define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 #define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 #define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 #define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 #define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); #define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) #define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) #define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) #define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) #define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) #define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) #define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) #define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) #define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) #define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) #define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) #define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) #define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) #define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) #define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) #define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) #define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) #define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) #define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) #define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) #define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) #define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) #define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) #define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) #define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) #define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) #define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) #define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) #define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) #define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) #define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) #define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) #define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) #define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) #define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) #endif /* GL_EXT_gpu_shader4 */ /* ---------------------------- GL_EXT_histogram --------------------------- */ #ifndef GL_EXT_histogram #define GL_EXT_histogram 1 #define GL_HISTOGRAM_EXT 0x8024 #define GL_PROXY_HISTOGRAM_EXT 0x8025 #define GL_HISTOGRAM_WIDTH_EXT 0x8026 #define GL_HISTOGRAM_FORMAT_EXT 0x8027 #define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 #define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 #define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A #define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B #define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C #define GL_HISTOGRAM_SINK_EXT 0x802D #define GL_MINMAX_EXT 0x802E #define GL_MINMAX_FORMAT_EXT 0x802F #define GL_MINMAX_SINK_EXT 0x8030 typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void *values); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); #define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) #define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) #define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) #define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) #define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) #define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) #define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) #define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) #define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) #define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) #define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) #endif /* GL_EXT_histogram */ /* ----------------------- GL_EXT_index_array_formats ---------------------- */ #ifndef GL_EXT_index_array_formats #define GL_EXT_index_array_formats 1 #define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) #endif /* GL_EXT_index_array_formats */ /* --------------------------- GL_EXT_index_func --------------------------- */ #ifndef GL_EXT_index_func #define GL_EXT_index_func 1 typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); #define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) #define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) #endif /* GL_EXT_index_func */ /* ------------------------- GL_EXT_index_material ------------------------- */ #ifndef GL_EXT_index_material #define GL_EXT_index_material 1 typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); #define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) #define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) #endif /* GL_EXT_index_material */ /* -------------------------- GL_EXT_index_texture ------------------------- */ #ifndef GL_EXT_index_texture #define GL_EXT_index_texture 1 #define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) #endif /* GL_EXT_index_texture */ /* -------------------------- GL_EXT_light_texture ------------------------- */ #ifndef GL_EXT_light_texture #define GL_EXT_light_texture 1 #define GL_FRAGMENT_MATERIAL_EXT 0x8349 #define GL_FRAGMENT_NORMAL_EXT 0x834A #define GL_FRAGMENT_COLOR_EXT 0x834C #define GL_ATTENUATION_EXT 0x834D #define GL_SHADOW_ATTENUATION_EXT 0x834E #define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F #define GL_TEXTURE_LIGHT_EXT 0x8350 #define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 #define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); #define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) #define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) #define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) #define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) #endif /* GL_EXT_light_texture */ /* ------------------------- GL_EXT_misc_attribute ------------------------- */ #ifndef GL_EXT_misc_attribute #define GL_EXT_misc_attribute 1 #define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) #endif /* GL_EXT_misc_attribute */ /* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ #ifndef GL_EXT_multi_draw_arrays #define GL_EXT_multi_draw_arrays 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const void *const *indices, GLsizei primcount); #define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) #define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) #define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) #endif /* GL_EXT_multi_draw_arrays */ /* --------------------------- GL_EXT_multisample -------------------------- */ #ifndef GL_EXT_multisample #define GL_EXT_multisample 1 #define GL_MULTISAMPLE_EXT 0x809D #define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E #define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F #define GL_SAMPLE_MASK_EXT 0x80A0 #define GL_1PASS_EXT 0x80A1 #define GL_2PASS_0_EXT 0x80A2 #define GL_2PASS_1_EXT 0x80A3 #define GL_4PASS_0_EXT 0x80A4 #define GL_4PASS_1_EXT 0x80A5 #define GL_4PASS_2_EXT 0x80A6 #define GL_4PASS_3_EXT 0x80A7 #define GL_SAMPLE_BUFFERS_EXT 0x80A8 #define GL_SAMPLES_EXT 0x80A9 #define GL_SAMPLE_MASK_VALUE_EXT 0x80AA #define GL_SAMPLE_MASK_INVERT_EXT 0x80AB #define GL_SAMPLE_PATTERN_EXT 0x80AC #define GL_MULTISAMPLE_BIT_EXT 0x20000000 typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); #define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) #define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) #define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) #endif /* GL_EXT_multisample */ /* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ #ifndef GL_EXT_packed_depth_stencil #define GL_EXT_packed_depth_stencil 1 #define GL_DEPTH_STENCIL_EXT 0x84F9 #define GL_UNSIGNED_INT_24_8_EXT 0x84FA #define GL_DEPTH24_STENCIL8_EXT 0x88F0 #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 #define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) #endif /* GL_EXT_packed_depth_stencil */ /* -------------------------- GL_EXT_packed_float -------------------------- */ #ifndef GL_EXT_packed_float #define GL_EXT_packed_float 1 #define GL_R11F_G11F_B10F_EXT 0x8C3A #define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B #define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C #define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) #endif /* GL_EXT_packed_float */ /* -------------------------- GL_EXT_packed_pixels ------------------------- */ #ifndef GL_EXT_packed_pixels #define GL_EXT_packed_pixels 1 #define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 #define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 #define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 #define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 #define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 #define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) #endif /* GL_EXT_packed_pixels */ /* ------------------------ GL_EXT_paletted_texture ------------------------ */ #ifndef GL_EXT_paletted_texture #define GL_EXT_paletted_texture 1 #define GL_TEXTURE_1D 0x0DE0 #define GL_TEXTURE_2D 0x0DE1 #define GL_PROXY_TEXTURE_1D 0x8063 #define GL_PROXY_TEXTURE_2D 0x8064 #define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 #define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 #define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA #define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB #define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC #define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF #define GL_COLOR_INDEX1_EXT 0x80E2 #define GL_COLOR_INDEX2_EXT 0x80E3 #define GL_COLOR_INDEX4_EXT 0x80E4 #define GL_COLOR_INDEX8_EXT 0x80E5 #define GL_COLOR_INDEX12_EXT 0x80E6 #define GL_COLOR_INDEX16_EXT 0x80E7 #define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED #define GL_TEXTURE_CUBE_MAP_ARB 0x8513 #define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void *data); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); #define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) #define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) #define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) #define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) #define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) #endif /* GL_EXT_paletted_texture */ /* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ #ifndef GL_EXT_pixel_buffer_object #define GL_EXT_pixel_buffer_object 1 #define GL_PIXEL_PACK_BUFFER_EXT 0x88EB #define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC #define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED #define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF #define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) #endif /* GL_EXT_pixel_buffer_object */ /* ------------------------- GL_EXT_pixel_transform ------------------------ */ #ifndef GL_EXT_pixel_transform #define GL_EXT_pixel_transform 1 #define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 #define GL_PIXEL_MAG_FILTER_EXT 0x8331 #define GL_PIXEL_MIN_FILTER_EXT 0x8332 #define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 #define GL_CUBIC_EXT 0x8334 #define GL_AVERAGE_EXT 0x8335 #define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 #define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 #define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); #define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) #define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) #define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) #define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) #define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) #define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) #define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) #endif /* GL_EXT_pixel_transform */ /* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ #ifndef GL_EXT_pixel_transform_color_table #define GL_EXT_pixel_transform_color_table 1 #define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) #endif /* GL_EXT_pixel_transform_color_table */ /* ------------------------ GL_EXT_point_parameters ------------------------ */ #ifndef GL_EXT_point_parameters #define GL_EXT_point_parameters 1 #define GL_POINT_SIZE_MIN_EXT 0x8126 #define GL_POINT_SIZE_MAX_EXT 0x8127 #define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 #define GL_DISTANCE_ATTENUATION_EXT 0x8129 typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); #define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) #define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) #define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) #endif /* GL_EXT_point_parameters */ /* ------------------------- GL_EXT_polygon_offset ------------------------- */ #ifndef GL_EXT_polygon_offset #define GL_EXT_polygon_offset 1 #define GL_POLYGON_OFFSET_EXT 0x8037 #define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 #define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); #define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) #define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) #endif /* GL_EXT_polygon_offset */ /* ---------------------- GL_EXT_polygon_offset_clamp ---------------------- */ #ifndef GL_EXT_polygon_offset_clamp #define GL_EXT_polygon_offset_clamp 1 #define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETCLAMPEXTPROC) (GLfloat factor, GLfloat units, GLfloat clamp); #define glPolygonOffsetClampEXT GLEW_GET_FUN(__glewPolygonOffsetClampEXT) #define GLEW_EXT_polygon_offset_clamp GLEW_GET_VAR(__GLEW_EXT_polygon_offset_clamp) #endif /* GL_EXT_polygon_offset_clamp */ /* ----------------------- GL_EXT_post_depth_coverage ---------------------- */ #ifndef GL_EXT_post_depth_coverage #define GL_EXT_post_depth_coverage 1 #define GLEW_EXT_post_depth_coverage GLEW_GET_VAR(__GLEW_EXT_post_depth_coverage) #endif /* GL_EXT_post_depth_coverage */ /* ------------------------ GL_EXT_provoking_vertex ------------------------ */ #ifndef GL_EXT_provoking_vertex #define GL_EXT_provoking_vertex 1 #define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C #define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D #define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E #define GL_PROVOKING_VERTEX_EXT 0x8E4F typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); #define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) #define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) #endif /* GL_EXT_provoking_vertex */ /* ----------------------- GL_EXT_raster_multisample ----------------------- */ #ifndef GL_EXT_raster_multisample #define GL_EXT_raster_multisample 1 #define GL_COLOR_SAMPLES_NV 0x8E20 #define GL_RASTER_MULTISAMPLE_EXT 0x9327 #define GL_RASTER_SAMPLES_EXT 0x9328 #define GL_MAX_RASTER_SAMPLES_EXT 0x9329 #define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A #define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B #define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C #define GL_DEPTH_SAMPLES_NV 0x932D #define GL_STENCIL_SAMPLES_NV 0x932E #define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F #define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 #define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 #define GL_COVERAGE_MODULATION_NV 0x9332 #define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONNVPROC) (GLenum components); typedef void (GLAPIENTRY * PFNGLCOVERAGEMODULATIONTABLENVPROC) (GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLGETCOVERAGEMODULATIONTABLENVPROC) (GLsizei bufsize, GLfloat* v); typedef void (GLAPIENTRY * PFNGLRASTERSAMPLESEXTPROC) (GLuint samples, GLboolean fixedsamplelocations); #define glCoverageModulationNV GLEW_GET_FUN(__glewCoverageModulationNV) #define glCoverageModulationTableNV GLEW_GET_FUN(__glewCoverageModulationTableNV) #define glGetCoverageModulationTableNV GLEW_GET_FUN(__glewGetCoverageModulationTableNV) #define glRasterSamplesEXT GLEW_GET_FUN(__glewRasterSamplesEXT) #define GLEW_EXT_raster_multisample GLEW_GET_VAR(__GLEW_EXT_raster_multisample) #endif /* GL_EXT_raster_multisample */ /* ------------------------- GL_EXT_rescale_normal ------------------------- */ #ifndef GL_EXT_rescale_normal #define GL_EXT_rescale_normal 1 #define GL_RESCALE_NORMAL_EXT 0x803A #define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) #endif /* GL_EXT_rescale_normal */ /* -------------------------- GL_EXT_scene_marker -------------------------- */ #ifndef GL_EXT_scene_marker #define GL_EXT_scene_marker 1 typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); #define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) #define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) #define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) #endif /* GL_EXT_scene_marker */ /* ------------------------- GL_EXT_secondary_color ------------------------ */ #ifndef GL_EXT_secondary_color #define GL_EXT_secondary_color 1 #define GL_COLOR_SUM_EXT 0x8458 #define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 #define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A #define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B #define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C #define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D #define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer); #define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) #define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) #define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) #define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) #define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) #define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) #define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) #define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) #define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) #define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) #define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) #define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) #define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) #define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) #define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) #define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) #define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) #define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) #endif /* GL_EXT_secondary_color */ /* --------------------- GL_EXT_separate_shader_objects -------------------- */ #ifndef GL_EXT_separate_shader_objects #define GL_EXT_separate_shader_objects 1 #define GL_ACTIVE_PROGRAM_EXT 0x8B8D typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string); typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); #define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) #define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) #define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) #define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) #endif /* GL_EXT_separate_shader_objects */ /* --------------------- GL_EXT_separate_specular_color -------------------- */ #ifndef GL_EXT_separate_specular_color #define GL_EXT_separate_specular_color 1 #define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 #define GL_SINGLE_COLOR_EXT 0x81F9 #define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA #define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) #endif /* GL_EXT_separate_specular_color */ /* ------------------- GL_EXT_shader_image_load_formatted ------------------ */ #ifndef GL_EXT_shader_image_load_formatted #define GL_EXT_shader_image_load_formatted 1 #define GLEW_EXT_shader_image_load_formatted GLEW_GET_VAR(__GLEW_EXT_shader_image_load_formatted) #endif /* GL_EXT_shader_image_load_formatted */ /* --------------------- GL_EXT_shader_image_load_store -------------------- */ #ifndef GL_EXT_shader_image_load_store #define GL_EXT_shader_image_load_store 1 #define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 #define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 #define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 #define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 #define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 #define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 #define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 #define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 #define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 #define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 #define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 #define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 #define GL_MAX_IMAGE_UNITS_EXT 0x8F38 #define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 #define GL_IMAGE_BINDING_NAME_EXT 0x8F3A #define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B #define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C #define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D #define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E #define GL_IMAGE_1D_EXT 0x904C #define GL_IMAGE_2D_EXT 0x904D #define GL_IMAGE_3D_EXT 0x904E #define GL_IMAGE_2D_RECT_EXT 0x904F #define GL_IMAGE_CUBE_EXT 0x9050 #define GL_IMAGE_BUFFER_EXT 0x9051 #define GL_IMAGE_1D_ARRAY_EXT 0x9052 #define GL_IMAGE_2D_ARRAY_EXT 0x9053 #define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 #define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 #define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 #define GL_INT_IMAGE_1D_EXT 0x9057 #define GL_INT_IMAGE_2D_EXT 0x9058 #define GL_INT_IMAGE_3D_EXT 0x9059 #define GL_INT_IMAGE_2D_RECT_EXT 0x905A #define GL_INT_IMAGE_CUBE_EXT 0x905B #define GL_INT_IMAGE_BUFFER_EXT 0x905C #define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D #define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E #define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F #define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 #define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 #define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 #define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 #define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 #define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 #define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 #define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 #define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 #define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 #define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B #define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C #define GL_MAX_IMAGE_SAMPLES_EXT 0x906D #define GL_IMAGE_BINDING_FORMAT_EXT 0x906E #define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); #define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) #define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) #define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) #endif /* GL_EXT_shader_image_load_store */ /* ----------------------- GL_EXT_shader_integer_mix ----------------------- */ #ifndef GL_EXT_shader_integer_mix #define GL_EXT_shader_integer_mix 1 #define GLEW_EXT_shader_integer_mix GLEW_GET_VAR(__GLEW_EXT_shader_integer_mix) #endif /* GL_EXT_shader_integer_mix */ /* -------------------------- GL_EXT_shadow_funcs -------------------------- */ #ifndef GL_EXT_shadow_funcs #define GL_EXT_shadow_funcs 1 #define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) #endif /* GL_EXT_shadow_funcs */ /* --------------------- GL_EXT_shared_texture_palette --------------------- */ #ifndef GL_EXT_shared_texture_palette #define GL_EXT_shared_texture_palette 1 #define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB #define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) #endif /* GL_EXT_shared_texture_palette */ /* ------------------------- GL_EXT_sparse_texture2 ------------------------ */ #ifndef GL_EXT_sparse_texture2 #define GL_EXT_sparse_texture2 1 #define GLEW_EXT_sparse_texture2 GLEW_GET_VAR(__GLEW_EXT_sparse_texture2) #endif /* GL_EXT_sparse_texture2 */ /* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ #ifndef GL_EXT_stencil_clear_tag #define GL_EXT_stencil_clear_tag 1 #define GL_STENCIL_TAG_BITS_EXT 0x88F2 #define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 #define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) #endif /* GL_EXT_stencil_clear_tag */ /* ------------------------ GL_EXT_stencil_two_side ------------------------ */ #ifndef GL_EXT_stencil_two_side #define GL_EXT_stencil_two_side 1 #define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 #define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); #define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) #define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) #endif /* GL_EXT_stencil_two_side */ /* -------------------------- GL_EXT_stencil_wrap -------------------------- */ #ifndef GL_EXT_stencil_wrap #define GL_EXT_stencil_wrap 1 #define GL_INCR_WRAP_EXT 0x8507 #define GL_DECR_WRAP_EXT 0x8508 #define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) #endif /* GL_EXT_stencil_wrap */ /* --------------------------- GL_EXT_subtexture --------------------------- */ #ifndef GL_EXT_subtexture #define GL_EXT_subtexture 1 typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *pixels); #define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) #define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) #define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) #define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) #endif /* GL_EXT_subtexture */ /* ----------------------------- GL_EXT_texture ---------------------------- */ #ifndef GL_EXT_texture #define GL_EXT_texture 1 #define GL_ALPHA4_EXT 0x803B #define GL_ALPHA8_EXT 0x803C #define GL_ALPHA12_EXT 0x803D #define GL_ALPHA16_EXT 0x803E #define GL_LUMINANCE4_EXT 0x803F #define GL_LUMINANCE8_EXT 0x8040 #define GL_LUMINANCE12_EXT 0x8041 #define GL_LUMINANCE16_EXT 0x8042 #define GL_LUMINANCE4_ALPHA4_EXT 0x8043 #define GL_LUMINANCE6_ALPHA2_EXT 0x8044 #define GL_LUMINANCE8_ALPHA8_EXT 0x8045 #define GL_LUMINANCE12_ALPHA4_EXT 0x8046 #define GL_LUMINANCE12_ALPHA12_EXT 0x8047 #define GL_LUMINANCE16_ALPHA16_EXT 0x8048 #define GL_INTENSITY_EXT 0x8049 #define GL_INTENSITY4_EXT 0x804A #define GL_INTENSITY8_EXT 0x804B #define GL_INTENSITY12_EXT 0x804C #define GL_INTENSITY16_EXT 0x804D #define GL_RGB2_EXT 0x804E #define GL_RGB4_EXT 0x804F #define GL_RGB5_EXT 0x8050 #define GL_RGB8_EXT 0x8051 #define GL_RGB10_EXT 0x8052 #define GL_RGB12_EXT 0x8053 #define GL_RGB16_EXT 0x8054 #define GL_RGBA2_EXT 0x8055 #define GL_RGBA4_EXT 0x8056 #define GL_RGB5_A1_EXT 0x8057 #define GL_RGBA8_EXT 0x8058 #define GL_RGB10_A2_EXT 0x8059 #define GL_RGBA12_EXT 0x805A #define GL_RGBA16_EXT 0x805B #define GL_TEXTURE_RED_SIZE_EXT 0x805C #define GL_TEXTURE_GREEN_SIZE_EXT 0x805D #define GL_TEXTURE_BLUE_SIZE_EXT 0x805E #define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F #define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 #define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 #define GL_REPLACE_EXT 0x8062 #define GL_PROXY_TEXTURE_1D_EXT 0x8063 #define GL_PROXY_TEXTURE_2D_EXT 0x8064 #define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) #endif /* GL_EXT_texture */ /* ---------------------------- GL_EXT_texture3D --------------------------- */ #ifndef GL_EXT_texture3D #define GL_EXT_texture3D 1 #define GL_PACK_SKIP_IMAGES_EXT 0x806B #define GL_PACK_IMAGE_HEIGHT_EXT 0x806C #define GL_UNPACK_SKIP_IMAGES_EXT 0x806D #define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E #define GL_TEXTURE_3D_EXT 0x806F #define GL_PROXY_TEXTURE_3D_EXT 0x8070 #define GL_TEXTURE_DEPTH_EXT 0x8071 #define GL_TEXTURE_WRAP_R_EXT 0x8072 #define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels); #define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) #define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) #endif /* GL_EXT_texture3D */ /* -------------------------- GL_EXT_texture_array ------------------------- */ #ifndef GL_EXT_texture_array #define GL_EXT_texture_array 1 #define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E #define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF #define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 #define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 #define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A #define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B #define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C #define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); #define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) #define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) #endif /* GL_EXT_texture_array */ /* ---------------------- GL_EXT_texture_buffer_object --------------------- */ #ifndef GL_EXT_texture_buffer_object #define GL_EXT_texture_buffer_object 1 #define GL_TEXTURE_BUFFER_EXT 0x8C2A #define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B #define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C #define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D #define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); #define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) #define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) #endif /* GL_EXT_texture_buffer_object */ /* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ #ifndef GL_EXT_texture_compression_dxt1 #define GL_EXT_texture_compression_dxt1 1 #define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) #endif /* GL_EXT_texture_compression_dxt1 */ /* -------------------- GL_EXT_texture_compression_latc -------------------- */ #ifndef GL_EXT_texture_compression_latc #define GL_EXT_texture_compression_latc 1 #define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 #define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 #define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 #define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 #define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) #endif /* GL_EXT_texture_compression_latc */ /* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ #ifndef GL_EXT_texture_compression_rgtc #define GL_EXT_texture_compression_rgtc 1 #define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB #define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC #define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD #define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE #define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) #endif /* GL_EXT_texture_compression_rgtc */ /* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ #ifndef GL_EXT_texture_compression_s3tc #define GL_EXT_texture_compression_s3tc 1 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 #define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) #endif /* GL_EXT_texture_compression_s3tc */ /* ------------------------ GL_EXT_texture_cube_map ------------------------ */ #ifndef GL_EXT_texture_cube_map #define GL_EXT_texture_cube_map 1 #define GL_NORMAL_MAP_EXT 0x8511 #define GL_REFLECTION_MAP_EXT 0x8512 #define GL_TEXTURE_CUBE_MAP_EXT 0x8513 #define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 #define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 #define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 #define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A #define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B #define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C #define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) #endif /* GL_EXT_texture_cube_map */ /* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ #ifndef GL_EXT_texture_edge_clamp #define GL_EXT_texture_edge_clamp 1 #define GL_CLAMP_TO_EDGE_EXT 0x812F #define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) #endif /* GL_EXT_texture_edge_clamp */ /* --------------------------- GL_EXT_texture_env -------------------------- */ #ifndef GL_EXT_texture_env #define GL_EXT_texture_env 1 #define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) #endif /* GL_EXT_texture_env */ /* ------------------------- GL_EXT_texture_env_add ------------------------ */ #ifndef GL_EXT_texture_env_add #define GL_EXT_texture_env_add 1 #define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) #endif /* GL_EXT_texture_env_add */ /* ----------------------- GL_EXT_texture_env_combine ---------------------- */ #ifndef GL_EXT_texture_env_combine #define GL_EXT_texture_env_combine 1 #define GL_COMBINE_EXT 0x8570 #define GL_COMBINE_RGB_EXT 0x8571 #define GL_COMBINE_ALPHA_EXT 0x8572 #define GL_RGB_SCALE_EXT 0x8573 #define GL_ADD_SIGNED_EXT 0x8574 #define GL_INTERPOLATE_EXT 0x8575 #define GL_CONSTANT_EXT 0x8576 #define GL_PRIMARY_COLOR_EXT 0x8577 #define GL_PREVIOUS_EXT 0x8578 #define GL_SOURCE0_RGB_EXT 0x8580 #define GL_SOURCE1_RGB_EXT 0x8581 #define GL_SOURCE2_RGB_EXT 0x8582 #define GL_SOURCE0_ALPHA_EXT 0x8588 #define GL_SOURCE1_ALPHA_EXT 0x8589 #define GL_SOURCE2_ALPHA_EXT 0x858A #define GL_OPERAND0_RGB_EXT 0x8590 #define GL_OPERAND1_RGB_EXT 0x8591 #define GL_OPERAND2_RGB_EXT 0x8592 #define GL_OPERAND0_ALPHA_EXT 0x8598 #define GL_OPERAND1_ALPHA_EXT 0x8599 #define GL_OPERAND2_ALPHA_EXT 0x859A #define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) #endif /* GL_EXT_texture_env_combine */ /* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ #ifndef GL_EXT_texture_env_dot3 #define GL_EXT_texture_env_dot3 1 #define GL_DOT3_RGB_EXT 0x8740 #define GL_DOT3_RGBA_EXT 0x8741 #define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) #endif /* GL_EXT_texture_env_dot3 */ /* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ #ifndef GL_EXT_texture_filter_anisotropic #define GL_EXT_texture_filter_anisotropic 1 #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF #define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) #endif /* GL_EXT_texture_filter_anisotropic */ /* ---------------------- GL_EXT_texture_filter_minmax --------------------- */ #ifndef GL_EXT_texture_filter_minmax #define GL_EXT_texture_filter_minmax 1 #define GL_TEXTURE_REDUCTION_MODE_EXT 0x9366 #define GL_WEIGHTED_AVERAGE_EXT 0x9367 #define GLEW_EXT_texture_filter_minmax GLEW_GET_VAR(__GLEW_EXT_texture_filter_minmax) #endif /* GL_EXT_texture_filter_minmax */ /* ------------------------- GL_EXT_texture_integer ------------------------ */ #ifndef GL_EXT_texture_integer #define GL_EXT_texture_integer 1 #define GL_RGBA32UI_EXT 0x8D70 #define GL_RGB32UI_EXT 0x8D71 #define GL_ALPHA32UI_EXT 0x8D72 #define GL_INTENSITY32UI_EXT 0x8D73 #define GL_LUMINANCE32UI_EXT 0x8D74 #define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 #define GL_RGBA16UI_EXT 0x8D76 #define GL_RGB16UI_EXT 0x8D77 #define GL_ALPHA16UI_EXT 0x8D78 #define GL_INTENSITY16UI_EXT 0x8D79 #define GL_LUMINANCE16UI_EXT 0x8D7A #define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B #define GL_RGBA8UI_EXT 0x8D7C #define GL_RGB8UI_EXT 0x8D7D #define GL_ALPHA8UI_EXT 0x8D7E #define GL_INTENSITY8UI_EXT 0x8D7F #define GL_LUMINANCE8UI_EXT 0x8D80 #define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 #define GL_RGBA32I_EXT 0x8D82 #define GL_RGB32I_EXT 0x8D83 #define GL_ALPHA32I_EXT 0x8D84 #define GL_INTENSITY32I_EXT 0x8D85 #define GL_LUMINANCE32I_EXT 0x8D86 #define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 #define GL_RGBA16I_EXT 0x8D88 #define GL_RGB16I_EXT 0x8D89 #define GL_ALPHA16I_EXT 0x8D8A #define GL_INTENSITY16I_EXT 0x8D8B #define GL_LUMINANCE16I_EXT 0x8D8C #define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D #define GL_RGBA8I_EXT 0x8D8E #define GL_RGB8I_EXT 0x8D8F #define GL_ALPHA8I_EXT 0x8D90 #define GL_INTENSITY8I_EXT 0x8D91 #define GL_LUMINANCE8I_EXT 0x8D92 #define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 #define GL_RED_INTEGER_EXT 0x8D94 #define GL_GREEN_INTEGER_EXT 0x8D95 #define GL_BLUE_INTEGER_EXT 0x8D96 #define GL_ALPHA_INTEGER_EXT 0x8D97 #define GL_RGB_INTEGER_EXT 0x8D98 #define GL_RGBA_INTEGER_EXT 0x8D99 #define GL_BGR_INTEGER_EXT 0x8D9A #define GL_BGRA_INTEGER_EXT 0x8D9B #define GL_LUMINANCE_INTEGER_EXT 0x8D9C #define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D #define GL_RGBA_INTEGER_MODE_EXT 0x8D9E typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); #define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) #define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) #define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) #define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) #define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) #define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) #define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) #endif /* GL_EXT_texture_integer */ /* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ #ifndef GL_EXT_texture_lod_bias #define GL_EXT_texture_lod_bias 1 #define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD #define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 #define GL_TEXTURE_LOD_BIAS_EXT 0x8501 #define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) #endif /* GL_EXT_texture_lod_bias */ /* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ #ifndef GL_EXT_texture_mirror_clamp #define GL_EXT_texture_mirror_clamp 1 #define GL_MIRROR_CLAMP_EXT 0x8742 #define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 #define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 #define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) #endif /* GL_EXT_texture_mirror_clamp */ /* ------------------------- GL_EXT_texture_object ------------------------- */ #ifndef GL_EXT_texture_object #define GL_EXT_texture_object 1 #define GL_TEXTURE_PRIORITY_EXT 0x8066 #define GL_TEXTURE_RESIDENT_EXT 0x8067 #define GL_TEXTURE_1D_BINDING_EXT 0x8068 #define GL_TEXTURE_2D_BINDING_EXT 0x8069 #define GL_TEXTURE_3D_BINDING_EXT 0x806A typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); #define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) #define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) #define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) #define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) #define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) #define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) #define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) #endif /* GL_EXT_texture_object */ /* --------------------- GL_EXT_texture_perturb_normal --------------------- */ #ifndef GL_EXT_texture_perturb_normal #define GL_EXT_texture_perturb_normal 1 #define GL_PERTURB_EXT 0x85AE #define GL_TEXTURE_NORMAL_EXT 0x85AF typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); #define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) #define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) #endif /* GL_EXT_texture_perturb_normal */ /* ------------------------ GL_EXT_texture_rectangle ----------------------- */ #ifndef GL_EXT_texture_rectangle #define GL_EXT_texture_rectangle 1 #define GL_TEXTURE_RECTANGLE_EXT 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 #define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 #define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) #endif /* GL_EXT_texture_rectangle */ /* -------------------------- GL_EXT_texture_sRGB -------------------------- */ #ifndef GL_EXT_texture_sRGB #define GL_EXT_texture_sRGB 1 #define GL_SRGB_EXT 0x8C40 #define GL_SRGB8_EXT 0x8C41 #define GL_SRGB_ALPHA_EXT 0x8C42 #define GL_SRGB8_ALPHA8_EXT 0x8C43 #define GL_SLUMINANCE_ALPHA_EXT 0x8C44 #define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 #define GL_SLUMINANCE_EXT 0x8C46 #define GL_SLUMINANCE8_EXT 0x8C47 #define GL_COMPRESSED_SRGB_EXT 0x8C48 #define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 #define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A #define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F #define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) #endif /* GL_EXT_texture_sRGB */ /* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ #ifndef GL_EXT_texture_sRGB_decode #define GL_EXT_texture_sRGB_decode 1 #define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 #define GL_DECODE_EXT 0x8A49 #define GL_SKIP_DECODE_EXT 0x8A4A #define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) #endif /* GL_EXT_texture_sRGB_decode */ /* --------------------- GL_EXT_texture_shared_exponent -------------------- */ #ifndef GL_EXT_texture_shared_exponent #define GL_EXT_texture_shared_exponent 1 #define GL_RGB9_E5_EXT 0x8C3D #define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E #define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F #define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) #endif /* GL_EXT_texture_shared_exponent */ /* -------------------------- GL_EXT_texture_snorm ------------------------- */ #ifndef GL_EXT_texture_snorm #define GL_EXT_texture_snorm 1 #define GL_RED_SNORM 0x8F90 #define GL_RG_SNORM 0x8F91 #define GL_RGB_SNORM 0x8F92 #define GL_RGBA_SNORM 0x8F93 #define GL_R8_SNORM 0x8F94 #define GL_RG8_SNORM 0x8F95 #define GL_RGB8_SNORM 0x8F96 #define GL_RGBA8_SNORM 0x8F97 #define GL_R16_SNORM 0x8F98 #define GL_RG16_SNORM 0x8F99 #define GL_RGB16_SNORM 0x8F9A #define GL_RGBA16_SNORM 0x8F9B #define GL_SIGNED_NORMALIZED 0x8F9C #define GL_ALPHA_SNORM 0x9010 #define GL_LUMINANCE_SNORM 0x9011 #define GL_LUMINANCE_ALPHA_SNORM 0x9012 #define GL_INTENSITY_SNORM 0x9013 #define GL_ALPHA8_SNORM 0x9014 #define GL_LUMINANCE8_SNORM 0x9015 #define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 #define GL_INTENSITY8_SNORM 0x9017 #define GL_ALPHA16_SNORM 0x9018 #define GL_LUMINANCE16_SNORM 0x9019 #define GL_LUMINANCE16_ALPHA16_SNORM 0x901A #define GL_INTENSITY16_SNORM 0x901B #define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) #endif /* GL_EXT_texture_snorm */ /* ------------------------- GL_EXT_texture_swizzle ------------------------ */ #ifndef GL_EXT_texture_swizzle #define GL_EXT_texture_swizzle 1 #define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 #define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 #define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 #define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 #define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 #define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) #endif /* GL_EXT_texture_swizzle */ /* --------------------------- GL_EXT_timer_query -------------------------- */ #ifndef GL_EXT_timer_query #define GL_EXT_timer_query 1 #define GL_TIME_ELAPSED_EXT 0x88BF typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); #define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) #define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) #define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) #endif /* GL_EXT_timer_query */ /* ----------------------- GL_EXT_transform_feedback ----------------------- */ #ifndef GL_EXT_transform_feedback #define GL_EXT_transform_feedback 1 #define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 #define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 #define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 #define GL_PRIMITIVES_GENERATED_EXT 0x8C87 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 #define GL_RASTERIZER_DISCARD_EXT 0x8C89 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B #define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C #define GL_SEPARATE_ATTRIBS_EXT 0x8C8D #define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode); #define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) #define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) #define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) #define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) #define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) #define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) #define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) #define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) #endif /* GL_EXT_transform_feedback */ /* -------------------------- GL_EXT_vertex_array -------------------------- */ #ifndef GL_EXT_vertex_array #define GL_EXT_vertex_array 1 #define GL_DOUBLE_EXT 0x140A #define GL_VERTEX_ARRAY_EXT 0x8074 #define GL_NORMAL_ARRAY_EXT 0x8075 #define GL_COLOR_ARRAY_EXT 0x8076 #define GL_INDEX_ARRAY_EXT 0x8077 #define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 #define GL_EDGE_FLAG_ARRAY_EXT 0x8079 #define GL_VERTEX_ARRAY_SIZE_EXT 0x807A #define GL_VERTEX_ARRAY_TYPE_EXT 0x807B #define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C #define GL_VERTEX_ARRAY_COUNT_EXT 0x807D #define GL_NORMAL_ARRAY_TYPE_EXT 0x807E #define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F #define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 #define GL_COLOR_ARRAY_SIZE_EXT 0x8081 #define GL_COLOR_ARRAY_TYPE_EXT 0x8082 #define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 #define GL_COLOR_ARRAY_COUNT_EXT 0x8084 #define GL_INDEX_ARRAY_TYPE_EXT 0x8085 #define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 #define GL_INDEX_ARRAY_COUNT_EXT 0x8087 #define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 #define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 #define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A #define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B #define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C #define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D #define GL_VERTEX_ARRAY_POINTER_EXT 0x808E #define GL_NORMAL_ARRAY_POINTER_EXT 0x808F #define GL_COLOR_ARRAY_POINTER_EXT 0x8090 #define GL_INDEX_ARRAY_POINTER_EXT 0x8091 #define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 #define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void *pointer); typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void *pointer); #define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) #define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) #define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) #define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) #define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) #define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) #define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) #define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) #define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) #endif /* GL_EXT_vertex_array */ /* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ #ifndef GL_EXT_vertex_array_bgra #define GL_EXT_vertex_array_bgra 1 #define GL_BGRA 0x80E1 #define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) #endif /* GL_EXT_vertex_array_bgra */ /* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ #ifndef GL_EXT_vertex_attrib_64bit #define GL_EXT_vertex_attrib_64bit 1 #define GL_DOUBLE_MAT2_EXT 0x8F46 #define GL_DOUBLE_MAT3_EXT 0x8F47 #define GL_DOUBLE_MAT4_EXT 0x8F48 #define GL_DOUBLE_MAT2x3_EXT 0x8F49 #define GL_DOUBLE_MAT2x4_EXT 0x8F4A #define GL_DOUBLE_MAT3x2_EXT 0x8F4B #define GL_DOUBLE_MAT3x4_EXT 0x8F4C #define GL_DOUBLE_MAT4x2_EXT 0x8F4D #define GL_DOUBLE_MAT4x3_EXT 0x8F4E #define GL_DOUBLE_VEC2_EXT 0x8FFC #define GL_DOUBLE_VEC3_EXT 0x8FFD #define GL_DOUBLE_VEC4_EXT 0x8FFE typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); #define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) #define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) #define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) #define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) #define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) #define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) #define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) #define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) #define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) #define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) #define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) #define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) #endif /* GL_EXT_vertex_attrib_64bit */ /* -------------------------- GL_EXT_vertex_shader ------------------------- */ #ifndef GL_EXT_vertex_shader #define GL_EXT_vertex_shader 1 #define GL_VERTEX_SHADER_EXT 0x8780 #define GL_VERTEX_SHADER_BINDING_EXT 0x8781 #define GL_OP_INDEX_EXT 0x8782 #define GL_OP_NEGATE_EXT 0x8783 #define GL_OP_DOT3_EXT 0x8784 #define GL_OP_DOT4_EXT 0x8785 #define GL_OP_MUL_EXT 0x8786 #define GL_OP_ADD_EXT 0x8787 #define GL_OP_MADD_EXT 0x8788 #define GL_OP_FRAC_EXT 0x8789 #define GL_OP_MAX_EXT 0x878A #define GL_OP_MIN_EXT 0x878B #define GL_OP_SET_GE_EXT 0x878C #define GL_OP_SET_LT_EXT 0x878D #define GL_OP_CLAMP_EXT 0x878E #define GL_OP_FLOOR_EXT 0x878F #define GL_OP_ROUND_EXT 0x8790 #define GL_OP_EXP_BASE_2_EXT 0x8791 #define GL_OP_LOG_BASE_2_EXT 0x8792 #define GL_OP_POWER_EXT 0x8793 #define GL_OP_RECIP_EXT 0x8794 #define GL_OP_RECIP_SQRT_EXT 0x8795 #define GL_OP_SUB_EXT 0x8796 #define GL_OP_CROSS_PRODUCT_EXT 0x8797 #define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 #define GL_OP_MOV_EXT 0x8799 #define GL_OUTPUT_VERTEX_EXT 0x879A #define GL_OUTPUT_COLOR0_EXT 0x879B #define GL_OUTPUT_COLOR1_EXT 0x879C #define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D #define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E #define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F #define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 #define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 #define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 #define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 #define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 #define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 #define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 #define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 #define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 #define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 #define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA #define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB #define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC #define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD #define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE #define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF #define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 #define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 #define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 #define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 #define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 #define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 #define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 #define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 #define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 #define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 #define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA #define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB #define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC #define GL_OUTPUT_FOG_EXT 0x87BD #define GL_SCALAR_EXT 0x87BE #define GL_VECTOR_EXT 0x87BF #define GL_MATRIX_EXT 0x87C0 #define GL_VARIANT_EXT 0x87C1 #define GL_INVARIANT_EXT 0x87C2 #define GL_LOCAL_CONSTANT_EXT 0x87C3 #define GL_LOCAL_EXT 0x87C4 #define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 #define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 #define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 #define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 #define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 #define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA #define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB #define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC #define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD #define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE #define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF #define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 #define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 #define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 #define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 #define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 #define GL_X_EXT 0x87D5 #define GL_Y_EXT 0x87D6 #define GL_Z_EXT 0x87D7 #define GL_W_EXT 0x87D8 #define GL_NEGATIVE_X_EXT 0x87D9 #define GL_NEGATIVE_Y_EXT 0x87DA #define GL_NEGATIVE_Z_EXT 0x87DB #define GL_NEGATIVE_W_EXT 0x87DC #define GL_ZERO_EXT 0x87DD #define GL_ONE_EXT 0x87DE #define GL_NEGATIVE_ONE_EXT 0x87DF #define GL_NORMALIZED_RANGE_EXT 0x87E0 #define GL_FULL_RANGE_EXT 0x87E1 #define GL_CURRENT_VERTEX_EXT 0x87E2 #define GL_MVP_MATRIX_EXT 0x87E3 #define GL_VARIANT_VALUE_EXT 0x87E4 #define GL_VARIANT_DATATYPE_EXT 0x87E5 #define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 #define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 #define GL_VARIANT_ARRAY_EXT 0x87E8 #define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 #define GL_INVARIANT_VALUE_EXT 0x87EA #define GL_INVARIANT_DATATYPE_EXT 0x87EB #define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC #define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, void **data); typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, void *addr); typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, void *addr); typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, void *addr); typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); #define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) #define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) #define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) #define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) #define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) #define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) #define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) #define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) #define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) #define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) #define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) #define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) #define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) #define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) #define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) #define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) #define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) #define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) #define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) #define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) #define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) #define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) #define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) #define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) #define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) #define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) #define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) #define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) #define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) #define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) #define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) #define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) #define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) #define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) #define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) #define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) #define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) #define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) #define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) #define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) #define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) #define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) #define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) #endif /* GL_EXT_vertex_shader */ /* ------------------------ GL_EXT_vertex_weighting ------------------------ */ #ifndef GL_EXT_vertex_weighting #define GL_EXT_vertex_weighting 1 #define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 #define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 #define GL_MODELVIEW0_EXT 0x1700 #define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 #define GL_MODELVIEW1_MATRIX_EXT 0x8506 #define GL_VERTEX_WEIGHTING_EXT 0x8509 #define GL_MODELVIEW1_EXT 0x850A #define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B #define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C #define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D #define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E #define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F #define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); #define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) #define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) #define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) #define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) #endif /* GL_EXT_vertex_weighting */ /* ------------------------- GL_EXT_x11_sync_object ------------------------ */ #ifndef GL_EXT_x11_sync_object #define GL_EXT_x11_sync_object 1 #define GL_SYNC_X11_FENCE_EXT 0x90E1 typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags); #define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT) #define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object) #endif /* GL_EXT_x11_sync_object */ /* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ #ifndef GL_GREMEDY_frame_terminator #define GL_GREMEDY_frame_terminator 1 typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); #define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) #define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) #endif /* GL_GREMEDY_frame_terminator */ /* ------------------------ GL_GREMEDY_string_marker ----------------------- */ #ifndef GL_GREMEDY_string_marker #define GL_GREMEDY_string_marker 1 typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void *string); #define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) #define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) #endif /* GL_GREMEDY_string_marker */ /* --------------------- GL_HP_convolution_border_modes -------------------- */ #ifndef GL_HP_convolution_border_modes #define GL_HP_convolution_border_modes 1 #define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) #endif /* GL_HP_convolution_border_modes */ /* ------------------------- GL_HP_image_transform ------------------------- */ #ifndef GL_HP_image_transform #define GL_HP_image_transform 1 typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); #define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) #define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) #define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) #define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) #define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) #define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) #define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) #endif /* GL_HP_image_transform */ /* -------------------------- GL_HP_occlusion_test ------------------------- */ #ifndef GL_HP_occlusion_test #define GL_HP_occlusion_test 1 #define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) #endif /* GL_HP_occlusion_test */ /* ------------------------- GL_HP_texture_lighting ------------------------ */ #ifndef GL_HP_texture_lighting #define GL_HP_texture_lighting 1 #define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) #endif /* GL_HP_texture_lighting */ /* --------------------------- GL_IBM_cull_vertex -------------------------- */ #ifndef GL_IBM_cull_vertex #define GL_IBM_cull_vertex 1 #define GL_CULL_VERTEX_IBM 103050 #define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) #endif /* GL_IBM_cull_vertex */ /* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ #ifndef GL_IBM_multimode_draw_arrays #define GL_IBM_multimode_draw_arrays 1 typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const void *const *indices, GLsizei primcount, GLint modestride); #define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) #define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) #define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) #endif /* GL_IBM_multimode_draw_arrays */ /* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ #ifndef GL_IBM_rasterpos_clip #define GL_IBM_rasterpos_clip 1 #define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 #define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) #endif /* GL_IBM_rasterpos_clip */ /* --------------------------- GL_IBM_static_data -------------------------- */ #ifndef GL_IBM_static_data #define GL_IBM_static_data 1 #define GL_ALL_STATIC_DATA_IBM 103060 #define GL_STATIC_VERTEX_ARRAY_IBM 103061 #define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) #endif /* GL_IBM_static_data */ /* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ #ifndef GL_IBM_texture_mirrored_repeat #define GL_IBM_texture_mirrored_repeat 1 #define GL_MIRRORED_REPEAT_IBM 0x8370 #define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) #endif /* GL_IBM_texture_mirrored_repeat */ /* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ #ifndef GL_IBM_vertex_array_lists #define GL_IBM_vertex_array_lists 1 #define GL_VERTEX_ARRAY_LIST_IBM 103070 #define GL_NORMAL_ARRAY_LIST_IBM 103071 #define GL_COLOR_ARRAY_LIST_IBM 103072 #define GL_INDEX_ARRAY_LIST_IBM 103073 #define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 #define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 #define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 #define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 #define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 #define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 #define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 #define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 #define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 #define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 #define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 #define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const void** pointer, GLint ptrstride); #define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) #define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) #define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) #define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) #define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) #define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) #define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) #define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) #define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) #endif /* GL_IBM_vertex_array_lists */ /* -------------------------- GL_INGR_color_clamp -------------------------- */ #ifndef GL_INGR_color_clamp #define GL_INGR_color_clamp 1 #define GL_RED_MIN_CLAMP_INGR 0x8560 #define GL_GREEN_MIN_CLAMP_INGR 0x8561 #define GL_BLUE_MIN_CLAMP_INGR 0x8562 #define GL_ALPHA_MIN_CLAMP_INGR 0x8563 #define GL_RED_MAX_CLAMP_INGR 0x8564 #define GL_GREEN_MAX_CLAMP_INGR 0x8565 #define GL_BLUE_MAX_CLAMP_INGR 0x8566 #define GL_ALPHA_MAX_CLAMP_INGR 0x8567 #define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) #endif /* GL_INGR_color_clamp */ /* ------------------------- GL_INGR_interlace_read ------------------------ */ #ifndef GL_INGR_interlace_read #define GL_INGR_interlace_read 1 #define GL_INTERLACE_READ_INGR 0x8568 #define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) #endif /* GL_INGR_interlace_read */ /* ------------------- GL_INTEL_fragment_shader_ordering ------------------- */ #ifndef GL_INTEL_fragment_shader_ordering #define GL_INTEL_fragment_shader_ordering 1 #define GLEW_INTEL_fragment_shader_ordering GLEW_GET_VAR(__GLEW_INTEL_fragment_shader_ordering) #endif /* GL_INTEL_fragment_shader_ordering */ /* ----------------------- GL_INTEL_framebuffer_CMAA ----------------------- */ #ifndef GL_INTEL_framebuffer_CMAA #define GL_INTEL_framebuffer_CMAA 1 #define GLEW_INTEL_framebuffer_CMAA GLEW_GET_VAR(__GLEW_INTEL_framebuffer_CMAA) #endif /* GL_INTEL_framebuffer_CMAA */ /* -------------------------- GL_INTEL_map_texture ------------------------- */ #ifndef GL_INTEL_map_texture #define GL_INTEL_map_texture 1 #define GL_LAYOUT_DEFAULT_INTEL 0 #define GL_LAYOUT_LINEAR_INTEL 1 #define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2 #define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF typedef void * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout); typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture); typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level); #define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL) #define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL) #define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL) #define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture) #endif /* GL_INTEL_map_texture */ /* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ #ifndef GL_INTEL_parallel_arrays #define GL_INTEL_parallel_arrays 1 #define GL_PARALLEL_ARRAYS_INTEL 0x83F4 #define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 #define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 #define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 #define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); #define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) #define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) #define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) #define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) #define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) #endif /* GL_INTEL_parallel_arrays */ /* ----------------------- GL_INTEL_performance_query ---------------------- */ #ifndef GL_INTEL_performance_query #define GL_INTEL_performance_query 1 #define GL_PERFQUERY_SINGLE_CONTEXT_INTEL 0x0000 #define GL_PERFQUERY_GLOBAL_CONTEXT_INTEL 0x0001 #define GL_PERFQUERY_DONOT_FLUSH_INTEL 0x83F9 #define GL_PERFQUERY_FLUSH_INTEL 0x83FA #define GL_PERFQUERY_WAIT_INTEL 0x83FB #define GL_PERFQUERY_COUNTER_EVENT_INTEL 0x94F0 #define GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL 0x94F1 #define GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL 0x94F2 #define GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL 0x94F3 #define GL_PERFQUERY_COUNTER_RAW_INTEL 0x94F4 #define GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL 0x94F5 #define GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL 0x94F8 #define GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL 0x94F9 #define GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL 0x94FA #define GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL 0x94FB #define GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL 0x94FC #define GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL 0x94FD #define GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL 0x94FE #define GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL 0x94FF #define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500 typedef void (GLAPIENTRY * PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle); typedef void (GLAPIENTRY * PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint* queryHandle); typedef void (GLAPIENTRY * PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle); typedef void (GLAPIENTRY * PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle); typedef void (GLAPIENTRY * PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint* queryId); typedef void (GLAPIENTRY * PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint* nextQueryId); typedef void (GLAPIENTRY * PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar* counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue); typedef void (GLAPIENTRY * PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten); typedef void (GLAPIENTRY * PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar* queryName, GLuint *queryId); typedef void (GLAPIENTRY * PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar* queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask); #define glBeginPerfQueryINTEL GLEW_GET_FUN(__glewBeginPerfQueryINTEL) #define glCreatePerfQueryINTEL GLEW_GET_FUN(__glewCreatePerfQueryINTEL) #define glDeletePerfQueryINTEL GLEW_GET_FUN(__glewDeletePerfQueryINTEL) #define glEndPerfQueryINTEL GLEW_GET_FUN(__glewEndPerfQueryINTEL) #define glGetFirstPerfQueryIdINTEL GLEW_GET_FUN(__glewGetFirstPerfQueryIdINTEL) #define glGetNextPerfQueryIdINTEL GLEW_GET_FUN(__glewGetNextPerfQueryIdINTEL) #define glGetPerfCounterInfoINTEL GLEW_GET_FUN(__glewGetPerfCounterInfoINTEL) #define glGetPerfQueryDataINTEL GLEW_GET_FUN(__glewGetPerfQueryDataINTEL) #define glGetPerfQueryIdByNameINTEL GLEW_GET_FUN(__glewGetPerfQueryIdByNameINTEL) #define glGetPerfQueryInfoINTEL GLEW_GET_FUN(__glewGetPerfQueryInfoINTEL) #define GLEW_INTEL_performance_query GLEW_GET_VAR(__GLEW_INTEL_performance_query) #endif /* GL_INTEL_performance_query */ /* ------------------------ GL_INTEL_texture_scissor ----------------------- */ #ifndef GL_INTEL_texture_scissor #define GL_INTEL_texture_scissor 1 typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); #define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) #define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) #define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) #endif /* GL_INTEL_texture_scissor */ /* --------------------- GL_KHR_blend_equation_advanced -------------------- */ #ifndef GL_KHR_blend_equation_advanced #define GL_KHR_blend_equation_advanced 1 #define GL_BLEND_ADVANCED_COHERENT_KHR 0x9285 #define GL_MULTIPLY_KHR 0x9294 #define GL_SCREEN_KHR 0x9295 #define GL_OVERLAY_KHR 0x9296 #define GL_DARKEN_KHR 0x9297 #define GL_LIGHTEN_KHR 0x9298 #define GL_COLORDODGE_KHR 0x9299 #define GL_COLORBURN_KHR 0x929A #define GL_HARDLIGHT_KHR 0x929B #define GL_SOFTLIGHT_KHR 0x929C #define GL_DIFFERENCE_KHR 0x929E #define GL_EXCLUSION_KHR 0x92A0 #define GL_HSL_HUE_KHR 0x92AD #define GL_HSL_SATURATION_KHR 0x92AE #define GL_HSL_COLOR_KHR 0x92AF #define GL_HSL_LUMINOSITY_KHR 0x92B0 typedef void (GLAPIENTRY * PFNGLBLENDBARRIERKHRPROC) (void); #define glBlendBarrierKHR GLEW_GET_FUN(__glewBlendBarrierKHR) #define GLEW_KHR_blend_equation_advanced GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced) #endif /* GL_KHR_blend_equation_advanced */ /* ---------------- GL_KHR_blend_equation_advanced_coherent ---------------- */ #ifndef GL_KHR_blend_equation_advanced_coherent #define GL_KHR_blend_equation_advanced_coherent 1 #define GLEW_KHR_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_KHR_blend_equation_advanced_coherent) #endif /* GL_KHR_blend_equation_advanced_coherent */ /* ---------------------- GL_KHR_context_flush_control --------------------- */ #ifndef GL_KHR_context_flush_control #define GL_KHR_context_flush_control 1 #define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB #define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC #define GLEW_KHR_context_flush_control GLEW_GET_VAR(__GLEW_KHR_context_flush_control) #endif /* GL_KHR_context_flush_control */ /* ------------------------------ GL_KHR_debug ----------------------------- */ #ifndef GL_KHR_debug #define GL_KHR_debug 1 #define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002 #define GL_STACK_OVERFLOW 0x0503 #define GL_STACK_UNDERFLOW 0x0504 #define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242 #define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243 #define GL_DEBUG_CALLBACK_FUNCTION 0x8244 #define GL_DEBUG_CALLBACK_USER_PARAM 0x8245 #define GL_DEBUG_SOURCE_API 0x8246 #define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247 #define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248 #define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249 #define GL_DEBUG_SOURCE_APPLICATION 0x824A #define GL_DEBUG_SOURCE_OTHER 0x824B #define GL_DEBUG_TYPE_ERROR 0x824C #define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D #define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E #define GL_DEBUG_TYPE_PORTABILITY 0x824F #define GL_DEBUG_TYPE_PERFORMANCE 0x8250 #define GL_DEBUG_TYPE_OTHER 0x8251 #define GL_DEBUG_TYPE_MARKER 0x8268 #define GL_DEBUG_TYPE_PUSH_GROUP 0x8269 #define GL_DEBUG_TYPE_POP_GROUP 0x826A #define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B #define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C #define GL_DEBUG_GROUP_STACK_DEPTH 0x826D #define GL_BUFFER 0x82E0 #define GL_SHADER 0x82E1 #define GL_PROGRAM 0x82E2 #define GL_QUERY 0x82E3 #define GL_PROGRAM_PIPELINE 0x82E4 #define GL_SAMPLER 0x82E6 #define GL_DISPLAY_LIST 0x82E7 #define GL_MAX_LABEL_LENGTH 0x82E8 #define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143 #define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144 #define GL_DEBUG_LOGGED_MESSAGES 0x9145 #define GL_DEBUG_SEVERITY_HIGH 0x9146 #define GL_DEBUG_SEVERITY_MEDIUM 0x9147 #define GL_DEBUG_SEVERITY_LOW 0x9148 #define GL_DEBUG_OUTPUT 0x92E0 typedef void (GLAPIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const void *userParam); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf); typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufSize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog); typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label); typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei* length, GLchar *label); typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label); typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar* label); typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void); typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message); #define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback) #define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl) #define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert) #define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog) #define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel) #define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel) #define glObjectLabel GLEW_GET_FUN(__glewObjectLabel) #define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel) #define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup) #define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup) #define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug) #endif /* GL_KHR_debug */ /* ---------------------------- GL_KHR_no_error ---------------------------- */ #ifndef GL_KHR_no_error #define GL_KHR_no_error 1 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR 0x00000008 #define GLEW_KHR_no_error GLEW_GET_VAR(__GLEW_KHR_no_error) #endif /* GL_KHR_no_error */ /* ------------------ GL_KHR_robust_buffer_access_behavior ----------------- */ #ifndef GL_KHR_robust_buffer_access_behavior #define GL_KHR_robust_buffer_access_behavior 1 #define GLEW_KHR_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_KHR_robust_buffer_access_behavior) #endif /* GL_KHR_robust_buffer_access_behavior */ /* --------------------------- GL_KHR_robustness --------------------------- */ #ifndef GL_KHR_robustness #define GL_KHR_robustness 1 #define GL_CONTEXT_LOST 0x0507 #define GL_LOSE_CONTEXT_ON_RESET 0x8252 #define GL_GUILTY_CONTEXT_RESET 0x8253 #define GL_INNOCENT_CONTEXT_RESET 0x8254 #define GL_UNKNOWN_CONTEXT_RESET 0x8255 #define GL_RESET_NOTIFICATION_STRATEGY 0x8256 #define GL_NO_RESET_NOTIFICATION 0x8261 #define GL_CONTEXT_ROBUST_ACCESS 0x90F3 typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); typedef void (GLAPIENTRY * PFNGLREADNPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data); #define glGetnUniformfv GLEW_GET_FUN(__glewGetnUniformfv) #define glGetnUniformiv GLEW_GET_FUN(__glewGetnUniformiv) #define glGetnUniformuiv GLEW_GET_FUN(__glewGetnUniformuiv) #define glReadnPixels GLEW_GET_FUN(__glewReadnPixels) #define GLEW_KHR_robustness GLEW_GET_VAR(__GLEW_KHR_robustness) #endif /* GL_KHR_robustness */ /* ------------------ GL_KHR_texture_compression_astc_hdr ------------------ */ #ifndef GL_KHR_texture_compression_astc_hdr #define GL_KHR_texture_compression_astc_hdr 1 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 #define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 #define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 #define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 #define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 #define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 #define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 #define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 #define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 #define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 #define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA #define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB #define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC #define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD #define GLEW_KHR_texture_compression_astc_hdr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_hdr) #endif /* GL_KHR_texture_compression_astc_hdr */ /* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */ #ifndef GL_KHR_texture_compression_astc_ldr #define GL_KHR_texture_compression_astc_ldr 1 #define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0 #define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1 #define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2 #define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3 #define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4 #define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5 #define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6 #define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7 #define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8 #define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9 #define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA #define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB #define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC #define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9 #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC #define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD #define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr) #endif /* GL_KHR_texture_compression_astc_ldr */ /* -------------------------- GL_KTX_buffer_region ------------------------- */ #ifndef GL_KTX_buffer_region #define GL_KTX_buffer_region 1 #define GL_KTX_FRONT_REGION 0x0 #define GL_KTX_BACK_REGION 0x1 #define GL_KTX_Z_REGION 0x2 #define GL_KTX_STENCIL_REGION 0x3 typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void); typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region); typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region); typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); #define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled) #define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion) #define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion) #define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion) #define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion) #define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) #endif /* GL_KTX_buffer_region */ /* ------------------------- GL_MESAX_texture_stack ------------------------ */ #ifndef GL_MESAX_texture_stack #define GL_MESAX_texture_stack 1 #define GL_TEXTURE_1D_STACK_MESAX 0x8759 #define GL_TEXTURE_2D_STACK_MESAX 0x875A #define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B #define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C #define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D #define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E #define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) #endif /* GL_MESAX_texture_stack */ /* -------------------------- GL_MESA_pack_invert -------------------------- */ #ifndef GL_MESA_pack_invert #define GL_MESA_pack_invert 1 #define GL_PACK_INVERT_MESA 0x8758 #define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) #endif /* GL_MESA_pack_invert */ /* ------------------------- GL_MESA_resize_buffers ------------------------ */ #ifndef GL_MESA_resize_buffers #define GL_MESA_resize_buffers 1 typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); #define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) #define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) #endif /* GL_MESA_resize_buffers */ /* --------------------------- GL_MESA_window_pos -------------------------- */ #ifndef GL_MESA_window_pos #define GL_MESA_window_pos 1 typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); #define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) #define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) #define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) #define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) #define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) #define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) #define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) #define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) #define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) #define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) #define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) #define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) #define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) #define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) #define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) #define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) #define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) #define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) #define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) #define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) #define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) #define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) #define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) #define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) #define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) #endif /* GL_MESA_window_pos */ /* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ #ifndef GL_MESA_ycbcr_texture #define GL_MESA_ycbcr_texture 1 #define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA #define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB #define GL_YCBCR_MESA 0x8757 #define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) #endif /* GL_MESA_ycbcr_texture */ /* ----------------------- GL_NVX_conditional_render ----------------------- */ #ifndef GL_NVX_conditional_render #define GL_NVX_conditional_render 1 typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void); #define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX) #define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX) #define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render) #endif /* GL_NVX_conditional_render */ /* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ #ifndef GL_NVX_gpu_memory_info #define GL_NVX_gpu_memory_info 1 #define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 #define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 #define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 #define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A #define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B #define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) #endif /* GL_NVX_gpu_memory_info */ /* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */ #ifndef GL_NV_bindless_multi_draw_indirect #define GL_NV_bindless_multi_draw_indirect 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount); #define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV) #define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV) #define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect) #endif /* GL_NV_bindless_multi_draw_indirect */ /* ---------------- GL_NV_bindless_multi_draw_indirect_count --------------- */ #ifndef GL_NV_bindless_multi_draw_indirect_count #define GL_NV_bindless_multi_draw_indirect_count 1 typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawCount, GLsizei maxDrawCount, GLsizei stride, GLint vertexBufferCount); #define glMultiDrawArraysIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessCountNV) #define glMultiDrawElementsIndirectBindlessCountNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessCountNV) #define GLEW_NV_bindless_multi_draw_indirect_count GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect_count) #endif /* GL_NV_bindless_multi_draw_indirect_count */ /* ------------------------- GL_NV_bindless_texture ------------------------ */ #ifndef GL_NV_bindless_texture #define GL_NV_bindless_texture 1 typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format); typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture); typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler); typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle); typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access); typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values); typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value); typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value); #define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV) #define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV) #define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV) #define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV) #define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV) #define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV) #define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV) #define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV) #define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV) #define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV) #define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV) #define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV) #define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV) #define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture) #endif /* GL_NV_bindless_texture */ /* --------------------- GL_NV_blend_equation_advanced --------------------- */ #ifndef GL_NV_blend_equation_advanced #define GL_NV_blend_equation_advanced 1 #define GL_XOR_NV 0x1506 #define GL_RED_NV 0x1903 #define GL_GREEN_NV 0x1904 #define GL_BLUE_NV 0x1905 #define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280 #define GL_BLEND_OVERLAP_NV 0x9281 #define GL_UNCORRELATED_NV 0x9282 #define GL_DISJOINT_NV 0x9283 #define GL_CONJOINT_NV 0x9284 #define GL_BLEND_ADVANCED_COHERENT_NV 0x9285 #define GL_SRC_NV 0x9286 #define GL_DST_NV 0x9287 #define GL_SRC_OVER_NV 0x9288 #define GL_DST_OVER_NV 0x9289 #define GL_SRC_IN_NV 0x928A #define GL_DST_IN_NV 0x928B #define GL_SRC_OUT_NV 0x928C #define GL_DST_OUT_NV 0x928D #define GL_SRC_ATOP_NV 0x928E #define GL_DST_ATOP_NV 0x928F #define GL_PLUS_NV 0x9291 #define GL_PLUS_DARKER_NV 0x9292 #define GL_MULTIPLY_NV 0x9294 #define GL_SCREEN_NV 0x9295 #define GL_OVERLAY_NV 0x9296 #define GL_DARKEN_NV 0x9297 #define GL_LIGHTEN_NV 0x9298 #define GL_COLORDODGE_NV 0x9299 #define GL_COLORBURN_NV 0x929A #define GL_HARDLIGHT_NV 0x929B #define GL_SOFTLIGHT_NV 0x929C #define GL_DIFFERENCE_NV 0x929E #define GL_MINUS_NV 0x929F #define GL_EXCLUSION_NV 0x92A0 #define GL_CONTRAST_NV 0x92A1 #define GL_INVERT_RGB_NV 0x92A3 #define GL_LINEARDODGE_NV 0x92A4 #define GL_LINEARBURN_NV 0x92A5 #define GL_VIVIDLIGHT_NV 0x92A6 #define GL_LINEARLIGHT_NV 0x92A7 #define GL_PINLIGHT_NV 0x92A8 #define GL_HARDMIX_NV 0x92A9 #define GL_HSL_HUE_NV 0x92AD #define GL_HSL_SATURATION_NV 0x92AE #define GL_HSL_COLOR_NV 0x92AF #define GL_HSL_LUMINOSITY_NV 0x92B0 #define GL_PLUS_CLAMPED_NV 0x92B1 #define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2 #define GL_MINUS_CLAMPED_NV 0x92B3 #define GL_INVERT_OVG_NV 0x92B4 typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void); typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value); #define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV) #define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV) #define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced) #endif /* GL_NV_blend_equation_advanced */ /* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */ #ifndef GL_NV_blend_equation_advanced_coherent #define GL_NV_blend_equation_advanced_coherent 1 #define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent) #endif /* GL_NV_blend_equation_advanced_coherent */ /* --------------------------- GL_NV_blend_square -------------------------- */ #ifndef GL_NV_blend_square #define GL_NV_blend_square 1 #define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) #endif /* GL_NV_blend_square */ /* ------------------------- GL_NV_compute_program5 ------------------------ */ #ifndef GL_NV_compute_program5 #define GL_NV_compute_program5 1 #define GL_COMPUTE_PROGRAM_NV 0x90FB #define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC #define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5) #endif /* GL_NV_compute_program5 */ /* ------------------------ GL_NV_conditional_render ----------------------- */ #ifndef GL_NV_conditional_render #define GL_NV_conditional_render 1 #define GL_QUERY_WAIT_NV 0x8E13 #define GL_QUERY_NO_WAIT_NV 0x8E14 #define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 #define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); #define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) #define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) #define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) #endif /* GL_NV_conditional_render */ /* ----------------------- GL_NV_conservative_raster ----------------------- */ #ifndef GL_NV_conservative_raster #define GL_NV_conservative_raster 1 #define GL_CONSERVATIVE_RASTERIZATION_NV 0x9346 #define GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV 0x9347 #define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348 #define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349 typedef void (GLAPIENTRY * PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits); #define glSubpixelPrecisionBiasNV GLEW_GET_FUN(__glewSubpixelPrecisionBiasNV) #define GLEW_NV_conservative_raster GLEW_GET_VAR(__GLEW_NV_conservative_raster) #endif /* GL_NV_conservative_raster */ /* -------------------- GL_NV_conservative_raster_dilate ------------------- */ #ifndef GL_NV_conservative_raster_dilate #define GL_NV_conservative_raster_dilate 1 #define GL_CONSERVATIVE_RASTER_DILATE_NV 0x9379 #define GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV 0x937A #define GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV 0x937B typedef void (GLAPIENTRY * PFNGLCONSERVATIVERASTERPARAMETERFNVPROC) (GLenum pname, GLfloat value); #define glConservativeRasterParameterfNV GLEW_GET_FUN(__glewConservativeRasterParameterfNV) #define GLEW_NV_conservative_raster_dilate GLEW_GET_VAR(__GLEW_NV_conservative_raster_dilate) #endif /* GL_NV_conservative_raster_dilate */ /* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ #ifndef GL_NV_copy_depth_to_color #define GL_NV_copy_depth_to_color 1 #define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E #define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F #define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) #endif /* GL_NV_copy_depth_to_color */ /* ---------------------------- GL_NV_copy_image --------------------------- */ #ifndef GL_NV_copy_image #define GL_NV_copy_image 1 typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); #define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) #define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) #endif /* GL_NV_copy_image */ /* -------------------------- GL_NV_deep_texture3D ------------------------- */ #ifndef GL_NV_deep_texture3D #define GL_NV_deep_texture3D 1 #define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0 #define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1 #define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D) #endif /* GL_NV_deep_texture3D */ /* ------------------------ GL_NV_depth_buffer_float ----------------------- */ #ifndef GL_NV_depth_buffer_float #define GL_NV_depth_buffer_float 1 #define GL_DEPTH_COMPONENT32F_NV 0x8DAB #define GL_DEPTH32F_STENCIL8_NV 0x8DAC #define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD #define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); #define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) #define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) #define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) #define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) #endif /* GL_NV_depth_buffer_float */ /* --------------------------- GL_NV_depth_clamp --------------------------- */ #ifndef GL_NV_depth_clamp #define GL_NV_depth_clamp 1 #define GL_DEPTH_CLAMP_NV 0x864F #define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) #endif /* GL_NV_depth_clamp */ /* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ #ifndef GL_NV_depth_range_unclamped #define GL_NV_depth_range_unclamped 1 #define GL_SAMPLE_COUNT_BITS_NV 0x8864 #define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 #define GL_QUERY_RESULT_NV 0x8866 #define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 #define GL_SAMPLE_COUNT_NV 0x8914 #define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) #endif /* GL_NV_depth_range_unclamped */ /* --------------------------- GL_NV_draw_texture -------------------------- */ #ifndef GL_NV_draw_texture #define GL_NV_draw_texture 1 typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1); #define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV) #define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture) #endif /* GL_NV_draw_texture */ /* ---------------------------- GL_NV_evaluators --------------------------- */ #ifndef GL_NV_evaluators #define GL_NV_evaluators 1 #define GL_EVAL_2D_NV 0x86C0 #define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 #define GL_MAP_TESSELLATION_NV 0x86C2 #define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 #define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 #define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 #define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 #define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 #define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 #define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 #define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA #define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB #define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC #define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD #define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE #define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF #define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 #define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 #define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 #define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 #define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 #define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 #define GL_MAX_MAP_TESSELLATION_NV 0x86D6 #define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void *points); typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points); typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); #define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) #define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) #define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) #define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) #define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) #define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) #define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) #define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) #define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) #define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) #endif /* GL_NV_evaluators */ /* ----------------------- GL_NV_explicit_multisample ---------------------- */ #ifndef GL_NV_explicit_multisample #define GL_NV_explicit_multisample 1 #define GL_SAMPLE_POSITION_NV 0x8E50 #define GL_SAMPLE_MASK_NV 0x8E51 #define GL_SAMPLE_MASK_VALUE_NV 0x8E52 #define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 #define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 #define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 #define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 #define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 #define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 #define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); #define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) #define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) #define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) #define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) #endif /* GL_NV_explicit_multisample */ /* ------------------------------ GL_NV_fence ------------------------------ */ #ifndef GL_NV_fence #define GL_NV_fence 1 #define GL_ALL_COMPLETED_NV 0x84F2 #define GL_FENCE_STATUS_NV 0x84F3 #define GL_FENCE_CONDITION_NV 0x84F4 typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); #define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) #define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) #define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) #define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) #define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) #define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) #define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) #define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) #endif /* GL_NV_fence */ /* -------------------------- GL_NV_fill_rectangle ------------------------- */ #ifndef GL_NV_fill_rectangle #define GL_NV_fill_rectangle 1 #define GL_FILL_RECTANGLE_NV 0x933C #define GLEW_NV_fill_rectangle GLEW_GET_VAR(__GLEW_NV_fill_rectangle) #endif /* GL_NV_fill_rectangle */ /* --------------------------- GL_NV_float_buffer -------------------------- */ #ifndef GL_NV_float_buffer #define GL_NV_float_buffer 1 #define GL_FLOAT_R_NV 0x8880 #define GL_FLOAT_RG_NV 0x8881 #define GL_FLOAT_RGB_NV 0x8882 #define GL_FLOAT_RGBA_NV 0x8883 #define GL_FLOAT_R16_NV 0x8884 #define GL_FLOAT_R32_NV 0x8885 #define GL_FLOAT_RG16_NV 0x8886 #define GL_FLOAT_RG32_NV 0x8887 #define GL_FLOAT_RGB16_NV 0x8888 #define GL_FLOAT_RGB32_NV 0x8889 #define GL_FLOAT_RGBA16_NV 0x888A #define GL_FLOAT_RGBA32_NV 0x888B #define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C #define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D #define GL_FLOAT_RGBA_MODE_NV 0x888E #define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) #endif /* GL_NV_float_buffer */ /* --------------------------- GL_NV_fog_distance -------------------------- */ #ifndef GL_NV_fog_distance #define GL_NV_fog_distance 1 #define GL_FOG_DISTANCE_MODE_NV 0x855A #define GL_EYE_RADIAL_NV 0x855B #define GL_EYE_PLANE_ABSOLUTE_NV 0x855C #define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) #endif /* GL_NV_fog_distance */ /* -------------------- GL_NV_fragment_coverage_to_color ------------------- */ #ifndef GL_NV_fragment_coverage_to_color #define GL_NV_fragment_coverage_to_color 1 #define GL_FRAGMENT_COVERAGE_TO_COLOR_NV 0x92DD #define GL_FRAGMENT_COVERAGE_COLOR_NV 0x92DE typedef void (GLAPIENTRY * PFNGLFRAGMENTCOVERAGECOLORNVPROC) (GLuint color); #define glFragmentCoverageColorNV GLEW_GET_FUN(__glewFragmentCoverageColorNV) #define GLEW_NV_fragment_coverage_to_color GLEW_GET_VAR(__GLEW_NV_fragment_coverage_to_color) #endif /* GL_NV_fragment_coverage_to_color */ /* ------------------------- GL_NV_fragment_program ------------------------ */ #ifndef GL_NV_fragment_program #define GL_NV_fragment_program 1 #define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 #define GL_FRAGMENT_PROGRAM_NV 0x8870 #define GL_MAX_TEXTURE_COORDS_NV 0x8871 #define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 #define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 #define GL_PROGRAM_ERROR_STRING_NV 0x8874 typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); #define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) #define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) #define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) #define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) #define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) #define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) #define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) #endif /* GL_NV_fragment_program */ /* ------------------------ GL_NV_fragment_program2 ------------------------ */ #ifndef GL_NV_fragment_program2 #define GL_NV_fragment_program2 1 #define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 #define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 #define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 #define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 #define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 #define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) #endif /* GL_NV_fragment_program2 */ /* ------------------------ GL_NV_fragment_program4 ------------------------ */ #ifndef GL_NV_fragment_program4 #define GL_NV_fragment_program4 1 #define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) #endif /* GL_NV_fragment_program4 */ /* --------------------- GL_NV_fragment_program_option --------------------- */ #ifndef GL_NV_fragment_program_option #define GL_NV_fragment_program_option 1 #define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) #endif /* GL_NV_fragment_program_option */ /* -------------------- GL_NV_fragment_shader_interlock -------------------- */ #ifndef GL_NV_fragment_shader_interlock #define GL_NV_fragment_shader_interlock 1 #define GLEW_NV_fragment_shader_interlock GLEW_GET_VAR(__GLEW_NV_fragment_shader_interlock) #endif /* GL_NV_fragment_shader_interlock */ /* -------------------- GL_NV_framebuffer_mixed_samples -------------------- */ #ifndef GL_NV_framebuffer_mixed_samples #define GL_NV_framebuffer_mixed_samples 1 #define GL_COLOR_SAMPLES_NV 0x8E20 #define GL_RASTER_MULTISAMPLE_EXT 0x9327 #define GL_RASTER_SAMPLES_EXT 0x9328 #define GL_MAX_RASTER_SAMPLES_EXT 0x9329 #define GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT 0x932A #define GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT 0x932B #define GL_EFFECTIVE_RASTER_SAMPLES_EXT 0x932C #define GL_DEPTH_SAMPLES_NV 0x932D #define GL_STENCIL_SAMPLES_NV 0x932E #define GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV 0x932F #define GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV 0x9330 #define GL_COVERAGE_MODULATION_TABLE_NV 0x9331 #define GL_COVERAGE_MODULATION_NV 0x9332 #define GL_COVERAGE_MODULATION_TABLE_SIZE_NV 0x9333 #define GLEW_NV_framebuffer_mixed_samples GLEW_GET_VAR(__GLEW_NV_framebuffer_mixed_samples) #endif /* GL_NV_framebuffer_mixed_samples */ /* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ #ifndef GL_NV_framebuffer_multisample_coverage #define GL_NV_framebuffer_multisample_coverage 1 #define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB #define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 #define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 #define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); #define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) #define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) #endif /* GL_NV_framebuffer_multisample_coverage */ /* ------------------------ GL_NV_geometry_program4 ------------------------ */ #ifndef GL_NV_geometry_program4 #define GL_NV_geometry_program4 1 #define GL_GEOMETRY_PROGRAM_NV 0x8C26 #define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 #define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); #define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) #define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) #endif /* GL_NV_geometry_program4 */ /* ------------------------- GL_NV_geometry_shader4 ------------------------ */ #ifndef GL_NV_geometry_shader4 #define GL_NV_geometry_shader4 1 #define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) #endif /* GL_NV_geometry_shader4 */ /* ------------------- GL_NV_geometry_shader_passthrough ------------------- */ #ifndef GL_NV_geometry_shader_passthrough #define GL_NV_geometry_shader_passthrough 1 #define GLEW_NV_geometry_shader_passthrough GLEW_GET_VAR(__GLEW_NV_geometry_shader_passthrough) #endif /* GL_NV_geometry_shader_passthrough */ /* --------------------------- GL_NV_gpu_program4 -------------------------- */ #ifndef GL_NV_gpu_program4 #define GL_NV_gpu_program4 1 #define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 #define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 #define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 #define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 #define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 #define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 #define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 #define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); #define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) #define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) #define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) #define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) #define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) #define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) #define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) #define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) #define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) #define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) #define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) #define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) #define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) #endif /* GL_NV_gpu_program4 */ /* --------------------------- GL_NV_gpu_program5 -------------------------- */ #ifndef GL_NV_gpu_program5 #define GL_NV_gpu_program5 1 #define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A #define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B #define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C #define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D #define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E #define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F #define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) #endif /* GL_NV_gpu_program5 */ /* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */ #ifndef GL_NV_gpu_program5_mem_extended #define GL_NV_gpu_program5_mem_extended 1 #define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended) #endif /* GL_NV_gpu_program5_mem_extended */ /* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ #ifndef GL_NV_gpu_program_fp64 #define GL_NV_gpu_program_fp64 1 #define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) #endif /* GL_NV_gpu_program_fp64 */ /* --------------------------- GL_NV_gpu_shader5 --------------------------- */ #ifndef GL_NV_gpu_shader5 #define GL_NV_gpu_shader5 1 #define GL_INT64_NV 0x140E #define GL_UNSIGNED_INT64_NV 0x140F #define GL_INT8_NV 0x8FE0 #define GL_INT8_VEC2_NV 0x8FE1 #define GL_INT8_VEC3_NV 0x8FE2 #define GL_INT8_VEC4_NV 0x8FE3 #define GL_INT16_NV 0x8FE4 #define GL_INT16_VEC2_NV 0x8FE5 #define GL_INT16_VEC3_NV 0x8FE6 #define GL_INT16_VEC4_NV 0x8FE7 #define GL_INT64_VEC2_NV 0x8FE9 #define GL_INT64_VEC3_NV 0x8FEA #define GL_INT64_VEC4_NV 0x8FEB #define GL_UNSIGNED_INT8_NV 0x8FEC #define GL_UNSIGNED_INT8_VEC2_NV 0x8FED #define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE #define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF #define GL_UNSIGNED_INT16_NV 0x8FF0 #define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 #define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 #define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 #define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 #define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 #define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 #define GL_FLOAT16_NV 0x8FF8 #define GL_FLOAT16_VEC2_NV 0x8FF9 #define GL_FLOAT16_VEC3_NV 0x8FFA #define GL_FLOAT16_VEC4_NV 0x8FFB typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); #define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) #define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) #define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) #define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) #define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) #define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) #define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) #define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) #define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) #define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) #define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) #define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) #define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) #define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) #define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) #define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) #define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) #define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) #define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) #define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) #define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) #define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) #define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) #define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) #define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) #define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) #define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) #define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) #define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) #define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) #define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) #define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) #define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) #define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) #define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) #endif /* GL_NV_gpu_shader5 */ /* ---------------------------- GL_NV_half_float --------------------------- */ #ifndef GL_NV_half_float #define GL_NV_half_float 1 #define GL_HALF_FLOAT_NV 0x140B typedef unsigned short GLhalf; typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); #define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) #define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) #define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) #define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) #define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) #define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) #define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) #define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) #define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) #define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) #define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) #define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) #define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) #define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) #define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) #define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) #define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) #define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) #define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) #define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) #define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) #define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) #define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) #define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) #define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) #define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) #define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) #define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) #define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) #define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) #define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) #define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) #define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) #define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) #define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) #define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) #define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) #define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) #define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) #define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) #define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) #define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) #define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) #define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) #define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) #define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) #define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) #endif /* GL_NV_half_float */ /* ------------------- GL_NV_internalformat_sample_query ------------------- */ #ifndef GL_NV_internalformat_sample_query #define GL_NV_internalformat_sample_query 1 #define GL_MULTISAMPLES_NV 0x9371 #define GL_SUPERSAMPLE_SCALE_X_NV 0x9372 #define GL_SUPERSAMPLE_SCALE_Y_NV 0x9373 #define GL_CONFORMANT_NV 0x9374 typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATSAMPLEIVNVPROC) (GLenum target, GLenum internalformat, GLsizei samples, GLenum pname, GLsizei bufSize, GLint* params); #define glGetInternalformatSampleivNV GLEW_GET_FUN(__glewGetInternalformatSampleivNV) #define GLEW_NV_internalformat_sample_query GLEW_GET_VAR(__GLEW_NV_internalformat_sample_query) #endif /* GL_NV_internalformat_sample_query */ /* ------------------------ GL_NV_light_max_exponent ----------------------- */ #ifndef GL_NV_light_max_exponent #define GL_NV_light_max_exponent 1 #define GL_MAX_SHININESS_NV 0x8504 #define GL_MAX_SPOT_EXPONENT_NV 0x8505 #define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) #endif /* GL_NV_light_max_exponent */ /* ----------------------- GL_NV_multisample_coverage ---------------------- */ #ifndef GL_NV_multisample_coverage #define GL_NV_multisample_coverage 1 #define GL_COLOR_SAMPLES_NV 0x8E20 #define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) #endif /* GL_NV_multisample_coverage */ /* --------------------- GL_NV_multisample_filter_hint --------------------- */ #ifndef GL_NV_multisample_filter_hint #define GL_NV_multisample_filter_hint 1 #define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 #define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) #endif /* GL_NV_multisample_filter_hint */ /* ------------------------- GL_NV_occlusion_query ------------------------- */ #ifndef GL_NV_occlusion_query #define GL_NV_occlusion_query 1 #define GL_PIXEL_COUNTER_BITS_NV 0x8864 #define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 #define GL_PIXEL_COUNT_NV 0x8866 #define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); #define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) #define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) #define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) #define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) #define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) #define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) #define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) #define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) #endif /* GL_NV_occlusion_query */ /* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ #ifndef GL_NV_packed_depth_stencil #define GL_NV_packed_depth_stencil 1 #define GL_DEPTH_STENCIL_NV 0x84F9 #define GL_UNSIGNED_INT_24_8_NV 0x84FA #define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) #endif /* GL_NV_packed_depth_stencil */ /* --------------------- GL_NV_parameter_buffer_object --------------------- */ #ifndef GL_NV_parameter_buffer_object #define GL_NV_parameter_buffer_object 1 #define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 #define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 #define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 #define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 #define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); #define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) #define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) #define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) #define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) #endif /* GL_NV_parameter_buffer_object */ /* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ #ifndef GL_NV_parameter_buffer_object2 #define GL_NV_parameter_buffer_object2 1 #define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) #endif /* GL_NV_parameter_buffer_object2 */ /* -------------------------- GL_NV_path_rendering ------------------------- */ #ifndef GL_NV_path_rendering #define GL_NV_path_rendering 1 #define GL_CLOSE_PATH_NV 0x00 #define GL_BOLD_BIT_NV 0x01 #define GL_GLYPH_WIDTH_BIT_NV 0x01 #define GL_GLYPH_HEIGHT_BIT_NV 0x02 #define GL_ITALIC_BIT_NV 0x02 #define GL_MOVE_TO_NV 0x02 #define GL_RELATIVE_MOVE_TO_NV 0x03 #define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04 #define GL_LINE_TO_NV 0x04 #define GL_RELATIVE_LINE_TO_NV 0x05 #define GL_HORIZONTAL_LINE_TO_NV 0x06 #define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07 #define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08 #define GL_VERTICAL_LINE_TO_NV 0x08 #define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09 #define GL_QUADRATIC_CURVE_TO_NV 0x0A #define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B #define GL_CUBIC_CURVE_TO_NV 0x0C #define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D #define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E #define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F #define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10 #define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10 #define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11 #define GL_SMALL_CCW_ARC_TO_NV 0x12 #define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13 #define GL_SMALL_CW_ARC_TO_NV 0x14 #define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15 #define GL_LARGE_CCW_ARC_TO_NV 0x16 #define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17 #define GL_LARGE_CW_ARC_TO_NV 0x18 #define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19 #define GL_CONIC_CURVE_TO_NV 0x1A #define GL_RELATIVE_CONIC_CURVE_TO_NV 0x1B #define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20 #define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40 #define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80 #define GL_ROUNDED_RECT_NV 0xE8 #define GL_RELATIVE_ROUNDED_RECT_NV 0xE9 #define GL_ROUNDED_RECT2_NV 0xEA #define GL_RELATIVE_ROUNDED_RECT2_NV 0xEB #define GL_ROUNDED_RECT4_NV 0xEC #define GL_RELATIVE_ROUNDED_RECT4_NV 0xED #define GL_ROUNDED_RECT8_NV 0xEE #define GL_RELATIVE_ROUNDED_RECT8_NV 0xEF #define GL_RESTART_PATH_NV 0xF0 #define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2 #define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4 #define GL_RECT_NV 0xF6 #define GL_RELATIVE_RECT_NV 0xF7 #define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8 #define GL_CIRCULAR_CW_ARC_TO_NV 0xFA #define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC #define GL_ARC_TO_NV 0xFE #define GL_RELATIVE_ARC_TO_NV 0xFF #define GL_GLYPH_HAS_KERNING_BIT_NV 0x100 #define GL_PRIMARY_COLOR_NV 0x852C #define GL_SECONDARY_COLOR_NV 0x852D #define GL_PRIMARY_COLOR 0x8577 #define GL_PATH_FORMAT_SVG_NV 0x9070 #define GL_PATH_FORMAT_PS_NV 0x9071 #define GL_STANDARD_FONT_NAME_NV 0x9072 #define GL_SYSTEM_FONT_NAME_NV 0x9073 #define GL_FILE_NAME_NV 0x9074 #define GL_PATH_STROKE_WIDTH_NV 0x9075 #define GL_PATH_END_CAPS_NV 0x9076 #define GL_PATH_INITIAL_END_CAP_NV 0x9077 #define GL_PATH_TERMINAL_END_CAP_NV 0x9078 #define GL_PATH_JOIN_STYLE_NV 0x9079 #define GL_PATH_MITER_LIMIT_NV 0x907A #define GL_PATH_DASH_CAPS_NV 0x907B #define GL_PATH_INITIAL_DASH_CAP_NV 0x907C #define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D #define GL_PATH_DASH_OFFSET_NV 0x907E #define GL_PATH_CLIENT_LENGTH_NV 0x907F #define GL_PATH_FILL_MODE_NV 0x9080 #define GL_PATH_FILL_MASK_NV 0x9081 #define GL_PATH_FILL_COVER_MODE_NV 0x9082 #define GL_PATH_STROKE_COVER_MODE_NV 0x9083 #define GL_PATH_STROKE_MASK_NV 0x9084 #define GL_PATH_STROKE_BOUND_NV 0x9086 #define GL_COUNT_UP_NV 0x9088 #define GL_COUNT_DOWN_NV 0x9089 #define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A #define GL_CONVEX_HULL_NV 0x908B #define GL_BOUNDING_BOX_NV 0x908D #define GL_TRANSLATE_X_NV 0x908E #define GL_TRANSLATE_Y_NV 0x908F #define GL_TRANSLATE_2D_NV 0x9090 #define GL_TRANSLATE_3D_NV 0x9091 #define GL_AFFINE_2D_NV 0x9092 #define GL_AFFINE_3D_NV 0x9094 #define GL_TRANSPOSE_AFFINE_2D_NV 0x9096 #define GL_TRANSPOSE_AFFINE_3D_NV 0x9098 #define GL_UTF8_NV 0x909A #define GL_UTF16_NV 0x909B #define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C #define GL_PATH_COMMAND_COUNT_NV 0x909D #define GL_PATH_COORD_COUNT_NV 0x909E #define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F #define GL_PATH_COMPUTED_LENGTH_NV 0x90A0 #define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1 #define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2 #define GL_SQUARE_NV 0x90A3 #define GL_ROUND_NV 0x90A4 #define GL_TRIANGULAR_NV 0x90A5 #define GL_BEVEL_NV 0x90A6 #define GL_MITER_REVERT_NV 0x90A7 #define GL_MITER_TRUNCATE_NV 0x90A8 #define GL_SKIP_MISSING_GLYPH_NV 0x90A9 #define GL_USE_MISSING_GLYPH_NV 0x90AA #define GL_PATH_ERROR_POSITION_NV 0x90AB #define GL_PATH_FOG_GEN_MODE_NV 0x90AC #define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD #define GL_ADJACENT_PAIRS_NV 0x90AE #define GL_FIRST_TO_REST_NV 0x90AF #define GL_PATH_GEN_MODE_NV 0x90B0 #define GL_PATH_GEN_COEFF_NV 0x90B1 #define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2 #define GL_PATH_GEN_COMPONENTS_NV 0x90B3 #define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4 #define GL_MOVE_TO_RESETS_NV 0x90B5 #define GL_MOVE_TO_CONTINUES_NV 0x90B6 #define GL_PATH_STENCIL_FUNC_NV 0x90B7 #define GL_PATH_STENCIL_REF_NV 0x90B8 #define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9 #define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD #define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE #define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF #define GL_FONT_GLYPHS_AVAILABLE_NV 0x9368 #define GL_FONT_TARGET_UNAVAILABLE_NV 0x9369 #define GL_FONT_UNAVAILABLE_NV 0x936A #define GL_FONT_UNINTELLIGIBLE_NV 0x936B #define GL_STANDARD_FONT_FORMAT_NV 0x936C #define GL_FRAGMENT_INPUT_NV 0x936D #define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000 #define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000 #define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000 #define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000 #define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000 #define GL_FONT_ASCENDER_BIT_NV 0x00200000 #define GL_FONT_DESCENDER_BIT_NV 0x00400000 #define GL_FONT_HEIGHT_BIT_NV 0x00800000 #define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000 #define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000 #define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000 #define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000 #define GL_FONT_HAS_KERNING_BIT_NV 0x10000000 #define GL_FONT_NUM_GLYPH_INDICES_BIT_NV 0x20000000 typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath); typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode); typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint path, GLenum coverMode); typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range); typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range); typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value); typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value); typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint path, GLubyte* commands); typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint path, GLfloat* coords); typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint path, GLfloat* dashArray); typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments); typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint firstPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics); typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLsizei stride, GLfloat *metrics); typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, GLfloat* value); typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, GLint* value); typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing); typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value); typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value); typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLfloat *params); typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight); typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path); typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y); typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOAD3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X2FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULT3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC) (GLenum matrixMode, const GLfloat* m); typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs); typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords); typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc); typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray); typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode); typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef GLenum (GLAPIENTRY * PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]); typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const void*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef GLenum (GLAPIENTRY * PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale); typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value); typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value); typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value); typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value); typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units); typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask); typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void *pathString); typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const void*coords); typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords); typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs); typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY); typedef void (GLAPIENTRY * PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat* coeffs); typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask); typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask, GLenum coverMode); typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues); typedef void (GLAPIENTRY * PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode); typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues); typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]); #define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV) #define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV) #define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV) #define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV) #define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV) #define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV) #define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV) #define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV) #define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV) #define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV) #define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV) #define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV) #define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV) #define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV) #define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV) #define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV) #define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV) #define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV) #define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV) #define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV) #define glGetProgramResourcefvNV GLEW_GET_FUN(__glewGetProgramResourcefvNV) #define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV) #define glIsPathNV GLEW_GET_FUN(__glewIsPathNV) #define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV) #define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV) #define glMatrixLoad3x2fNV GLEW_GET_FUN(__glewMatrixLoad3x2fNV) #define glMatrixLoad3x3fNV GLEW_GET_FUN(__glewMatrixLoad3x3fNV) #define glMatrixLoadTranspose3x3fNV GLEW_GET_FUN(__glewMatrixLoadTranspose3x3fNV) #define glMatrixMult3x2fNV GLEW_GET_FUN(__glewMatrixMult3x2fNV) #define glMatrixMult3x3fNV GLEW_GET_FUN(__glewMatrixMult3x3fNV) #define glMatrixMultTranspose3x3fNV GLEW_GET_FUN(__glewMatrixMultTranspose3x3fNV) #define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV) #define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV) #define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV) #define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV) #define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV) #define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV) #define glPathGlyphIndexArrayNV GLEW_GET_FUN(__glewPathGlyphIndexArrayNV) #define glPathGlyphIndexRangeNV GLEW_GET_FUN(__glewPathGlyphIndexRangeNV) #define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV) #define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV) #define glPathMemoryGlyphIndexArrayNV GLEW_GET_FUN(__glewPathMemoryGlyphIndexArrayNV) #define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV) #define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV) #define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV) #define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV) #define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV) #define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV) #define glPathStringNV GLEW_GET_FUN(__glewPathStringNV) #define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV) #define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV) #define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV) #define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV) #define glProgramPathFragmentInputGenNV GLEW_GET_FUN(__glewProgramPathFragmentInputGenNV) #define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV) #define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV) #define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV) #define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV) #define glStencilThenCoverFillPathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverFillPathInstancedNV) #define glStencilThenCoverFillPathNV GLEW_GET_FUN(__glewStencilThenCoverFillPathNV) #define glStencilThenCoverStrokePathInstancedNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathInstancedNV) #define glStencilThenCoverStrokePathNV GLEW_GET_FUN(__glewStencilThenCoverStrokePathNV) #define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV) #define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV) #define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering) #endif /* GL_NV_path_rendering */ /* -------------------- GL_NV_path_rendering_shared_edge ------------------- */ #ifndef GL_NV_path_rendering_shared_edge #define GL_NV_path_rendering_shared_edge 1 #define GL_SHARED_EDGE_NV 0xC0 #define GLEW_NV_path_rendering_shared_edge GLEW_GET_VAR(__GLEW_NV_path_rendering_shared_edge) #endif /* GL_NV_path_rendering_shared_edge */ /* ------------------------- GL_NV_pixel_data_range ------------------------ */ #ifndef GL_NV_pixel_data_range #define GL_NV_pixel_data_range 1 #define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 #define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 #define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A #define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B #define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C #define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void *pointer); #define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) #define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) #define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) #endif /* GL_NV_pixel_data_range */ /* --------------------------- GL_NV_point_sprite -------------------------- */ #ifndef GL_NV_point_sprite #define GL_NV_point_sprite 1 #define GL_POINT_SPRITE_NV 0x8861 #define GL_COORD_REPLACE_NV 0x8862 #define GL_POINT_SPRITE_R_MODE_NV 0x8863 typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); #define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) #define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) #define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) #endif /* GL_NV_point_sprite */ /* -------------------------- GL_NV_present_video -------------------------- */ #ifndef GL_NV_present_video #define GL_NV_present_video 1 #define GL_FRAME_NV 0x8E26 #define GL_FIELDS_NV 0x8E27 #define GL_CURRENT_TIME_NV 0x8E28 #define GL_NUM_FILL_STREAMS_NV 0x8E29 #define GL_PRESENT_TIME_NV 0x8E2A #define GL_PRESENT_DURATION_NV 0x8E2B typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); #define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) #define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) #define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) #define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) #define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) #define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) #define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) #endif /* GL_NV_present_video */ /* ------------------------ GL_NV_primitive_restart ------------------------ */ #ifndef GL_NV_primitive_restart #define GL_NV_primitive_restart 1 #define GL_PRIMITIVE_RESTART_NV 0x8558 #define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); #define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) #define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) #define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) #endif /* GL_NV_primitive_restart */ /* ------------------------ GL_NV_register_combiners ----------------------- */ #ifndef GL_NV_register_combiners #define GL_NV_register_combiners 1 #define GL_REGISTER_COMBINERS_NV 0x8522 #define GL_VARIABLE_A_NV 0x8523 #define GL_VARIABLE_B_NV 0x8524 #define GL_VARIABLE_C_NV 0x8525 #define GL_VARIABLE_D_NV 0x8526 #define GL_VARIABLE_E_NV 0x8527 #define GL_VARIABLE_F_NV 0x8528 #define GL_VARIABLE_G_NV 0x8529 #define GL_CONSTANT_COLOR0_NV 0x852A #define GL_CONSTANT_COLOR1_NV 0x852B #define GL_PRIMARY_COLOR_NV 0x852C #define GL_SECONDARY_COLOR_NV 0x852D #define GL_SPARE0_NV 0x852E #define GL_SPARE1_NV 0x852F #define GL_DISCARD_NV 0x8530 #define GL_E_TIMES_F_NV 0x8531 #define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 #define GL_UNSIGNED_IDENTITY_NV 0x8536 #define GL_UNSIGNED_INVERT_NV 0x8537 #define GL_EXPAND_NORMAL_NV 0x8538 #define GL_EXPAND_NEGATE_NV 0x8539 #define GL_HALF_BIAS_NORMAL_NV 0x853A #define GL_HALF_BIAS_NEGATE_NV 0x853B #define GL_SIGNED_IDENTITY_NV 0x853C #define GL_SIGNED_NEGATE_NV 0x853D #define GL_SCALE_BY_TWO_NV 0x853E #define GL_SCALE_BY_FOUR_NV 0x853F #define GL_SCALE_BY_ONE_HALF_NV 0x8540 #define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 #define GL_COMBINER_INPUT_NV 0x8542 #define GL_COMBINER_MAPPING_NV 0x8543 #define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 #define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 #define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 #define GL_COMBINER_MUX_SUM_NV 0x8547 #define GL_COMBINER_SCALE_NV 0x8548 #define GL_COMBINER_BIAS_NV 0x8549 #define GL_COMBINER_AB_OUTPUT_NV 0x854A #define GL_COMBINER_CD_OUTPUT_NV 0x854B #define GL_COMBINER_SUM_OUTPUT_NV 0x854C #define GL_MAX_GENERAL_COMBINERS_NV 0x854D #define GL_NUM_GENERAL_COMBINERS_NV 0x854E #define GL_COLOR_SUM_CLAMP_NV 0x854F #define GL_COMBINER0_NV 0x8550 #define GL_COMBINER1_NV 0x8551 #define GL_COMBINER2_NV 0x8552 #define GL_COMBINER3_NV 0x8553 #define GL_COMBINER4_NV 0x8554 #define GL_COMBINER5_NV 0x8555 #define GL_COMBINER6_NV 0x8556 #define GL_COMBINER7_NV 0x8557 typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); #define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) #define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) #define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) #define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) #define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) #define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) #define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) #define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) #define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) #define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) #define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) #define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) #define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) #define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) #endif /* GL_NV_register_combiners */ /* ----------------------- GL_NV_register_combiners2 ----------------------- */ #ifndef GL_NV_register_combiners2 #define GL_NV_register_combiners2 1 #define GL_PER_STAGE_CONSTANTS_NV 0x8535 typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); #define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) #define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) #define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) #endif /* GL_NV_register_combiners2 */ /* ------------------------- GL_NV_sample_locations ------------------------ */ #ifndef GL_NV_sample_locations #define GL_NV_sample_locations 1 #define GL_SAMPLE_LOCATION_NV 0x8E50 #define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D #define GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV 0x933E #define GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV 0x933F #define GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV 0x9340 #define GL_PROGRAMMABLE_SAMPLE_LOCATION_NV 0x9341 #define GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV 0x9342 #define GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV 0x9343 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLenum target, GLuint start, GLsizei count, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC) (GLuint framebuffer, GLuint start, GLsizei count, const GLfloat* v); #define glFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewFramebufferSampleLocationsfvNV) #define glNamedFramebufferSampleLocationsfvNV GLEW_GET_FUN(__glewNamedFramebufferSampleLocationsfvNV) #define GLEW_NV_sample_locations GLEW_GET_VAR(__GLEW_NV_sample_locations) #endif /* GL_NV_sample_locations */ /* ------------------ GL_NV_sample_mask_override_coverage ------------------ */ #ifndef GL_NV_sample_mask_override_coverage #define GL_NV_sample_mask_override_coverage 1 #define GLEW_NV_sample_mask_override_coverage GLEW_GET_VAR(__GLEW_NV_sample_mask_override_coverage) #endif /* GL_NV_sample_mask_override_coverage */ /* ---------------------- GL_NV_shader_atomic_counters --------------------- */ #ifndef GL_NV_shader_atomic_counters #define GL_NV_shader_atomic_counters 1 #define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters) #endif /* GL_NV_shader_atomic_counters */ /* ----------------------- GL_NV_shader_atomic_float ----------------------- */ #ifndef GL_NV_shader_atomic_float #define GL_NV_shader_atomic_float 1 #define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float) #endif /* GL_NV_shader_atomic_float */ /* -------------------- GL_NV_shader_atomic_fp16_vector -------------------- */ #ifndef GL_NV_shader_atomic_fp16_vector #define GL_NV_shader_atomic_fp16_vector 1 #define GLEW_NV_shader_atomic_fp16_vector GLEW_GET_VAR(__GLEW_NV_shader_atomic_fp16_vector) #endif /* GL_NV_shader_atomic_fp16_vector */ /* ----------------------- GL_NV_shader_atomic_int64 ----------------------- */ #ifndef GL_NV_shader_atomic_int64 #define GL_NV_shader_atomic_int64 1 #define GLEW_NV_shader_atomic_int64 GLEW_GET_VAR(__GLEW_NV_shader_atomic_int64) #endif /* GL_NV_shader_atomic_int64 */ /* ------------------------ GL_NV_shader_buffer_load ----------------------- */ #ifndef GL_NV_shader_buffer_load #define GL_NV_shader_buffer_load 1 #define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D #define GL_GPU_ADDRESS_NV 0x8F34 #define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); #define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) #define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) #define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) #define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) #define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) #define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) #define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) #define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) #define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) #define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) #define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) #define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) #define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) #define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) #endif /* GL_NV_shader_buffer_load */ /* ------------------- GL_NV_shader_storage_buffer_object ------------------ */ #ifndef GL_NV_shader_storage_buffer_object #define GL_NV_shader_storage_buffer_object 1 #define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object) #endif /* GL_NV_shader_storage_buffer_object */ /* ----------------------- GL_NV_shader_thread_group ----------------------- */ #ifndef GL_NV_shader_thread_group #define GL_NV_shader_thread_group 1 #define GL_WARP_SIZE_NV 0x9339 #define GL_WARPS_PER_SM_NV 0x933A #define GL_SM_COUNT_NV 0x933B #define GLEW_NV_shader_thread_group GLEW_GET_VAR(__GLEW_NV_shader_thread_group) #endif /* GL_NV_shader_thread_group */ /* ---------------------- GL_NV_shader_thread_shuffle ---------------------- */ #ifndef GL_NV_shader_thread_shuffle #define GL_NV_shader_thread_shuffle 1 #define GLEW_NV_shader_thread_shuffle GLEW_GET_VAR(__GLEW_NV_shader_thread_shuffle) #endif /* GL_NV_shader_thread_shuffle */ /* ---------------------- GL_NV_tessellation_program5 ---------------------- */ #ifndef GL_NV_tessellation_program5 #define GL_NV_tessellation_program5 1 #define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 #define GL_TESS_CONTROL_PROGRAM_NV 0x891E #define GL_TESS_EVALUATION_PROGRAM_NV 0x891F #define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 #define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 #define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) #endif /* GL_NV_tessellation_program5 */ /* -------------------------- GL_NV_texgen_emboss -------------------------- */ #ifndef GL_NV_texgen_emboss #define GL_NV_texgen_emboss 1 #define GL_EMBOSS_LIGHT_NV 0x855D #define GL_EMBOSS_CONSTANT_NV 0x855E #define GL_EMBOSS_MAP_NV 0x855F #define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) #endif /* GL_NV_texgen_emboss */ /* ------------------------ GL_NV_texgen_reflection ------------------------ */ #ifndef GL_NV_texgen_reflection #define GL_NV_texgen_reflection 1 #define GL_NORMAL_MAP_NV 0x8511 #define GL_REFLECTION_MAP_NV 0x8512 #define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) #endif /* GL_NV_texgen_reflection */ /* ------------------------- GL_NV_texture_barrier ------------------------- */ #ifndef GL_NV_texture_barrier #define GL_NV_texture_barrier 1 typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); #define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) #define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) #endif /* GL_NV_texture_barrier */ /* --------------------- GL_NV_texture_compression_vtc --------------------- */ #ifndef GL_NV_texture_compression_vtc #define GL_NV_texture_compression_vtc 1 #define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) #endif /* GL_NV_texture_compression_vtc */ /* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ #ifndef GL_NV_texture_env_combine4 #define GL_NV_texture_env_combine4 1 #define GL_COMBINE4_NV 0x8503 #define GL_SOURCE3_RGB_NV 0x8583 #define GL_SOURCE3_ALPHA_NV 0x858B #define GL_OPERAND3_RGB_NV 0x8593 #define GL_OPERAND3_ALPHA_NV 0x859B #define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) #endif /* GL_NV_texture_env_combine4 */ /* ---------------------- GL_NV_texture_expand_normal ---------------------- */ #ifndef GL_NV_texture_expand_normal #define GL_NV_texture_expand_normal 1 #define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F #define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) #endif /* GL_NV_texture_expand_normal */ /* ----------------------- GL_NV_texture_multisample ----------------------- */ #ifndef GL_NV_texture_multisample #define GL_NV_texture_multisample 1 #define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045 #define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046 typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations); #define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV) #define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV) #define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV) #define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV) #define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV) #define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV) #define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample) #endif /* GL_NV_texture_multisample */ /* ------------------------ GL_NV_texture_rectangle ------------------------ */ #ifndef GL_NV_texture_rectangle #define GL_NV_texture_rectangle 1 #define GL_TEXTURE_RECTANGLE_NV 0x84F5 #define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 #define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 #define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 #define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) #endif /* GL_NV_texture_rectangle */ /* -------------------------- GL_NV_texture_shader ------------------------- */ #ifndef GL_NV_texture_shader #define GL_NV_texture_shader 1 #define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C #define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D #define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E #define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 #define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA #define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB #define GL_DSDT_MAG_INTENSITY_NV 0x86DC #define GL_SHADER_CONSISTENT_NV 0x86DD #define GL_TEXTURE_SHADER_NV 0x86DE #define GL_SHADER_OPERATION_NV 0x86DF #define GL_CULL_MODES_NV 0x86E0 #define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 #define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 #define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 #define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 #define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 #define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 #define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 #define GL_CONST_EYE_NV 0x86E5 #define GL_PASS_THROUGH_NV 0x86E6 #define GL_CULL_FRAGMENT_NV 0x86E7 #define GL_OFFSET_TEXTURE_2D_NV 0x86E8 #define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 #define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA #define GL_DOT_PRODUCT_NV 0x86EC #define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED #define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE #define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 #define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 #define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 #define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 #define GL_HILO_NV 0x86F4 #define GL_DSDT_NV 0x86F5 #define GL_DSDT_MAG_NV 0x86F6 #define GL_DSDT_MAG_VIB_NV 0x86F7 #define GL_HILO16_NV 0x86F8 #define GL_SIGNED_HILO_NV 0x86F9 #define GL_SIGNED_HILO16_NV 0x86FA #define GL_SIGNED_RGBA_NV 0x86FB #define GL_SIGNED_RGBA8_NV 0x86FC #define GL_SIGNED_RGB_NV 0x86FE #define GL_SIGNED_RGB8_NV 0x86FF #define GL_SIGNED_LUMINANCE_NV 0x8701 #define GL_SIGNED_LUMINANCE8_NV 0x8702 #define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 #define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 #define GL_SIGNED_ALPHA_NV 0x8705 #define GL_SIGNED_ALPHA8_NV 0x8706 #define GL_SIGNED_INTENSITY_NV 0x8707 #define GL_SIGNED_INTENSITY8_NV 0x8708 #define GL_DSDT8_NV 0x8709 #define GL_DSDT8_MAG8_NV 0x870A #define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B #define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C #define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D #define GL_HI_SCALE_NV 0x870E #define GL_LO_SCALE_NV 0x870F #define GL_DS_SCALE_NV 0x8710 #define GL_DT_SCALE_NV 0x8711 #define GL_MAGNITUDE_SCALE_NV 0x8712 #define GL_VIBRANCE_SCALE_NV 0x8713 #define GL_HI_BIAS_NV 0x8714 #define GL_LO_BIAS_NV 0x8715 #define GL_DS_BIAS_NV 0x8716 #define GL_DT_BIAS_NV 0x8717 #define GL_MAGNITUDE_BIAS_NV 0x8718 #define GL_VIBRANCE_BIAS_NV 0x8719 #define GL_TEXTURE_BORDER_VALUES_NV 0x871A #define GL_TEXTURE_HI_SIZE_NV 0x871B #define GL_TEXTURE_LO_SIZE_NV 0x871C #define GL_TEXTURE_DS_SIZE_NV 0x871D #define GL_TEXTURE_DT_SIZE_NV 0x871E #define GL_TEXTURE_MAG_SIZE_NV 0x871F #define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) #endif /* GL_NV_texture_shader */ /* ------------------------- GL_NV_texture_shader2 ------------------------- */ #ifndef GL_NV_texture_shader2 #define GL_NV_texture_shader2 1 #define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA #define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB #define GL_DSDT_MAG_INTENSITY_NV 0x86DC #define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF #define GL_HILO_NV 0x86F4 #define GL_DSDT_NV 0x86F5 #define GL_DSDT_MAG_NV 0x86F6 #define GL_DSDT_MAG_VIB_NV 0x86F7 #define GL_HILO16_NV 0x86F8 #define GL_SIGNED_HILO_NV 0x86F9 #define GL_SIGNED_HILO16_NV 0x86FA #define GL_SIGNED_RGBA_NV 0x86FB #define GL_SIGNED_RGBA8_NV 0x86FC #define GL_SIGNED_RGB_NV 0x86FE #define GL_SIGNED_RGB8_NV 0x86FF #define GL_SIGNED_LUMINANCE_NV 0x8701 #define GL_SIGNED_LUMINANCE8_NV 0x8702 #define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 #define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 #define GL_SIGNED_ALPHA_NV 0x8705 #define GL_SIGNED_ALPHA8_NV 0x8706 #define GL_SIGNED_INTENSITY_NV 0x8707 #define GL_SIGNED_INTENSITY8_NV 0x8708 #define GL_DSDT8_NV 0x8709 #define GL_DSDT8_MAG8_NV 0x870A #define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B #define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C #define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D #define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) #endif /* GL_NV_texture_shader2 */ /* ------------------------- GL_NV_texture_shader3 ------------------------- */ #ifndef GL_NV_texture_shader3 #define GL_NV_texture_shader3 1 #define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 #define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 #define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 #define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 #define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 #define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 #define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 #define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 #define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 #define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 #define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A #define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B #define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C #define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D #define GL_HILO8_NV 0x885E #define GL_SIGNED_HILO8_NV 0x885F #define GL_FORCE_BLUE_TO_ONE_NV 0x8860 #define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) #endif /* GL_NV_texture_shader3 */ /* ------------------------ GL_NV_transform_feedback ----------------------- */ #ifndef GL_NV_transform_feedback #define GL_NV_transform_feedback 1 #define GL_BACK_PRIMARY_COLOR_NV 0x8C77 #define GL_BACK_SECONDARY_COLOR_NV 0x8C78 #define GL_TEXTURE_COORD_NV 0x8C79 #define GL_CLIP_DISTANCE_NV 0x8C7A #define GL_VERTEX_ID_NV 0x8C7B #define GL_PRIMITIVE_ID_NV 0x8C7C #define GL_GENERIC_ATTRIB_NV 0x8C7D #define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E #define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 #define GL_ACTIVE_VARYINGS_NV 0x8C81 #define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 #define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 #define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 #define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 #define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 #define GL_PRIMITIVES_GENERATED_NV 0x8C87 #define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 #define GL_RASTERIZER_DISCARD_NV 0x8C89 #define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A #define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B #define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C #define GL_SEPARATE_ATTRIBS_NV 0x8C8D #define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E #define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); #define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) #define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) #define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) #define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) #define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) #define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) #define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) #define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) #define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) #define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) #define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) #define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) #endif /* GL_NV_transform_feedback */ /* ----------------------- GL_NV_transform_feedback2 ----------------------- */ #ifndef GL_NV_transform_feedback2 #define GL_NV_transform_feedback2 1 #define GL_TRANSFORM_FEEDBACK_NV 0x8E22 #define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 #define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 #define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); #define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) #define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) #define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) #define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) #define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) #define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) #define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) #define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) #endif /* GL_NV_transform_feedback2 */ /* ------------------ GL_NV_uniform_buffer_unified_memory ------------------ */ #ifndef GL_NV_uniform_buffer_unified_memory #define GL_NV_uniform_buffer_unified_memory 1 #define GL_UNIFORM_BUFFER_UNIFIED_NV 0x936E #define GL_UNIFORM_BUFFER_ADDRESS_NV 0x936F #define GL_UNIFORM_BUFFER_LENGTH_NV 0x9370 #define GLEW_NV_uniform_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_uniform_buffer_unified_memory) #endif /* GL_NV_uniform_buffer_unified_memory */ /* -------------------------- GL_NV_vdpau_interop -------------------------- */ #ifndef GL_NV_vdpau_interop #define GL_NV_vdpau_interop 1 #define GL_SURFACE_STATE_NV 0x86EB #define GL_SURFACE_REGISTERED_NV 0x86FD #define GL_SURFACE_MAPPED_NV 0x8700 #define GL_WRITE_DISCARD_NV 0x88BE typedef GLintptr GLvdpauSurfaceNV; typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const void*getProcAddress); typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); #define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) #define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) #define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) #define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) #define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) #define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) #define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) #define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) #define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) #define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) #define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) #endif /* GL_NV_vdpau_interop */ /* ------------------------ GL_NV_vertex_array_range ----------------------- */ #ifndef GL_NV_vertex_array_range #define GL_NV_vertex_array_range 1 #define GL_VERTEX_ARRAY_RANGE_NV 0x851D #define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E #define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F #define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 #define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void *pointer); #define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) #define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) #define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) #endif /* GL_NV_vertex_array_range */ /* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ #ifndef GL_NV_vertex_array_range2 #define GL_NV_vertex_array_range2 1 #define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 #define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) #endif /* GL_NV_vertex_array_range2 */ /* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ #ifndef GL_NV_vertex_attrib_integer_64bit #define GL_NV_vertex_attrib_integer_64bit 1 #define GL_INT64_NV 0x140E #define GL_UNSIGNED_INT64_NV 0x140F typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); #define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) #define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) #define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) #define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) #define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) #define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) #define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) #define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) #define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) #define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) #define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) #define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) #define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) #define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) #define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) #define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) #define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) #define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) #define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) #define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) #endif /* GL_NV_vertex_attrib_integer_64bit */ /* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ #ifndef GL_NV_vertex_buffer_unified_memory #define GL_NV_vertex_buffer_unified_memory 1 #define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E #define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F #define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 #define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 #define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 #define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 #define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 #define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 #define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 #define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 #define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 #define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 #define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A #define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B #define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C #define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D #define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E #define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F #define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 #define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 #define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 #define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 #define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 #define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 #define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); #define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) #define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) #define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) #define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) #define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) #define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) #define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) #define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) #define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) #define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) #define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) #define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) #define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) #endif /* GL_NV_vertex_buffer_unified_memory */ /* -------------------------- GL_NV_vertex_program ------------------------- */ #ifndef GL_NV_vertex_program #define GL_NV_vertex_program 1 #define GL_VERTEX_PROGRAM_NV 0x8620 #define GL_VERTEX_STATE_PROGRAM_NV 0x8621 #define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 #define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 #define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 #define GL_CURRENT_ATTRIB_NV 0x8626 #define GL_PROGRAM_LENGTH_NV 0x8627 #define GL_PROGRAM_STRING_NV 0x8628 #define GL_MODELVIEW_PROJECTION_NV 0x8629 #define GL_IDENTITY_NV 0x862A #define GL_INVERSE_NV 0x862B #define GL_TRANSPOSE_NV 0x862C #define GL_INVERSE_TRANSPOSE_NV 0x862D #define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E #define GL_MAX_TRACK_MATRICES_NV 0x862F #define GL_MATRIX0_NV 0x8630 #define GL_MATRIX1_NV 0x8631 #define GL_MATRIX2_NV 0x8632 #define GL_MATRIX3_NV 0x8633 #define GL_MATRIX4_NV 0x8634 #define GL_MATRIX5_NV 0x8635 #define GL_MATRIX6_NV 0x8636 #define GL_MATRIX7_NV 0x8637 #define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 #define GL_CURRENT_MATRIX_NV 0x8641 #define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 #define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 #define GL_PROGRAM_PARAMETER_NV 0x8644 #define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 #define GL_PROGRAM_TARGET_NV 0x8646 #define GL_PROGRAM_RESIDENT_NV 0x8647 #define GL_TRACK_MATRIX_NV 0x8648 #define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 #define GL_VERTEX_PROGRAM_BINDING_NV 0x864A #define GL_PROGRAM_ERROR_POSITION_NV 0x864B #define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 #define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 #define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 #define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 #define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 #define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 #define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 #define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 #define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 #define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 #define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A #define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B #define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C #define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D #define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E #define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F #define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 #define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 #define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 #define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 #define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 #define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 #define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 #define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 #define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 #define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 #define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A #define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B #define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C #define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D #define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E #define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F #define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 #define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 #define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 #define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 #define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 #define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 #define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 #define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 #define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 #define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 #define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A #define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B #define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C #define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D #define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E #define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, void** pointer); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); #define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) #define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) #define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) #define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) #define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) #define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) #define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) #define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) #define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) #define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) #define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) #define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) #define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) #define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) #define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) #define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) #define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) #define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) #define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) #define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) #define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) #define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) #define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) #define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) #define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) #define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) #define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) #define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) #define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) #define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) #define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) #define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) #define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) #define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) #define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) #define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) #define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) #define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) #define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) #define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) #define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) #define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) #define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) #define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) #define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) #define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) #define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) #define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) #define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) #define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) #define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) #define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) #define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) #define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) #define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) #define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) #define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) #define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) #define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) #define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) #define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) #define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) #define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) #define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) #define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) #endif /* GL_NV_vertex_program */ /* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ #ifndef GL_NV_vertex_program1_1 #define GL_NV_vertex_program1_1 1 #define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) #endif /* GL_NV_vertex_program1_1 */ /* ------------------------- GL_NV_vertex_program2 ------------------------- */ #ifndef GL_NV_vertex_program2 #define GL_NV_vertex_program2 1 #define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) #endif /* GL_NV_vertex_program2 */ /* ---------------------- GL_NV_vertex_program2_option --------------------- */ #ifndef GL_NV_vertex_program2_option #define GL_NV_vertex_program2_option 1 #define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 #define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 #define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) #endif /* GL_NV_vertex_program2_option */ /* ------------------------- GL_NV_vertex_program3 ------------------------- */ #ifndef GL_NV_vertex_program3 #define GL_NV_vertex_program3 1 #define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C #define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) #endif /* GL_NV_vertex_program3 */ /* ------------------------- GL_NV_vertex_program4 ------------------------- */ #ifndef GL_NV_vertex_program4 #define GL_NV_vertex_program4 1 #define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD #define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) #endif /* GL_NV_vertex_program4 */ /* -------------------------- GL_NV_video_capture -------------------------- */ #ifndef GL_NV_video_capture #define GL_NV_video_capture 1 #define GL_VIDEO_BUFFER_NV 0x9020 #define GL_VIDEO_BUFFER_BINDING_NV 0x9021 #define GL_FIELD_UPPER_NV 0x9022 #define GL_FIELD_LOWER_NV 0x9023 #define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 #define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 #define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 #define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 #define GL_VIDEO_BUFFER_PITCH_NV 0x9028 #define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 #define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A #define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B #define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C #define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D #define GL_PARTIAL_SUCCESS_NV 0x902E #define GL_SUCCESS_NV 0x902F #define GL_FAILURE_NV 0x9030 #define GL_YCBYCR8_422_NV 0x9031 #define GL_YCBAYCR8A_4224_NV 0x9032 #define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 #define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 #define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 #define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 #define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 #define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 #define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 #define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A #define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B #define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params); typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time); typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params); typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params); #define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV) #define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV) #define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV) #define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV) #define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV) #define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV) #define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV) #define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV) #define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV) #define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV) #define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV) #define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV) #define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture) #endif /* GL_NV_video_capture */ /* ------------------------- GL_NV_viewport_array2 ------------------------- */ #ifndef GL_NV_viewport_array2 #define GL_NV_viewport_array2 1 #define GLEW_NV_viewport_array2 GLEW_GET_VAR(__GLEW_NV_viewport_array2) #endif /* GL_NV_viewport_array2 */ /* ------------------------ GL_OES_byte_coordinates ------------------------ */ #ifndef GL_OES_byte_coordinates #define GL_OES_byte_coordinates 1 #define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) #endif /* GL_OES_byte_coordinates */ /* ------------------- GL_OES_compressed_paletted_texture ------------------ */ #ifndef GL_OES_compressed_paletted_texture #define GL_OES_compressed_paletted_texture 1 #define GL_PALETTE4_RGB8_OES 0x8B90 #define GL_PALETTE4_RGBA8_OES 0x8B91 #define GL_PALETTE4_R5_G6_B5_OES 0x8B92 #define GL_PALETTE4_RGBA4_OES 0x8B93 #define GL_PALETTE4_RGB5_A1_OES 0x8B94 #define GL_PALETTE8_RGB8_OES 0x8B95 #define GL_PALETTE8_RGBA8_OES 0x8B96 #define GL_PALETTE8_R5_G6_B5_OES 0x8B97 #define GL_PALETTE8_RGBA4_OES 0x8B98 #define GL_PALETTE8_RGB5_A1_OES 0x8B99 #define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) #endif /* GL_OES_compressed_paletted_texture */ /* --------------------------- GL_OES_read_format -------------------------- */ #ifndef GL_OES_read_format #define GL_OES_read_format 1 #define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A #define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B #define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) #endif /* GL_OES_read_format */ /* ------------------------ GL_OES_single_precision ------------------------ */ #ifndef GL_OES_single_precision #define GL_OES_single_precision 1 typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampf depth); typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); #define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) #define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) #define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) #define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) #define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) #define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) #define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) #endif /* GL_OES_single_precision */ /* ---------------------------- GL_OML_interlace --------------------------- */ #ifndef GL_OML_interlace #define GL_OML_interlace 1 #define GL_INTERLACE_OML 0x8980 #define GL_INTERLACE_READ_OML 0x8981 #define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) #endif /* GL_OML_interlace */ /* ---------------------------- GL_OML_resample ---------------------------- */ #ifndef GL_OML_resample #define GL_OML_resample 1 #define GL_PACK_RESAMPLE_OML 0x8984 #define GL_UNPACK_RESAMPLE_OML 0x8985 #define GL_RESAMPLE_REPLICATE_OML 0x8986 #define GL_RESAMPLE_ZERO_FILL_OML 0x8987 #define GL_RESAMPLE_AVERAGE_OML 0x8988 #define GL_RESAMPLE_DECIMATE_OML 0x8989 #define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) #endif /* GL_OML_resample */ /* ---------------------------- GL_OML_subsample --------------------------- */ #ifndef GL_OML_subsample #define GL_OML_subsample 1 #define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 #define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 #define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) #endif /* GL_OML_subsample */ /* ---------------------------- GL_OVR_multiview --------------------------- */ #ifndef GL_OVR_multiview #define GL_OVR_multiview 1 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR 0x9630 #define GL_MAX_VIEWS_OVR 0x9631 #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR 0x9632 #define GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR 0x9633 typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); #define glFramebufferTextureMultiviewOVR GLEW_GET_FUN(__glewFramebufferTextureMultiviewOVR) #define GLEW_OVR_multiview GLEW_GET_VAR(__GLEW_OVR_multiview) #endif /* GL_OVR_multiview */ /* --------------------------- GL_OVR_multiview2 --------------------------- */ #ifndef GL_OVR_multiview2 #define GL_OVR_multiview2 1 #define GLEW_OVR_multiview2 GLEW_GET_VAR(__GLEW_OVR_multiview2) #endif /* GL_OVR_multiview2 */ /* --------------------------- GL_PGI_misc_hints --------------------------- */ #ifndef GL_PGI_misc_hints #define GL_PGI_misc_hints 1 #define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 #define GL_CONSERVE_MEMORY_HINT_PGI 107005 #define GL_RECLAIM_MEMORY_HINT_PGI 107006 #define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 #define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 #define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 #define GL_ALWAYS_FAST_HINT_PGI 107020 #define GL_ALWAYS_SOFT_HINT_PGI 107021 #define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 #define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 #define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 #define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 #define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 #define GL_STRICT_LIGHTING_HINT_PGI 107031 #define GL_STRICT_SCISSOR_HINT_PGI 107032 #define GL_FULL_STIPPLE_HINT_PGI 107033 #define GL_CLIP_NEAR_HINT_PGI 107040 #define GL_CLIP_FAR_HINT_PGI 107041 #define GL_WIDE_LINE_HINT_PGI 107042 #define GL_BACK_NORMALS_HINT_PGI 107043 #define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) #endif /* GL_PGI_misc_hints */ /* -------------------------- GL_PGI_vertex_hints -------------------------- */ #ifndef GL_PGI_vertex_hints #define GL_PGI_vertex_hints 1 #define GL_VERTEX23_BIT_PGI 0x00000004 #define GL_VERTEX4_BIT_PGI 0x00000008 #define GL_COLOR3_BIT_PGI 0x00010000 #define GL_COLOR4_BIT_PGI 0x00020000 #define GL_EDGEFLAG_BIT_PGI 0x00040000 #define GL_INDEX_BIT_PGI 0x00080000 #define GL_MAT_AMBIENT_BIT_PGI 0x00100000 #define GL_VERTEX_DATA_HINT_PGI 107050 #define GL_VERTEX_CONSISTENT_HINT_PGI 107051 #define GL_MATERIAL_SIDE_HINT_PGI 107052 #define GL_MAX_VERTEX_HINT_PGI 107053 #define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 #define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 #define GL_MAT_EMISSION_BIT_PGI 0x00800000 #define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 #define GL_MAT_SHININESS_BIT_PGI 0x02000000 #define GL_MAT_SPECULAR_BIT_PGI 0x04000000 #define GL_NORMAL_BIT_PGI 0x08000000 #define GL_TEXCOORD1_BIT_PGI 0x10000000 #define GL_TEXCOORD2_BIT_PGI 0x20000000 #define GL_TEXCOORD3_BIT_PGI 0x40000000 #define GL_TEXCOORD4_BIT_PGI 0x80000000 #define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) #endif /* GL_PGI_vertex_hints */ /* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */ #ifndef GL_REGAL_ES1_0_compatibility #define GL_REGAL_ES1_0_compatibility 1 typedef int GLclampx; typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref); typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha); typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth); typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha); typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar); typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width); typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m); typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m); typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz); typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar); typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size); typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units); typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z); typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert); typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z); typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z); #define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx) #define glClearColorx GLEW_GET_FUN(__glewClearColorx) #define glClearDepthx GLEW_GET_FUN(__glewClearDepthx) #define glColor4x GLEW_GET_FUN(__glewColor4x) #define glDepthRangex GLEW_GET_FUN(__glewDepthRangex) #define glFogx GLEW_GET_FUN(__glewFogx) #define glFogxv GLEW_GET_FUN(__glewFogxv) #define glFrustumf GLEW_GET_FUN(__glewFrustumf) #define glFrustumx GLEW_GET_FUN(__glewFrustumx) #define glLightModelx GLEW_GET_FUN(__glewLightModelx) #define glLightModelxv GLEW_GET_FUN(__glewLightModelxv) #define glLightx GLEW_GET_FUN(__glewLightx) #define glLightxv GLEW_GET_FUN(__glewLightxv) #define glLineWidthx GLEW_GET_FUN(__glewLineWidthx) #define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx) #define glMaterialx GLEW_GET_FUN(__glewMaterialx) #define glMaterialxv GLEW_GET_FUN(__glewMaterialxv) #define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx) #define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x) #define glNormal3x GLEW_GET_FUN(__glewNormal3x) #define glOrthof GLEW_GET_FUN(__glewOrthof) #define glOrthox GLEW_GET_FUN(__glewOrthox) #define glPointSizex GLEW_GET_FUN(__glewPointSizex) #define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx) #define glRotatex GLEW_GET_FUN(__glewRotatex) #define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex) #define glScalex GLEW_GET_FUN(__glewScalex) #define glTexEnvx GLEW_GET_FUN(__glewTexEnvx) #define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv) #define glTexParameterx GLEW_GET_FUN(__glewTexParameterx) #define glTranslatex GLEW_GET_FUN(__glewTranslatex) #define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility) #endif /* GL_REGAL_ES1_0_compatibility */ /* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */ #ifndef GL_REGAL_ES1_1_compatibility #define GL_REGAL_ES1_1_compatibility 1 typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation); typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation); typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]); typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]); typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param); typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params); typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params); #define glClipPlanef GLEW_GET_FUN(__glewClipPlanef) #define glClipPlanex GLEW_GET_FUN(__glewClipPlanex) #define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef) #define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex) #define glGetFixedv GLEW_GET_FUN(__glewGetFixedv) #define glGetLightxv GLEW_GET_FUN(__glewGetLightxv) #define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv) #define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv) #define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv) #define glPointParameterx GLEW_GET_FUN(__glewPointParameterx) #define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv) #define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES) #define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv) #define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility) #endif /* GL_REGAL_ES1_1_compatibility */ /* ---------------------------- GL_REGAL_enable ---------------------------- */ #ifndef GL_REGAL_enable #define GL_REGAL_enable 1 #define GL_ERROR_REGAL 0x9322 #define GL_DEBUG_REGAL 0x9323 #define GL_LOG_REGAL 0x9324 #define GL_EMULATION_REGAL 0x9325 #define GL_DRIVER_REGAL 0x9326 #define GL_MISSING_REGAL 0x9360 #define GL_TRACE_REGAL 0x9361 #define GL_CACHE_REGAL 0x9362 #define GL_CODE_REGAL 0x9363 #define GL_STATISTICS_REGAL 0x9364 #define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable) #endif /* GL_REGAL_enable */ /* ------------------------- GL_REGAL_error_string ------------------------- */ #ifndef GL_REGAL_error_string #define GL_REGAL_error_string 1 typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error); #define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL) #define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string) #endif /* GL_REGAL_error_string */ /* ------------------------ GL_REGAL_extension_query ----------------------- */ #ifndef GL_REGAL_extension_query #define GL_REGAL_extension_query 1 typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext); typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext); #define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL) #define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL) #define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query) #endif /* GL_REGAL_extension_query */ /* ------------------------------ GL_REGAL_log ----------------------------- */ #ifndef GL_REGAL_log #define GL_REGAL_log 1 #define GL_LOG_ERROR_REGAL 0x9319 #define GL_LOG_WARNING_REGAL 0x931A #define GL_LOG_INFO_REGAL 0x931B #define GL_LOG_APP_REGAL 0x931C #define GL_LOG_DRIVER_REGAL 0x931D #define GL_LOG_INTERNAL_REGAL 0x931E #define GL_LOG_DEBUG_REGAL 0x931F #define GL_LOG_STATUS_REGAL 0x9320 #define GL_LOG_HTTP_REGAL 0x9321 typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, void *context); typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback); #define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL) #define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log) #endif /* GL_REGAL_log */ /* ------------------------- GL_REGAL_proc_address ------------------------- */ #ifndef GL_REGAL_proc_address #define GL_REGAL_proc_address 1 typedef void * (GLAPIENTRY * PFNGLGETPROCADDRESSREGALPROC) (const GLchar *name); #define glGetProcAddressREGAL GLEW_GET_FUN(__glewGetProcAddressREGAL) #define GLEW_REGAL_proc_address GLEW_GET_VAR(__GLEW_REGAL_proc_address) #endif /* GL_REGAL_proc_address */ /* ----------------------- GL_REND_screen_coordinates ---------------------- */ #ifndef GL_REND_screen_coordinates #define GL_REND_screen_coordinates 1 #define GL_SCREEN_COORDINATES_REND 0x8490 #define GL_INVERTED_SCREEN_W_REND 0x8491 #define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) #endif /* GL_REND_screen_coordinates */ /* ------------------------------- GL_S3_s3tc ------------------------------ */ #ifndef GL_S3_s3tc #define GL_S3_s3tc 1 #define GL_RGB_S3TC 0x83A0 #define GL_RGB4_S3TC 0x83A1 #define GL_RGBA_S3TC 0x83A2 #define GL_RGBA4_S3TC 0x83A3 #define GL_RGBA_DXT5_S3TC 0x83A4 #define GL_RGBA4_DXT5_S3TC 0x83A5 #define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) #endif /* GL_S3_s3tc */ /* -------------------------- GL_SGIS_color_range -------------------------- */ #ifndef GL_SGIS_color_range #define GL_SGIS_color_range 1 #define GL_EXTENDED_RANGE_SGIS 0x85A5 #define GL_MIN_RED_SGIS 0x85A6 #define GL_MAX_RED_SGIS 0x85A7 #define GL_MIN_GREEN_SGIS 0x85A8 #define GL_MAX_GREEN_SGIS 0x85A9 #define GL_MIN_BLUE_SGIS 0x85AA #define GL_MAX_BLUE_SGIS 0x85AB #define GL_MIN_ALPHA_SGIS 0x85AC #define GL_MAX_ALPHA_SGIS 0x85AD #define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) #endif /* GL_SGIS_color_range */ /* ------------------------- GL_SGIS_detail_texture ------------------------ */ #ifndef GL_SGIS_detail_texture #define GL_SGIS_detail_texture 1 typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); #define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) #define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) #define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) #endif /* GL_SGIS_detail_texture */ /* -------------------------- GL_SGIS_fog_function ------------------------- */ #ifndef GL_SGIS_fog_function #define GL_SGIS_fog_function 1 typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); #define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) #define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) #define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) #endif /* GL_SGIS_fog_function */ /* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ #ifndef GL_SGIS_generate_mipmap #define GL_SGIS_generate_mipmap 1 #define GL_GENERATE_MIPMAP_SGIS 0x8191 #define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 #define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) #endif /* GL_SGIS_generate_mipmap */ /* -------------------------- GL_SGIS_multisample -------------------------- */ #ifndef GL_SGIS_multisample #define GL_SGIS_multisample 1 #define GL_MULTISAMPLE_SGIS 0x809D #define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E #define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F #define GL_SAMPLE_MASK_SGIS 0x80A0 #define GL_1PASS_SGIS 0x80A1 #define GL_2PASS_0_SGIS 0x80A2 #define GL_2PASS_1_SGIS 0x80A3 #define GL_4PASS_0_SGIS 0x80A4 #define GL_4PASS_1_SGIS 0x80A5 #define GL_4PASS_2_SGIS 0x80A6 #define GL_4PASS_3_SGIS 0x80A7 #define GL_SAMPLE_BUFFERS_SGIS 0x80A8 #define GL_SAMPLES_SGIS 0x80A9 #define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA #define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB #define GL_SAMPLE_PATTERN_SGIS 0x80AC typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); #define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) #define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) #define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) #endif /* GL_SGIS_multisample */ /* ------------------------- GL_SGIS_pixel_texture ------------------------- */ #ifndef GL_SGIS_pixel_texture #define GL_SGIS_pixel_texture 1 #define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) #endif /* GL_SGIS_pixel_texture */ /* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ #ifndef GL_SGIS_point_line_texgen #define GL_SGIS_point_line_texgen 1 #define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 #define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 #define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 #define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 #define GL_EYE_POINT_SGIS 0x81F4 #define GL_OBJECT_POINT_SGIS 0x81F5 #define GL_EYE_LINE_SGIS 0x81F6 #define GL_OBJECT_LINE_SGIS 0x81F7 #define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) #endif /* GL_SGIS_point_line_texgen */ /* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ #ifndef GL_SGIS_sharpen_texture #define GL_SGIS_sharpen_texture 1 typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); #define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) #define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) #define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) #endif /* GL_SGIS_sharpen_texture */ /* --------------------------- GL_SGIS_texture4D --------------------------- */ #ifndef GL_SGIS_texture4D #define GL_SGIS_texture4D 1 typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void *pixels); typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void *pixels); #define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) #define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) #define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) #endif /* GL_SGIS_texture4D */ /* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ #ifndef GL_SGIS_texture_border_clamp #define GL_SGIS_texture_border_clamp 1 #define GL_CLAMP_TO_BORDER_SGIS 0x812D #define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) #endif /* GL_SGIS_texture_border_clamp */ /* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ #ifndef GL_SGIS_texture_edge_clamp #define GL_SGIS_texture_edge_clamp 1 #define GL_CLAMP_TO_EDGE_SGIS 0x812F #define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) #endif /* GL_SGIS_texture_edge_clamp */ /* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ #ifndef GL_SGIS_texture_filter4 #define GL_SGIS_texture_filter4 1 typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); #define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) #define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) #define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) #endif /* GL_SGIS_texture_filter4 */ /* -------------------------- GL_SGIS_texture_lod -------------------------- */ #ifndef GL_SGIS_texture_lod #define GL_SGIS_texture_lod 1 #define GL_TEXTURE_MIN_LOD_SGIS 0x813A #define GL_TEXTURE_MAX_LOD_SGIS 0x813B #define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C #define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D #define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) #endif /* GL_SGIS_texture_lod */ /* ------------------------- GL_SGIS_texture_select ------------------------ */ #ifndef GL_SGIS_texture_select #define GL_SGIS_texture_select 1 #define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) #endif /* GL_SGIS_texture_select */ /* ----------------------------- GL_SGIX_async ----------------------------- */ #ifndef GL_SGIX_async #define GL_SGIX_async 1 #define GL_ASYNC_MARKER_SGIX 0x8329 typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); #define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) #define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) #define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) #define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) #define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) #define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) #define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) #endif /* GL_SGIX_async */ /* ------------------------ GL_SGIX_async_histogram ------------------------ */ #ifndef GL_SGIX_async_histogram #define GL_SGIX_async_histogram 1 #define GL_ASYNC_HISTOGRAM_SGIX 0x832C #define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D #define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) #endif /* GL_SGIX_async_histogram */ /* -------------------------- GL_SGIX_async_pixel -------------------------- */ #ifndef GL_SGIX_async_pixel #define GL_SGIX_async_pixel 1 #define GL_ASYNC_TEX_IMAGE_SGIX 0x835C #define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D #define GL_ASYNC_READ_PIXELS_SGIX 0x835E #define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F #define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 #define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 #define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) #endif /* GL_SGIX_async_pixel */ /* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ #ifndef GL_SGIX_blend_alpha_minmax #define GL_SGIX_blend_alpha_minmax 1 #define GL_ALPHA_MIN_SGIX 0x8320 #define GL_ALPHA_MAX_SGIX 0x8321 #define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) #endif /* GL_SGIX_blend_alpha_minmax */ /* ---------------------------- GL_SGIX_clipmap ---------------------------- */ #ifndef GL_SGIX_clipmap #define GL_SGIX_clipmap 1 #define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) #endif /* GL_SGIX_clipmap */ /* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ #ifndef GL_SGIX_convolution_accuracy #define GL_SGIX_convolution_accuracy 1 #define GL_CONVOLUTION_HINT_SGIX 0x8316 #define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) #endif /* GL_SGIX_convolution_accuracy */ /* ------------------------- GL_SGIX_depth_texture ------------------------- */ #ifndef GL_SGIX_depth_texture #define GL_SGIX_depth_texture 1 #define GL_DEPTH_COMPONENT16_SGIX 0x81A5 #define GL_DEPTH_COMPONENT24_SGIX 0x81A6 #define GL_DEPTH_COMPONENT32_SGIX 0x81A7 #define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) #endif /* GL_SGIX_depth_texture */ /* -------------------------- GL_SGIX_flush_raster ------------------------- */ #ifndef GL_SGIX_flush_raster #define GL_SGIX_flush_raster 1 typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); #define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) #define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) #endif /* GL_SGIX_flush_raster */ /* --------------------------- GL_SGIX_fog_offset -------------------------- */ #ifndef GL_SGIX_fog_offset #define GL_SGIX_fog_offset 1 #define GL_FOG_OFFSET_SGIX 0x8198 #define GL_FOG_OFFSET_VALUE_SGIX 0x8199 #define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) #endif /* GL_SGIX_fog_offset */ /* -------------------------- GL_SGIX_fog_texture -------------------------- */ #ifndef GL_SGIX_fog_texture #define GL_SGIX_fog_texture 1 #define GL_FOG_PATCHY_FACTOR_SGIX 0 #define GL_FRAGMENT_FOG_SGIX 0 #define GL_TEXTURE_FOG_SGIX 0 typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); #define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) #define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) #endif /* GL_SGIX_fog_texture */ /* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ #ifndef GL_SGIX_fragment_specular_lighting #define GL_SGIX_fragment_specular_lighting 1 typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); #define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) #define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) #define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) #define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) #define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) #define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) #define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) #define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) #define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) #define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) #define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) #define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) #define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) #define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) #define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) #define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) #define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) #define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) #endif /* GL_SGIX_fragment_specular_lighting */ /* --------------------------- GL_SGIX_framezoom --------------------------- */ #ifndef GL_SGIX_framezoom #define GL_SGIX_framezoom 1 typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); #define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) #define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) #endif /* GL_SGIX_framezoom */ /* --------------------------- GL_SGIX_interlace --------------------------- */ #ifndef GL_SGIX_interlace #define GL_SGIX_interlace 1 #define GL_INTERLACE_SGIX 0x8094 #define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) #endif /* GL_SGIX_interlace */ /* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ #ifndef GL_SGIX_ir_instrument1 #define GL_SGIX_ir_instrument1 1 #define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) #endif /* GL_SGIX_ir_instrument1 */ /* ------------------------- GL_SGIX_list_priority ------------------------- */ #ifndef GL_SGIX_list_priority #define GL_SGIX_list_priority 1 #define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) #endif /* GL_SGIX_list_priority */ /* ------------------------- GL_SGIX_pixel_texture ------------------------- */ #ifndef GL_SGIX_pixel_texture #define GL_SGIX_pixel_texture 1 typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); #define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) #define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) #endif /* GL_SGIX_pixel_texture */ /* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ #ifndef GL_SGIX_pixel_texture_bits #define GL_SGIX_pixel_texture_bits 1 #define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) #endif /* GL_SGIX_pixel_texture_bits */ /* ------------------------ GL_SGIX_reference_plane ------------------------ */ #ifndef GL_SGIX_reference_plane #define GL_SGIX_reference_plane 1 typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); #define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) #define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) #endif /* GL_SGIX_reference_plane */ /* ---------------------------- GL_SGIX_resample --------------------------- */ #ifndef GL_SGIX_resample #define GL_SGIX_resample 1 #define GL_PACK_RESAMPLE_SGIX 0x842E #define GL_UNPACK_RESAMPLE_SGIX 0x842F #define GL_RESAMPLE_DECIMATE_SGIX 0x8430 #define GL_RESAMPLE_REPLICATE_SGIX 0x8433 #define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 #define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) #endif /* GL_SGIX_resample */ /* ----------------------------- GL_SGIX_shadow ---------------------------- */ #ifndef GL_SGIX_shadow #define GL_SGIX_shadow 1 #define GL_TEXTURE_COMPARE_SGIX 0x819A #define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B #define GL_TEXTURE_LEQUAL_R_SGIX 0x819C #define GL_TEXTURE_GEQUAL_R_SGIX 0x819D #define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) #endif /* GL_SGIX_shadow */ /* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ #ifndef GL_SGIX_shadow_ambient #define GL_SGIX_shadow_ambient 1 #define GL_SHADOW_AMBIENT_SGIX 0x80BF #define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) #endif /* GL_SGIX_shadow_ambient */ /* ----------------------------- GL_SGIX_sprite ---------------------------- */ #ifndef GL_SGIX_sprite #define GL_SGIX_sprite 1 typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); #define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) #define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) #define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) #define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) #define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) #endif /* GL_SGIX_sprite */ /* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ #ifndef GL_SGIX_tag_sample_buffer #define GL_SGIX_tag_sample_buffer 1 typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); #define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) #define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) #endif /* GL_SGIX_tag_sample_buffer */ /* ------------------------ GL_SGIX_texture_add_env ------------------------ */ #ifndef GL_SGIX_texture_add_env #define GL_SGIX_texture_add_env 1 #define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) #endif /* GL_SGIX_texture_add_env */ /* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ #ifndef GL_SGIX_texture_coordinate_clamp #define GL_SGIX_texture_coordinate_clamp 1 #define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 #define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A #define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B #define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) #endif /* GL_SGIX_texture_coordinate_clamp */ /* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ #ifndef GL_SGIX_texture_lod_bias #define GL_SGIX_texture_lod_bias 1 #define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) #endif /* GL_SGIX_texture_lod_bias */ /* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ #ifndef GL_SGIX_texture_multi_buffer #define GL_SGIX_texture_multi_buffer 1 #define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E #define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) #endif /* GL_SGIX_texture_multi_buffer */ /* ------------------------- GL_SGIX_texture_range ------------------------- */ #ifndef GL_SGIX_texture_range #define GL_SGIX_texture_range 1 #define GL_RGB_SIGNED_SGIX 0x85E0 #define GL_RGBA_SIGNED_SGIX 0x85E1 #define GL_ALPHA_SIGNED_SGIX 0x85E2 #define GL_LUMINANCE_SIGNED_SGIX 0x85E3 #define GL_INTENSITY_SIGNED_SGIX 0x85E4 #define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 #define GL_RGB16_SIGNED_SGIX 0x85E6 #define GL_RGBA16_SIGNED_SGIX 0x85E7 #define GL_ALPHA16_SIGNED_SGIX 0x85E8 #define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 #define GL_INTENSITY16_SIGNED_SGIX 0x85EA #define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB #define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC #define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED #define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE #define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF #define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 #define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 #define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 #define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 #define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 #define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 #define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 #define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 #define GL_MIN_LUMINANCE_SGIS 0x85F8 #define GL_MAX_LUMINANCE_SGIS 0x85F9 #define GL_MIN_INTENSITY_SGIS 0x85FA #define GL_MAX_INTENSITY_SGIS 0x85FB #define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) #endif /* GL_SGIX_texture_range */ /* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ #ifndef GL_SGIX_texture_scale_bias #define GL_SGIX_texture_scale_bias 1 #define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 #define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A #define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B #define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C #define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) #endif /* GL_SGIX_texture_scale_bias */ /* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ #ifndef GL_SGIX_vertex_preclip #define GL_SGIX_vertex_preclip 1 #define GL_VERTEX_PRECLIP_SGIX 0x83EE #define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF #define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) #endif /* GL_SGIX_vertex_preclip */ /* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ #ifndef GL_SGIX_vertex_preclip_hint #define GL_SGIX_vertex_preclip_hint 1 #define GL_VERTEX_PRECLIP_SGIX 0x83EE #define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF #define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) #endif /* GL_SGIX_vertex_preclip_hint */ /* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ #ifndef GL_SGIX_ycrcb #define GL_SGIX_ycrcb 1 #define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) #endif /* GL_SGIX_ycrcb */ /* -------------------------- GL_SGI_color_matrix -------------------------- */ #ifndef GL_SGI_color_matrix #define GL_SGI_color_matrix 1 #define GL_COLOR_MATRIX_SGI 0x80B1 #define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 #define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 #define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 #define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 #define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 #define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 #define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 #define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 #define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA #define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB #define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) #endif /* GL_SGI_color_matrix */ /* --------------------------- GL_SGI_color_table -------------------------- */ #ifndef GL_SGI_color_table #define GL_SGI_color_table 1 #define GL_COLOR_TABLE_SGI 0x80D0 #define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 #define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 #define GL_PROXY_COLOR_TABLE_SGI 0x80D3 #define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 #define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 #define GL_COLOR_TABLE_SCALE_SGI 0x80D6 #define GL_COLOR_TABLE_BIAS_SGI 0x80D7 #define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 #define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 #define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA #define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB #define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC #define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD #define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE #define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void *table); typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void *table); #define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) #define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) #define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) #define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) #define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) #define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) #define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) #define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) #endif /* GL_SGI_color_table */ /* ----------------------- GL_SGI_texture_color_table ---------------------- */ #ifndef GL_SGI_texture_color_table #define GL_SGI_texture_color_table 1 #define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC #define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD #define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) #endif /* GL_SGI_texture_color_table */ /* ------------------------- GL_SUNX_constant_data ------------------------- */ #ifndef GL_SUNX_constant_data #define GL_SUNX_constant_data 1 #define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 #define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); #define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) #define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) #endif /* GL_SUNX_constant_data */ /* -------------------- GL_SUN_convolution_border_modes -------------------- */ #ifndef GL_SUN_convolution_border_modes #define GL_SUN_convolution_border_modes 1 #define GL_WRAP_BORDER_SUN 0x81D4 #define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) #endif /* GL_SUN_convolution_border_modes */ /* -------------------------- GL_SUN_global_alpha -------------------------- */ #ifndef GL_SUN_global_alpha #define GL_SUN_global_alpha 1 #define GL_GLOBAL_ALPHA_SUN 0x81D9 #define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); #define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) #define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) #define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) #define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) #define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) #define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) #define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) #define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) #define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) #endif /* GL_SUN_global_alpha */ /* --------------------------- GL_SUN_mesh_array --------------------------- */ #ifndef GL_SUN_mesh_array #define GL_SUN_mesh_array 1 #define GL_QUAD_MESH_SUN 0x8614 #define GL_TRIANGLE_MESH_SUN 0x8615 #define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) #endif /* GL_SUN_mesh_array */ /* ------------------------ GL_SUN_read_video_pixels ----------------------- */ #ifndef GL_SUN_read_video_pixels #define GL_SUN_read_video_pixels 1 typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels); #define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) #define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) #endif /* GL_SUN_read_video_pixels */ /* --------------------------- GL_SUN_slice_accum -------------------------- */ #ifndef GL_SUN_slice_accum #define GL_SUN_slice_accum 1 #define GL_SLICE_ACCUM_SUN 0x85CC #define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) #endif /* GL_SUN_slice_accum */ /* -------------------------- GL_SUN_triangle_list ------------------------- */ #ifndef GL_SUN_triangle_list #define GL_SUN_triangle_list 1 #define GL_RESTART_SUN 0x01 #define GL_REPLACE_MIDDLE_SUN 0x02 #define GL_REPLACE_OLDEST_SUN 0x03 #define GL_TRIANGLE_LIST_SUN 0x81D7 #define GL_REPLACEMENT_CODE_SUN 0x81D8 #define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 #define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 #define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 #define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 #define GL_R1UI_V3F_SUN 0x85C4 #define GL_R1UI_C4UB_V3F_SUN 0x85C5 #define GL_R1UI_C3F_V3F_SUN 0x85C6 #define GL_R1UI_N3F_V3F_SUN 0x85C7 #define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 #define GL_R1UI_T2F_V3F_SUN 0x85C9 #define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA #define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void *pointer); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); #define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) #define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) #define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) #define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) #define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) #define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) #define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) #define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) #endif /* GL_SUN_triangle_list */ /* ----------------------------- GL_SUN_vertex ----------------------------- */ #ifndef GL_SUN_vertex #define GL_SUN_vertex 1 typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); #define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) #define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) #define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) #define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) #define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) #define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) #define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) #define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) #define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) #define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) #define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) #define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) #define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) #define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) #define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) #define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) #define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) #define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) #define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) #define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) #define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) #define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) #define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) #define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) #define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) #define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) #define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) #define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) #define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) #define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) #define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) #define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) #define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) #define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) #define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) #define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) #define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) #define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) #define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) #define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) #define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) #endif /* GL_SUN_vertex */ /* -------------------------- GL_WIN_phong_shading ------------------------- */ #ifndef GL_WIN_phong_shading #define GL_WIN_phong_shading 1 #define GL_PHONG_WIN 0x80EA #define GL_PHONG_HINT_WIN 0x80EB #define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) #endif /* GL_WIN_phong_shading */ /* -------------------------- GL_WIN_specular_fog -------------------------- */ #ifndef GL_WIN_specular_fog #define GL_WIN_specular_fog 1 #define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC #define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) #endif /* GL_WIN_specular_fog */ /* ---------------------------- GL_WIN_swap_hint --------------------------- */ #ifndef GL_WIN_swap_hint #define GL_WIN_swap_hint 1 typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); #define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) #define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) #endif /* GL_WIN_swap_hint */ /* ------------------------------------------------------------------------- */ #if defined(GLEW_MX) && defined(_WIN32) #define GLEW_FUN_EXPORT #else #define GLEW_FUN_EXPORT GLEWAPI #endif /* GLEW_MX */ #if defined(GLEW_MX) #define GLEW_VAR_EXPORT #else #define GLEW_VAR_EXPORT GLEWAPI #endif /* GLEW_MX */ #if defined(GLEW_MX) && defined(_WIN32) struct GLEWContextStruct { #endif /* GLEW_MX */ GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSPROC __glewGetGraphicsResetStatus; GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEPROC __glewGetnCompressedTexImage; GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEPROC __glewGetnTexImage; GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVPROC __glewGetnUniformdv; GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD; GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; GLEW_FUN_EXPORT PFNGLQUERYOBJECTPARAMETERUIAMDPROC __glewQueryObjectParameteruiAMD; GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD; GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD; GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD; GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE; GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE; GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE; GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE; GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE; GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE; GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE; GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE; GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE; GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; GLEW_FUN_EXPORT PFNGLMEMORYBARRIERBYREGIONPROC __glewMemoryBarrierByRegion; GLEW_FUN_EXPORT PFNGLPRIMITIVEBOUNDINGBOXARBPROC __glewPrimitiveBoundingBoxARB; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance; GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB; GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB; GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB; GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB; GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB; GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB; GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB; GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB; GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB; GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT; GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData; GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData; GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT; GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT; GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage; GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage; GLEW_FUN_EXPORT PFNGLCLIPCONTROLPROC __glewClipControl; GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute; GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect; GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB; GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPROC __glewBindTextureUnit; GLEW_FUN_EXPORT PFNGLBLITNAMEDFRAMEBUFFERPROC __glewBlitNamedFramebuffer; GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSPROC __glewCheckNamedFramebufferStatus; GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAPROC __glewClearNamedBufferData; GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAPROC __glewClearNamedBufferSubData; GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFIPROC __glewClearNamedFramebufferfi; GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERFVPROC __glewClearNamedFramebufferfv; GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERIVPROC __glewClearNamedFramebufferiv; GLEW_FUN_EXPORT PFNGLCLEARNAMEDFRAMEBUFFERUIVPROC __glewClearNamedFramebufferuiv; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DPROC __glewCompressedTextureSubImage1D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DPROC __glewCompressedTextureSubImage2D; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DPROC __glewCompressedTextureSubImage3D; GLEW_FUN_EXPORT PFNGLCOPYNAMEDBUFFERSUBDATAPROC __glewCopyNamedBufferSubData; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DPROC __glewCopyTextureSubImage1D; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DPROC __glewCopyTextureSubImage2D; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DPROC __glewCopyTextureSubImage3D; GLEW_FUN_EXPORT PFNGLCREATEBUFFERSPROC __glewCreateBuffers; GLEW_FUN_EXPORT PFNGLCREATEFRAMEBUFFERSPROC __glewCreateFramebuffers; GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPIPELINESPROC __glewCreateProgramPipelines; GLEW_FUN_EXPORT PFNGLCREATEQUERIESPROC __glewCreateQueries; GLEW_FUN_EXPORT PFNGLCREATERENDERBUFFERSPROC __glewCreateRenderbuffers; GLEW_FUN_EXPORT PFNGLCREATESAMPLERSPROC __glewCreateSamplers; GLEW_FUN_EXPORT PFNGLCREATETEXTURESPROC __glewCreateTextures; GLEW_FUN_EXPORT PFNGLCREATETRANSFORMFEEDBACKSPROC __glewCreateTransformFeedbacks; GLEW_FUN_EXPORT PFNGLCREATEVERTEXARRAYSPROC __glewCreateVertexArrays; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBPROC __glewDisableVertexArrayAttrib; GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBPROC __glewEnableVertexArrayAttrib; GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEPROC __glewFlushMappedNamedBufferRange; GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPPROC __glewGenerateTextureMipmap; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEPROC __glewGetCompressedTextureImage; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERI64VPROC __glewGetNamedBufferParameteri64v; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVPROC __glewGetNamedBufferParameteriv; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVPROC __glewGetNamedBufferPointerv; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAPROC __glewGetNamedBufferSubData; GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetNamedFramebufferAttachmentParameteriv; GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVPROC __glewGetNamedFramebufferParameteriv; GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVPROC __glewGetNamedRenderbufferParameteriv; GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTI64VPROC __glewGetQueryBufferObjecti64v; GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTIVPROC __glewGetQueryBufferObjectiv; GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUI64VPROC __glewGetQueryBufferObjectui64v; GLEW_FUN_EXPORT PFNGLGETQUERYBUFFEROBJECTUIVPROC __glewGetQueryBufferObjectuiv; GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEPROC __glewGetTextureImage; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVPROC __glewGetTextureLevelParameterfv; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVPROC __glewGetTextureLevelParameteriv; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVPROC __glewGetTextureParameterIiv; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVPROC __glewGetTextureParameterIuiv; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVPROC __glewGetTextureParameterfv; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVPROC __glewGetTextureParameteriv; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI64_VPROC __glewGetTransformFeedbacki64_v; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKI_VPROC __glewGetTransformFeedbacki_v; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKIVPROC __glewGetTransformFeedbackiv; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXED64IVPROC __glewGetVertexArrayIndexed64iv; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINDEXEDIVPROC __glewGetVertexArrayIndexediv; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYIVPROC __glewGetVertexArrayiv; GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERDATAPROC __glewInvalidateNamedFramebufferData; GLEW_FUN_EXPORT PFNGLINVALIDATENAMEDFRAMEBUFFERSUBDATAPROC __glewInvalidateNamedFramebufferSubData; GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERPROC __glewMapNamedBuffer; GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEPROC __glewMapNamedBufferRange; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAPROC __glewNamedBufferData; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEPROC __glewNamedBufferStorage; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAPROC __glewNamedBufferSubData; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERPROC __glewNamedFramebufferDrawBuffer; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERDRAWBUFFERSPROC __glewNamedFramebufferDrawBuffers; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIPROC __glewNamedFramebufferParameteri; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERREADBUFFERPROC __glewNamedFramebufferReadBuffer; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFERPROC __glewNamedFramebufferRenderbuffer; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREPROC __glewNamedFramebufferTexture; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYERPROC __glewNamedFramebufferTextureLayer; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEPROC __glewNamedRenderbufferStorage; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewNamedRenderbufferStorageMultisample; GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERPROC __glewTextureBuffer; GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEPROC __glewTextureBufferRange; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVPROC __glewTextureParameterIiv; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVPROC __glewTextureParameterIuiv; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFPROC __glewTextureParameterf; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVPROC __glewTextureParameterfv; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIPROC __glewTextureParameteri; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVPROC __glewTextureParameteriv; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DPROC __glewTextureStorage1D; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DPROC __glewTextureStorage2D; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEPROC __glewTextureStorage2DMultisample; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DPROC __glewTextureStorage3D; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEPROC __glewTextureStorage3DMultisample; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DPROC __glewTextureSubImage1D; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DPROC __glewTextureSubImage2D; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DPROC __glewTextureSubImage3D; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC __glewTransformFeedbackBufferBase; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC __glewTransformFeedbackBufferRange; GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFERPROC __glewUnmapNamedBuffer; GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBBINDINGPROC __glewVertexArrayAttribBinding; GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBFORMATPROC __glewVertexArrayAttribFormat; GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBIFORMATPROC __glewVertexArrayAttribIFormat; GLEW_FUN_EXPORT PFNGLVERTEXARRAYATTRIBLFORMATPROC __glewVertexArrayAttribLFormat; GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDINGDIVISORPROC __glewVertexArrayBindingDivisor; GLEW_FUN_EXPORT PFNGLVERTEXARRAYELEMENTBUFFERPROC __glewVertexArrayElementBuffer; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERPROC __glewVertexArrayVertexBuffer; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBUFFERSPROC __glewVertexArrayVertexBuffers; GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri; GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv; GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT; GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTURESUBIMAGEPROC __glewGetCompressedTextureSubImage; GLEW_FUN_EXPORT PFNGLGETTEXTURESUBIMAGEPROC __glewGetTextureSubImage; GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VARBPROC __glewGetUniformi64vARB; GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VARBPROC __glewGetUniformui64vARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMI64VARBPROC __glewGetnUniformi64vARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMUI64VARBPROC __glewGetnUniformui64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64ARBPROC __glewProgramUniform1i64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VARBPROC __glewProgramUniform1i64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64ARBPROC __glewProgramUniform1ui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VARBPROC __glewProgramUniform1ui64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64ARBPROC __glewProgramUniform2i64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VARBPROC __glewProgramUniform2i64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64ARBPROC __glewProgramUniform2ui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VARBPROC __glewProgramUniform2ui64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64ARBPROC __glewProgramUniform3i64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VARBPROC __glewProgramUniform3i64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64ARBPROC __glewProgramUniform3ui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VARBPROC __glewProgramUniform3ui64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64ARBPROC __glewProgramUniform4i64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VARBPROC __glewProgramUniform4i64vARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64ARBPROC __glewProgramUniform4ui64ARB; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VARBPROC __glewProgramUniform4ui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM1I64ARBPROC __glewUniform1i64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM1I64VARBPROC __glewUniform1i64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM1UI64ARBPROC __glewUniform1ui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VARBPROC __glewUniform1ui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM2I64ARBPROC __glewUniform2i64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM2I64VARBPROC __glewUniform2i64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM2UI64ARBPROC __glewUniform2ui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VARBPROC __glewUniform2ui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM3I64ARBPROC __glewUniform3i64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM3I64VARBPROC __glewUniform3i64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM3UI64ARBPROC __glewUniform3ui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VARBPROC __glewUniform3ui64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM4I64ARBPROC __glewUniform4i64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM4I64VARBPROC __glewUniform4i64vARB; GLEW_FUN_EXPORT PFNGLUNIFORM4UI64ARBPROC __glewUniform4ui64ARB; GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VARBPROC __glewUniform4ui64vARB; GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ; GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v; GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData; GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData; GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer; GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer; GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage; GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage; GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase; GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange; GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures; GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers; GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures; GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect; GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; GLEW_FUN_EXPORT PFNGLMAXSHADERCOMPILERTHREADSARBPROC __glewMaxShaderCompilerThreadsARB; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv; GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB; GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewFramebufferSampleLocationsfvARB; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVARBPROC __glewNamedFramebufferSampleLocationsfvARB; GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv; GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture; GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier; GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding; GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; GLEW_FUN_EXPORT PFNGLBUFFERPAGECOMMITMENTARBPROC __glewBufferPageCommitmentARB; GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB; GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT; GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERPROC __glewTextureBarrier; GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange; GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D; GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D; GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT; GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample; GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT; GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT; GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer; GLEW_FUN_EXPORT PFNGLVERTEXARRAYBINDVERTEXBUFFEREXTPROC __glewVertexArrayBindVertexBufferEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBBINDINGEXTPROC __glewVertexArrayVertexAttribBindingEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBFORMATEXTPROC __glewVertexArrayVertexAttribFormatEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIFORMATEXTPROC __glewVertexArrayVertexAttribIFormatEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLFORMATEXTPROC __glewVertexArrayVertexAttribLFormatEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXBINDINGDIVISOREXTPROC __glewVertexArrayVertexBindingDivisorEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat; GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor; GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI; GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI; GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETOBJECTLABELEXTPROC __glewGetObjectLabelEXT; GLEW_FUN_EXPORT PFNGLLABELOBJECTEXTPROC __glewLabelObjectEXT; GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT; GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT; GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT; GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBDIVISOREXTPROC __glewVertexArrayVertexAttribDivisorEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETCLAMPEXTPROC __glewPolygonOffsetClampEXT; GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONNVPROC __glewCoverageModulationNV; GLEW_FUN_EXPORT PFNGLCOVERAGEMODULATIONTABLENVPROC __glewCoverageModulationTableNV; GLEW_FUN_EXPORT PFNGLGETCOVERAGEMODULATIONTABLENVPROC __glewGetCoverageModulationTableNV; GLEW_FUN_EXPORT PFNGLRASTERSAMPLESEXTPROC __glewRasterSamplesEXT; GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT; GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL; GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL; GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL; GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; GLEW_FUN_EXPORT PFNGLBEGINPERFQUERYINTELPROC __glewBeginPerfQueryINTEL; GLEW_FUN_EXPORT PFNGLCREATEPERFQUERYINTELPROC __glewCreatePerfQueryINTEL; GLEW_FUN_EXPORT PFNGLDELETEPERFQUERYINTELPROC __glewDeletePerfQueryINTEL; GLEW_FUN_EXPORT PFNGLENDPERFQUERYINTELPROC __glewEndPerfQueryINTEL; GLEW_FUN_EXPORT PFNGLGETFIRSTPERFQUERYIDINTELPROC __glewGetFirstPerfQueryIdINTEL; GLEW_FUN_EXPORT PFNGLGETNEXTPERFQUERYIDINTELPROC __glewGetNextPerfQueryIdINTEL; GLEW_FUN_EXPORT PFNGLGETPERFCOUNTERINFOINTELPROC __glewGetPerfCounterInfoINTEL; GLEW_FUN_EXPORT PFNGLGETPERFQUERYDATAINTELPROC __glewGetPerfQueryDataINTEL; GLEW_FUN_EXPORT PFNGLGETPERFQUERYIDBYNAMEINTELPROC __glewGetPerfQueryIdByNameINTEL; GLEW_FUN_EXPORT PFNGLGETPERFQUERYINFOINTELPROC __glewGetPerfQueryInfoINTEL; GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; GLEW_FUN_EXPORT PFNGLBLENDBARRIERKHRPROC __glewBlendBarrierKHR; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl; GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert; GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog; GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel; GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel; GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel; GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel; GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup; GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup; GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVPROC __glewGetnUniformfv; GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVPROC __glewGetnUniformiv; GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVPROC __glewGetnUniformuiv; GLEW_FUN_EXPORT PFNGLREADNPIXELSPROC __glewReadnPixels; GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled; GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion; GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion; GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion; GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion; GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX; GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV; GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawArraysIndirectBindlessCountNV; GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSCOUNTNVPROC __glewMultiDrawElementsIndirectBindlessCountNV; GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV; GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV; GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV; GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV; GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV; GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV; GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV; GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV; GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV; GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV; GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV; GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV; GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; GLEW_FUN_EXPORT PFNGLSUBPIXELPRECISIONBIASNVPROC __glewSubpixelPrecisionBiasNV; GLEW_FUN_EXPORT PFNGLCONSERVATIVERASTERPARAMETERFNVPROC __glewConservativeRasterParameterfNV; GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV; GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; GLEW_FUN_EXPORT PFNGLFRAGMENTCOVERAGECOLORNVPROC __glewFragmentCoverageColorNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATSAMPLEIVNVPROC __glewGetInternalformatSampleivNV; GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV; GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV; GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV; GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV; GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV; GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV; GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV; GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV; GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV; GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV; GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV; GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV; GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV; GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV; GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV; GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV; GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV; GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV; GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV; GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEFVNVPROC __glewGetProgramResourcefvNV; GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV; GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV; GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV; GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV; GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X2FNVPROC __glewMatrixLoad3x2fNV; GLEW_FUN_EXPORT PFNGLMATRIXLOAD3X3FNVPROC __glewMatrixLoad3x3fNV; GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSE3X3FNVPROC __glewMatrixLoadTranspose3x3fNV; GLEW_FUN_EXPORT PFNGLMATRIXMULT3X2FNVPROC __glewMatrixMult3x2fNV; GLEW_FUN_EXPORT PFNGLMATRIXMULT3X3FNVPROC __glewMatrixMult3x3fNV; GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSE3X3FNVPROC __glewMatrixMultTranspose3x3fNV; GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV; GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV; GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV; GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV; GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV; GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV; GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXARRAYNVPROC __glewPathGlyphIndexArrayNV; GLEW_FUN_EXPORT PFNGLPATHGLYPHINDEXRANGENVPROC __glewPathGlyphIndexRangeNV; GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV; GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV; GLEW_FUN_EXPORT PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC __glewPathMemoryGlyphIndexArrayNV; GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV; GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV; GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV; GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV; GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV; GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV; GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV; GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV; GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV; GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV; GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV; GLEW_FUN_EXPORT PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC __glewProgramPathFragmentInputGenNV; GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV; GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV; GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV; GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV; GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC __glewStencilThenCoverFillPathInstancedNV; GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERFILLPATHNVPROC __glewStencilThenCoverFillPathNV; GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC __glewStencilThenCoverStrokePathInstancedNV; GLEW_FUN_EXPORT PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC __glewStencilThenCoverStrokePathNV; GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV; GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV; GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewFramebufferSampleLocationsfvNV; GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERSAMPLELOCATIONSFVNVPROC __glewNamedFramebufferSampleLocationsfvNV; GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV; GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV; GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV; GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV; GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV; GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV; GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV; GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV; GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV; GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV; GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV; GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV; GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV; GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV; GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC __glewFramebufferTextureMultiviewOVR; GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx; GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx; GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx; GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x; GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex; GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx; GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv; GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf; GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx; GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx; GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv; GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx; GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv; GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx; GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx; GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx; GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv; GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx; GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x; GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x; GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof; GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox; GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex; GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx; GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex; GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex; GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex; GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx; GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv; GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx; GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex; GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef; GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex; GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef; GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex; GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv; GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv; GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv; GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv; GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx; GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv; GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES; GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv; GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL; GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL; GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL; GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL; GLEW_FUN_EXPORT PFNGLGETPROCADDRESSREGALPROC __glewGetProcAddressREGAL; GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; #if defined(GLEW_MX) && !defined(_WIN32) struct GLEWContextStruct { #endif /* GLEW_MX */ GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4; GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_5; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gcn_shader; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_gpu_shader_int64; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_occlusion_query_event; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_atomic_counter_ops; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_value_export; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback4; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query; GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_1_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_2_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clip_control; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conditional_render_inverted; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cull_distance; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_derivative_control; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_direct_state_access; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader_interlock; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_texture_sub_image; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_int64; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_parallel_shader_compile; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pipeline_statistics_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_post_depth_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_locations; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counter_ops; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_ballot; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_clock; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_image_samples; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_viewport_layer_array; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture2; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_barrier; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_filter_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_overflow_query; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_label; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_post_depth_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_raster_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_formatted; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_integer_mix; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_sparse_texture2; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object; GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_fragment_shader_ordering; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_framebuffer_CMAA; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_performance_query; GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_blend_equation_advanced_coherent; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_context_flush_control; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_no_error; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robust_buffer_access_behavior; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_robustness; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_hdr; GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr; GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render; GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect; GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect_count; GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture; GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced; GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent; GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster; GLEW_VAR_EXPORT GLboolean __GLEW_NV_conservative_raster_dilate; GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D; GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture; GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fill_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_coverage_to_color; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_shader_interlock; GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_mixed_samples; GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader_passthrough; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; GLEW_VAR_EXPORT GLboolean __GLEW_NV_internalformat_sample_query; GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering; GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering_shared_edge; GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_locations; GLEW_VAR_EXPORT GLboolean __GLEW_NV_sample_mask_override_coverage; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_fp16_vector; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_int64; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_group; GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_thread_shuffle; GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_uniform_buffer_unified_memory; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture; GLEW_VAR_EXPORT GLboolean __GLEW_NV_viewport_array2; GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview; GLEW_VAR_EXPORT GLboolean __GLEW_OVR_multiview2; GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log; GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_proc_address; GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; #ifdef GLEW_MX }; /* GLEWContextStruct */ #endif /* GLEW_MX */ /* ------------------------------------------------------------------------- */ /* error codes */ #define GLEW_OK 0 #define GLEW_NO_ERROR 0 #define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ #define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ #define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ /* string codes */ #define GLEW_VERSION 1 #define GLEW_VERSION_MAJOR 2 #define GLEW_VERSION_MINOR 3 #define GLEW_VERSION_MICRO 4 /* ------------------------------------------------------------------------- */ /* GLEW version info */ /* VERSION 1.13.0 VERSION_MAJOR 1 VERSION_MINOR 13 VERSION_MICRO 0 */ /* API */ #ifdef GLEW_MX typedef struct GLEWContextStruct GLEWContext; GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx); GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name); #define glewInit() glewContextInit(glewGetContext()) #define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) #define glewIsExtensionSupported(x) glewIsSupported(x) #define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) #ifdef _WIN32 # define GLEW_GET_FUN(x) glewGetContext()->x #else # define GLEW_GET_FUN(x) x #endif #else /* GLEW_MX */ GLEWAPI GLenum GLEWAPIENTRY glewInit (void); GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name); #define glewIsExtensionSupported(x) glewIsSupported(x) #define GLEW_GET_VAR(x) (*(const GLboolean*)&x) #define GLEW_GET_FUN(x) x #endif /* GLEW_MX */ GLEWAPI GLboolean glewExperimental; GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name); GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error); GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name); #ifdef __cplusplus } #endif #ifdef GLEW_APIENTRY_DEFINED #undef GLEW_APIENTRY_DEFINED #undef APIENTRY #endif #ifdef GLEW_CALLBACK_DEFINED #undef GLEW_CALLBACK_DEFINED #undef CALLBACK #endif #ifdef GLEW_WINGDIAPI_DEFINED #undef GLEW_WINGDIAPI_DEFINED #undef WINGDIAPI #endif #undef GLAPI /* #undef GLEWAPI */ #endif /* __glew_h__ */ ================================================ FILE: Libraries/Core/Windows/Headers/GL/glxew.h ================================================ /* ** The OpenGL Extension Wrangler Library ** Copyright (C) 2008-2015, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are met: ** ** * Redistributions of source code must retain the above copyright notice, ** this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright notice, ** this list of conditions and the following disclaimer in the documentation ** and/or other materials provided with the distribution. ** * The name of the author may be used to endorse or promote products ** derived from this software without specific prior written permission. ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ** THE POSSIBILITY OF SUCH DAMAGE. */ /* * Mesa 3-D graphics library * Version: 7.0 * * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* ** Copyright (c) 2007 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ #ifndef __glxew_h__ #define __glxew_h__ #define __GLXEW_H__ #ifdef __glxext_h_ #error glxext.h included before glxew.h #endif #if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) #error glx.h included before glxew.h #endif #define __glxext_h_ #define GLX_H #define __GLX_glx_h__ #define __glx_h__ #include #include #include #include #ifdef __cplusplus extern "C" { #endif /* ---------------------------- GLX_VERSION_1_0 --------------------------- */ #ifndef GLX_VERSION_1_0 #define GLX_VERSION_1_0 1 #define GLX_USE_GL 1 #define GLX_BUFFER_SIZE 2 #define GLX_LEVEL 3 #define GLX_RGBA 4 #define GLX_DOUBLEBUFFER 5 #define GLX_STEREO 6 #define GLX_AUX_BUFFERS 7 #define GLX_RED_SIZE 8 #define GLX_GREEN_SIZE 9 #define GLX_BLUE_SIZE 10 #define GLX_ALPHA_SIZE 11 #define GLX_DEPTH_SIZE 12 #define GLX_STENCIL_SIZE 13 #define GLX_ACCUM_RED_SIZE 14 #define GLX_ACCUM_GREEN_SIZE 15 #define GLX_ACCUM_BLUE_SIZE 16 #define GLX_ACCUM_ALPHA_SIZE 17 #define GLX_BAD_SCREEN 1 #define GLX_BAD_ATTRIBUTE 2 #define GLX_NO_EXTENSION 3 #define GLX_BAD_VISUAL 4 #define GLX_BAD_CONTEXT 5 #define GLX_BAD_VALUE 6 #define GLX_BAD_ENUM 7 typedef XID GLXDrawable; typedef XID GLXPixmap; #ifdef __sun typedef struct __glXContextRec *GLXContext; #else typedef struct __GLXcontextRec *GLXContext; #endif typedef unsigned int GLXVideoDeviceNV; extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); extern void glXDestroyContext (Display *dpy, GLXContext ctx); extern Bool glXIsDirect (Display *dpy, GLXContext ctx); extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); extern GLXContext glXGetCurrentContext (void); extern GLXDrawable glXGetCurrentDrawable (void); extern void glXWaitGL (void); extern void glXWaitX (void); extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); extern void glXUseXFont (Font font, int first, int count, int listBase); #define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) #endif /* GLX_VERSION_1_0 */ /* ---------------------------- GLX_VERSION_1_1 --------------------------- */ #ifndef GLX_VERSION_1_1 #define GLX_VERSION_1_1 #define GLX_VENDOR 0x1 #define GLX_VERSION 0x2 #define GLX_EXTENSIONS 0x3 extern const char* glXQueryExtensionsString (Display *dpy, int screen); extern const char* glXGetClientString (Display *dpy, int name); extern const char* glXQueryServerString (Display *dpy, int screen, int name); #define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) #endif /* GLX_VERSION_1_1 */ /* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ #ifndef GLX_VERSION_1_2 #define GLX_VERSION_1_2 1 typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); #define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) #define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) #endif /* GLX_VERSION_1_2 */ /* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ #ifndef GLX_VERSION_1_3 #define GLX_VERSION_1_3 1 #define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 #define GLX_RGBA_BIT 0x00000001 #define GLX_WINDOW_BIT 0x00000001 #define GLX_COLOR_INDEX_BIT 0x00000002 #define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 #define GLX_PIXMAP_BIT 0x00000002 #define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 #define GLX_PBUFFER_BIT 0x00000004 #define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 #define GLX_AUX_BUFFERS_BIT 0x00000010 #define GLX_CONFIG_CAVEAT 0x20 #define GLX_DEPTH_BUFFER_BIT 0x00000020 #define GLX_X_VISUAL_TYPE 0x22 #define GLX_TRANSPARENT_TYPE 0x23 #define GLX_TRANSPARENT_INDEX_VALUE 0x24 #define GLX_TRANSPARENT_RED_VALUE 0x25 #define GLX_TRANSPARENT_GREEN_VALUE 0x26 #define GLX_TRANSPARENT_BLUE_VALUE 0x27 #define GLX_TRANSPARENT_ALPHA_VALUE 0x28 #define GLX_STENCIL_BUFFER_BIT 0x00000040 #define GLX_ACCUM_BUFFER_BIT 0x00000080 #define GLX_NONE 0x8000 #define GLX_SLOW_CONFIG 0x8001 #define GLX_TRUE_COLOR 0x8002 #define GLX_DIRECT_COLOR 0x8003 #define GLX_PSEUDO_COLOR 0x8004 #define GLX_STATIC_COLOR 0x8005 #define GLX_GRAY_SCALE 0x8006 #define GLX_STATIC_GRAY 0x8007 #define GLX_TRANSPARENT_RGB 0x8008 #define GLX_TRANSPARENT_INDEX 0x8009 #define GLX_VISUAL_ID 0x800B #define GLX_SCREEN 0x800C #define GLX_NON_CONFORMANT_CONFIG 0x800D #define GLX_DRAWABLE_TYPE 0x8010 #define GLX_RENDER_TYPE 0x8011 #define GLX_X_RENDERABLE 0x8012 #define GLX_FBCONFIG_ID 0x8013 #define GLX_RGBA_TYPE 0x8014 #define GLX_COLOR_INDEX_TYPE 0x8015 #define GLX_MAX_PBUFFER_WIDTH 0x8016 #define GLX_MAX_PBUFFER_HEIGHT 0x8017 #define GLX_MAX_PBUFFER_PIXELS 0x8018 #define GLX_PRESERVED_CONTENTS 0x801B #define GLX_LARGEST_PBUFFER 0x801C #define GLX_WIDTH 0x801D #define GLX_HEIGHT 0x801E #define GLX_EVENT_MASK 0x801F #define GLX_DAMAGED 0x8020 #define GLX_SAVED 0x8021 #define GLX_WINDOW 0x8022 #define GLX_PBUFFER 0x8023 #define GLX_PBUFFER_HEIGHT 0x8040 #define GLX_PBUFFER_WIDTH 0x8041 #define GLX_PBUFFER_CLOBBER_MASK 0x08000000 #define GLX_DONT_CARE 0xFFFFFFFF typedef XID GLXFBConfigID; typedef XID GLXPbuffer; typedef XID GLXWindow; typedef struct __GLXFBConfigRec *GLXFBConfig; typedef struct { int event_type; int draw_type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; unsigned int buffer_mask; unsigned int aux_buffer; int x, y; int width, height; int count; } GLXPbufferClobberEvent; typedef union __GLXEvent { GLXPbufferClobberEvent glxpbufferclobber; long pad[24]; } GLXEvent; typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); #define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) #define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) #define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) #define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) #define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) #define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) #define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) #define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) #define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) #define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) #define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) #define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) #define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) #define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) #define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) #define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) #define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) #define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) #endif /* GLX_VERSION_1_3 */ /* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ #ifndef GLX_VERSION_1_4 #define GLX_VERSION_1_4 1 #define GLX_SAMPLE_BUFFERS 100000 #define GLX_SAMPLES 100001 extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); #define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) #endif /* GLX_VERSION_1_4 */ /* -------------------------- GLX_3DFX_multisample ------------------------- */ #ifndef GLX_3DFX_multisample #define GLX_3DFX_multisample 1 #define GLX_SAMPLE_BUFFERS_3DFX 0x8050 #define GLX_SAMPLES_3DFX 0x8051 #define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) #endif /* GLX_3DFX_multisample */ /* ------------------------ GLX_AMD_gpu_association ------------------------ */ #ifndef GLX_AMD_gpu_association #define GLX_AMD_gpu_association 1 #define GLX_GPU_VENDOR_AMD 0x1F00 #define GLX_GPU_RENDERER_STRING_AMD 0x1F01 #define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 #define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 #define GLX_GPU_RAM_AMD 0x21A3 #define GLX_GPU_CLOCK_AMD 0x21A4 #define GLX_GPU_NUM_PIPES_AMD 0x21A5 #define GLX_GPU_NUM_SIMD_AMD 0x21A6 #define GLX_GPU_NUM_RB_AMD 0x21A7 #define GLX_GPU_NUM_SPI_AMD 0x21A8 typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list); typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList); typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx); typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx); typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids); typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data); typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx); #define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD) #define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD) #define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD) #define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD) #define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD) #define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD) #define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD) #define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD) #define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD) #define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) #endif /* GLX_AMD_gpu_association */ /* --------------------- GLX_ARB_context_flush_control --------------------- */ #ifndef GLX_ARB_context_flush_control #define GLX_ARB_context_flush_control 1 #define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 #define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 #define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 #define GLXEW_ARB_context_flush_control GLXEW_GET_VAR(__GLXEW_ARB_context_flush_control) #endif /* GLX_ARB_context_flush_control */ /* ------------------------- GLX_ARB_create_context ------------------------ */ #ifndef GLX_ARB_create_context #define GLX_ARB_create_context 1 #define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 #define GLX_CONTEXT_FLAGS_ARB 0x2094 typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); #define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) #define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) #endif /* GLX_ARB_create_context */ /* --------------------- GLX_ARB_create_context_profile -------------------- */ #ifndef GLX_ARB_create_context_profile #define GLX_ARB_create_context_profile 1 #define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 #define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 #define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 #define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) #endif /* GLX_ARB_create_context_profile */ /* ------------------- GLX_ARB_create_context_robustness ------------------- */ #ifndef GLX_ARB_create_context_robustness #define GLX_ARB_create_context_robustness 1 #define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 #define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 #define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 #define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 #define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) #endif /* GLX_ARB_create_context_robustness */ /* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ #ifndef GLX_ARB_fbconfig_float #define GLX_ARB_fbconfig_float 1 #define GLX_RGBA_FLOAT_BIT_ARB 0x00000004 #define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9 #define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) #endif /* GLX_ARB_fbconfig_float */ /* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ #ifndef GLX_ARB_framebuffer_sRGB #define GLX_ARB_framebuffer_sRGB 1 #define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 #define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) #endif /* GLX_ARB_framebuffer_sRGB */ /* ------------------------ GLX_ARB_get_proc_address ----------------------- */ #ifndef GLX_ARB_get_proc_address #define GLX_ARB_get_proc_address 1 extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); #define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) #endif /* GLX_ARB_get_proc_address */ /* -------------------------- GLX_ARB_multisample -------------------------- */ #ifndef GLX_ARB_multisample #define GLX_ARB_multisample 1 #define GLX_SAMPLE_BUFFERS_ARB 100000 #define GLX_SAMPLES_ARB 100001 #define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) #endif /* GLX_ARB_multisample */ /* ---------------- GLX_ARB_robustness_application_isolation --------------- */ #ifndef GLX_ARB_robustness_application_isolation #define GLX_ARB_robustness_application_isolation 1 #define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 #define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation) #endif /* GLX_ARB_robustness_application_isolation */ /* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */ #ifndef GLX_ARB_robustness_share_group_isolation #define GLX_ARB_robustness_share_group_isolation 1 #define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 #define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation) #endif /* GLX_ARB_robustness_share_group_isolation */ /* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ #ifndef GLX_ARB_vertex_buffer_object #define GLX_ARB_vertex_buffer_object 1 #define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 #define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) #endif /* GLX_ARB_vertex_buffer_object */ /* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ #ifndef GLX_ATI_pixel_format_float #define GLX_ATI_pixel_format_float 1 #define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 #define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) #endif /* GLX_ATI_pixel_format_float */ /* ------------------------- GLX_ATI_render_texture ------------------------ */ #ifndef GLX_ATI_render_texture #define GLX_ATI_render_texture 1 #define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 #define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 #define GLX_TEXTURE_FORMAT_ATI 0x9802 #define GLX_TEXTURE_TARGET_ATI 0x9803 #define GLX_MIPMAP_TEXTURE_ATI 0x9804 #define GLX_TEXTURE_RGB_ATI 0x9805 #define GLX_TEXTURE_RGBA_ATI 0x9806 #define GLX_NO_TEXTURE_ATI 0x9807 #define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 #define GLX_TEXTURE_1D_ATI 0x9809 #define GLX_TEXTURE_2D_ATI 0x980A #define GLX_MIPMAP_LEVEL_ATI 0x980B #define GLX_CUBE_MAP_FACE_ATI 0x980C #define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D #define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E #define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F #define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 #define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 #define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 #define GLX_FRONT_LEFT_ATI 0x9813 #define GLX_FRONT_RIGHT_ATI 0x9814 #define GLX_BACK_LEFT_ATI 0x9815 #define GLX_BACK_RIGHT_ATI 0x9816 #define GLX_AUX0_ATI 0x9817 #define GLX_AUX1_ATI 0x9818 #define GLX_AUX2_ATI 0x9819 #define GLX_AUX3_ATI 0x981A #define GLX_AUX4_ATI 0x981B #define GLX_AUX5_ATI 0x981C #define GLX_AUX6_ATI 0x981D #define GLX_AUX7_ATI 0x981E #define GLX_AUX8_ATI 0x981F #define GLX_AUX9_ATI 0x9820 #define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 #define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); #define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) #define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) #define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) #define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) #endif /* GLX_ATI_render_texture */ /* --------------------------- GLX_EXT_buffer_age -------------------------- */ #ifndef GLX_EXT_buffer_age #define GLX_EXT_buffer_age 1 #define GLX_BACK_BUFFER_AGE_EXT 0x20F4 #define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age) #endif /* GLX_EXT_buffer_age */ /* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ #ifndef GLX_EXT_create_context_es2_profile #define GLX_EXT_create_context_es2_profile 1 #define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 #define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) #endif /* GLX_EXT_create_context_es2_profile */ /* ------------------- GLX_EXT_create_context_es_profile ------------------- */ #ifndef GLX_EXT_create_context_es_profile #define GLX_EXT_create_context_es_profile 1 #define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 #define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile) #endif /* GLX_EXT_create_context_es_profile */ /* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ #ifndef GLX_EXT_fbconfig_packed_float #define GLX_EXT_fbconfig_packed_float 1 #define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 #define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 #define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) #endif /* GLX_EXT_fbconfig_packed_float */ /* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ #ifndef GLX_EXT_framebuffer_sRGB #define GLX_EXT_framebuffer_sRGB 1 #define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 #define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) #endif /* GLX_EXT_framebuffer_sRGB */ /* ------------------------- GLX_EXT_import_context ------------------------ */ #ifndef GLX_EXT_import_context #define GLX_EXT_import_context 1 #define GLX_SHARE_CONTEXT_EXT 0x800A #define GLX_VISUAL_ID_EXT 0x800B #define GLX_SCREEN_EXT 0x800C typedef XID GLXContextID; typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); #define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) #define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) #define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) #define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) #define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) #endif /* GLX_EXT_import_context */ /* -------------------------- GLX_EXT_scene_marker ------------------------- */ #ifndef GLX_EXT_scene_marker #define GLX_EXT_scene_marker 1 #define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) #endif /* GLX_EXT_scene_marker */ /* -------------------------- GLX_EXT_stereo_tree -------------------------- */ #ifndef GLX_EXT_stereo_tree #define GLX_EXT_stereo_tree 1 #define GLX_STEREO_NOTIFY_EXT 0x00000000 #define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 #define GLX_STEREO_TREE_EXT 0x20F5 #define GLXEW_EXT_stereo_tree GLXEW_GET_VAR(__GLXEW_EXT_stereo_tree) #endif /* GLX_EXT_stereo_tree */ /* -------------------------- GLX_EXT_swap_control ------------------------- */ #ifndef GLX_EXT_swap_control #define GLX_EXT_swap_control 1 #define GLX_SWAP_INTERVAL_EXT 0x20F1 #define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); #define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) #define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) #endif /* GLX_EXT_swap_control */ /* ----------------------- GLX_EXT_swap_control_tear ----------------------- */ #ifndef GLX_EXT_swap_control_tear #define GLX_EXT_swap_control_tear 1 #define GLX_LATE_SWAPS_TEAR_EXT 0x20F3 #define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear) #endif /* GLX_EXT_swap_control_tear */ /* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ #ifndef GLX_EXT_texture_from_pixmap #define GLX_EXT_texture_from_pixmap 1 #define GLX_TEXTURE_1D_BIT_EXT 0x00000001 #define GLX_TEXTURE_2D_BIT_EXT 0x00000002 #define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 #define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 #define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 #define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 #define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 #define GLX_Y_INVERTED_EXT 0x20D4 #define GLX_TEXTURE_FORMAT_EXT 0x20D5 #define GLX_TEXTURE_TARGET_EXT 0x20D6 #define GLX_MIPMAP_TEXTURE_EXT 0x20D7 #define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 #define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 #define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA #define GLX_TEXTURE_1D_EXT 0x20DB #define GLX_TEXTURE_2D_EXT 0x20DC #define GLX_TEXTURE_RECTANGLE_EXT 0x20DD #define GLX_FRONT_LEFT_EXT 0x20DE #define GLX_FRONT_RIGHT_EXT 0x20DF #define GLX_BACK_LEFT_EXT 0x20E0 #define GLX_BACK_RIGHT_EXT 0x20E1 #define GLX_AUX0_EXT 0x20E2 #define GLX_AUX1_EXT 0x20E3 #define GLX_AUX2_EXT 0x20E4 #define GLX_AUX3_EXT 0x20E5 #define GLX_AUX4_EXT 0x20E6 #define GLX_AUX5_EXT 0x20E7 #define GLX_AUX6_EXT 0x20E8 #define GLX_AUX7_EXT 0x20E9 #define GLX_AUX8_EXT 0x20EA #define GLX_AUX9_EXT 0x20EB typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); #define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) #define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) #define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) #endif /* GLX_EXT_texture_from_pixmap */ /* -------------------------- GLX_EXT_visual_info -------------------------- */ #ifndef GLX_EXT_visual_info #define GLX_EXT_visual_info 1 #define GLX_X_VISUAL_TYPE_EXT 0x22 #define GLX_TRANSPARENT_TYPE_EXT 0x23 #define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 #define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 #define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 #define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 #define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 #define GLX_NONE_EXT 0x8000 #define GLX_TRUE_COLOR_EXT 0x8002 #define GLX_DIRECT_COLOR_EXT 0x8003 #define GLX_PSEUDO_COLOR_EXT 0x8004 #define GLX_STATIC_COLOR_EXT 0x8005 #define GLX_GRAY_SCALE_EXT 0x8006 #define GLX_STATIC_GRAY_EXT 0x8007 #define GLX_TRANSPARENT_RGB_EXT 0x8008 #define GLX_TRANSPARENT_INDEX_EXT 0x8009 #define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) #endif /* GLX_EXT_visual_info */ /* ------------------------- GLX_EXT_visual_rating ------------------------- */ #ifndef GLX_EXT_visual_rating #define GLX_EXT_visual_rating 1 #define GLX_VISUAL_CAVEAT_EXT 0x20 #define GLX_SLOW_VISUAL_EXT 0x8001 #define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D #define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) #endif /* GLX_EXT_visual_rating */ /* -------------------------- GLX_INTEL_swap_event ------------------------- */ #ifndef GLX_INTEL_swap_event #define GLX_INTEL_swap_event 1 #define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 #define GLX_COPY_COMPLETE_INTEL 0x8181 #define GLX_FLIP_COMPLETE_INTEL 0x8182 #define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 #define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) #endif /* GLX_INTEL_swap_event */ /* -------------------------- GLX_MESA_agp_offset -------------------------- */ #ifndef GLX_MESA_agp_offset #define GLX_MESA_agp_offset 1 typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); #define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) #define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) #endif /* GLX_MESA_agp_offset */ /* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ #ifndef GLX_MESA_copy_sub_buffer #define GLX_MESA_copy_sub_buffer 1 typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); #define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) #define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) #endif /* GLX_MESA_copy_sub_buffer */ /* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ #ifndef GLX_MESA_pixmap_colormap #define GLX_MESA_pixmap_colormap 1 typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); #define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) #define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) #endif /* GLX_MESA_pixmap_colormap */ /* ------------------------ GLX_MESA_query_renderer ------------------------ */ #ifndef GLX_MESA_query_renderer #define GLX_MESA_query_renderer 1 #define GLX_RENDERER_VENDOR_ID_MESA 0x8183 #define GLX_RENDERER_DEVICE_ID_MESA 0x8184 #define GLX_RENDERER_VERSION_MESA 0x8185 #define GLX_RENDERER_ACCELERATED_MESA 0x8186 #define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187 #define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188 #define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189 #define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A #define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B #define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C #define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D #define GLX_RENDERER_ID_MESA 0x818E typedef Bool ( * PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int* value); typedef const char* ( * PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute); typedef Bool ( * PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display* dpy, int screen, int renderer, int attribute, unsigned int *value); typedef const char* ( * PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute); #define glXQueryCurrentRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererIntegerMESA) #define glXQueryCurrentRendererStringMESA GLXEW_GET_FUN(__glewXQueryCurrentRendererStringMESA) #define glXQueryRendererIntegerMESA GLXEW_GET_FUN(__glewXQueryRendererIntegerMESA) #define glXQueryRendererStringMESA GLXEW_GET_FUN(__glewXQueryRendererStringMESA) #define GLXEW_MESA_query_renderer GLXEW_GET_VAR(__GLXEW_MESA_query_renderer) #endif /* GLX_MESA_query_renderer */ /* ------------------------ GLX_MESA_release_buffers ----------------------- */ #ifndef GLX_MESA_release_buffers #define GLX_MESA_release_buffers 1 typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); #define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) #define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) #endif /* GLX_MESA_release_buffers */ /* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ #ifndef GLX_MESA_set_3dfx_mode #define GLX_MESA_set_3dfx_mode 1 #define GLX_3DFX_WINDOW_MODE_MESA 0x1 #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); #define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) #define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) #endif /* GLX_MESA_set_3dfx_mode */ /* ------------------------- GLX_MESA_swap_control ------------------------- */ #ifndef GLX_MESA_swap_control #define GLX_MESA_swap_control 1 typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void); typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval); #define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA) #define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA) #define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control) #endif /* GLX_MESA_swap_control */ /* --------------------------- GLX_NV_copy_buffer -------------------------- */ #ifndef GLX_NV_copy_buffer #define GLX_NV_copy_buffer 1 typedef void ( * PFNGLXCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); typedef void ( * PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display* dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); #define glXCopyBufferSubDataNV GLXEW_GET_FUN(__glewXCopyBufferSubDataNV) #define glXNamedCopyBufferSubDataNV GLXEW_GET_FUN(__glewXNamedCopyBufferSubDataNV) #define GLXEW_NV_copy_buffer GLXEW_GET_VAR(__GLXEW_NV_copy_buffer) #endif /* GLX_NV_copy_buffer */ /* --------------------------- GLX_NV_copy_image --------------------------- */ #ifndef GLX_NV_copy_image #define GLX_NV_copy_image 1 typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); #define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) #define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) #endif /* GLX_NV_copy_image */ /* ------------------------ GLX_NV_delay_before_swap ----------------------- */ #ifndef GLX_NV_delay_before_swap #define GLX_NV_delay_before_swap 1 typedef Bool ( * PFNGLXDELAYBEFORESWAPNVPROC) (Display* dpy, GLXDrawable drawable, GLfloat seconds); #define glXDelayBeforeSwapNV GLXEW_GET_FUN(__glewXDelayBeforeSwapNV) #define GLXEW_NV_delay_before_swap GLXEW_GET_VAR(__GLXEW_NV_delay_before_swap) #endif /* GLX_NV_delay_before_swap */ /* -------------------------- GLX_NV_float_buffer -------------------------- */ #ifndef GLX_NV_float_buffer #define GLX_NV_float_buffer 1 #define GLX_FLOAT_COMPONENTS_NV 0x20B0 #define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) #endif /* GLX_NV_float_buffer */ /* ---------------------- GLX_NV_multisample_coverage ---------------------- */ #ifndef GLX_NV_multisample_coverage #define GLX_NV_multisample_coverage 1 #define GLX_COLOR_SAMPLES_NV 0x20B3 #define GLX_COVERAGE_SAMPLES_NV 100001 #define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) #endif /* GLX_NV_multisample_coverage */ /* -------------------------- GLX_NV_present_video ------------------------- */ #ifndef GLX_NV_present_video #define GLX_NV_present_video 1 #define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); #define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) #define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) #define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) #endif /* GLX_NV_present_video */ /* --------------------------- GLX_NV_swap_group --------------------------- */ #ifndef GLX_NV_swap_group #define GLX_NV_swap_group 1 typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); #define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) #define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) #define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) #define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) #define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) #define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) #define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) #endif /* GLX_NV_swap_group */ /* ----------------------- GLX_NV_vertex_array_range ----------------------- */ #ifndef GLX_NV_vertex_array_range #define GLX_NV_vertex_array_range 1 typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); #define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) #define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) #define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) #endif /* GLX_NV_vertex_array_range */ /* -------------------------- GLX_NV_video_capture ------------------------- */ #ifndef GLX_NV_video_capture #define GLX_NV_video_capture 1 #define GLX_DEVICE_ID_NV 0x20CD #define GLX_UNIQUE_ID_NV 0x20CE #define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF typedef XID GLXVideoCaptureDeviceNV; typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device); typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements); typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value); typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device); #define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV) #define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV) #define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV) #define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV) #define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV) #define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture) #endif /* GLX_NV_video_capture */ /* ---------------------------- GLX_NV_video_out --------------------------- */ #ifndef GLX_NV_video_out #define GLX_NV_video_out 1 #define GLX_VIDEO_OUT_COLOR_NV 0x20C3 #define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 #define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 #define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 #define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 #define GLX_VIDEO_OUT_FRAME_NV 0x20C8 #define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 #define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA #define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB #define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); #define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) #define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) #define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) #define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) #define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) #define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) #define GLXEW_NV_video_out GLXEW_GET_VAR(__GLXEW_NV_video_out) #endif /* GLX_NV_video_out */ /* -------------------------- GLX_OML_swap_method -------------------------- */ #ifndef GLX_OML_swap_method #define GLX_OML_swap_method 1 #define GLX_SWAP_METHOD_OML 0x8060 #define GLX_SWAP_EXCHANGE_OML 0x8061 #define GLX_SWAP_COPY_OML 0x8062 #define GLX_SWAP_UNDEFINED_OML 0x8063 #define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) #endif /* GLX_OML_swap_method */ /* -------------------------- GLX_OML_sync_control ------------------------- */ #ifndef GLX_OML_sync_control #define GLX_OML_sync_control 1 typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); #define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) #define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) #define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) #define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) #define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) #define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) #endif /* GLX_OML_sync_control */ /* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ #ifndef GLX_SGIS_blended_overlay #define GLX_SGIS_blended_overlay 1 #define GLX_BLENDED_RGBA_SGIS 0x8025 #define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) #endif /* GLX_SGIS_blended_overlay */ /* -------------------------- GLX_SGIS_color_range ------------------------- */ #ifndef GLX_SGIS_color_range #define GLX_SGIS_color_range 1 #define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) #endif /* GLX_SGIS_color_range */ /* -------------------------- GLX_SGIS_multisample ------------------------- */ #ifndef GLX_SGIS_multisample #define GLX_SGIS_multisample 1 #define GLX_SAMPLE_BUFFERS_SGIS 100000 #define GLX_SAMPLES_SGIS 100001 #define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) #endif /* GLX_SGIS_multisample */ /* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ #ifndef GLX_SGIS_shared_multisample #define GLX_SGIS_shared_multisample 1 #define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 #define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 #define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) #endif /* GLX_SGIS_shared_multisample */ /* --------------------------- GLX_SGIX_fbconfig --------------------------- */ #ifndef GLX_SGIX_fbconfig #define GLX_SGIX_fbconfig 1 #define GLX_RGBA_BIT_SGIX 0x00000001 #define GLX_WINDOW_BIT_SGIX 0x00000001 #define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 #define GLX_PIXMAP_BIT_SGIX 0x00000002 #define GLX_SCREEN_EXT 0x800C #define GLX_DRAWABLE_TYPE_SGIX 0x8010 #define GLX_RENDER_TYPE_SGIX 0x8011 #define GLX_X_RENDERABLE_SGIX 0x8012 #define GLX_FBCONFIG_ID_SGIX 0x8013 #define GLX_RGBA_TYPE_SGIX 0x8014 #define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 typedef XID GLXFBConfigIDSGIX; typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); #define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) #define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) #define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) #define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) #define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) #define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) #define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) #endif /* GLX_SGIX_fbconfig */ /* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ #ifndef GLX_SGIX_hyperpipe #define GLX_SGIX_hyperpipe 1 #define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 #define GLX_PIPE_RECT_SGIX 0x00000001 #define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 #define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 #define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 #define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 #define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 #define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 #define GLX_BAD_HYPERPIPE_SGIX 92 #define GLX_HYPERPIPE_ID_SGIX 0x8030 typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int networkId; } GLXHyperpipeNetworkSGIX; typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int XOrigin; int YOrigin; int maxHeight; int maxWidth; } GLXPipeRectLimits; typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int channel; unsigned int participationType; int timeSlice; } GLXHyperpipeConfigSGIX; typedef struct { char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; int srcXOrigin; int srcYOrigin; int srcWidth; int srcHeight; int destXOrigin; int destYOrigin; int destWidth; int destHeight; } GLXPipeRect; typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); #define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) #define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) #define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) #define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) #define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) #define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) #define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) #define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) #define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) #endif /* GLX_SGIX_hyperpipe */ /* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ #ifndef GLX_SGIX_pbuffer #define GLX_SGIX_pbuffer 1 #define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 #define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 #define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 #define GLX_PBUFFER_BIT_SGIX 0x00000004 #define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 #define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 #define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 #define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 #define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 #define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 #define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 #define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 #define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 #define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 #define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A #define GLX_PRESERVED_CONTENTS_SGIX 0x801B #define GLX_LARGEST_PBUFFER_SGIX 0x801C #define GLX_WIDTH_SGIX 0x801D #define GLX_HEIGHT_SGIX 0x801E #define GLX_EVENT_MASK_SGIX 0x801F #define GLX_DAMAGED_SGIX 0x8020 #define GLX_SAVED_SGIX 0x8021 #define GLX_WINDOW_SGIX 0x8022 #define GLX_PBUFFER_SGIX 0x8023 #define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 typedef XID GLXPbufferSGIX; typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); #define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) #define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) #define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) #define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) #define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) #define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) #endif /* GLX_SGIX_pbuffer */ /* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ #ifndef GLX_SGIX_swap_barrier #define GLX_SGIX_swap_barrier 1 typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); #define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) #define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) #define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) #endif /* GLX_SGIX_swap_barrier */ /* -------------------------- GLX_SGIX_swap_group -------------------------- */ #ifndef GLX_SGIX_swap_group #define GLX_SGIX_swap_group 1 typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); #define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) #define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) #endif /* GLX_SGIX_swap_group */ /* ------------------------- GLX_SGIX_video_resize ------------------------- */ #ifndef GLX_SGIX_video_resize #define GLX_SGIX_video_resize 1 #define GLX_SYNC_FRAME_SGIX 0x00000000 #define GLX_SYNC_SWAP_SGIX 0x00000001 typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); #define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) #define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) #define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) #define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) #define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) #define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) #endif /* GLX_SGIX_video_resize */ /* ---------------------- GLX_SGIX_visual_select_group --------------------- */ #ifndef GLX_SGIX_visual_select_group #define GLX_SGIX_visual_select_group 1 #define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 #define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) #endif /* GLX_SGIX_visual_select_group */ /* ---------------------------- GLX_SGI_cushion ---------------------------- */ #ifndef GLX_SGI_cushion #define GLX_SGI_cushion 1 typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); #define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) #define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) #endif /* GLX_SGI_cushion */ /* ----------------------- GLX_SGI_make_current_read ----------------------- */ #ifndef GLX_SGI_make_current_read #define GLX_SGI_make_current_read 1 typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); #define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) #define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) #define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) #endif /* GLX_SGI_make_current_read */ /* -------------------------- GLX_SGI_swap_control ------------------------- */ #ifndef GLX_SGI_swap_control #define GLX_SGI_swap_control 1 typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); #define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) #define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) #endif /* GLX_SGI_swap_control */ /* --------------------------- GLX_SGI_video_sync -------------------------- */ #ifndef GLX_SGI_video_sync #define GLX_SGI_video_sync 1 typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); #define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) #define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) #define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) #endif /* GLX_SGI_video_sync */ /* --------------------- GLX_SUN_get_transparent_index --------------------- */ #ifndef GLX_SUN_get_transparent_index #define GLX_SUN_get_transparent_index 1 typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); #define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) #define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) #endif /* GLX_SUN_get_transparent_index */ /* -------------------------- GLX_SUN_video_resize ------------------------- */ #ifndef GLX_SUN_video_resize #define GLX_SUN_video_resize 1 #define GLX_VIDEO_RESIZE_SUN 0x8171 #define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); #define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) #define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) #define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) #endif /* GLX_SUN_video_resize */ /* ------------------------------------------------------------------------- */ #ifdef GLEW_MX #define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT #define GLXEW_VAR_EXPORT #else #define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT #define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT #endif /* GLEW_MX */ GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow; GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext; GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent; GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD; GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD; GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD; GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD; GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD; GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD; GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD; GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD; GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD; GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC __glewXQueryCurrentRendererIntegerMESA; GLXEW_FUN_EXPORT PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC __glewXQueryCurrentRendererStringMESA; GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERINTEGERMESAPROC __glewXQueryRendererIntegerMESA; GLXEW_FUN_EXPORT PFNGLXQUERYRENDERERSTRINGMESAPROC __glewXQueryRendererStringMESA; GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA; GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA; GLXEW_FUN_EXPORT PFNGLXCOPYBUFFERSUBDATANVPROC __glewXCopyBufferSubDataNV; GLXEW_FUN_EXPORT PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC __glewXNamedCopyBufferSubDataNV; GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; GLXEW_FUN_EXPORT PFNGLXDELAYBEFORESWAPNVPROC __glewXDelayBeforeSwapNV; GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV; GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV; GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV; GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV; GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV; GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI; GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; #if defined(GLEW_MX) struct GLXEWContextStruct { #endif /* GLEW_MX */ GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0; GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1; GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2; GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3; GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4; GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample; GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_context_flush_control; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation; GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_stereo_tree; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info; GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating; GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event; GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset; GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_query_renderer; GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers; GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_buffer; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_delay_before_swap; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture; GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_out; GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method; GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control; GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync; GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize; #ifdef GLEW_MX }; /* GLXEWContextStruct */ #endif /* GLEW_MX */ /* ------------------------------------------------------------------------ */ #ifdef GLEW_MX typedef struct GLXEWContextStruct GLXEWContext; GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx); GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name); #define glxewInit() glxewContextInit(glxewGetContext()) #define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) #define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) #define GLXEW_GET_FUN(x) x #else /* GLEW_MX */ GLEWAPI GLenum GLEWAPIENTRY glxewInit (); GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name); #define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) #define GLXEW_GET_FUN(x) x #endif /* GLEW_MX */ GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name); #ifdef __cplusplus } #endif #endif /* __glxew_h__ */ ================================================ FILE: Libraries/Core/Windows/Headers/GL/wglew.h ================================================ /* ** The OpenGL Extension Wrangler Library ** Copyright (C) 2008-2015, Nigel Stewart ** Copyright (C) 2002-2008, Milan Ikits ** Copyright (C) 2002-2008, Marcelo E. Magallon ** Copyright (C) 2002, Lev Povalahev ** All rights reserved. ** ** Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are met: ** ** * Redistributions of source code must retain the above copyright notice, ** this list of conditions and the following disclaimer. ** * Redistributions in binary form must reproduce the above copyright notice, ** this list of conditions and the following disclaimer in the documentation ** and/or other materials provided with the distribution. ** * The name of the author may be used to endorse or promote products ** derived from this software without specific prior written permission. ** ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF ** THE POSSIBILITY OF SUCH DAMAGE. */ /* ** Copyright (c) 2007 The Khronos Group Inc. ** ** Permission is hereby granted, free of charge, to any person obtaining a ** copy of this software and/or associated documentation files (the ** "Materials"), to deal in the Materials without restriction, including ** without limitation the rights to use, copy, modify, merge, publish, ** distribute, sublicense, and/or sell copies of the Materials, and to ** permit persons to whom the Materials are furnished to do so, subject to ** the following conditions: ** ** The above copyright notice and this permission notice shall be included ** in all copies or substantial portions of the Materials. ** ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. */ #ifndef __wglew_h__ #define __wglew_h__ #define __WGLEW_H__ #ifdef __wglext_h_ #error wglext.h included before wglew.h #endif #define __wglext_h_ #if !defined(WINAPI) # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN 1 # endif #include # undef WIN32_LEAN_AND_MEAN #endif /* * GLEW_STATIC needs to be set when using the static version. * GLEW_BUILD is set when building the DLL version. */ #ifdef GLEW_STATIC # define GLEWAPI extern #else # ifdef GLEW_BUILD # define GLEWAPI extern __declspec(dllexport) # else # define GLEWAPI extern __declspec(dllimport) # endif #endif #ifdef __cplusplus extern "C" { #endif /* -------------------------- WGL_3DFX_multisample ------------------------- */ #ifndef WGL_3DFX_multisample #define WGL_3DFX_multisample 1 #define WGL_SAMPLE_BUFFERS_3DFX 0x2060 #define WGL_SAMPLES_3DFX 0x2061 #define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) #endif /* WGL_3DFX_multisample */ /* ------------------------- WGL_3DL_stereo_control ------------------------ */ #ifndef WGL_3DL_stereo_control #define WGL_3DL_stereo_control 1 #define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 #define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 #define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 #define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); #define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) #define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) #endif /* WGL_3DL_stereo_control */ /* ------------------------ WGL_AMD_gpu_association ------------------------ */ #ifndef WGL_AMD_gpu_association #define WGL_AMD_gpu_association 1 #define WGL_GPU_VENDOR_AMD 0x1F00 #define WGL_GPU_RENDERER_STRING_AMD 0x1F01 #define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 #define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 #define WGL_GPU_RAM_AMD 0x21A3 #define WGL_GPU_CLOCK_AMD 0x21A4 #define WGL_GPU_NUM_PIPES_AMD 0x21A5 #define WGL_GPU_NUM_SIMD_AMD 0x21A6 #define WGL_GPU_NUM_RB_AMD 0x21A7 #define WGL_GPU_NUM_SPI_AMD 0x21A8 typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); #define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) #define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) #define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) #define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) #define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) #define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) #define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) #define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) #define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) #define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) #endif /* WGL_AMD_gpu_association */ /* ------------------------- WGL_ARB_buffer_region ------------------------- */ #ifndef WGL_ARB_buffer_region #define WGL_ARB_buffer_region 1 #define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 #define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 #define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 #define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); #define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) #define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) #define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) #define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) #define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) #endif /* WGL_ARB_buffer_region */ /* --------------------- WGL_ARB_context_flush_control --------------------- */ #ifndef WGL_ARB_context_flush_control #define WGL_ARB_context_flush_control 1 #define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0x0000 #define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097 #define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098 #define WGLEW_ARB_context_flush_control WGLEW_GET_VAR(__WGLEW_ARB_context_flush_control) #endif /* WGL_ARB_context_flush_control */ /* ------------------------- WGL_ARB_create_context ------------------------ */ #ifndef WGL_ARB_create_context #define WGL_ARB_create_context 1 #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 #define WGL_CONTEXT_FLAGS_ARB 0x2094 #define ERROR_INVALID_VERSION_ARB 0x2095 #define ERROR_INVALID_PROFILE_ARB 0x2096 typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); #define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) #define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) #endif /* WGL_ARB_create_context */ /* --------------------- WGL_ARB_create_context_profile -------------------- */ #ifndef WGL_ARB_create_context_profile #define WGL_ARB_create_context_profile 1 #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 #define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) #endif /* WGL_ARB_create_context_profile */ /* ------------------- WGL_ARB_create_context_robustness ------------------- */ #ifndef WGL_ARB_create_context_robustness #define WGL_ARB_create_context_robustness 1 #define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 #define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 #define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 #define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 #define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) #endif /* WGL_ARB_create_context_robustness */ /* ----------------------- WGL_ARB_extensions_string ----------------------- */ #ifndef WGL_ARB_extensions_string #define WGL_ARB_extensions_string 1 typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); #define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) #define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) #endif /* WGL_ARB_extensions_string */ /* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ #ifndef WGL_ARB_framebuffer_sRGB #define WGL_ARB_framebuffer_sRGB 1 #define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 #define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) #endif /* WGL_ARB_framebuffer_sRGB */ /* ----------------------- WGL_ARB_make_current_read ----------------------- */ #ifndef WGL_ARB_make_current_read #define WGL_ARB_make_current_read 1 #define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 #define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); #define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) #define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) #define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) #endif /* WGL_ARB_make_current_read */ /* -------------------------- WGL_ARB_multisample -------------------------- */ #ifndef WGL_ARB_multisample #define WGL_ARB_multisample 1 #define WGL_SAMPLE_BUFFERS_ARB 0x2041 #define WGL_SAMPLES_ARB 0x2042 #define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) #endif /* WGL_ARB_multisample */ /* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ #ifndef WGL_ARB_pbuffer #define WGL_ARB_pbuffer 1 #define WGL_DRAW_TO_PBUFFER_ARB 0x202D #define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E #define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F #define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 #define WGL_PBUFFER_LARGEST_ARB 0x2033 #define WGL_PBUFFER_WIDTH_ARB 0x2034 #define WGL_PBUFFER_HEIGHT_ARB 0x2035 #define WGL_PBUFFER_LOST_ARB 0x2036 DECLARE_HANDLE(HPBUFFERARB); typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); #define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) #define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) #define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) #define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) #define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) #define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) #endif /* WGL_ARB_pbuffer */ /* -------------------------- WGL_ARB_pixel_format ------------------------- */ #ifndef WGL_ARB_pixel_format #define WGL_ARB_pixel_format 1 #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 #define WGL_DRAW_TO_WINDOW_ARB 0x2001 #define WGL_DRAW_TO_BITMAP_ARB 0x2002 #define WGL_ACCELERATION_ARB 0x2003 #define WGL_NEED_PALETTE_ARB 0x2004 #define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 #define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 #define WGL_SWAP_METHOD_ARB 0x2007 #define WGL_NUMBER_OVERLAYS_ARB 0x2008 #define WGL_NUMBER_UNDERLAYS_ARB 0x2009 #define WGL_TRANSPARENT_ARB 0x200A #define WGL_SHARE_DEPTH_ARB 0x200C #define WGL_SHARE_STENCIL_ARB 0x200D #define WGL_SHARE_ACCUM_ARB 0x200E #define WGL_SUPPORT_GDI_ARB 0x200F #define WGL_SUPPORT_OPENGL_ARB 0x2010 #define WGL_DOUBLE_BUFFER_ARB 0x2011 #define WGL_STEREO_ARB 0x2012 #define WGL_PIXEL_TYPE_ARB 0x2013 #define WGL_COLOR_BITS_ARB 0x2014 #define WGL_RED_BITS_ARB 0x2015 #define WGL_RED_SHIFT_ARB 0x2016 #define WGL_GREEN_BITS_ARB 0x2017 #define WGL_GREEN_SHIFT_ARB 0x2018 #define WGL_BLUE_BITS_ARB 0x2019 #define WGL_BLUE_SHIFT_ARB 0x201A #define WGL_ALPHA_BITS_ARB 0x201B #define WGL_ALPHA_SHIFT_ARB 0x201C #define WGL_ACCUM_BITS_ARB 0x201D #define WGL_ACCUM_RED_BITS_ARB 0x201E #define WGL_ACCUM_GREEN_BITS_ARB 0x201F #define WGL_ACCUM_BLUE_BITS_ARB 0x2020 #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 #define WGL_DEPTH_BITS_ARB 0x2022 #define WGL_STENCIL_BITS_ARB 0x2023 #define WGL_AUX_BUFFERS_ARB 0x2024 #define WGL_NO_ACCELERATION_ARB 0x2025 #define WGL_GENERIC_ACCELERATION_ARB 0x2026 #define WGL_FULL_ACCELERATION_ARB 0x2027 #define WGL_SWAP_EXCHANGE_ARB 0x2028 #define WGL_SWAP_COPY_ARB 0x2029 #define WGL_SWAP_UNDEFINED_ARB 0x202A #define WGL_TYPE_RGBA_ARB 0x202B #define WGL_TYPE_COLORINDEX_ARB 0x202C #define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 #define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); #define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) #define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) #define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) #define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) #endif /* WGL_ARB_pixel_format */ /* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ #ifndef WGL_ARB_pixel_format_float #define WGL_ARB_pixel_format_float 1 #define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 #define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) #endif /* WGL_ARB_pixel_format_float */ /* ------------------------- WGL_ARB_render_texture ------------------------ */ #ifndef WGL_ARB_render_texture #define WGL_ARB_render_texture 1 #define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 #define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 #define WGL_TEXTURE_FORMAT_ARB 0x2072 #define WGL_TEXTURE_TARGET_ARB 0x2073 #define WGL_MIPMAP_TEXTURE_ARB 0x2074 #define WGL_TEXTURE_RGB_ARB 0x2075 #define WGL_TEXTURE_RGBA_ARB 0x2076 #define WGL_NO_TEXTURE_ARB 0x2077 #define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 #define WGL_TEXTURE_1D_ARB 0x2079 #define WGL_TEXTURE_2D_ARB 0x207A #define WGL_MIPMAP_LEVEL_ARB 0x207B #define WGL_CUBE_MAP_FACE_ARB 0x207C #define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E #define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 #define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 #define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 #define WGL_FRONT_LEFT_ARB 0x2083 #define WGL_FRONT_RIGHT_ARB 0x2084 #define WGL_BACK_LEFT_ARB 0x2085 #define WGL_BACK_RIGHT_ARB 0x2086 #define WGL_AUX0_ARB 0x2087 #define WGL_AUX1_ARB 0x2088 #define WGL_AUX2_ARB 0x2089 #define WGL_AUX3_ARB 0x208A #define WGL_AUX4_ARB 0x208B #define WGL_AUX5_ARB 0x208C #define WGL_AUX6_ARB 0x208D #define WGL_AUX7_ARB 0x208E #define WGL_AUX8_ARB 0x208F #define WGL_AUX9_ARB 0x2090 typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); #define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) #define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) #define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) #define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) #endif /* WGL_ARB_render_texture */ /* ---------------- WGL_ARB_robustness_application_isolation --------------- */ #ifndef WGL_ARB_robustness_application_isolation #define WGL_ARB_robustness_application_isolation 1 #define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 #define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation) #endif /* WGL_ARB_robustness_application_isolation */ /* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */ #ifndef WGL_ARB_robustness_share_group_isolation #define WGL_ARB_robustness_share_group_isolation 1 #define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008 #define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation) #endif /* WGL_ARB_robustness_share_group_isolation */ /* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ #ifndef WGL_ATI_pixel_format_float #define WGL_ATI_pixel_format_float 1 #define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 #define GL_RGBA_FLOAT_MODE_ATI 0x8820 #define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 #define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) #endif /* WGL_ATI_pixel_format_float */ /* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ #ifndef WGL_ATI_render_texture_rectangle #define WGL_ATI_render_texture_rectangle 1 #define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 #define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) #endif /* WGL_ATI_render_texture_rectangle */ /* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ #ifndef WGL_EXT_create_context_es2_profile #define WGL_EXT_create_context_es2_profile 1 #define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 #define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) #endif /* WGL_EXT_create_context_es2_profile */ /* ------------------- WGL_EXT_create_context_es_profile ------------------- */ #ifndef WGL_EXT_create_context_es_profile #define WGL_EXT_create_context_es_profile 1 #define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004 #define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile) #endif /* WGL_EXT_create_context_es_profile */ /* -------------------------- WGL_EXT_depth_float -------------------------- */ #ifndef WGL_EXT_depth_float #define WGL_EXT_depth_float 1 #define WGL_DEPTH_FLOAT_EXT 0x2040 #define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) #endif /* WGL_EXT_depth_float */ /* ---------------------- WGL_EXT_display_color_table ---------------------- */ #ifndef WGL_EXT_display_color_table #define WGL_EXT_display_color_table 1 typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); #define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) #define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) #define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) #define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) #define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) #endif /* WGL_EXT_display_color_table */ /* ----------------------- WGL_EXT_extensions_string ----------------------- */ #ifndef WGL_EXT_extensions_string #define WGL_EXT_extensions_string 1 typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); #define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) #define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) #endif /* WGL_EXT_extensions_string */ /* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ #ifndef WGL_EXT_framebuffer_sRGB #define WGL_EXT_framebuffer_sRGB 1 #define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 #define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) #endif /* WGL_EXT_framebuffer_sRGB */ /* ----------------------- WGL_EXT_make_current_read ----------------------- */ #ifndef WGL_EXT_make_current_read #define WGL_EXT_make_current_read 1 #define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); #define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) #define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) #define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) #endif /* WGL_EXT_make_current_read */ /* -------------------------- WGL_EXT_multisample -------------------------- */ #ifndef WGL_EXT_multisample #define WGL_EXT_multisample 1 #define WGL_SAMPLE_BUFFERS_EXT 0x2041 #define WGL_SAMPLES_EXT 0x2042 #define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) #endif /* WGL_EXT_multisample */ /* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ #ifndef WGL_EXT_pbuffer #define WGL_EXT_pbuffer 1 #define WGL_DRAW_TO_PBUFFER_EXT 0x202D #define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E #define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F #define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 #define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 #define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 #define WGL_PBUFFER_LARGEST_EXT 0x2033 #define WGL_PBUFFER_WIDTH_EXT 0x2034 #define WGL_PBUFFER_HEIGHT_EXT 0x2035 DECLARE_HANDLE(HPBUFFEREXT); typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); #define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) #define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) #define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) #define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) #define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) #define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) #endif /* WGL_EXT_pbuffer */ /* -------------------------- WGL_EXT_pixel_format ------------------------- */ #ifndef WGL_EXT_pixel_format #define WGL_EXT_pixel_format 1 #define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 #define WGL_DRAW_TO_WINDOW_EXT 0x2001 #define WGL_DRAW_TO_BITMAP_EXT 0x2002 #define WGL_ACCELERATION_EXT 0x2003 #define WGL_NEED_PALETTE_EXT 0x2004 #define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 #define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 #define WGL_SWAP_METHOD_EXT 0x2007 #define WGL_NUMBER_OVERLAYS_EXT 0x2008 #define WGL_NUMBER_UNDERLAYS_EXT 0x2009 #define WGL_TRANSPARENT_EXT 0x200A #define WGL_TRANSPARENT_VALUE_EXT 0x200B #define WGL_SHARE_DEPTH_EXT 0x200C #define WGL_SHARE_STENCIL_EXT 0x200D #define WGL_SHARE_ACCUM_EXT 0x200E #define WGL_SUPPORT_GDI_EXT 0x200F #define WGL_SUPPORT_OPENGL_EXT 0x2010 #define WGL_DOUBLE_BUFFER_EXT 0x2011 #define WGL_STEREO_EXT 0x2012 #define WGL_PIXEL_TYPE_EXT 0x2013 #define WGL_COLOR_BITS_EXT 0x2014 #define WGL_RED_BITS_EXT 0x2015 #define WGL_RED_SHIFT_EXT 0x2016 #define WGL_GREEN_BITS_EXT 0x2017 #define WGL_GREEN_SHIFT_EXT 0x2018 #define WGL_BLUE_BITS_EXT 0x2019 #define WGL_BLUE_SHIFT_EXT 0x201A #define WGL_ALPHA_BITS_EXT 0x201B #define WGL_ALPHA_SHIFT_EXT 0x201C #define WGL_ACCUM_BITS_EXT 0x201D #define WGL_ACCUM_RED_BITS_EXT 0x201E #define WGL_ACCUM_GREEN_BITS_EXT 0x201F #define WGL_ACCUM_BLUE_BITS_EXT 0x2020 #define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 #define WGL_DEPTH_BITS_EXT 0x2022 #define WGL_STENCIL_BITS_EXT 0x2023 #define WGL_AUX_BUFFERS_EXT 0x2024 #define WGL_NO_ACCELERATION_EXT 0x2025 #define WGL_GENERIC_ACCELERATION_EXT 0x2026 #define WGL_FULL_ACCELERATION_EXT 0x2027 #define WGL_SWAP_EXCHANGE_EXT 0x2028 #define WGL_SWAP_COPY_EXT 0x2029 #define WGL_SWAP_UNDEFINED_EXT 0x202A #define WGL_TYPE_RGBA_EXT 0x202B #define WGL_TYPE_COLORINDEX_EXT 0x202C typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); #define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) #define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) #define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) #define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) #endif /* WGL_EXT_pixel_format */ /* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ #ifndef WGL_EXT_pixel_format_packed_float #define WGL_EXT_pixel_format_packed_float 1 #define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 #define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) #endif /* WGL_EXT_pixel_format_packed_float */ /* -------------------------- WGL_EXT_swap_control ------------------------- */ #ifndef WGL_EXT_swap_control #define WGL_EXT_swap_control 1 typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); #define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) #define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) #define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) #endif /* WGL_EXT_swap_control */ /* ----------------------- WGL_EXT_swap_control_tear ----------------------- */ #ifndef WGL_EXT_swap_control_tear #define WGL_EXT_swap_control_tear 1 #define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear) #endif /* WGL_EXT_swap_control_tear */ /* --------------------- WGL_I3D_digital_video_control --------------------- */ #ifndef WGL_I3D_digital_video_control #define WGL_I3D_digital_video_control 1 #define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 #define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 #define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 #define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); #define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) #define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) #define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) #endif /* WGL_I3D_digital_video_control */ /* ----------------------------- WGL_I3D_gamma ----------------------------- */ #ifndef WGL_I3D_gamma #define WGL_I3D_gamma 1 #define WGL_GAMMA_TABLE_SIZE_I3D 0x204E #define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); #define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) #define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) #define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) #define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) #define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) #endif /* WGL_I3D_gamma */ /* ---------------------------- WGL_I3D_genlock ---------------------------- */ #ifndef WGL_I3D_genlock #define WGL_I3D_genlock 1 #define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 #define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 #define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 #define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 #define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 #define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 #define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A #define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B #define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); #define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) #define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) #define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) #define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) #define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) #define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) #define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) #define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) #define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) #define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) #define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) #define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) #define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) #endif /* WGL_I3D_genlock */ /* -------------------------- WGL_I3D_image_buffer ------------------------- */ #ifndef WGL_I3D_image_buffer #define WGL_I3D_image_buffer 1 #define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 #define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); #define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) #define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) #define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) #define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) #define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) #endif /* WGL_I3D_image_buffer */ /* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ #ifndef WGL_I3D_swap_frame_lock #define WGL_I3D_swap_frame_lock 1 typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); #define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) #define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) #define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) #define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) #define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) #endif /* WGL_I3D_swap_frame_lock */ /* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ #ifndef WGL_I3D_swap_frame_usage #define WGL_I3D_swap_frame_usage 1 typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); #define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) #define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) #define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) #define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) #define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) #endif /* WGL_I3D_swap_frame_usage */ /* --------------------------- WGL_NV_DX_interop --------------------------- */ #ifndef WGL_NV_DX_interop #define WGL_NV_DX_interop 1 #define WGL_ACCESS_READ_ONLY_NV 0x0000 #define WGL_ACCESS_READ_WRITE_NV 0x0001 #define WGL_ACCESS_WRITE_DISCARD_NV 0x0002 typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice); typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access); typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice); typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access); typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle); typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects); typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject); #define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV) #define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV) #define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV) #define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV) #define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV) #define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV) #define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV) #define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV) #define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop) #endif /* WGL_NV_DX_interop */ /* --------------------------- WGL_NV_DX_interop2 -------------------------- */ #ifndef WGL_NV_DX_interop2 #define WGL_NV_DX_interop2 1 #define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2) #endif /* WGL_NV_DX_interop2 */ /* --------------------------- WGL_NV_copy_image --------------------------- */ #ifndef WGL_NV_copy_image #define WGL_NV_copy_image 1 typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); #define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) #define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) #endif /* WGL_NV_copy_image */ /* ------------------------ WGL_NV_delay_before_swap ----------------------- */ #ifndef WGL_NV_delay_before_swap #define WGL_NV_delay_before_swap 1 typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds); #define wglDelayBeforeSwapNV WGLEW_GET_FUN(__wglewDelayBeforeSwapNV) #define WGLEW_NV_delay_before_swap WGLEW_GET_VAR(__WGLEW_NV_delay_before_swap) #endif /* WGL_NV_delay_before_swap */ /* -------------------------- WGL_NV_float_buffer -------------------------- */ #ifndef WGL_NV_float_buffer #define WGL_NV_float_buffer 1 #define WGL_FLOAT_COMPONENTS_NV 0x20B0 #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 #define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 #define WGL_TEXTURE_FLOAT_R_NV 0x20B5 #define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 #define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 #define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 #define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) #endif /* WGL_NV_float_buffer */ /* -------------------------- WGL_NV_gpu_affinity -------------------------- */ #ifndef WGL_NV_gpu_affinity #define WGL_NV_gpu_affinity 1 #define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 #define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 DECLARE_HANDLE(HGPUNV); typedef struct _GPU_DEVICE { DWORD cb; CHAR DeviceName[32]; CHAR DeviceString[128]; DWORD Flags; RECT rcVirtualScreen; } GPU_DEVICE, *PGPU_DEVICE; typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); #define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) #define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) #define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) #define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) #define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) #define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) #endif /* WGL_NV_gpu_affinity */ /* ---------------------- WGL_NV_multisample_coverage ---------------------- */ #ifndef WGL_NV_multisample_coverage #define WGL_NV_multisample_coverage 1 #define WGL_COVERAGE_SAMPLES_NV 0x2042 #define WGL_COLOR_SAMPLES_NV 0x20B9 #define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) #endif /* WGL_NV_multisample_coverage */ /* -------------------------- WGL_NV_present_video ------------------------- */ #ifndef WGL_NV_present_video #define WGL_NV_present_video 1 #define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); #define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) #define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) #define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) #define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) #endif /* WGL_NV_present_video */ /* ---------------------- WGL_NV_render_depth_texture ---------------------- */ #ifndef WGL_NV_render_depth_texture #define WGL_NV_render_depth_texture 1 #define WGL_NO_TEXTURE_ARB 0x2077 #define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 #define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 #define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 #define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 #define WGL_DEPTH_COMPONENT_NV 0x20A7 #define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) #endif /* WGL_NV_render_depth_texture */ /* -------------------- WGL_NV_render_texture_rectangle -------------------- */ #ifndef WGL_NV_render_texture_rectangle #define WGL_NV_render_texture_rectangle 1 #define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 #define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 #define WGL_TEXTURE_RECTANGLE_NV 0x20A2 #define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) #endif /* WGL_NV_render_texture_rectangle */ /* --------------------------- WGL_NV_swap_group --------------------------- */ #ifndef WGL_NV_swap_group #define WGL_NV_swap_group 1 typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); #define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) #define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) #define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) #define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) #define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) #define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) #define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) #endif /* WGL_NV_swap_group */ /* ----------------------- WGL_NV_vertex_array_range ----------------------- */ #ifndef WGL_NV_vertex_array_range #define WGL_NV_vertex_array_range 1 typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); #define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) #define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) #define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) #endif /* WGL_NV_vertex_array_range */ /* -------------------------- WGL_NV_video_capture ------------------------- */ #ifndef WGL_NV_video_capture #define WGL_NV_video_capture 1 #define WGL_UNIQUE_ID_NV 0x20CE #define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF DECLARE_HANDLE(HVIDEOINPUTDEVICENV); typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice); typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList); typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue); typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice); #define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV) #define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV) #define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV) #define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV) #define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV) #define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture) #endif /* WGL_NV_video_capture */ /* -------------------------- WGL_NV_video_output -------------------------- */ #ifndef WGL_NV_video_output #define WGL_NV_video_output 1 #define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 #define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 #define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 #define WGL_VIDEO_OUT_COLOR_NV 0x20C3 #define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 #define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 #define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 #define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 #define WGL_VIDEO_OUT_FRAME 0x20C8 #define WGL_VIDEO_OUT_FIELD_1 0x20C9 #define WGL_VIDEO_OUT_FIELD_2 0x20CA #define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB #define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC DECLARE_HANDLE(HPVIDEODEV); typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); #define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) #define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) #define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) #define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) #define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) #define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) #define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) #endif /* WGL_NV_video_output */ /* -------------------------- WGL_OML_sync_control ------------------------- */ #ifndef WGL_OML_sync_control #define WGL_OML_sync_control 1 typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); #define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) #define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) #define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) #define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) #define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) #define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) #define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) #endif /* WGL_OML_sync_control */ /* ------------------------------------------------------------------------- */ #ifdef GLEW_MX #define WGLEW_FUN_EXPORT #define WGLEW_VAR_EXPORT #else #define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT #define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT #endif /* GLEW_MX */ #ifdef GLEW_MX struct WGLEWContextStruct { #endif /* GLEW_MX */ WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV; WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV; WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV; WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV; WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV; WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV; WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV; WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV; WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; WGLEW_FUN_EXPORT PFNWGLDELAYBEFORESWAPNVPROC __wglewDelayBeforeSwapNV; WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV; WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV; WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV; WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV; WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV; WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample; WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control; WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_context_flush_control; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation; WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation; WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control; WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_delay_before_swap; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture; WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output; WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control; #ifdef GLEW_MX }; /* WGLEWContextStruct */ #endif /* GLEW_MX */ /* ------------------------------------------------------------------------- */ #ifdef GLEW_MX typedef struct WGLEWContextStruct WGLEWContext; GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx); GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name); #define wglewInit() wglewContextInit(wglewGetContext()) #define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) #define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) #define WGLEW_GET_FUN(x) wglewGetContext()->x #else /* GLEW_MX */ GLEWAPI GLenum GLEWAPIENTRY wglewInit (); GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name); #define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) #define WGLEW_GET_FUN(x) x #endif /* GLEW_MX */ GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name); #ifdef __cplusplus } #endif #undef GLEWAPI #endif /* __wglew_h__ */ ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/AlResource.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_ALRESOURCE_HPP #define SFML_ALRESOURCE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Base class for classes that require an OpenAL context /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API AlResource { protected: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// AlResource(); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~AlResource(); }; } // namespace sf #endif // SFML_ALRESOURCE_HPP //////////////////////////////////////////////////////////// /// \class sf::AlResource /// \ingroup audio /// /// This class is for internal use only, it must be the base /// of every class that requires a valid OpenAL context in /// order to work. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/Export.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_AUDIO_EXPORT_HPP #define SFML_AUDIO_EXPORT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include //////////////////////////////////////////////////////////// // Define portable import / export macros //////////////////////////////////////////////////////////// #if defined(SFML_AUDIO_EXPORTS) #define SFML_AUDIO_API SFML_API_EXPORT #else #define SFML_AUDIO_API SFML_API_IMPORT #endif #endif // SFML_AUDIO_EXPORT_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/InputSoundFile.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_INPUTSOUNDFILE_HPP #define SFML_INPUTSOUNDFILE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include namespace sf { class InputStream; class SoundFileReader; //////////////////////////////////////////////////////////// /// \brief Provide read access to sound files /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API InputSoundFile : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// InputSoundFile(); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~InputSoundFile(); //////////////////////////////////////////////////////////// /// \brief Open a sound file from the disk for reading /// /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. /// /// \param filename Path of the sound file to load /// /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// bool openFromFile(const std::string& filename); //////////////////////////////////////////////////////////// /// \brief Open a sound file in memory for reading /// /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. /// /// \param data Pointer to the file data in memory /// \param sizeInBytes Size of the data to load, in bytes /// /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// bool openFromMemory(const void* data, std::size_t sizeInBytes); //////////////////////////////////////////////////////////// /// \brief Open a sound file from a custom stream for reading /// /// The supported audio formats are: WAV (PCM only), OGG/Vorbis, FLAC. /// The supported sample sizes for FLAC and WAV are 8, 16, 24 and 32 bit. /// /// \param stream Source stream to read from /// /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// bool openFromStream(InputStream& stream); //////////////////////////////////////////////////////////// /// \brief Open the sound file from the disk for writing /// /// \param filename Path of the sound file to write /// \param channelCount Number of channels in the sound /// \param sampleRate Sample rate of the sound /// /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// bool openForWriting(const std::string& filename, unsigned int channelCount, unsigned int sampleRate); //////////////////////////////////////////////////////////// /// \brief Get the total number of audio samples in the file /// /// \return Number of samples /// //////////////////////////////////////////////////////////// Uint64 getSampleCount() const; //////////////////////////////////////////////////////////// /// \brief Get the number of channels used by the sound /// /// \return Number of channels (1 = mono, 2 = stereo) /// //////////////////////////////////////////////////////////// unsigned int getChannelCount() const; //////////////////////////////////////////////////////////// /// \brief Get the sample rate of the sound /// /// \return Sample rate, in samples per second /// //////////////////////////////////////////////////////////// unsigned int getSampleRate() const; //////////////////////////////////////////////////////////// /// \brief Get the total duration of the sound file /// /// This function is provided for convenience, the duration is /// deduced from the other sound file attributes. /// /// \return Duration of the sound file /// //////////////////////////////////////////////////////////// Time getDuration() const; //////////////////////////////////////////////////////////// /// \brief Change the current read position to the given sample offset /// /// This function takes a sample offset to provide maximum /// precision. If you need to jump to a given time, use the /// other overload. /// /// The sample offset takes the channels into account. /// Offsets can be calculated like this: /// `sampleNumber * sampleRate * channelCount` /// If the given offset exceeds to total number of samples, /// this function jumps to the end of the sound file. /// /// \param sampleOffset Index of the sample to jump to, relative to the beginning /// //////////////////////////////////////////////////////////// void seek(Uint64 sampleOffset); //////////////////////////////////////////////////////////// /// \brief Change the current read position to the given time offset /// /// Using a time offset is handy but imprecise. If you need an accurate /// result, consider using the overload which takes a sample offset. /// /// If the given time exceeds to total duration, this function jumps /// to the end of the sound file. /// /// \param timeOffset Time to jump to, relative to the beginning /// //////////////////////////////////////////////////////////// void seek(Time timeOffset); //////////////////////////////////////////////////////////// /// \brief Read audio samples from the open file /// /// \param samples Pointer to the sample array to fill /// \param maxCount Maximum number of samples to read /// /// \return Number of samples actually read (may be less than \a maxCount) /// //////////////////////////////////////////////////////////// Uint64 read(Int16* samples, Uint64 maxCount); private: //////////////////////////////////////////////////////////// /// \brief Close the current file /// //////////////////////////////////////////////////////////// void close(); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// SoundFileReader* m_reader; ///< Reader that handles I/O on the file's format InputStream* m_stream; ///< Input stream used to access the file's data bool m_streamOwned; ///< Is the stream internal or external? Uint64 m_sampleCount; ///< Total number of samples in the file unsigned int m_channelCount; ///< Number of channels of the sound unsigned int m_sampleRate; ///< Number of samples per second }; } // namespace sf #endif // SFML_INPUTSOUNDFILE_HPP //////////////////////////////////////////////////////////// /// \class sf::InputSoundFile /// \ingroup audio /// /// This class decodes audio samples from a sound file. It is /// used internally by higher-level classes such as sf::SoundBuffer /// and sf::Music, but can also be useful if you want to process /// or analyze audio files without playing them, or if you want to /// implement your own version of sf::Music with more specific /// features. /// /// Usage example: /// \code /// // Open a sound file /// sf::InputSoundFile file; /// if (!file.openFromFile("music.ogg")) /// /* error */; /// /// // Print the sound attributes /// std::cout << "duration: " << file.getDuration().asSeconds() << std::endl; /// std::cout << "channels: " << file.getChannelCount() << std::endl; /// std::cout << "sample rate: " << file.getSampleRate() << std::endl; /// std::cout << "sample count: " << file.getSampleCount() << std::endl; /// /// // Read and process batches of samples until the end of file is reached /// sf::Int16 samples[1024]; /// sf::Uint64 count; /// do /// { /// count = file.read(samples, 1024); /// /// // process, analyze, play, convert, or whatever /// // you want to do with the samples... /// } /// while (count > 0); /// \endcode /// /// \see sf::SoundFileReader, sf::OutputSoundFile /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/Listener.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_LISTENER_HPP #define SFML_LISTENER_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief The audio listener is the point in the scene /// from where all the sounds are heard /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API Listener { public: //////////////////////////////////////////////////////////// /// \brief Change the global volume of all the sounds and musics /// /// The volume is a number between 0 and 100; it is combined with /// the individual volume of each sound / music. /// The default value for the volume is 100 (maximum). /// /// \param volume New global volume, in the range [0, 100] /// /// \see getGlobalVolume /// //////////////////////////////////////////////////////////// static void setGlobalVolume(float volume); //////////////////////////////////////////////////////////// /// \brief Get the current value of the global volume /// /// \return Current global volume, in the range [0, 100] /// /// \see setGlobalVolume /// //////////////////////////////////////////////////////////// static float getGlobalVolume(); //////////////////////////////////////////////////////////// /// \brief Set the position of the listener in the scene /// /// The default listener's position is (0, 0, 0). /// /// \param x X coordinate of the listener's position /// \param y Y coordinate of the listener's position /// \param z Z coordinate of the listener's position /// /// \see getPosition, setDirection /// //////////////////////////////////////////////////////////// static void setPosition(float x, float y, float z); //////////////////////////////////////////////////////////// /// \brief Set the position of the listener in the scene /// /// The default listener's position is (0, 0, 0). /// /// \param position New listener's position /// /// \see getPosition, setDirection /// //////////////////////////////////////////////////////////// static void setPosition(const Vector3f& position); //////////////////////////////////////////////////////////// /// \brief Get the current position of the listener in the scene /// /// \return Listener's position /// /// \see setPosition /// //////////////////////////////////////////////////////////// static Vector3f getPosition(); //////////////////////////////////////////////////////////// /// \brief Set the forward vector of the listener in the scene /// /// The direction (also called "at vector") is the vector /// pointing forward from the listener's perspective. Together /// with the up vector, it defines the 3D orientation of the /// listener in the scene. The direction vector doesn't /// have to be normalized. /// The default listener's direction is (0, 0, -1). /// /// \param x X coordinate of the listener's direction /// \param y Y coordinate of the listener's direction /// \param z Z coordinate of the listener's direction /// /// \see getDirection, setUpVector, setPosition /// //////////////////////////////////////////////////////////// static void setDirection(float x, float y, float z); //////////////////////////////////////////////////////////// /// \brief Set the forward vector of the listener in the scene /// /// The direction (also called "at vector") is the vector /// pointing forward from the listener's perspective. Together /// with the up vector, it defines the 3D orientation of the /// listener in the scene. The direction vector doesn't /// have to be normalized. /// The default listener's direction is (0, 0, -1). /// /// \param direction New listener's direction /// /// \see getDirection, setUpVector, setPosition /// //////////////////////////////////////////////////////////// static void setDirection(const Vector3f& direction); //////////////////////////////////////////////////////////// /// \brief Get the current forward vector of the listener in the scene /// /// \return Listener's forward vector (not normalized) /// /// \see setDirection /// //////////////////////////////////////////////////////////// static Vector3f getDirection(); //////////////////////////////////////////////////////////// /// \brief Set the upward vector of the listener in the scene /// /// The up vector is the vector that points upward from the /// listener's perspective. Together with the direction, it /// defines the 3D orientation of the listener in the scene. /// The up vector doesn't have to be normalized. /// The default listener's up vector is (0, 1, 0). It is usually /// not necessary to change it, especially in 2D scenarios. /// /// \param x X coordinate of the listener's up vector /// \param y Y coordinate of the listener's up vector /// \param z Z coordinate of the listener's up vector /// /// \see getUpVector, setDirection, setPosition /// //////////////////////////////////////////////////////////// static void setUpVector(float x, float y, float z); //////////////////////////////////////////////////////////// /// \brief Set the upward vector of the listener in the scene /// /// The up vector is the vector that points upward from the /// listener's perspective. Together with the direction, it /// defines the 3D orientation of the listener in the scene. /// The up vector doesn't have to be normalized. /// The default listener's up vector is (0, 1, 0). It is usually /// not necessary to change it, especially in 2D scenarios. /// /// \param upVector New listener's up vector /// /// \see getUpVector, setDirection, setPosition /// //////////////////////////////////////////////////////////// static void setUpVector(const Vector3f& upVector); //////////////////////////////////////////////////////////// /// \brief Get the current upward vector of the listener in the scene /// /// \return Listener's upward vector (not normalized) /// /// \see setUpVector /// //////////////////////////////////////////////////////////// static Vector3f getUpVector(); }; } // namespace sf #endif // SFML_LISTENER_HPP //////////////////////////////////////////////////////////// /// \class sf::Listener /// \ingroup audio /// /// The audio listener defines the global properties of the /// audio environment, it defines where and how sounds and musics /// are heard. If sf::View is the eyes of the user, then sf::Listener /// is his ears (by the way, they are often linked together -- /// same position, orientation, etc.). /// /// sf::Listener is a simple interface, which allows to setup the /// listener in the 3D audio environment (position, direction and /// up vector), and to adjust the global volume. /// /// Because the listener is unique in the scene, sf::Listener only /// contains static functions and doesn't have to be instantiated. /// /// Usage example: /// \code /// // Move the listener to the position (1, 0, -5) /// sf::Listener::setPosition(1, 0, -5); /// /// // Make it face the right axis (1, 0, 0) /// sf::Listener::setDirection(1, 0, 0); /// /// // Reduce the global volume /// sf::Listener::setGlobalVolume(50); /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/Music.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_MUSIC_HPP #define SFML_MUSIC_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include namespace sf { class InputStream; //////////////////////////////////////////////////////////// /// \brief Streamed music played from an audio file /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API Music : public SoundStream { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// Music(); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~Music(); //////////////////////////////////////////////////////////// /// \brief Open a music from an audio file /// /// This function doesn't start playing the music (call play() /// to do so). /// See the documentation of sf::InputSoundFile for the list /// of supported formats. /// /// \warning Since the music is not loaded at once but rather /// streamed continuously, the file must remain accessible until /// the sf::Music object loads a new music or is destroyed. /// /// \param filename Path of the music file to open /// /// \return True if loading succeeded, false if it failed /// /// \see openFromMemory, openFromStream /// //////////////////////////////////////////////////////////// bool openFromFile(const std::string& filename); //////////////////////////////////////////////////////////// /// \brief Open a music from an audio file in memory /// /// This function doesn't start playing the music (call play() /// to do so). /// See the documentation of sf::InputSoundFile for the list /// of supported formats. /// /// \warning Since the music is not loaded at once but rather streamed /// continuously, the \a data buffer must remain accessible until /// the sf::Music object loads a new music or is destroyed. That is, /// you can't deallocate the buffer right after calling this function. /// /// \param data Pointer to the file data in memory /// \param sizeInBytes Size of the data to load, in bytes /// /// \return True if loading succeeded, false if it failed /// /// \see openFromFile, openFromStream /// //////////////////////////////////////////////////////////// bool openFromMemory(const void* data, std::size_t sizeInBytes); //////////////////////////////////////////////////////////// /// \brief Open a music from an audio file in a custom stream /// /// This function doesn't start playing the music (call play() /// to do so). /// See the documentation of sf::InputSoundFile for the list /// of supported formats. /// /// \warning Since the music is not loaded at once but rather /// streamed continuously, the \a stream must remain accessible /// until the sf::Music object loads a new music or is destroyed. /// /// \param stream Source stream to read from /// /// \return True if loading succeeded, false if it failed /// /// \see openFromFile, openFromMemory /// //////////////////////////////////////////////////////////// bool openFromStream(InputStream& stream); //////////////////////////////////////////////////////////// /// \brief Get the total duration of the music /// /// \return Music duration /// //////////////////////////////////////////////////////////// Time getDuration() const; protected: //////////////////////////////////////////////////////////// /// \brief Request a new chunk of audio samples from the stream source /// /// This function fills the chunk from the next samples /// to read from the audio file. /// /// \param data Chunk of data to fill /// /// \return True to continue playback, false to stop /// //////////////////////////////////////////////////////////// virtual bool onGetData(Chunk& data); //////////////////////////////////////////////////////////// /// \brief Change the current playing position in the stream source /// /// \param timeOffset New playing position, from the beginning of the music /// //////////////////////////////////////////////////////////// virtual void onSeek(Time timeOffset); private: //////////////////////////////////////////////////////////// /// \brief Initialize the internal state after loading a new music /// //////////////////////////////////////////////////////////// void initialize(); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// InputSoundFile m_file; ///< The streamed music file Time m_duration; ///< Music duration std::vector m_samples; ///< Temporary buffer of samples Mutex m_mutex; ///< Mutex protecting the data }; } // namespace sf #endif // SFML_MUSIC_HPP //////////////////////////////////////////////////////////// /// \class sf::Music /// \ingroup audio /// /// Musics are sounds that are streamed rather than completely /// loaded in memory. This is especially useful for compressed /// musics that usually take hundreds of MB when they are /// uncompressed: by streaming it instead of loading it entirely, /// you avoid saturating the memory and have almost no loading delay. /// This implies that the underlying resource (file, stream or /// memory buffer) must remain valid for the lifetime of the /// sf::Music object. /// /// Apart from that, a sf::Music has almost the same features as /// the sf::SoundBuffer / sf::Sound pair: you can play/pause/stop /// it, request its parameters (channels, sample rate), change /// the way it is played (pitch, volume, 3D position, ...), etc. /// /// As a sound stream, a music is played in its own thread in order /// not to block the rest of the program. This means that you can /// leave the music alone after calling play(), it will manage itself /// very well. /// /// Usage example: /// \code /// // Declare a new music /// sf::Music music; /// /// // Open it from an audio file /// if (!music.openFromFile("music.ogg")) /// { /// // error... /// } /// /// // Change some parameters /// music.setPosition(0, 1, 10); // change its 3D position /// music.setPitch(2); // increase the pitch /// music.setVolume(50); // reduce the volume /// music.setLoop(true); // make it loop /// /// // Play it /// music.play(); /// \endcode /// /// \see sf::Sound, sf::SoundStream /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/OutputSoundFile.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_OUTPUTSOUNDFILE_HPP #define SFML_OUTPUTSOUNDFILE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { class SoundFileWriter; //////////////////////////////////////////////////////////// /// \brief Provide write access to sound files /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API OutputSoundFile : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// OutputSoundFile(); //////////////////////////////////////////////////////////// /// \brief Destructor /// /// Closes the file if it was still open. /// //////////////////////////////////////////////////////////// ~OutputSoundFile(); //////////////////////////////////////////////////////////// /// \brief Open the sound file from the disk for writing /// /// The supported audio formats are: WAV, OGG/Vorbis, FLAC. /// /// \param filename Path of the sound file to write /// \param sampleRate Sample rate of the sound /// \param channelCount Number of channels in the sound /// /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// bool openFromFile(const std::string& filename, unsigned int sampleRate, unsigned int channelCount); //////////////////////////////////////////////////////////// /// \brief Write audio samples to the file /// /// \param samples Pointer to the sample array to write /// \param count Number of samples to write /// //////////////////////////////////////////////////////////// void write(const Int16* samples, Uint64 count); private: //////////////////////////////////////////////////////////// /// \brief Close the current file /// //////////////////////////////////////////////////////////// void close(); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// SoundFileWriter* m_writer; ///< Writer that handles I/O on the file's format }; } // namespace sf #endif // SFML_OUTPUTSOUNDFILE_HPP //////////////////////////////////////////////////////////// /// \class sf::OutputSoundFile /// \ingroup audio /// /// This class encodes audio samples to a sound file. It is /// used internally by higher-level classes such as sf::SoundBuffer, /// but can also be useful if you want to create audio files from /// custom data sources, like generated audio samples. /// /// Usage example: /// \code /// // Create a sound file, ogg/vorbis format, 44100 Hz, stereo /// sf::OutputSoundFile file; /// if (!file.openFromFile("music.ogg", 44100, 2)) /// /* error */; /// /// while (...) /// { /// // Read or generate audio samples from your custom source /// std::vector samples = ...; /// /// // Write them to the file /// file.write(samples.data(), samples.size()); /// } /// \endcode /// /// \see sf::SoundFileWriter, sf::InputSoundFile /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/Sound.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOUND_HPP #define SFML_SOUND_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include namespace sf { class SoundBuffer; //////////////////////////////////////////////////////////// /// \brief Regular sound that can be played in the audio environment /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API Sound : public SoundSource { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// Sound(); //////////////////////////////////////////////////////////// /// \brief Construct the sound with a buffer /// /// \param buffer Sound buffer containing the audio data to play with the sound /// //////////////////////////////////////////////////////////// explicit Sound(const SoundBuffer& buffer); //////////////////////////////////////////////////////////// /// \brief Copy constructor /// /// \param copy Instance to copy /// //////////////////////////////////////////////////////////// Sound(const Sound& copy); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~Sound(); //////////////////////////////////////////////////////////// /// \brief Start or resume playing the sound /// /// This function starts the stream if it was stopped, resumes /// it if it was paused, and restarts it from beginning if it /// was it already playing. /// This function uses its own thread so that it doesn't block /// the rest of the program while the sound is played. /// /// \see pause, stop /// //////////////////////////////////////////////////////////// void play(); //////////////////////////////////////////////////////////// /// \brief Pause the sound /// /// This function pauses the sound if it was playing, /// otherwise (sound already paused or stopped) it has no effect. /// /// \see play, stop /// //////////////////////////////////////////////////////////// void pause(); //////////////////////////////////////////////////////////// /// \brief stop playing the sound /// /// This function stops the sound if it was playing or paused, /// and does nothing if it was already stopped. /// It also resets the playing position (unlike pause()). /// /// \see play, pause /// //////////////////////////////////////////////////////////// void stop(); //////////////////////////////////////////////////////////// /// \brief Set the source buffer containing the audio data to play /// /// It is important to note that the sound buffer is not copied, /// thus the sf::SoundBuffer instance must remain alive as long /// as it is attached to the sound. /// /// \param buffer Sound buffer to attach to the sound /// /// \see getBuffer /// //////////////////////////////////////////////////////////// void setBuffer(const SoundBuffer& buffer); //////////////////////////////////////////////////////////// /// \brief Set whether or not the sound should loop after reaching the end /// /// If set, the sound will restart from beginning after /// reaching the end and so on, until it is stopped or /// setLoop(false) is called. /// The default looping state for sound is false. /// /// \param loop True to play in loop, false to play once /// /// \see getLoop /// //////////////////////////////////////////////////////////// void setLoop(bool loop); //////////////////////////////////////////////////////////// /// \brief Change the current playing position of the sound /// /// The playing position can be changed when the sound is /// either paused or playing. Changing the playing position /// when the sound is stopped has no effect, since playing /// the sound will reset its position. /// /// \param timeOffset New playing position, from the beginning of the sound /// /// \see getPlayingOffset /// //////////////////////////////////////////////////////////// void setPlayingOffset(Time timeOffset); //////////////////////////////////////////////////////////// /// \brief Get the audio buffer attached to the sound /// /// \return Sound buffer attached to the sound (can be NULL) /// //////////////////////////////////////////////////////////// const SoundBuffer* getBuffer() const; //////////////////////////////////////////////////////////// /// \brief Tell whether or not the sound is in loop mode /// /// \return True if the sound is looping, false otherwise /// /// \see setLoop /// //////////////////////////////////////////////////////////// bool getLoop() const; //////////////////////////////////////////////////////////// /// \brief Get the current playing position of the sound /// /// \return Current playing position, from the beginning of the sound /// /// \see setPlayingOffset /// //////////////////////////////////////////////////////////// Time getPlayingOffset() const; //////////////////////////////////////////////////////////// /// \brief Get the current status of the sound (stopped, paused, playing) /// /// \return Current status of the sound /// //////////////////////////////////////////////////////////// Status getStatus() const; //////////////////////////////////////////////////////////// /// \brief Overload of assignment operator /// /// \param right Instance to assign /// /// \return Reference to self /// //////////////////////////////////////////////////////////// Sound& operator =(const Sound& right); //////////////////////////////////////////////////////////// /// \brief Reset the internal buffer of the sound /// /// This function is for internal use only, you don't have /// to use it. It is called by the sf::SoundBuffer that /// this sound uses, when it is destroyed in order to prevent /// the sound from using a dead buffer. /// //////////////////////////////////////////////////////////// void resetBuffer(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// const SoundBuffer* m_buffer; ///< Sound buffer bound to the source }; } // namespace sf #endif // SFML_SOUND_HPP //////////////////////////////////////////////////////////// /// \class sf::Sound /// \ingroup audio /// /// sf::Sound is the class to use to play sounds. /// It provides: /// \li Control (play, pause, stop) /// \li Ability to modify output parameters in real-time (pitch, volume, ...) /// \li 3D spatial features (position, attenuation, ...). /// /// sf::Sound is perfect for playing short sounds that can /// fit in memory and require no latency, like foot steps or /// gun shots. For longer sounds, like background musics /// or long speeches, rather see sf::Music (which is based /// on streaming). /// /// In order to work, a sound must be given a buffer of audio /// data to play. Audio data (samples) is stored in sf::SoundBuffer, /// and attached to a sound with the setBuffer() function. /// The buffer object attached to a sound must remain alive /// as long as the sound uses it. Note that multiple sounds /// can use the same sound buffer at the same time. /// /// Usage example: /// \code /// sf::SoundBuffer buffer; /// buffer.loadFromFile("sound.wav"); /// /// sf::Sound sound; /// sound.setBuffer(buffer); /// sound.play(); /// \endcode /// /// \see sf::SoundBuffer, sf::Music /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/SoundBuffer.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOUNDBUFFER_HPP #define SFML_SOUNDBUFFER_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include namespace sf { class Sound; class InputSoundFile; class InputStream; //////////////////////////////////////////////////////////// /// \brief Storage for audio samples defining a sound /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API SoundBuffer : AlResource { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// SoundBuffer(); //////////////////////////////////////////////////////////// /// \brief Copy constructor /// /// \param copy Instance to copy /// //////////////////////////////////////////////////////////// SoundBuffer(const SoundBuffer& copy); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~SoundBuffer(); //////////////////////////////////////////////////////////// /// \brief Load the sound buffer from a file /// /// See the documentation of sf::InputSoundFile for the list /// of supported formats. /// /// \param filename Path of the sound file to load /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromMemory, loadFromStream, loadFromSamples, saveToFile /// //////////////////////////////////////////////////////////// bool loadFromFile(const std::string& filename); //////////////////////////////////////////////////////////// /// \brief Load the sound buffer from a file in memory /// /// See the documentation of sf::InputSoundFile for the list /// of supported formats. /// /// \param data Pointer to the file data in memory /// \param sizeInBytes Size of the data to load, in bytes /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromStream, loadFromSamples /// //////////////////////////////////////////////////////////// bool loadFromMemory(const void* data, std::size_t sizeInBytes); //////////////////////////////////////////////////////////// /// \brief Load the sound buffer from a custom stream /// /// See the documentation of sf::InputSoundFile for the list /// of supported formats. /// /// \param stream Source stream to read from /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromMemory, loadFromSamples /// //////////////////////////////////////////////////////////// bool loadFromStream(InputStream& stream); //////////////////////////////////////////////////////////// /// \brief Load the sound buffer from an array of audio samples /// /// The assumed format of the audio samples is 16 bits signed integer /// (sf::Int16). /// /// \param samples Pointer to the array of samples in memory /// \param sampleCount Number of samples in the array /// \param channelCount Number of channels (1 = mono, 2 = stereo, ...) /// \param sampleRate Sample rate (number of samples to play per second) /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromMemory, saveToFile /// //////////////////////////////////////////////////////////// bool loadFromSamples(const Int16* samples, Uint64 sampleCount, unsigned int channelCount, unsigned int sampleRate); //////////////////////////////////////////////////////////// /// \brief Save the sound buffer to an audio file /// /// See the documentation of sf::OutputSoundFile for the list /// of supported formats. /// /// \param filename Path of the sound file to write /// /// \return True if saving succeeded, false if it failed /// /// \see loadFromFile, loadFromMemory, loadFromSamples /// //////////////////////////////////////////////////////////// bool saveToFile(const std::string& filename) const; //////////////////////////////////////////////////////////// /// \brief Get the array of audio samples stored in the buffer /// /// The format of the returned samples is 16 bits signed integer /// (sf::Int16). The total number of samples in this array /// is given by the getSampleCount() function. /// /// \return Read-only pointer to the array of sound samples /// /// \see getSampleCount /// //////////////////////////////////////////////////////////// const Int16* getSamples() const; //////////////////////////////////////////////////////////// /// \brief Get the number of samples stored in the buffer /// /// The array of samples can be accessed with the getSamples() /// function. /// /// \return Number of samples /// /// \see getSamples /// //////////////////////////////////////////////////////////// Uint64 getSampleCount() const; //////////////////////////////////////////////////////////// /// \brief Get the sample rate of the sound /// /// The sample rate is the number of samples played per second. /// The higher, the better the quality (for example, 44100 /// samples/s is CD quality). /// /// \return Sample rate (number of samples per second) /// /// \see getChannelCount, getDuration /// //////////////////////////////////////////////////////////// unsigned int getSampleRate() const; //////////////////////////////////////////////////////////// /// \brief Get the number of channels used by the sound /// /// If the sound is mono then the number of channels will /// be 1, 2 for stereo, etc. /// /// \return Number of channels /// /// \see getSampleRate, getDuration /// //////////////////////////////////////////////////////////// unsigned int getChannelCount() const; //////////////////////////////////////////////////////////// /// \brief Get the total duration of the sound /// /// \return Sound duration /// /// \see getSampleRate, getChannelCount /// //////////////////////////////////////////////////////////// Time getDuration() const; //////////////////////////////////////////////////////////// /// \brief Overload of assignment operator /// /// \param right Instance to assign /// /// \return Reference to self /// //////////////////////////////////////////////////////////// SoundBuffer& operator =(const SoundBuffer& right); private: friend class Sound; //////////////////////////////////////////////////////////// /// \brief Initialize the internal state after loading a new sound /// /// \param file Sound file providing access to the new loaded sound /// /// \return True on successful initialization, false on failure /// //////////////////////////////////////////////////////////// bool initialize(InputSoundFile& file); //////////////////////////////////////////////////////////// /// \brief Update the internal buffer with the cached audio samples /// /// \param channelCount Number of channels /// \param sampleRate Sample rate (number of samples per second) /// /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// bool update(unsigned int channelCount, unsigned int sampleRate); //////////////////////////////////////////////////////////// /// \brief Add a sound to the list of sounds that use this buffer /// /// \param sound Sound instance to attach /// //////////////////////////////////////////////////////////// void attachSound(Sound* sound) const; //////////////////////////////////////////////////////////// /// \brief Remove a sound from the list of sounds that use this buffer /// /// \param sound Sound instance to detach /// //////////////////////////////////////////////////////////// void detachSound(Sound* sound) const; //////////////////////////////////////////////////////////// // Types //////////////////////////////////////////////////////////// typedef std::set SoundList; ///< Set of unique sound instances //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// unsigned int m_buffer; ///< OpenAL buffer identifier std::vector m_samples; ///< Samples buffer Time m_duration; ///< Sound duration mutable SoundList m_sounds; ///< List of sounds that are using this buffer }; } // namespace sf #endif // SFML_SOUNDBUFFER_HPP //////////////////////////////////////////////////////////// /// \class sf::SoundBuffer /// \ingroup audio /// /// A sound buffer holds the data of a sound, which is /// an array of audio samples. A sample is a 16 bits signed integer /// that defines the amplitude of the sound at a given time. /// The sound is then reconstituted by playing these samples at /// a high rate (for example, 44100 samples per second is the /// standard rate used for playing CDs). In short, audio samples /// are like texture pixels, and a sf::SoundBuffer is similar to /// a sf::Texture. /// /// A sound buffer can be loaded from a file (see loadFromFile() /// for the complete list of supported formats), from memory, from /// a custom stream (see sf::InputStream) or directly from an array /// of samples. It can also be saved back to a file. /// /// Sound buffers alone are not very useful: they hold the audio data /// but cannot be played. To do so, you need to use the sf::Sound class, /// which provides functions to play/pause/stop the sound as well as /// changing the way it is outputted (volume, pitch, 3D position, ...). /// This separation allows more flexibility and better performances: /// indeed a sf::SoundBuffer is a heavy resource, and any operation on it /// is slow (often too slow for real-time applications). On the other /// side, a sf::Sound is a lightweight object, which can use the audio data /// of a sound buffer and change the way it is played without actually /// modifying that data. Note that it is also possible to bind /// several sf::Sound instances to the same sf::SoundBuffer. /// /// It is important to note that the sf::Sound instance doesn't /// copy the buffer that it uses, it only keeps a reference to it. /// Thus, a sf::SoundBuffer must not be destructed while it is /// used by a sf::Sound (i.e. never write a function that /// uses a local sf::SoundBuffer instance for loading a sound). /// /// Usage example: /// \code /// // Declare a new sound buffer /// sf::SoundBuffer buffer; /// /// // Load it from a file /// if (!buffer.loadFromFile("sound.wav")) /// { /// // error... /// } /// /// // Create a sound source and bind it to the buffer /// sf::Sound sound1; /// sound1.setBuffer(buffer); /// /// // Play the sound /// sound1.play(); /// /// // Create another sound source bound to the same buffer /// sf::Sound sound2; /// sound2.setBuffer(buffer); /// /// // Play it with a higher pitch -- the first sound remains unchanged /// sound2.setPitch(2); /// sound2.play(); /// \endcode /// /// \see sf::Sound, sf::SoundBufferRecorder /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/SoundBufferRecorder.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOUNDBUFFERRECORDER_HPP #define SFML_SOUNDBUFFERRECORDER_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Specialized SoundRecorder which stores the captured /// audio data into a sound buffer /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API SoundBufferRecorder : public SoundRecorder { public: //////////////////////////////////////////////////////////// /// \brief destructor /// //////////////////////////////////////////////////////////// ~SoundBufferRecorder(); //////////////////////////////////////////////////////////// /// \brief Get the sound buffer containing the captured audio data /// /// The sound buffer is valid only after the capture has ended. /// This function provides a read-only access to the internal /// sound buffer, but it can be copied if you need to /// make any modification to it. /// /// \return Read-only access to the sound buffer /// //////////////////////////////////////////////////////////// const SoundBuffer& getBuffer() const; protected: //////////////////////////////////////////////////////////// /// \brief Start capturing audio data /// /// \return True to start the capture, or false to abort it /// //////////////////////////////////////////////////////////// virtual bool onStart(); //////////////////////////////////////////////////////////// /// \brief Process a new chunk of recorded samples /// /// \param samples Pointer to the new chunk of recorded samples /// \param sampleCount Number of samples pointed by \a samples /// /// \return True to continue the capture, or false to stop it /// //////////////////////////////////////////////////////////// virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount); //////////////////////////////////////////////////////////// /// \brief Stop capturing audio data /// //////////////////////////////////////////////////////////// virtual void onStop(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// std::vector m_samples; ///< Temporary sample buffer to hold the recorded data SoundBuffer m_buffer; ///< Sound buffer that will contain the recorded data }; } // namespace sf #endif // SFML_SOUNDBUFFERRECORDER_HPP //////////////////////////////////////////////////////////// /// \class sf::SoundBufferRecorder /// \ingroup audio /// /// sf::SoundBufferRecorder allows to access a recorded sound /// through a sf::SoundBuffer, so that it can be played, saved /// to a file, etc. /// /// It has the same simple interface as its base class (start(), stop()) /// and adds a function to retrieve the recorded sound buffer /// (getBuffer()). /// /// As usual, don't forget to call the isAvailable() function /// before using this class (see sf::SoundRecorder for more details /// about this). /// /// Usage example: /// \code /// if (sf::SoundBufferRecorder::isAvailable()) /// { /// // Record some audio data /// sf::SoundBufferRecorder recorder; /// recorder.start(); /// ... /// recorder.stop(); /// /// // Get the buffer containing the captured audio data /// const sf::SoundBuffer& buffer = recorder.getBuffer(); /// /// // Save it to a file (for example...) /// buffer.saveToFile("my_record.ogg"); /// } /// \endcode /// /// \see sf::SoundRecorder /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/SoundFileFactory.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOUNDFILEFACTORY_HPP #define SFML_SOUNDFILEFACTORY_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { class InputStream; class SoundFileReader; class SoundFileWriter; //////////////////////////////////////////////////////////// /// \brief Manages and instantiates sound file readers and writers /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API SoundFileFactory { public: //////////////////////////////////////////////////////////// /// \brief Register a new reader /// /// \see unregisterReader /// //////////////////////////////////////////////////////////// template static void registerReader(); //////////////////////////////////////////////////////////// /// \brief Unregister a reader /// /// \see registerReader /// //////////////////////////////////////////////////////////// template static void unregisterReader(); //////////////////////////////////////////////////////////// /// \brief Register a new writer /// /// \see unregisterWriter /// //////////////////////////////////////////////////////////// template static void registerWriter(); //////////////////////////////////////////////////////////// /// \brief Unregister a writer /// /// \see registerWriter /// //////////////////////////////////////////////////////////// template static void unregisterWriter(); //////////////////////////////////////////////////////////// /// \brief Instantiate the right reader for the given file on disk /// /// It's up to the caller to release the returned reader /// /// \param filename Path of the sound file /// /// \return A new sound file reader that can read the given file, or null if no reader can handle it /// /// \see createReaderFromMemory, createReaderFromStream /// //////////////////////////////////////////////////////////// static SoundFileReader* createReaderFromFilename(const std::string& filename); //////////////////////////////////////////////////////////// /// \brief Instantiate the right codec for the given file in memory /// /// It's up to the caller to release the returned reader /// /// \param data Pointer to the file data in memory /// \param sizeInBytes Total size of the file data, in bytes /// /// \return A new sound file codec that can read the given file, or null if no codec can handle it /// /// \see createReaderFromFilename, createReaderFromStream /// //////////////////////////////////////////////////////////// static SoundFileReader* createReaderFromMemory(const void* data, std::size_t sizeInBytes); //////////////////////////////////////////////////////////// /// \brief Instantiate the right codec for the given file in stream /// /// It's up to the caller to release the returned reader /// /// \param stream Source stream to read from /// /// \return A new sound file codec that can read the given file, or null if no codec can handle it /// /// \see createReaderFromFilename, createReaderFromMemory /// //////////////////////////////////////////////////////////// static SoundFileReader* createReaderFromStream(InputStream& stream); //////////////////////////////////////////////////////////// /// \brief Instantiate the right writer for the given file on disk /// /// It's up to the caller to release the returned writer /// /// \param filename Path of the sound file /// /// \return A new sound file writer that can write given file, or null if no writer can handle it /// //////////////////////////////////////////////////////////// static SoundFileWriter* createWriterFromFilename(const std::string& filename); private: //////////////////////////////////////////////////////////// // Types //////////////////////////////////////////////////////////// struct ReaderFactory { bool (*check)(InputStream&); SoundFileReader* (*create)(); }; typedef std::vector ReaderFactoryArray; struct WriterFactory { bool (*check)(const std::string&); SoundFileWriter* (*create)(); }; typedef std::vector WriterFactoryArray; //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// static ReaderFactoryArray s_readers; ///< List of all registered readers static WriterFactoryArray s_writers; ///< List of all registered writers }; } // namespace sf #include #endif // SFML_SOUNDFILEFACTORY_HPP //////////////////////////////////////////////////////////// /// \class sf::SoundFileFactory /// \ingroup audio /// /// This class is where all the sound file readers and writers are /// registered. You should normally only need to use its registration /// and unregistration functions; readers/writers creation and manipulation /// are wrapped into the higher-level classes sf::InputSoundFile and /// sf::OutputSoundFile. /// /// To register a new reader (writer) use the sf::SoundFileFactory::registerReader /// (registerWriter) static function. You don't have to call the unregisterReader /// (unregisterWriter) function, unless you want to unregister a format before your /// application ends (typically, when a plugin is unloaded). /// /// Usage example: /// \code /// sf::SoundFileFactory::registerReader(); /// sf::SoundFileFactory::registerWriter(); /// \endcode /// /// \see sf::InputSoundFile, sf::OutputSoundFile, sf::SoundFileReader, sf::SoundFileWriter /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/SoundFileFactory.inl ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// namespace sf { namespace priv { template SoundFileReader* createReader() {return new T;} template SoundFileWriter* createWriter() {return new T;} } //////////////////////////////////////////////////////////// template void SoundFileFactory::registerReader() { // Make sure the same class won't be registered twice unregisterReader(); // Create a new factory with the functions provided by the class ReaderFactory factory; factory.check = &T::check; factory.create = &priv::createReader; // Add it s_readers.push_back(factory); } //////////////////////////////////////////////////////////// template void SoundFileFactory::unregisterReader() { // Remove the instance(s) of the reader from the array of factories for (ReaderFactoryArray::iterator it = s_readers.begin(); it != s_readers.end(); ) { if (it->create == &priv::createReader) it = s_readers.erase(it); else ++it; } } //////////////////////////////////////////////////////////// template void SoundFileFactory::registerWriter() { // Make sure the same class won't be registered twice unregisterWriter(); // Create a new factory with the functions provided by the class WriterFactory factory; factory.check = &T::check; factory.create = &priv::createWriter; // Add it s_writers.push_back(factory); } //////////////////////////////////////////////////////////// template void SoundFileFactory::unregisterWriter() { // Remove the instance(s) of the writer from the array of factories for (WriterFactoryArray::iterator it = s_writers.begin(); it != s_writers.end(); ) { if (it->create == &priv::createWriter) it = s_writers.erase(it); else ++it; } } } // namespace sf ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/SoundFileReader.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOUNDFILEREADER_HPP #define SFML_SOUNDFILEREADER_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { class InputStream; //////////////////////////////////////////////////////////// /// \brief Abstract base class for sound file decoding /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API SoundFileReader { public: //////////////////////////////////////////////////////////// /// \brief Structure holding the audio properties of a sound file /// //////////////////////////////////////////////////////////// struct Info { Uint64 sampleCount; ///< Total number of samples in the file unsigned int channelCount; ///< Number of channels of the sound unsigned int sampleRate; ///< Samples rate of the sound, in samples per second }; //////////////////////////////////////////////////////////// /// \brief Virtual destructor /// //////////////////////////////////////////////////////////// virtual ~SoundFileReader() {} //////////////////////////////////////////////////////////// /// \brief Open a sound file for reading /// /// The provided stream reference is valid as long as the /// SoundFileReader is alive, so it is safe to use/store it /// during the whole lifetime of the reader. /// /// \param stream Source stream to read from /// \param info Structure to fill with the properties of the loaded sound /// /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// virtual bool open(InputStream& stream, Info& info) = 0; //////////////////////////////////////////////////////////// /// \brief Change the current read position to the given sample offset /// /// The sample offset takes the channels into account. /// Offsets can be calculated like this: /// `sampleNumber * sampleRate * channelCount` /// If the given offset exceeds to total number of samples, /// this function must jump to the end of the file. /// /// \param sampleOffset Index of the sample to jump to, relative to the beginning /// //////////////////////////////////////////////////////////// virtual void seek(Uint64 sampleOffset) = 0; //////////////////////////////////////////////////////////// /// \brief Read audio samples from the open file /// /// \param samples Pointer to the sample array to fill /// \param maxCount Maximum number of samples to read /// /// \return Number of samples actually read (may be less than \a maxCount) /// //////////////////////////////////////////////////////////// virtual Uint64 read(Int16* samples, Uint64 maxCount) = 0; }; } // namespace sf #endif // SFML_SOUNDFILEREADER_HPP //////////////////////////////////////////////////////////// /// \class sf::SoundFileReader /// \ingroup audio /// /// This class allows users to read audio file formats not natively /// supported by SFML, and thus extend the set of supported readable /// audio formats. /// /// A valid sound file reader must override the open, seek and write functions, /// as well as providing a static check function; the latter is used by /// SFML to find a suitable writer for a given input file. /// /// To register a new reader, use the sf::SoundFileFactory::registerReader /// template function. /// /// Usage example: /// \code /// class MySoundFileReader : public sf::SoundFileReader /// { /// public: /// /// static bool check(sf::InputStream& stream) /// { /// // typically, read the first few header bytes and check fields that identify the format /// // return true if the reader can handle the format /// } /// /// virtual bool open(sf::InputStream& stream, Info& info) /// { /// // read the sound file header and fill the sound attributes /// // (channel count, sample count and sample rate) /// // return true on success /// } /// /// virtual void seek(sf::Uint64 sampleOffset) /// { /// // advance to the sampleOffset-th sample from the beginning of the sound /// } /// /// virtual sf::Uint64 read(sf::Int16* samples, sf::Uint64 maxCount) /// { /// // read up to 'maxCount' samples into the 'samples' array, /// // convert them (for example from normalized float) if they are not stored /// // as 16-bits signed integers in the file /// // return the actual number of samples read /// } /// }; /// /// sf::SoundFileFactory::registerReader(); /// \endcode /// /// \see sf::InputSoundFile, sf::SoundFileFactory, sf::SoundFileWriter /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/SoundFileWriter.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOUNDFILEWRITER_HPP #define SFML_SOUNDFILEWRITER_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Abstract base class for sound file encoding /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API SoundFileWriter { public: //////////////////////////////////////////////////////////// /// \brief Virtual destructor /// //////////////////////////////////////////////////////////// virtual ~SoundFileWriter() {} //////////////////////////////////////////////////////////// /// \brief Open a sound file for writing /// /// \param filename Path of the file to open /// \param sampleRate Sample rate of the sound /// \param channelCount Number of channels of the sound /// /// \return True if the file was successfully opened /// //////////////////////////////////////////////////////////// virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) = 0; //////////////////////////////////////////////////////////// /// \brief Write audio samples to the open file /// /// \param samples Pointer to the sample array to write /// \param count Number of samples to write /// //////////////////////////////////////////////////////////// virtual void write(const Int16* samples, Uint64 count) = 0; }; } // namespace sf #endif // SFML_SOUNDFILEWRITER_HPP //////////////////////////////////////////////////////////// /// \class sf::SoundFileWriter /// \ingroup audio /// /// This class allows users to write audio file formats not natively /// supported by SFML, and thus extend the set of supported writable /// audio formats. /// /// A valid sound file writer must override the open and write functions, /// as well as providing a static check function; the latter is used by /// SFML to find a suitable writer for a given filename. /// /// To register a new writer, use the sf::SoundFileFactory::registerWriter /// template function. /// /// Usage example: /// \code /// class MySoundFileWriter : public sf::SoundFileWriter /// { /// public: /// /// static bool check(const std::string& filename) /// { /// // typically, check the extension /// // return true if the writer can handle the format /// } /// /// virtual bool open(const std::string& filename, unsigned int sampleRate, unsigned int channelCount) /// { /// // open the file 'filename' for writing, /// // write the given sample rate and channel count to the file header /// // return true on success /// } /// /// virtual void write(const sf::Int16* samples, sf::Uint64 count) /// { /// // write 'count' samples stored at address 'samples', /// // convert them (for example to normalized float) if the format requires it /// } /// }; /// /// sf::SoundFileFactory::registerWriter(); /// \endcode /// /// \see sf::OutputSoundFile, sf::SoundFileFactory, sf::SoundFileReader /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/SoundRecorder.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOUNDRECORDER_HPP #define SFML_SOUNDRECORDER_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Abstract base class for capturing sound data /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API SoundRecorder : AlResource { public: //////////////////////////////////////////////////////////// /// \brief destructor /// //////////////////////////////////////////////////////////// virtual ~SoundRecorder(); //////////////////////////////////////////////////////////// /// \brief Start the capture /// /// The \a sampleRate parameter defines the number of audio samples /// captured per second. The higher, the better the quality /// (for example, 44100 samples/sec is CD quality). /// This function uses its own thread so that it doesn't block /// the rest of the program while the capture runs. /// Please note that only one capture can happen at the same time. /// You can select which capture device will be used, by passing /// the name to the setDevice() method. If none was selected /// before, the default capture device will be used. You can get a /// list of the names of all available capture devices by calling /// getAvailableDevices(). /// /// \param sampleRate Desired capture rate, in number of samples per second /// /// \return True, if start of capture was successful /// /// \see stop, getAvailableDevices /// //////////////////////////////////////////////////////////// bool start(unsigned int sampleRate = 44100); //////////////////////////////////////////////////////////// /// \brief Stop the capture /// /// \see start /// //////////////////////////////////////////////////////////// void stop(); //////////////////////////////////////////////////////////// /// \brief Get the sample rate /// /// The sample rate defines the number of audio samples /// captured per second. The higher, the better the quality /// (for example, 44100 samples/sec is CD quality). /// /// \return Sample rate, in samples per second /// //////////////////////////////////////////////////////////// unsigned int getSampleRate() const; //////////////////////////////////////////////////////////// /// \brief Get a list of the names of all available audio capture devices /// /// This function returns a vector of strings, containing /// the names of all available audio capture devices. /// /// \return A vector of strings containing the names /// //////////////////////////////////////////////////////////// static std::vector getAvailableDevices(); //////////////////////////////////////////////////////////// /// \brief Get the name of the default audio capture device /// /// This function returns the name of the default audio /// capture device. If none is available, an empty string /// is returned. /// /// \return The name of the default audio capture device /// //////////////////////////////////////////////////////////// static std::string getDefaultDevice(); //////////////////////////////////////////////////////////// /// \brief Set the audio capture device /// /// This function sets the audio capture device to the device /// with the given \a name. It can be called on the fly (i.e: /// while recording). If you do so while recording and /// opening the device fails, it stops the recording. /// /// \param name The name of the audio capture device /// /// \return True, if it was able to set the requested device /// /// \see getAvailableDevices, getDefaultDevice /// //////////////////////////////////////////////////////////// bool setDevice(const std::string& name); //////////////////////////////////////////////////////////// /// \brief Get the name of the current audio capture device /// /// \return The name of the current audio capture device /// //////////////////////////////////////////////////////////// const std::string& getDevice() const; //////////////////////////////////////////////////////////// /// \brief Set the channel count of the audio capture device /// /// This method allows you to specify the number of channels /// used for recording. Currently only 16-bit mono and /// 16-bit stereo are supported. /// /// \param channelCount Number of channels. Currently only /// mono (1) and stereo (2) are supported. /// /// \see getChannelCount /// //////////////////////////////////////////////////////////// void setChannelCount(unsigned int channelCount); //////////////////////////////////////////////////////////// /// \brief Get the number of channels used by this recorder /// /// Currently only mono and stereo are supported, so the /// value is either 1 (for mono) or 2 (for stereo). /// /// \return Number of channels /// /// \see setChannelCount /// //////////////////////////////////////////////////////////// unsigned int getChannelCount() const; //////////////////////////////////////////////////////////// /// \brief Check if the system supports audio capture /// /// This function should always be called before using /// the audio capture features. If it returns false, then /// any attempt to use sf::SoundRecorder or one of its derived /// classes will fail. /// /// \return True if audio capture is supported, false otherwise /// //////////////////////////////////////////////////////////// static bool isAvailable(); protected: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor is only meant to be called by derived classes. /// //////////////////////////////////////////////////////////// SoundRecorder(); //////////////////////////////////////////////////////////// /// \brief Set the processing interval /// /// The processing interval controls the period /// between calls to the onProcessSamples function. You may /// want to use a small interval if you want to process the /// recorded data in real time, for example. /// /// Note: this is only a hint, the actual period may vary. /// So don't rely on this parameter to implement precise timing. /// /// The default processing interval is 100 ms. /// /// \param interval Processing interval /// //////////////////////////////////////////////////////////// void setProcessingInterval(Time interval); //////////////////////////////////////////////////////////// /// \brief Start capturing audio data /// /// This virtual function may be overridden by a derived class /// if something has to be done every time a new capture /// starts. If not, this function can be ignored; the default /// implementation does nothing. /// /// \return True to start the capture, or false to abort it /// //////////////////////////////////////////////////////////// virtual bool onStart(); //////////////////////////////////////////////////////////// /// \brief Process a new chunk of recorded samples /// /// This virtual function is called every time a new chunk of /// recorded data is available. The derived class can then do /// whatever it wants with it (storing it, playing it, sending /// it over the network, etc.). /// /// \param samples Pointer to the new chunk of recorded samples /// \param sampleCount Number of samples pointed by \a samples /// /// \return True to continue the capture, or false to stop it /// //////////////////////////////////////////////////////////// virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount) = 0; //////////////////////////////////////////////////////////// /// \brief Stop capturing audio data /// /// This virtual function may be overridden by a derived class /// if something has to be done every time the capture /// ends. If not, this function can be ignored; the default /// implementation does nothing. /// //////////////////////////////////////////////////////////// virtual void onStop(); private: //////////////////////////////////////////////////////////// /// \brief Function called as the entry point of the thread /// /// This function starts the recording loop, and returns /// only when the capture is stopped. /// //////////////////////////////////////////////////////////// void record(); //////////////////////////////////////////////////////////// /// \brief Get the new available audio samples and process them /// /// This function is called continuously during the /// capture loop. It retrieves the captured samples and /// forwards them to the derived class. /// //////////////////////////////////////////////////////////// void processCapturedSamples(); //////////////////////////////////////////////////////////// /// \brief Clean up the recorder's internal resources /// /// This function is called when the capture stops. /// //////////////////////////////////////////////////////////// void cleanup(); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Thread m_thread; ///< Thread running the background recording task std::vector m_samples; ///< Buffer to store captured samples unsigned int m_sampleRate; ///< Sample rate Time m_processingInterval; ///< Time period between calls to onProcessSamples bool m_isCapturing; ///< Capturing state std::string m_deviceName; ///< Name of the audio capture device unsigned int m_channelCount; ///< Number of recording channels }; } // namespace sf #endif // SFML_SOUNDRECORDER_HPP //////////////////////////////////////////////////////////// /// \class sf::SoundRecorder /// \ingroup audio /// /// sf::SoundBuffer provides a simple interface to access /// the audio recording capabilities of the computer /// (the microphone). As an abstract base class, it only cares /// about capturing sound samples, the task of making something /// useful with them is left to the derived class. Note that /// SFML provides a built-in specialization for saving the /// captured data to a sound buffer (see sf::SoundBufferRecorder). /// /// A derived class has only one virtual function to override: /// \li onProcessSamples provides the new chunks of audio samples while the capture happens /// /// Moreover, two additional virtual functions can be overridden /// as well if necessary: /// \li onStart is called before the capture happens, to perform custom initializations /// \li onStop is called after the capture ends, to perform custom cleanup /// /// A derived class can also control the frequency of the onProcessSamples /// calls, with the setProcessingInterval protected function. The default /// interval is chosen so that recording thread doesn't consume too much /// CPU, but it can be changed to a smaller value if you need to process /// the recorded data in real time, for example. /// /// The audio capture feature may not be supported or activated /// on every platform, thus it is recommended to check its /// availability with the isAvailable() function. If it returns /// false, then any attempt to use an audio recorder will fail. /// /// If you have multiple sound input devices connected to your /// computer (for example: microphone, external soundcard, webcam mic, ...) /// you can get a list of all available devices through the /// getAvailableDevices() function. You can then select a device /// by calling setDevice() with the appropriate device. Otherwise /// the default capturing device will be used. /// /// By default the recording is in 16-bit mono. Using the /// setChannelCount method you can change the number of channels /// used by the audio capture device to record. Note that you /// have to decide whether you want to record in mono or stereo /// before starting the recording. /// /// It is important to note that the audio capture happens in a /// separate thread, so that it doesn't block the rest of the /// program. In particular, the onProcessSamples virtual function /// (but not onStart and not onStop) will be called /// from this separate thread. It is important to keep this in /// mind, because you may have to take care of synchronization /// issues if you share data between threads. /// Another thing to bear in mind is that you must call stop() /// in the destructor of your derived class, so that the recording /// thread finishes before your object is destroyed. /// /// Usage example: /// \code /// class CustomRecorder : public sf::SoundRecorder /// { /// ~CustomRecorder() /// { /// // Make sure to stop the recording thread /// stop(); /// } /// /// virtual bool onStart() // optional /// { /// // Initialize whatever has to be done before the capture starts /// ... /// /// // Return true to start playing /// return true; /// } /// /// virtual bool onProcessSamples(const Int16* samples, std::size_t sampleCount) /// { /// // Do something with the new chunk of samples (store them, send them, ...) /// ... /// /// // Return true to continue playing /// return true; /// } /// /// virtual void onStop() // optional /// { /// // Clean up whatever has to be done after the capture ends /// ... /// } /// } /// /// // Usage /// if (CustomRecorder::isAvailable()) /// { /// CustomRecorder recorder; /// /// if (!recorder.start()) /// return -1; /// /// ... /// recorder.stop(); /// } /// \endcode /// /// \see sf::SoundBufferRecorder /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/SoundSource.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOUNDSOURCE_HPP #define SFML_SOUNDSOURCE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Base class defining a sound's properties /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API SoundSource : AlResource { public: //////////////////////////////////////////////////////////// /// \brief Enumeration of the sound source states /// //////////////////////////////////////////////////////////// enum Status { Stopped, ///< Sound is not playing Paused, ///< Sound is paused Playing ///< Sound is playing }; //////////////////////////////////////////////////////////// /// \brief Copy constructor /// /// \param copy Instance to copy /// //////////////////////////////////////////////////////////// SoundSource(const SoundSource& copy); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// virtual ~SoundSource(); //////////////////////////////////////////////////////////// /// \brief Set the pitch of the sound /// /// The pitch represents the perceived fundamental frequency /// of a sound; thus you can make a sound more acute or grave /// by changing its pitch. A side effect of changing the pitch /// is to modify the playing speed of the sound as well. /// The default value for the pitch is 1. /// /// \param pitch New pitch to apply to the sound /// /// \see getPitch /// //////////////////////////////////////////////////////////// void setPitch(float pitch); //////////////////////////////////////////////////////////// /// \brief Set the volume of the sound /// /// The volume is a value between 0 (mute) and 100 (full volume). /// The default value for the volume is 100. /// /// \param volume Volume of the sound /// /// \see getVolume /// //////////////////////////////////////////////////////////// void setVolume(float volume); //////////////////////////////////////////////////////////// /// \brief Set the 3D position of the sound in the audio scene /// /// Only sounds with one channel (mono sounds) can be /// spatialized. /// The default position of a sound is (0, 0, 0). /// /// \param x X coordinate of the position of the sound in the scene /// \param y Y coordinate of the position of the sound in the scene /// \param z Z coordinate of the position of the sound in the scene /// /// \see getPosition /// //////////////////////////////////////////////////////////// void setPosition(float x, float y, float z); //////////////////////////////////////////////////////////// /// \brief Set the 3D position of the sound in the audio scene /// /// Only sounds with one channel (mono sounds) can be /// spatialized. /// The default position of a sound is (0, 0, 0). /// /// \param position Position of the sound in the scene /// /// \see getPosition /// //////////////////////////////////////////////////////////// void setPosition(const Vector3f& position); //////////////////////////////////////////////////////////// /// \brief Make the sound's position relative to the listener or absolute /// /// Making a sound relative to the listener will ensure that it will always /// be played the same way regardless of the position of the listener. /// This can be useful for non-spatialized sounds, sounds that are /// produced by the listener, or sounds attached to it. /// The default value is false (position is absolute). /// /// \param relative True to set the position relative, false to set it absolute /// /// \see isRelativeToListener /// //////////////////////////////////////////////////////////// void setRelativeToListener(bool relative); //////////////////////////////////////////////////////////// /// \brief Set the minimum distance of the sound /// /// The "minimum distance" of a sound is the maximum /// distance at which it is heard at its maximum volume. Further /// than the minimum distance, it will start to fade out according /// to its attenuation factor. A value of 0 ("inside the head /// of the listener") is an invalid value and is forbidden. /// The default value of the minimum distance is 1. /// /// \param distance New minimum distance of the sound /// /// \see getMinDistance, setAttenuation /// //////////////////////////////////////////////////////////// void setMinDistance(float distance); //////////////////////////////////////////////////////////// /// \brief Set the attenuation factor of the sound /// /// The attenuation is a multiplicative factor which makes /// the sound more or less loud according to its distance /// from the listener. An attenuation of 0 will produce a /// non-attenuated sound, i.e. its volume will always be the same /// whether it is heard from near or from far. On the other hand, /// an attenuation value such as 100 will make the sound fade out /// very quickly as it gets further from the listener. /// The default value of the attenuation is 1. /// /// \param attenuation New attenuation factor of the sound /// /// \see getAttenuation, setMinDistance /// //////////////////////////////////////////////////////////// void setAttenuation(float attenuation); //////////////////////////////////////////////////////////// /// \brief Get the pitch of the sound /// /// \return Pitch of the sound /// /// \see setPitch /// //////////////////////////////////////////////////////////// float getPitch() const; //////////////////////////////////////////////////////////// /// \brief Get the volume of the sound /// /// \return Volume of the sound, in the range [0, 100] /// /// \see setVolume /// //////////////////////////////////////////////////////////// float getVolume() const; //////////////////////////////////////////////////////////// /// \brief Get the 3D position of the sound in the audio scene /// /// \return Position of the sound /// /// \see setPosition /// //////////////////////////////////////////////////////////// Vector3f getPosition() const; //////////////////////////////////////////////////////////// /// \brief Tell whether the sound's position is relative to the /// listener or is absolute /// /// \return True if the position is relative, false if it's absolute /// /// \see setRelativeToListener /// //////////////////////////////////////////////////////////// bool isRelativeToListener() const; //////////////////////////////////////////////////////////// /// \brief Get the minimum distance of the sound /// /// \return Minimum distance of the sound /// /// \see setMinDistance, getAttenuation /// //////////////////////////////////////////////////////////// float getMinDistance() const; //////////////////////////////////////////////////////////// /// \brief Get the attenuation factor of the sound /// /// \return Attenuation factor of the sound /// /// \see setAttenuation, getMinDistance /// //////////////////////////////////////////////////////////// float getAttenuation() const; //////////////////////////////////////////////////////////// /// \brief Overload of assignment operator /// /// \param right Instance to assign /// /// \return Reference to self /// //////////////////////////////////////////////////////////// SoundSource& operator =(const SoundSource& right); protected: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor is meant to be called by derived classes only. /// //////////////////////////////////////////////////////////// SoundSource(); //////////////////////////////////////////////////////////// /// \brief Get the current status of the sound (stopped, paused, playing) /// /// \return Current status of the sound /// //////////////////////////////////////////////////////////// Status getStatus() const; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// unsigned int m_source; ///< OpenAL source identifier }; } // namespace sf #endif // SFML_SOUNDSOURCE_HPP //////////////////////////////////////////////////////////// /// \class sf::SoundSource /// \ingroup audio /// /// sf::SoundSource is not meant to be used directly, it /// only serves as a common base for all audio objects /// that can live in the audio environment. /// /// It defines several properties for the sound: pitch, /// volume, position, attenuation, etc. All of them can be /// changed at any time with no impact on performances. /// /// \see sf::Sound, sf::SoundStream /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio/SoundStream.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOUNDSTREAM_HPP #define SFML_SOUNDSTREAM_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Abstract base class for streamed audio sources /// //////////////////////////////////////////////////////////// class SFML_AUDIO_API SoundStream : public SoundSource { public: //////////////////////////////////////////////////////////// /// \brief Structure defining a chunk of audio data to stream /// //////////////////////////////////////////////////////////// struct Chunk { const Int16* samples; ///< Pointer to the audio samples std::size_t sampleCount; ///< Number of samples pointed by Samples }; //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// virtual ~SoundStream(); //////////////////////////////////////////////////////////// /// \brief Start or resume playing the audio stream /// /// This function starts the stream if it was stopped, resumes /// it if it was paused, and restarts it from the beginning if /// it was already playing. /// This function uses its own thread so that it doesn't block /// the rest of the program while the stream is played. /// /// \see pause, stop /// //////////////////////////////////////////////////////////// void play(); //////////////////////////////////////////////////////////// /// \brief Pause the audio stream /// /// This function pauses the stream if it was playing, /// otherwise (stream already paused or stopped) it has no effect. /// /// \see play, stop /// //////////////////////////////////////////////////////////// void pause(); //////////////////////////////////////////////////////////// /// \brief Stop playing the audio stream /// /// This function stops the stream if it was playing or paused, /// and does nothing if it was already stopped. /// It also resets the playing position (unlike pause()). /// /// \see play, pause /// //////////////////////////////////////////////////////////// void stop(); //////////////////////////////////////////////////////////// /// \brief Return the number of channels of the stream /// /// 1 channel means a mono sound, 2 means stereo, etc. /// /// \return Number of channels /// //////////////////////////////////////////////////////////// unsigned int getChannelCount() const; //////////////////////////////////////////////////////////// /// \brief Get the stream sample rate of the stream /// /// The sample rate is the number of audio samples played per /// second. The higher, the better the quality. /// /// \return Sample rate, in number of samples per second /// //////////////////////////////////////////////////////////// unsigned int getSampleRate() const; //////////////////////////////////////////////////////////// /// \brief Get the current status of the stream (stopped, paused, playing) /// /// \return Current status /// //////////////////////////////////////////////////////////// Status getStatus() const; //////////////////////////////////////////////////////////// /// \brief Change the current playing position of the stream /// /// The playing position can be changed when the stream is /// either paused or playing. Changing the playing position /// when the stream is stopped has no effect, since playing /// the stream would reset its position. /// /// \param timeOffset New playing position, from the beginning of the stream /// /// \see getPlayingOffset /// //////////////////////////////////////////////////////////// void setPlayingOffset(Time timeOffset); //////////////////////////////////////////////////////////// /// \brief Get the current playing position of the stream /// /// \return Current playing position, from the beginning of the stream /// /// \see setPlayingOffset /// //////////////////////////////////////////////////////////// Time getPlayingOffset() const; //////////////////////////////////////////////////////////// /// \brief Set whether or not the stream should loop after reaching the end /// /// If set, the stream will restart from beginning after /// reaching the end and so on, until it is stopped or /// setLoop(false) is called. /// The default looping state for streams is false. /// /// \param loop True to play in loop, false to play once /// /// \see getLoop /// //////////////////////////////////////////////////////////// void setLoop(bool loop); //////////////////////////////////////////////////////////// /// \brief Tell whether or not the stream is in loop mode /// /// \return True if the stream is looping, false otherwise /// /// \see setLoop /// //////////////////////////////////////////////////////////// bool getLoop() const; protected: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor is only meant to be called by derived classes. /// //////////////////////////////////////////////////////////// SoundStream(); //////////////////////////////////////////////////////////// /// \brief Define the audio stream parameters /// /// This function must be called by derived classes as soon /// as they know the audio settings of the stream to play. /// Any attempt to manipulate the stream (play(), ...) before /// calling this function will fail. /// It can be called multiple times if the settings of the /// audio stream change, but only when the stream is stopped. /// /// \param channelCount Number of channels of the stream /// \param sampleRate Sample rate, in samples per second /// //////////////////////////////////////////////////////////// void initialize(unsigned int channelCount, unsigned int sampleRate); //////////////////////////////////////////////////////////// /// \brief Request a new chunk of audio samples from the stream source /// /// This function must be overridden by derived classes to provide /// the audio samples to play. It is called continuously by the /// streaming loop, in a separate thread. /// The source can choose to stop the streaming loop at any time, by /// returning false to the caller. /// If you return true (i.e. continue streaming) it is important that /// the returned array of samples is not empty; this would stop the stream /// due to an internal limitation. /// /// \param data Chunk of data to fill /// /// \return True to continue playback, false to stop /// //////////////////////////////////////////////////////////// virtual bool onGetData(Chunk& data) = 0; //////////////////////////////////////////////////////////// /// \brief Change the current playing position in the stream source /// /// This function must be overridden by derived classes to /// allow random seeking into the stream source. /// /// \param timeOffset New playing position, relative to the beginning of the stream /// //////////////////////////////////////////////////////////// virtual void onSeek(Time timeOffset) = 0; private: //////////////////////////////////////////////////////////// /// \brief Function called as the entry point of the thread /// /// This function starts the streaming loop, and returns /// only when the sound is stopped. /// //////////////////////////////////////////////////////////// void streamData(); //////////////////////////////////////////////////////////// /// \brief Fill a new buffer with audio samples, and append /// it to the playing queue /// /// This function is called as soon as a buffer has been fully /// consumed; it fills it again and inserts it back into the /// playing queue. /// /// \param bufferNum Number of the buffer to fill (in [0, BufferCount]) /// /// \return True if the stream source has requested to stop, false otherwise /// //////////////////////////////////////////////////////////// bool fillAndPushBuffer(unsigned int bufferNum); //////////////////////////////////////////////////////////// /// \brief Fill the audio buffers and put them all into the playing queue /// /// This function is called when playing starts and the /// playing queue is empty. /// /// \return True if the derived class has requested to stop, false otherwise /// //////////////////////////////////////////////////////////// bool fillQueue(); //////////////////////////////////////////////////////////// /// \brief Clear all the audio buffers and empty the playing queue /// /// This function is called when the stream is stopped. /// //////////////////////////////////////////////////////////// void clearQueue(); enum { BufferCount = 3 ///< Number of audio buffers used by the streaming loop }; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Thread m_thread; ///< Thread running the background tasks mutable Mutex m_threadMutex; ///< Thread mutex Status m_threadStartState; ///< State the thread starts in (Playing, Paused, Stopped) bool m_isStreaming; ///< Streaming state (true = playing, false = stopped) unsigned int m_buffers[BufferCount]; ///< Sound buffers used to store temporary audio data unsigned int m_channelCount; ///< Number of channels (1 = mono, 2 = stereo, ...) unsigned int m_sampleRate; ///< Frequency (samples / second) Uint32 m_format; ///< Format of the internal sound buffers bool m_loop; ///< Loop flag (true to loop, false to play once) Uint64 m_samplesProcessed; ///< Number of buffers processed since beginning of the stream bool m_endBuffers[BufferCount]; ///< Each buffer is marked as "end buffer" or not, for proper duration calculation }; } // namespace sf #endif // SFML_SOUNDSTREAM_HPP //////////////////////////////////////////////////////////// /// \class sf::SoundStream /// \ingroup audio /// /// Unlike audio buffers (see sf::SoundBuffer), audio streams /// are never completely loaded in memory. Instead, the audio /// data is acquired continuously while the stream is playing. /// This behavior allows to play a sound with no loading delay, /// and keeps the memory consumption very low. /// /// Sound sources that need to be streamed are usually big files /// (compressed audio musics that would eat hundreds of MB in memory) /// or files that would take a lot of time to be received /// (sounds played over the network). /// /// sf::SoundStream is a base class that doesn't care about the /// stream source, which is left to the derived class. SFML provides /// a built-in specialization for big files (see sf::Music). /// No network stream source is provided, but you can write your own /// by combining this class with the network module. /// /// A derived class has to override two virtual functions: /// \li onGetData fills a new chunk of audio data to be played /// \li onSeek changes the current playing position in the source /// /// It is important to note that each SoundStream is played in its /// own separate thread, so that the streaming loop doesn't block the /// rest of the program. In particular, the OnGetData and OnSeek /// virtual functions may sometimes be called from this separate thread. /// It is important to keep this in mind, because you may have to take /// care of synchronization issues if you share data between threads. /// /// Usage example: /// \code /// class CustomStream : public sf::SoundStream /// { /// public: /// /// bool open(const std::string& location) /// { /// // Open the source and get audio settings /// ... /// unsigned int channelCount = ...; /// unsigned int sampleRate = ...; /// /// // Initialize the stream -- important! /// initialize(channelCount, sampleRate); /// } /// /// private: /// /// virtual bool onGetData(Chunk& data) /// { /// // Fill the chunk with audio data from the stream source /// // (note: must not be empty if you want to continue playing) /// data.samples = ...; /// data.sampleCount = ...; /// /// // Return true to continue playing /// return true; /// } /// /// virtual void onSeek(Uint32 timeOffset) /// { /// // Change the current position in the stream source /// ... /// } /// } /// /// // Usage /// CustomStream stream; /// stream.open("path/to/stream"); /// stream.play(); /// \endcode /// /// \see sf::Music /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Audio.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_AUDIO_HPP #define SFML_AUDIO_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif // SFML_AUDIO_HPP //////////////////////////////////////////////////////////// /// \defgroup audio Audio module /// /// Sounds, streaming (musics or custom sources), recording, /// spatialization. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Config.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_CONFIG_HPP #define SFML_CONFIG_HPP //////////////////////////////////////////////////////////// // Define the SFML version //////////////////////////////////////////////////////////// #define SFML_VERSION_MAJOR 2 #define SFML_VERSION_MINOR 4 #define SFML_VERSION_PATCH 2 //////////////////////////////////////////////////////////// // Identify the operating system // see http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system //////////////////////////////////////////////////////////// #if defined(_WIN32) // Windows #define SFML_SYSTEM_WINDOWS #ifndef NOMINMAX #define NOMINMAX #endif #elif defined(__APPLE__) && defined(__MACH__) // Apple platform, see which one it is #include "TargetConditionals.h" #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR // iOS #define SFML_SYSTEM_IOS #elif TARGET_OS_MAC // MacOS #define SFML_SYSTEM_MACOS #else // Unsupported Apple system #error This Apple operating system is not supported by SFML library #endif #elif defined(__unix__) // UNIX system, see which one it is #if defined(__ANDROID__) // Android #define SFML_SYSTEM_ANDROID #elif defined(__linux__) // Linux #define SFML_SYSTEM_LINUX #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) // FreeBSD #define SFML_SYSTEM_FREEBSD #else // Unsupported UNIX system #error This UNIX operating system is not supported by SFML library #endif #else // Unsupported system #error This operating system is not supported by SFML library #endif //////////////////////////////////////////////////////////// // Define a portable debug macro //////////////////////////////////////////////////////////// #if !defined(NDEBUG) #define SFML_DEBUG #endif //////////////////////////////////////////////////////////// // Define helpers to create portable import / export macros for each module //////////////////////////////////////////////////////////// #if !defined(SFML_STATIC) #if defined(SFML_SYSTEM_WINDOWS) // Windows compilers need specific (and different) keywords for export and import #define SFML_API_EXPORT __declspec(dllexport) #define SFML_API_IMPORT __declspec(dllimport) // For Visual C++ compilers, we also need to turn off this annoying C4251 warning #ifdef _MSC_VER #pragma warning(disable: 4251) #endif #else // Linux, FreeBSD, Mac OS X #if __GNUC__ >= 4 // GCC 4 has special keywords for showing/hidding symbols, // the same keyword is used for both importing and exporting #define SFML_API_EXPORT __attribute__ ((__visibility__ ("default"))) #define SFML_API_IMPORT __attribute__ ((__visibility__ ("default"))) #else // GCC < 4 has no mechanism to explicitely hide symbols, everything's exported #define SFML_API_EXPORT #define SFML_API_IMPORT #endif #endif #else // Static build doesn't need import/export macros #define SFML_API_EXPORT #define SFML_API_IMPORT #endif //////////////////////////////////////////////////////////// // Cross-platform warning for deprecated functions and classes // // Usage: // class SFML_DEPRECATED MyClass // { // SFML_DEPRECATED void memberFunc(); // }; // // SFML_DEPRECATED void globalFunc(); //////////////////////////////////////////////////////////// #if defined(SFML_NO_DEPRECATED_WARNINGS) // User explicitly requests to disable deprecation warnings #define SFML_DEPRECATED #elif defined(_MSC_VER) // Microsoft C++ compiler // Note: On newer MSVC versions, using deprecated functions causes a compiler error. In order to // trigger a warning instead of an error, the compiler flag /sdl- (instead of /sdl) must be specified. #define SFML_DEPRECATED __declspec(deprecated) #elif defined(__GNUC__) // g++ and Clang #define SFML_DEPRECATED __attribute__ ((deprecated)) #else // Other compilers are not supported, leave class or function as-is. // With a bit of luck, the #pragma directive works, otherwise users get a warning (no error!) for unrecognized #pragma. #pragma message("SFML_DEPRECATED is not supported for your compiler, please contact the SFML team") #define SFML_DEPRECATED #endif //////////////////////////////////////////////////////////// // Define portable fixed-size types //////////////////////////////////////////////////////////// namespace sf { // All "common" platforms use the same size for char, short and int // (basically there are 3 types for 3 sizes, so no other match is possible), // we can use them without doing any kind of check // 8 bits integer types typedef signed char Int8; typedef unsigned char Uint8; // 16 bits integer types typedef signed short Int16; typedef unsigned short Uint16; // 32 bits integer types typedef signed int Int32; typedef unsigned int Uint32; // 64 bits integer types #if defined(_MSC_VER) typedef signed __int64 Int64; typedef unsigned __int64 Uint64; #else typedef signed long long Int64; typedef unsigned long long Uint64; #endif } // namespace sf #endif // SFML_CONFIG_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/BlendMode.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_BLENDMODE_HPP #define SFML_BLENDMODE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Blending modes for drawing /// //////////////////////////////////////////////////////////// struct SFML_GRAPHICS_API BlendMode { //////////////////////////////////////////////////////// /// \brief Enumeration of the blending factors /// /// The factors are mapped directly to their OpenGL equivalents, /// specified by glBlendFunc() or glBlendFuncSeparate(). //////////////////////////////////////////////////////// enum Factor { Zero, ///< (0, 0, 0, 0) One, ///< (1, 1, 1, 1) SrcColor, ///< (src.r, src.g, src.b, src.a) OneMinusSrcColor, ///< (1, 1, 1, 1) - (src.r, src.g, src.b, src.a) DstColor, ///< (dst.r, dst.g, dst.b, dst.a) OneMinusDstColor, ///< (1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a) SrcAlpha, ///< (src.a, src.a, src.a, src.a) OneMinusSrcAlpha, ///< (1, 1, 1, 1) - (src.a, src.a, src.a, src.a) DstAlpha, ///< (dst.a, dst.a, dst.a, dst.a) OneMinusDstAlpha ///< (1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a) }; //////////////////////////////////////////////////////// /// \brief Enumeration of the blending equations /// /// The equations are mapped directly to their OpenGL equivalents, /// specified by glBlendEquation() or glBlendEquationSeparate(). //////////////////////////////////////////////////////// enum Equation { Add, ///< Pixel = Src * SrcFactor + Dst * DstFactor Subtract, ///< Pixel = Src * SrcFactor - Dst * DstFactor ReverseSubtract ///< Pixel = Dst * DstFactor - Src * SrcFactor }; //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Constructs a blending mode that does alpha blending. /// //////////////////////////////////////////////////////////// BlendMode(); //////////////////////////////////////////////////////////// /// \brief Construct the blend mode given the factors and equation. /// /// This constructor uses the same factors and equation for both /// color and alpha components. It also defaults to the Add equation. /// /// \param sourceFactor Specifies how to compute the source factor for the color and alpha channels. /// \param destinationFactor Specifies how to compute the destination factor for the color and alpha channels. /// \param blendEquation Specifies how to combine the source and destination colors and alpha. /// //////////////////////////////////////////////////////////// BlendMode(Factor sourceFactor, Factor destinationFactor, Equation blendEquation = Add); //////////////////////////////////////////////////////////// /// \brief Construct the blend mode given the factors and equation. /// /// \param colorSourceFactor Specifies how to compute the source factor for the color channels. /// \param colorDestinationFactor Specifies how to compute the destination factor for the color channels. /// \param colorBlendEquation Specifies how to combine the source and destination colors. /// \param alphaSourceFactor Specifies how to compute the source factor. /// \param alphaDestinationFactor Specifies how to compute the destination factor. /// \param alphaBlendEquation Specifies how to combine the source and destination alphas. /// //////////////////////////////////////////////////////////// BlendMode(Factor colorSourceFactor, Factor colorDestinationFactor, Equation colorBlendEquation, Factor alphaSourceFactor, Factor alphaDestinationFactor, Equation alphaBlendEquation); //////////////////////////////////////////////////////////// // Member Data //////////////////////////////////////////////////////////// Factor colorSrcFactor; ///< Source blending factor for the color channels Factor colorDstFactor; ///< Destination blending factor for the color channels Equation colorEquation; ///< Blending equation for the color channels Factor alphaSrcFactor; ///< Source blending factor for the alpha channel Factor alphaDstFactor; ///< Destination blending factor for the alpha channel Equation alphaEquation; ///< Blending equation for the alpha channel }; //////////////////////////////////////////////////////////// /// \relates BlendMode /// \brief Overload of the == operator /// /// \param left Left operand /// \param right Right operand /// /// \return True if blending modes are equal, false if they are different /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API bool operator ==(const BlendMode& left, const BlendMode& right); //////////////////////////////////////////////////////////// /// \relates BlendMode /// \brief Overload of the != operator /// /// \param left Left operand /// \param right Right operand /// /// \return True if blending modes are different, false if they are equal /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API bool operator !=(const BlendMode& left, const BlendMode& right); //////////////////////////////////////////////////////////// // Commonly used blending modes //////////////////////////////////////////////////////////// SFML_GRAPHICS_API extern const BlendMode BlendAlpha; ///< Blend source and dest according to dest alpha SFML_GRAPHICS_API extern const BlendMode BlendAdd; ///< Add source to dest SFML_GRAPHICS_API extern const BlendMode BlendMultiply; ///< Multiply source and dest SFML_GRAPHICS_API extern const BlendMode BlendNone; ///< Overwrite dest with source } // namespace sf #endif // SFML_BLENDMODE_HPP //////////////////////////////////////////////////////////// /// \class sf::BlendMode /// \ingroup graphics /// /// sf::BlendMode is a class that represents a blend mode. A blend /// mode determines how the colors of an object you draw are /// mixed with the colors that are already in the buffer. /// /// The class is composed of 6 components, each of which has its /// own public member variable: /// \li %Color Source Factor (@ref colorSrcFactor) /// \li %Color Destination Factor (@ref colorDstFactor) /// \li %Color Blend Equation (@ref colorEquation) /// \li Alpha Source Factor (@ref alphaSrcFactor) /// \li Alpha Destination Factor (@ref alphaDstFactor) /// \li Alpha Blend Equation (@ref alphaEquation) /// /// The source factor specifies how the pixel you are drawing contributes /// to the final color. The destination factor specifies how the pixel /// already drawn in the buffer contributes to the final color. /// /// The color channels RGB (red, green, blue; simply referred to as /// color) and A (alpha; the transparency) can be treated separately. This /// separation can be useful for specific blend modes, but most often you /// won't need it and will simply treat the color as a single unit. /// /// The blend factors and equations correspond to their OpenGL equivalents. /// In general, the color of the resulting pixel is calculated according /// to the following formula (\a src is the color of the source pixel, \a dst /// the color of the destination pixel, the other variables correspond to the /// public members, with the equations being + or - operators): /// \code /// dst.rgb = colorSrcFactor * src.rgb (colorEquation) colorDstFactor * dst.rgb /// dst.a = alphaSrcFactor * src.a (alphaEquation) alphaDstFactor * dst.a /// \endcode /// All factors and colors are represented as floating point numbers between /// 0 and 1. Where necessary, the result is clamped to fit in that range. /// /// The most common blending modes are defined as constants /// in the sf namespace: /// /// \code /// sf::BlendMode alphaBlending = sf::BlendAlpha; /// sf::BlendMode additiveBlending = sf::BlendAdd; /// sf::BlendMode multiplicativeBlending = sf::BlendMultiply; /// sf::BlendMode noBlending = sf::BlendNone; /// \endcode /// /// In SFML, a blend mode can be specified every time you draw a sf::Drawable /// object to a render target. It is part of the sf::RenderStates compound /// that is passed to the member function sf::RenderTarget::draw(). /// /// \see sf::RenderStates, sf::RenderTarget /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/CircleShape.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_CIRCLESHAPE_HPP #define SFML_CIRCLESHAPE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Specialized shape representing a circle /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API CircleShape : public Shape { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// \param radius Radius of the circle /// \param pointCount Number of points composing the circle /// //////////////////////////////////////////////////////////// explicit CircleShape(float radius = 0, std::size_t pointCount = 30); //////////////////////////////////////////////////////////// /// \brief Set the radius of the circle /// /// \param radius New radius of the circle /// /// \see getRadius /// //////////////////////////////////////////////////////////// void setRadius(float radius); //////////////////////////////////////////////////////////// /// \brief Get the radius of the circle /// /// \return Radius of the circle /// /// \see setRadius /// //////////////////////////////////////////////////////////// float getRadius() const; //////////////////////////////////////////////////////////// /// \brief Set the number of points of the circle /// /// \param count New number of points of the circle /// /// \see getPointCount /// //////////////////////////////////////////////////////////// void setPointCount(std::size_t count); //////////////////////////////////////////////////////////// /// \brief Get the number of points of the circle /// /// \return Number of points of the circle /// /// \see setPointCount /// //////////////////////////////////////////////////////////// virtual std::size_t getPointCount() const; //////////////////////////////////////////////////////////// /// \brief Get a point of the circle /// /// The returned point is in local coordinates, that is, /// the shape's transforms (position, rotation, scale) are /// not taken into account. /// The result is undefined if \a index is out of the valid range. /// /// \param index Index of the point to get, in range [0 .. getPointCount() - 1] /// /// \return index-th point of the shape /// //////////////////////////////////////////////////////////// virtual Vector2f getPoint(std::size_t index) const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// float m_radius; ///< Radius of the circle std::size_t m_pointCount; ///< Number of points composing the circle }; } // namespace sf #endif // SFML_CIRCLESHAPE_HPP //////////////////////////////////////////////////////////// /// \class sf::CircleShape /// \ingroup graphics /// /// This class inherits all the functions of sf::Transformable /// (position, rotation, scale, bounds, ...) as well as the /// functions of sf::Shape (outline, color, texture, ...). /// /// Usage example: /// \code /// sf::CircleShape circle; /// circle.setRadius(150); /// circle.setOutlineColor(sf::Color::Red); /// circle.setOutlineThickness(5); /// circle.setPosition(10, 20); /// ... /// window.draw(circle); /// \endcode /// /// Since the graphics card can't draw perfect circles, we have to /// fake them with multiple triangles connected to each other. The /// "points count" property of sf::CircleShape defines how many of these /// triangles to use, and therefore defines the quality of the circle. /// /// The number of points can also be used for another purpose; with /// small numbers you can create any regular polygon shape: /// equilateral triangle, square, pentagon, hexagon, ... /// /// \see sf::Shape, sf::RectangleShape, sf::ConvexShape /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Color.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_COLOR_HPP #define SFML_COLOR_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Utility class for manipulating RGBA colors /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Color { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Constructs an opaque black color. It is equivalent to /// sf::Color(0, 0, 0, 255). /// //////////////////////////////////////////////////////////// Color(); //////////////////////////////////////////////////////////// /// \brief Construct the color from its 4 RGBA components /// /// \param red Red component (in the range [0, 255]) /// \param green Green component (in the range [0, 255]) /// \param blue Blue component (in the range [0, 255]) /// \param alpha Alpha (opacity) component (in the range [0, 255]) /// //////////////////////////////////////////////////////////// Color(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha = 255); //////////////////////////////////////////////////////////// /// \brief Construct the color from 32-bit unsigned integer /// /// \param color Number containing the RGBA components (in that order) /// //////////////////////////////////////////////////////////// explicit Color(Uint32 color); //////////////////////////////////////////////////////////// /// \brief Retrieve the color as a 32-bit unsigned integer /// /// \return Color represented as a 32-bit unsigned integer /// //////////////////////////////////////////////////////////// Uint32 toInteger() const; //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// static const Color Black; ///< Black predefined color static const Color White; ///< White predefined color static const Color Red; ///< Red predefined color static const Color Green; ///< Green predefined color static const Color Blue; ///< Blue predefined color static const Color Yellow; ///< Yellow predefined color static const Color Magenta; ///< Magenta predefined color static const Color Cyan; ///< Cyan predefined color static const Color Transparent; ///< Transparent (black) predefined color //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Uint8 r; ///< Red component Uint8 g; ///< Green component Uint8 b; ///< Blue component Uint8 a; ///< Alpha (opacity) component }; //////////////////////////////////////////////////////////// /// \relates Color /// \brief Overload of the == operator /// /// This operator compares two colors and check if they are equal. /// /// \param left Left operand /// \param right Right operand /// /// \return True if colors are equal, false if they are different /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API bool operator ==(const Color& left, const Color& right); //////////////////////////////////////////////////////////// /// \relates Color /// \brief Overload of the != operator /// /// This operator compares two colors and check if they are different. /// /// \param left Left operand /// \param right Right operand /// /// \return True if colors are different, false if they are equal /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API bool operator !=(const Color& left, const Color& right); //////////////////////////////////////////////////////////// /// \relates Color /// \brief Overload of the binary + operator /// /// This operator returns the component-wise sum of two colors. /// Components that exceed 255 are clamped to 255. /// /// \param left Left operand /// \param right Right operand /// /// \return Result of \a left + \a right /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API Color operator +(const Color& left, const Color& right); //////////////////////////////////////////////////////////// /// \relates Color /// \brief Overload of the binary - operator /// /// This operator returns the component-wise subtraction of two colors. /// Components below 0 are clamped to 0. /// /// \param left Left operand /// \param right Right operand /// /// \return Result of \a left - \a right /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API Color operator -(const Color& left, const Color& right); //////////////////////////////////////////////////////////// /// \relates Color /// \brief Overload of the binary * operator /// /// This operator returns the component-wise multiplication /// (also called "modulation") of two colors. /// Components are then divided by 255 so that the result is /// still in the range [0, 255]. /// /// \param left Left operand /// \param right Right operand /// /// \return Result of \a left * \a right /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API Color operator *(const Color& left, const Color& right); //////////////////////////////////////////////////////////// /// \relates Color /// \brief Overload of the binary += operator /// /// This operator computes the component-wise sum of two colors, /// and assigns the result to the left operand. /// Components that exceed 255 are clamped to 255. /// /// \param left Left operand /// \param right Right operand /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API Color& operator +=(Color& left, const Color& right); //////////////////////////////////////////////////////////// /// \relates Color /// \brief Overload of the binary -= operator /// /// This operator computes the component-wise subtraction of two colors, /// and assigns the result to the left operand. /// Components below 0 are clamped to 0. /// /// \param left Left operand /// \param right Right operand /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API Color& operator -=(Color& left, const Color& right); //////////////////////////////////////////////////////////// /// \relates Color /// \brief Overload of the binary *= operator /// /// This operator returns the component-wise multiplication /// (also called "modulation") of two colors, and assigns /// the result to the left operand. /// Components are then divided by 255 so that the result is /// still in the range [0, 255]. /// /// \param left Left operand /// \param right Right operand /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API Color& operator *=(Color& left, const Color& right); } // namespace sf #endif // SFML_COLOR_HPP //////////////////////////////////////////////////////////// /// \class sf::Color /// \ingroup graphics /// /// sf::Color is a simple color class composed of 4 components: /// \li Red /// \li Green /// \li Blue /// \li Alpha (opacity) /// /// Each component is a public member, an unsigned integer in /// the range [0, 255]. Thus, colors can be constructed and /// manipulated very easily: /// /// \code /// sf::Color color(255, 0, 0); // red /// color.r = 0; // make it black /// color.b = 128; // make it dark blue /// \endcode /// /// The fourth component of colors, named "alpha", represents /// the opacity of the color. A color with an alpha value of /// 255 will be fully opaque, while an alpha value of 0 will /// make a color fully transparent, whatever the value of the /// other components is. /// /// The most common colors are already defined as static variables: /// \code /// sf::Color black = sf::Color::Black; /// sf::Color white = sf::Color::White; /// sf::Color red = sf::Color::Red; /// sf::Color green = sf::Color::Green; /// sf::Color blue = sf::Color::Blue; /// sf::Color yellow = sf::Color::Yellow; /// sf::Color magenta = sf::Color::Magenta; /// sf::Color cyan = sf::Color::Cyan; /// sf::Color transparent = sf::Color::Transparent; /// \endcode /// /// Colors can also be added and modulated (multiplied) using the /// overloaded operators + and *. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/ConvexShape.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_CONVEXSHAPE_HPP #define SFML_CONVEXSHAPE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Specialized shape representing a convex polygon /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API ConvexShape : public Shape { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// \param pointCount Number of points of the polygon /// //////////////////////////////////////////////////////////// explicit ConvexShape(std::size_t pointCount = 0); //////////////////////////////////////////////////////////// /// \brief Set the number of points of the polygon /// /// \a count must be greater than 2 to define a valid shape. /// /// \param count New number of points of the polygon /// /// \see getPointCount /// //////////////////////////////////////////////////////////// void setPointCount(std::size_t count); //////////////////////////////////////////////////////////// /// \brief Get the number of points of the polygon /// /// \return Number of points of the polygon /// /// \see setPointCount /// //////////////////////////////////////////////////////////// virtual std::size_t getPointCount() const; //////////////////////////////////////////////////////////// /// \brief Set the position of a point /// /// Don't forget that the polygon must remain convex, and /// the points need to stay ordered! /// setPointCount must be called first in order to set the total /// number of points. The result is undefined if \a index is out /// of the valid range. /// /// \param index Index of the point to change, in range [0 .. getPointCount() - 1] /// \param point New position of the point /// /// \see getPoint /// //////////////////////////////////////////////////////////// void setPoint(std::size_t index, const Vector2f& point); //////////////////////////////////////////////////////////// /// \brief Get the position of a point /// /// The returned point is in local coordinates, that is, /// the shape's transforms (position, rotation, scale) are /// not taken into account. /// The result is undefined if \a index is out of the valid range. /// /// \param index Index of the point to get, in range [0 .. getPointCount() - 1] /// /// \return Position of the index-th point of the polygon /// /// \see setPoint /// //////////////////////////////////////////////////////////// virtual Vector2f getPoint(std::size_t index) const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// std::vector m_points; ///< Points composing the convex polygon }; } // namespace sf #endif // SFML_CONVEXSHAPE_HPP //////////////////////////////////////////////////////////// /// \class sf::ConvexShape /// \ingroup graphics /// /// This class inherits all the functions of sf::Transformable /// (position, rotation, scale, bounds, ...) as well as the /// functions of sf::Shape (outline, color, texture, ...). /// /// It is important to keep in mind that a convex shape must /// always be... convex, otherwise it may not be drawn correctly. /// Moreover, the points must be defined in order; using a random /// order would result in an incorrect shape. /// /// Usage example: /// \code /// sf::ConvexShape polygon; /// polygon.setPointCount(3); /// polygon.setPoint(0, sf::Vector2f(0, 0)); /// polygon.setPoint(1, sf::Vector2f(0, 10)); /// polygon.setPoint(2, sf::Vector2f(25, 5)); /// polygon.setOutlineColor(sf::Color::Red); /// polygon.setOutlineThickness(5); /// polygon.setPosition(10, 20); /// ... /// window.draw(polygon); /// \endcode /// /// \see sf::Shape, sf::RectangleShape, sf::CircleShape /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Drawable.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_DRAWABLE_HPP #define SFML_DRAWABLE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { class RenderTarget; //////////////////////////////////////////////////////////// /// \brief Abstract base class for objects that can be drawn /// to a render target /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Drawable { public: //////////////////////////////////////////////////////////// /// \brief Virtual destructor /// //////////////////////////////////////////////////////////// virtual ~Drawable() {} protected: friend class RenderTarget; //////////////////////////////////////////////////////////// /// \brief Draw the object to a render target /// /// This is a pure virtual function that has to be implemented /// by the derived class to define how the drawable should be /// drawn. /// /// \param target Render target to draw to /// \param states Current render states /// //////////////////////////////////////////////////////////// virtual void draw(RenderTarget& target, RenderStates states) const = 0; }; } // namespace sf #endif // SFML_DRAWABLE_HPP //////////////////////////////////////////////////////////// /// \class sf::Drawable /// \ingroup graphics /// /// sf::Drawable is a very simple base class that allows objects /// of derived classes to be drawn to a sf::RenderTarget. /// /// All you have to do in your derived class is to override the /// draw virtual function. /// /// Note that inheriting from sf::Drawable is not mandatory, /// but it allows this nice syntax "window.draw(object)" rather /// than "object.draw(window)", which is more consistent with other /// SFML classes. /// /// Example: /// \code /// class MyDrawable : public sf::Drawable /// { /// public: /// /// ... /// /// private: /// /// virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const /// { /// // You can draw other high-level objects /// target.draw(m_sprite, states); /// /// // ... or use the low-level API /// states.texture = &m_texture; /// target.draw(m_vertices, states); /// /// // ... or draw with OpenGL directly /// glBegin(GL_QUADS); /// ... /// glEnd(); /// } /// /// sf::Sprite m_sprite; /// sf::Texture m_texture; /// sf::VertexArray m_vertices; /// }; /// \endcode /// /// \see sf::RenderTarget /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Export.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_GRAPHICS_EXPORT_HPP #define SFML_GRAPHICS_EXPORT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include //////////////////////////////////////////////////////////// // Define portable import / export macros //////////////////////////////////////////////////////////// #if defined(SFML_GRAPHICS_EXPORTS) #define SFML_GRAPHICS_API SFML_API_EXPORT #else #define SFML_GRAPHICS_API SFML_API_IMPORT #endif #endif // SFML_GRAPHICS_EXPORT_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Font.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_FONT_HPP #define SFML_FONT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include namespace sf { class InputStream; //////////////////////////////////////////////////////////// /// \brief Class for loading and manipulating character fonts /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Font { public: //////////////////////////////////////////////////////////// /// \brief Holds various information about a font /// //////////////////////////////////////////////////////////// struct Info { std::string family; ///< The font family }; public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor defines an empty font /// //////////////////////////////////////////////////////////// Font(); //////////////////////////////////////////////////////////// /// \brief Copy constructor /// /// \param copy Instance to copy /// //////////////////////////////////////////////////////////// Font(const Font& copy); //////////////////////////////////////////////////////////// /// \brief Destructor /// /// Cleans up all the internal resources used by the font /// //////////////////////////////////////////////////////////// ~Font(); //////////////////////////////////////////////////////////// /// \brief Load the font from a file /// /// The supported font formats are: TrueType, Type 1, CFF, /// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. /// Note that this function know nothing about the standard /// fonts installed on the user's system, thus you can't /// load them directly. /// /// \warning SFML cannot preload all the font data in this /// function, so the file has to remain accessible until /// the sf::Font object loads a new font or is destroyed. /// /// \param filename Path of the font file to load /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromMemory, loadFromStream /// //////////////////////////////////////////////////////////// bool loadFromFile(const std::string& filename); //////////////////////////////////////////////////////////// /// \brief Load the font from a file in memory /// /// The supported font formats are: TrueType, Type 1, CFF, /// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. /// /// \warning SFML cannot preload all the font data in this /// function, so the buffer pointed by \a data has to remain /// valid until the sf::Font object loads a new font or /// is destroyed. /// /// \param data Pointer to the file data in memory /// \param sizeInBytes Size of the data to load, in bytes /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromStream /// //////////////////////////////////////////////////////////// bool loadFromMemory(const void* data, std::size_t sizeInBytes); //////////////////////////////////////////////////////////// /// \brief Load the font from a custom stream /// /// The supported font formats are: TrueType, Type 1, CFF, /// OpenType, SFNT, X11 PCF, Windows FNT, BDF, PFR and Type 42. /// Warning: SFML cannot preload all the font data in this /// function, so the contents of \a stream have to remain /// valid as long as the font is used. /// /// \warning SFML cannot preload all the font data in this /// function, so the stream has to remain accessible until /// the sf::Font object loads a new font or is destroyed. /// /// \param stream Source stream to read from /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromMemory /// //////////////////////////////////////////////////////////// bool loadFromStream(InputStream& stream); //////////////////////////////////////////////////////////// /// \brief Get the font information /// /// \return A structure that holds the font information /// //////////////////////////////////////////////////////////// const Info& getInfo() const; //////////////////////////////////////////////////////////// /// \brief Retrieve a glyph of the font /// /// If the font is a bitmap font, not all character sizes /// might be available. If the glyph is not available at the /// requested size, an empty glyph is returned. /// /// Be aware that using a negative value for the outline /// thickness will cause distorted rendering. /// /// \param codePoint Unicode code point of the character to get /// \param characterSize Reference character size /// \param bold Retrieve the bold version or the regular one? /// \param outlineThickness Thickness of outline (when != 0 the glyph will not be filled) /// /// \return The glyph corresponding to \a codePoint and \a characterSize /// //////////////////////////////////////////////////////////// const Glyph& getGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, float outlineThickness = 0) const; //////////////////////////////////////////////////////////// /// \brief Get the kerning offset of two glyphs /// /// The kerning is an extra offset (negative) to apply between two /// glyphs when rendering them, to make the pair look more "natural". /// For example, the pair "AV" have a special kerning to make them /// closer than other characters. Most of the glyphs pairs have a /// kerning offset of zero, though. /// /// \param first Unicode code point of the first character /// \param second Unicode code point of the second character /// \param characterSize Reference character size /// /// \return Kerning value for \a first and \a second, in pixels /// //////////////////////////////////////////////////////////// float getKerning(Uint32 first, Uint32 second, unsigned int characterSize) const; //////////////////////////////////////////////////////////// /// \brief Get the line spacing /// /// Line spacing is the vertical offset to apply between two /// consecutive lines of text. /// /// \param characterSize Reference character size /// /// \return Line spacing, in pixels /// //////////////////////////////////////////////////////////// float getLineSpacing(unsigned int characterSize) const; //////////////////////////////////////////////////////////// /// \brief Get the position of the underline /// /// Underline position is the vertical offset to apply between the /// baseline and the underline. /// /// \param characterSize Reference character size /// /// \return Underline position, in pixels /// /// \see getUnderlineThickness /// //////////////////////////////////////////////////////////// float getUnderlinePosition(unsigned int characterSize) const; //////////////////////////////////////////////////////////// /// \brief Get the thickness of the underline /// /// Underline thickness is the vertical size of the underline. /// /// \param characterSize Reference character size /// /// \return Underline thickness, in pixels /// /// \see getUnderlinePosition /// //////////////////////////////////////////////////////////// float getUnderlineThickness(unsigned int characterSize) const; //////////////////////////////////////////////////////////// /// \brief Retrieve the texture containing the loaded glyphs of a certain size /// /// The contents of the returned texture changes as more glyphs /// are requested, thus it is not very relevant. It is mainly /// used internally by sf::Text. /// /// \param characterSize Reference character size /// /// \return Texture containing the glyphs of the requested size /// //////////////////////////////////////////////////////////// const Texture& getTexture(unsigned int characterSize) const; //////////////////////////////////////////////////////////// /// \brief Overload of assignment operator /// /// \param right Instance to assign /// /// \return Reference to self /// //////////////////////////////////////////////////////////// Font& operator =(const Font& right); private: //////////////////////////////////////////////////////////// /// \brief Structure defining a row of glyphs /// //////////////////////////////////////////////////////////// struct Row { Row(unsigned int rowTop, unsigned int rowHeight) : width(0), top(rowTop), height(rowHeight) {} unsigned int width; ///< Current width of the row unsigned int top; ///< Y position of the row into the texture unsigned int height; ///< Height of the row }; //////////////////////////////////////////////////////////// // Types //////////////////////////////////////////////////////////// typedef std::map GlyphTable; ///< Table mapping a codepoint to its glyph //////////////////////////////////////////////////////////// /// \brief Structure defining a page of glyphs /// //////////////////////////////////////////////////////////// struct Page { Page(); GlyphTable glyphs; ///< Table mapping code points to their corresponding glyph Texture texture; ///< Texture containing the pixels of the glyphs unsigned int nextRow; ///< Y position of the next new row in the texture std::vector rows; ///< List containing the position of all the existing rows }; //////////////////////////////////////////////////////////// /// \brief Free all the internal resources /// //////////////////////////////////////////////////////////// void cleanup(); //////////////////////////////////////////////////////////// /// \brief Load a new glyph and store it in the cache /// /// \param codePoint Unicode code point of the character to load /// \param characterSize Reference character size /// \param bold Retrieve the bold version or the regular one? /// \param outlineThickness Thickness of outline (when != 0 the glyph will not be filled) /// /// \return The glyph corresponding to \a codePoint and \a characterSize /// //////////////////////////////////////////////////////////// Glyph loadGlyph(Uint32 codePoint, unsigned int characterSize, bool bold, float outlineThickness) const; //////////////////////////////////////////////////////////// /// \brief Find a suitable rectangle within the texture for a glyph /// /// \param page Page of glyphs to search in /// \param width Width of the rectangle /// \param height Height of the rectangle /// /// \return Found rectangle within the texture /// //////////////////////////////////////////////////////////// IntRect findGlyphRect(Page& page, unsigned int width, unsigned int height) const; //////////////////////////////////////////////////////////// /// \brief Make sure that the given size is the current one /// /// \param characterSize Reference character size /// /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// bool setCurrentSize(unsigned int characterSize) const; //////////////////////////////////////////////////////////// // Types //////////////////////////////////////////////////////////// typedef std::map PageTable; ///< Table mapping a character size to its page (texture) //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// void* m_library; ///< Pointer to the internal library interface (it is typeless to avoid exposing implementation details) void* m_face; ///< Pointer to the internal font face (it is typeless to avoid exposing implementation details) void* m_streamRec; ///< Pointer to the stream rec instance (it is typeless to avoid exposing implementation details) void* m_stroker; ///< Pointer to the stroker (it is typeless to avoid exposing implementation details) int* m_refCount; ///< Reference counter used by implicit sharing Info m_info; ///< Information about the font mutable PageTable m_pages; ///< Table containing the glyphs pages by character size mutable std::vector m_pixelBuffer; ///< Pixel buffer holding a glyph's pixels before being written to the texture #ifdef SFML_SYSTEM_ANDROID void* m_stream; ///< Asset file streamer (if loaded from file) #endif }; } // namespace sf #endif // SFML_FONT_HPP //////////////////////////////////////////////////////////// /// \class sf::Font /// \ingroup graphics /// /// Fonts can be loaded from a file, from memory or from a custom /// stream, and supports the most common types of fonts. See /// the loadFromFile function for the complete list of supported formats. /// /// Once it is loaded, a sf::Font instance provides three /// types of information about the font: /// \li Global metrics, such as the line spacing /// \li Per-glyph metrics, such as bounding box or kerning /// \li Pixel representation of glyphs /// /// Fonts alone are not very useful: they hold the font data /// but cannot make anything useful of it. To do so you need to /// use the sf::Text class, which is able to properly output text /// with several options such as character size, style, color, /// position, rotation, etc. /// This separation allows more flexibility and better performances: /// indeed a sf::Font is a heavy resource, and any operation on it /// is slow (often too slow for real-time applications). On the other /// side, a sf::Text is a lightweight object which can combine the /// glyphs data and metrics of a sf::Font to display any text on a /// render target. /// Note that it is also possible to bind several sf::Text instances /// to the same sf::Font. /// /// It is important to note that the sf::Text instance doesn't /// copy the font that it uses, it only keeps a reference to it. /// Thus, a sf::Font must not be destructed while it is /// used by a sf::Text (i.e. never write a function that /// uses a local sf::Font instance for creating a text). /// /// Usage example: /// \code /// // Declare a new font /// sf::Font font; /// /// // Load it from a file /// if (!font.loadFromFile("arial.ttf")) /// { /// // error... /// } /// /// // Create a text which uses our font /// sf::Text text1; /// text1.setFont(font); /// text1.setCharacterSize(30); /// text1.setStyle(sf::Text::Regular); /// /// // Create another text using the same font, but with different parameters /// sf::Text text2; /// text2.setFont(font); /// text2.setCharacterSize(50); /// text2.setStyle(sf::Text::Italic); /// \endcode /// /// Apart from loading font files, and passing them to instances /// of sf::Text, you should normally not have to deal directly /// with this class. However, it may be useful to access the /// font metrics or rasterized glyphs for advanced usage. /// /// Note that if the font is a bitmap font, it is not scalable, /// thus not all requested sizes will be available to use. This /// needs to be taken into consideration when using sf::Text. /// If you need to display text of a certain size, make sure the /// corresponding bitmap font that supports that size is used. /// /// \see sf::Text /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Glsl.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_GLSL_HPP #define SFML_GLSL_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include namespace sf { namespace priv { // Forward declarations template struct Matrix; template struct Vector4; #include } // namespace priv //////////////////////////////////////////////////////////// /// \brief Namespace with GLSL types /// //////////////////////////////////////////////////////////// namespace Glsl { //////////////////////////////////////////////////////////// /// \brief 2D float vector (\p vec2 in GLSL) /// //////////////////////////////////////////////////////////// typedef Vector2 Vec2; //////////////////////////////////////////////////////////// /// \brief 2D int vector (\p ivec2 in GLSL) /// //////////////////////////////////////////////////////////// typedef Vector2 Ivec2; //////////////////////////////////////////////////////////// /// \brief 2D bool vector (\p bvec2 in GLSL) /// //////////////////////////////////////////////////////////// typedef Vector2 Bvec2; //////////////////////////////////////////////////////////// /// \brief 3D float vector (\p vec3 in GLSL) /// //////////////////////////////////////////////////////////// typedef Vector3 Vec3; //////////////////////////////////////////////////////////// /// \brief 3D int vector (\p ivec3 in GLSL) /// //////////////////////////////////////////////////////////// typedef Vector3 Ivec3; //////////////////////////////////////////////////////////// /// \brief 3D bool vector (\p bvec3 in GLSL) /// //////////////////////////////////////////////////////////// typedef Vector3 Bvec3; #ifdef SFML_DOXYGEN //////////////////////////////////////////////////////////// /// \brief 4D float vector (\p vec4 in GLSL) /// /// 4D float vectors can be implicitly converted from sf::Color /// instances. Each color channel is normalized from integers /// in [0, 255] to floating point values in [0, 1]. /// \code /// sf::Glsl::Vec4 zeroVector; /// sf::Glsl::Vec4 vector(1.f, 2.f, 3.f, 4.f); /// sf::Glsl::Vec4 color = sf::Color::Cyan; /// \endcode //////////////////////////////////////////////////////////// typedef implementation-defined Vec4; //////////////////////////////////////////////////////////// /// \brief 4D int vector (\p ivec4 in GLSL) /// /// 4D int vectors can be implicitly converted from sf::Color /// instances. Each color channel remains unchanged inside /// the integer interval [0, 255]. /// \code /// sf::Glsl::Ivec4 zeroVector; /// sf::Glsl::Ivec4 vector(1, 2, 3, 4); /// sf::Glsl::Ivec4 color = sf::Color::Cyan; /// \endcode //////////////////////////////////////////////////////////// typedef implementation-defined Ivec4; //////////////////////////////////////////////////////////// /// \brief 4D bool vector (\p bvec4 in GLSL) /// //////////////////////////////////////////////////////////// typedef implementation-defined Bvec4; //////////////////////////////////////////////////////////// /// \brief 3x3 float matrix (\p mat3 in GLSL) /// /// The matrix can be constructed from an array with 3x3 /// elements, aligned in column-major order. For example, /// a translation by (x, y) looks as follows: /// \code /// float array[9] = /// { /// 1, 0, 0, /// 0, 1, 0, /// x, y, 1 /// }; /// /// sf::Glsl::Mat3 matrix(array); /// \endcode /// /// Mat3 can also be implicitly converted from sf::Transform: /// \code /// sf::Transform transform; /// sf::Glsl::Mat3 matrix = transform; /// \endcode //////////////////////////////////////////////////////////// typedef implementation-defined Mat3; //////////////////////////////////////////////////////////// /// \brief 4x4 float matrix (\p mat4 in GLSL) /// /// The matrix can be constructed from an array with 4x4 /// elements, aligned in column-major order. For example, /// a translation by (x, y, z) looks as follows: /// \code /// float array[16] = /// { /// 1, 0, 0, 0, /// 0, 1, 0, 0, /// 0, 0, 1, 0, /// x, y, z, 1 /// }; /// /// sf::Glsl::Mat4 matrix(array); /// \endcode /// /// Mat4 can also be implicitly converted from sf::Transform: /// \code /// sf::Transform transform; /// sf::Glsl::Mat4 matrix = transform; /// \endcode //////////////////////////////////////////////////////////// typedef implementation-defined Mat4; #else // SFML_DOXYGEN typedef priv::Vector4 Vec4; typedef priv::Vector4 Ivec4; typedef priv::Vector4 Bvec4; typedef priv::Matrix<3, 3> Mat3; typedef priv::Matrix<4, 4> Mat4; #endif // SFML_DOXYGEN } // namespace Glsl } // namespace sf #endif // SFML_GLSL_HPP //////////////////////////////////////////////////////////// /// \namespace sf::Glsl /// \ingroup graphics /// /// \details The sf::Glsl namespace contains types that match /// their equivalents in GLSL, the OpenGL shading language. /// These types are exclusively used by the sf::Shader class. /// /// Types that already exist in SFML, such as \ref sf::Vector2 /// and \ref sf::Vector3, are reused as typedefs, so you can use /// the types in this namespace as well as the original ones. /// Others are newly defined, such as Glsl::Vec4 or Glsl::Mat3. Their /// actual type is an implementation detail and should not be used. /// /// All vector types support a default constructor that /// initializes every component to zero, in addition to a /// constructor with one parameter for each component. /// The components are stored in member variables called /// x, y, z, and w. /// /// All matrix types support a constructor with a float* /// parameter that points to a float array of the appropriate /// size (that is, 9 in a 3x3 matrix, 16 in a 4x4 matrix). /// Furthermore, they can be converted from sf::Transform /// objects. /// /// \see sf::Shader /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Glsl.inl ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// /// \brief Helper functions to copy sf::Transform to sf::Glsl::Mat3/4 /// //////////////////////////////////////////////////////////// void SFML_GRAPHICS_API copyMatrix(const Transform& source, Matrix<3, 3>& dest); void SFML_GRAPHICS_API copyMatrix(const Transform& source, Matrix<4, 4>& dest); //////////////////////////////////////////////////////////// /// \brief Copy array-based matrix with given number of elements /// /// Indirection to std::copy() to avoid inclusion of /// and MSVC's annoying 4996 warning in header /// //////////////////////////////////////////////////////////// void SFML_GRAPHICS_API copyMatrix(const float* source, std::size_t elements, float* dest); //////////////////////////////////////////////////////////// /// \brief Helper functions to copy sf::Color to sf::Glsl::Vec4/Ivec4 /// //////////////////////////////////////////////////////////// void SFML_GRAPHICS_API copyVector(const Color& source, Vector4& dest); void SFML_GRAPHICS_API copyVector(const Color& source, Vector4& dest); //////////////////////////////////////////////////////////// /// \brief Matrix type, used to set uniforms in GLSL /// //////////////////////////////////////////////////////////// template struct Matrix { //////////////////////////////////////////////////////////// /// \brief Construct from raw data /// /// \param pointer Points to the beginning of an array that /// has the size of the matrix. The elements /// are copied to the instance. /// //////////////////////////////////////////////////////////// explicit Matrix(const float* pointer) { copyMatrix(pointer, Columns * Rows, array); } //////////////////////////////////////////////////////////// /// \brief Construct implicitly from SFML transform /// /// This constructor is only supported for 3x3 and 4x4 /// matrices. /// /// \param transform Object containing a transform. /// //////////////////////////////////////////////////////////// Matrix(const Transform& transform) { copyMatrix(transform, *this); } float array[Columns * Rows]; ///< Array holding matrix data }; //////////////////////////////////////////////////////////// /// \brief 4D vector type, used to set uniforms in GLSL /// //////////////////////////////////////////////////////////// template struct Vector4 { //////////////////////////////////////////////////////////// /// \brief Default constructor, creates a zero vector /// //////////////////////////////////////////////////////////// Vector4() : x(0), y(0), z(0), w(0) { } //////////////////////////////////////////////////////////// /// \brief Construct from 4 vector components /// /// \param X Component of the 4D vector /// \param Y Component of the 4D vector /// \param Z Component of the 4D vector /// \param W Component of the 4D vector /// //////////////////////////////////////////////////////////// Vector4(T X, T Y, T Z, T W) : x(X), y(Y), z(Z), w(W) { } //////////////////////////////////////////////////////////// /// \brief Conversion constructor /// /// \param other 4D vector of different type /// //////////////////////////////////////////////////////////// template explicit Vector4(const Vector4& other) : x(static_cast(other.x)), y(static_cast(other.y)), z(static_cast(other.z)), w(static_cast(other.w)) { } //////////////////////////////////////////////////////////// /// \brief Construct float vector implicitly from color /// /// \param color Color instance. Is normalized to [0, 1] /// for floats, and left as-is for ints. /// //////////////////////////////////////////////////////////// Vector4(const Color& color) // uninitialized { copyVector(color, *this); } T x; ///< 1st component (X) of the 4D vector T y; ///< 2nd component (Y) of the 4D vector T z; ///< 3rd component (Z) of the 4D vector T w; ///< 4th component (W) of the 4D vector }; ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Glyph.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_GLYPH_HPP #define SFML_GLYPH_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Structure describing a glyph /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Glyph { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// Glyph() : advance(0) {} //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// float advance; ///< Offset to move horizontally to the next character FloatRect bounds; ///< Bounding rectangle of the glyph, in coordinates relative to the baseline IntRect textureRect; ///< Texture coordinates of the glyph inside the font's texture }; } // namespace sf #endif // SFML_GLYPH_HPP //////////////////////////////////////////////////////////// /// \class sf::Glyph /// \ingroup graphics /// /// A glyph is the visual representation of a character. /// /// The sf::Glyph structure provides the information needed /// to handle the glyph: /// \li its coordinates in the font's texture /// \li its bounding rectangle /// \li the offset to apply to get the starting position of the next glyph /// /// \see sf::Font /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Image.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_IMAGE_HPP #define SFML_IMAGE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include namespace sf { class InputStream; //////////////////////////////////////////////////////////// /// \brief Class for loading, manipulating and saving images /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Image { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates an empty image. /// //////////////////////////////////////////////////////////// Image(); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~Image(); //////////////////////////////////////////////////////////// /// \brief Create the image and fill it with a unique color /// /// \param width Width of the image /// \param height Height of the image /// \param color Fill color /// //////////////////////////////////////////////////////////// void create(unsigned int width, unsigned int height, const Color& color = Color(0, 0, 0)); //////////////////////////////////////////////////////////// /// \brief Create the image from an array of pixels /// /// The \a pixel array is assumed to contain 32-bits RGBA pixels, /// and have the given \a width and \a height. If not, this is /// an undefined behavior. /// If \a pixels is null, an empty image is created. /// /// \param width Width of the image /// \param height Height of the image /// \param pixels Array of pixels to copy to the image /// //////////////////////////////////////////////////////////// void create(unsigned int width, unsigned int height, const Uint8* pixels); //////////////////////////////////////////////////////////// /// \brief Load the image from a file on disk /// /// The supported image formats are bmp, png, tga, jpg, gif, /// psd, hdr and pic. Some format options are not supported, /// like progressive jpeg. /// If this function fails, the image is left unchanged. /// /// \param filename Path of the image file to load /// /// \return True if loading was successful /// /// \see loadFromMemory, loadFromStream, saveToFile /// //////////////////////////////////////////////////////////// bool loadFromFile(const std::string& filename); //////////////////////////////////////////////////////////// /// \brief Load the image from a file in memory /// /// The supported image formats are bmp, png, tga, jpg, gif, /// psd, hdr and pic. Some format options are not supported, /// like progressive jpeg. /// If this function fails, the image is left unchanged. /// /// \param data Pointer to the file data in memory /// \param size Size of the data to load, in bytes /// /// \return True if loading was successful /// /// \see loadFromFile, loadFromStream /// //////////////////////////////////////////////////////////// bool loadFromMemory(const void* data, std::size_t size); //////////////////////////////////////////////////////////// /// \brief Load the image from a custom stream /// /// The supported image formats are bmp, png, tga, jpg, gif, /// psd, hdr and pic. Some format options are not supported, /// like progressive jpeg. /// If this function fails, the image is left unchanged. /// /// \param stream Source stream to read from /// /// \return True if loading was successful /// /// \see loadFromFile, loadFromMemory /// //////////////////////////////////////////////////////////// bool loadFromStream(InputStream& stream); //////////////////////////////////////////////////////////// /// \brief Save the image to a file on disk /// /// The format of the image is automatically deduced from /// the extension. The supported image formats are bmp, png, /// tga and jpg. The destination file is overwritten /// if it already exists. This function fails if the image is empty. /// /// \param filename Path of the file to save /// /// \return True if saving was successful /// /// \see create, loadFromFile, loadFromMemory /// //////////////////////////////////////////////////////////// bool saveToFile(const std::string& filename) const; //////////////////////////////////////////////////////////// /// \brief Return the size (width and height) of the image /// /// \return Size of the image, in pixels /// //////////////////////////////////////////////////////////// Vector2u getSize() const; //////////////////////////////////////////////////////////// /// \brief Create a transparency mask from a specified color-key /// /// This function sets the alpha value of every pixel matching /// the given color to \a alpha (0 by default), so that they /// become transparent. /// /// \param color Color to make transparent /// \param alpha Alpha value to assign to transparent pixels /// //////////////////////////////////////////////////////////// void createMaskFromColor(const Color& color, Uint8 alpha = 0); //////////////////////////////////////////////////////////// /// \brief Copy pixels from another image onto this one /// /// This function does a slow pixel copy and should not be /// used intensively. It can be used to prepare a complex /// static image from several others, but if you need this /// kind of feature in real-time you'd better use sf::RenderTexture. /// /// If \a sourceRect is empty, the whole image is copied. /// If \a applyAlpha is set to true, the transparency of /// source pixels is applied. If it is false, the pixels are /// copied unchanged with their alpha value. /// /// \param source Source image to copy /// \param destX X coordinate of the destination position /// \param destY Y coordinate of the destination position /// \param sourceRect Sub-rectangle of the source image to copy /// \param applyAlpha Should the copy take into account the source transparency? /// //////////////////////////////////////////////////////////// void copy(const Image& source, unsigned int destX, unsigned int destY, const IntRect& sourceRect = IntRect(0, 0, 0, 0), bool applyAlpha = false); //////////////////////////////////////////////////////////// /// \brief Change the color of a pixel /// /// This function doesn't check the validity of the pixel /// coordinates, using out-of-range values will result in /// an undefined behavior. /// /// \param x X coordinate of pixel to change /// \param y Y coordinate of pixel to change /// \param color New color of the pixel /// /// \see getPixel /// //////////////////////////////////////////////////////////// void setPixel(unsigned int x, unsigned int y, const Color& color); //////////////////////////////////////////////////////////// /// \brief Get the color of a pixel /// /// This function doesn't check the validity of the pixel /// coordinates, using out-of-range values will result in /// an undefined behavior. /// /// \param x X coordinate of pixel to get /// \param y Y coordinate of pixel to get /// /// \return Color of the pixel at coordinates (x, y) /// /// \see setPixel /// //////////////////////////////////////////////////////////// Color getPixel(unsigned int x, unsigned int y) const; //////////////////////////////////////////////////////////// /// \brief Get a read-only pointer to the array of pixels /// /// The returned value points to an array of RGBA pixels made of /// 8 bits integers components. The size of the array is /// width * height * 4 (getSize().x * getSize().y * 4). /// Warning: the returned pointer may become invalid if you /// modify the image, so you should never store it for too long. /// If the image is empty, a null pointer is returned. /// /// \return Read-only pointer to the array of pixels /// //////////////////////////////////////////////////////////// const Uint8* getPixelsPtr() const; //////////////////////////////////////////////////////////// /// \brief Flip the image horizontally (left <-> right) /// //////////////////////////////////////////////////////////// void flipHorizontally(); //////////////////////////////////////////////////////////// /// \brief Flip the image vertically (top <-> bottom) /// //////////////////////////////////////////////////////////// void flipVertically(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Vector2u m_size; ///< Image size std::vector m_pixels; ///< Pixels of the image #ifdef SFML_SYSTEM_ANDROID void* m_stream; ///< Asset file streamer (if loaded from file) #endif }; } // namespace sf #endif // SFML_IMAGE_HPP //////////////////////////////////////////////////////////// /// \class sf::Image /// \ingroup graphics /// /// sf::Image is an abstraction to manipulate images /// as bidimensional arrays of pixels. The class provides /// functions to load, read, write and save pixels, as well /// as many other useful functions. /// /// sf::Image can handle a unique internal representation of /// pixels, which is RGBA 32 bits. This means that a pixel /// must be composed of 8 bits red, green, blue and alpha /// channels -- just like a sf::Color. /// All the functions that return an array of pixels follow /// this rule, and all parameters that you pass to sf::Image /// functions (such as loadFromMemory) must use this /// representation as well. /// /// A sf::Image can be copied, but it is a heavy resource and /// if possible you should always use [const] references to /// pass or return them to avoid useless copies. /// /// Usage example: /// \code /// // Load an image file from a file /// sf::Image background; /// if (!background.loadFromFile("background.jpg")) /// return -1; /// /// // Create a 20x20 image filled with black color /// sf::Image image; /// image.create(20, 20, sf::Color::Black); /// /// // Copy image1 on image2 at position (10, 10) /// image.copy(background, 10, 10); /// /// // Make the top-left pixel transparent /// sf::Color color = image.getPixel(0, 0); /// color.a = 0; /// image.setPixel(0, 0, color); /// /// // Save the image to a file /// if (!image.saveToFile("result.png")) /// return -1; /// \endcode /// /// \see sf::Texture /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/PrimitiveType.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_PRIMITIVETYPE_HPP #define SFML_PRIMITIVETYPE_HPP namespace sf { //////////////////////////////////////////////////////////// /// \ingroup graphics /// \brief Types of primitives that a sf::VertexArray can render /// /// Points and lines have no area, therefore their thickness /// will always be 1 pixel, regardless the current transform /// and view. /// //////////////////////////////////////////////////////////// enum PrimitiveType { Points, ///< List of individual points Lines, ///< List of individual lines LineStrip, ///< List of connected lines, a point uses the previous point to form a line Triangles, ///< List of individual triangles TriangleStrip, ///< List of connected triangles, a point uses the two previous points to form a triangle TriangleFan, ///< List of connected triangles, a point uses the common center and the previous point to form a triangle Quads, ///< List of individual quads (deprecated, don't work with OpenGL ES) // Deprecated names LinesStrip = LineStrip, ///< \deprecated Use LineStrip instead TrianglesStrip = TriangleStrip, ///< \deprecated Use TriangleStrip instead TrianglesFan = TriangleFan ///< \deprecated Use TriangleFan instead }; } // namespace sf #endif // SFML_PRIMITIVETYPE_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Rect.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_RECT_HPP #define SFML_RECT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Utility class for manipulating 2D axis aligned rectangles /// //////////////////////////////////////////////////////////// template class Rect { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates an empty rectangle (it is equivalent to calling /// Rect(0, 0, 0, 0)). /// //////////////////////////////////////////////////////////// Rect(); //////////////////////////////////////////////////////////// /// \brief Construct the rectangle from its coordinates /// /// Be careful, the last two parameters are the width /// and height, not the right and bottom coordinates! /// /// \param rectLeft Left coordinate of the rectangle /// \param rectTop Top coordinate of the rectangle /// \param rectWidth Width of the rectangle /// \param rectHeight Height of the rectangle /// //////////////////////////////////////////////////////////// Rect(T rectLeft, T rectTop, T rectWidth, T rectHeight); //////////////////////////////////////////////////////////// /// \brief Construct the rectangle from position and size /// /// Be careful, the last parameter is the size, /// not the bottom-right corner! /// /// \param position Position of the top-left corner of the rectangle /// \param size Size of the rectangle /// //////////////////////////////////////////////////////////// Rect(const Vector2& position, const Vector2& size); //////////////////////////////////////////////////////////// /// \brief Construct the rectangle from another type of rectangle /// /// This constructor doesn't replace the copy constructor, /// it's called only when U != T. /// A call to this constructor will fail to compile if U /// is not convertible to T. /// /// \param rectangle Rectangle to convert /// //////////////////////////////////////////////////////////// template explicit Rect(const Rect& rectangle); //////////////////////////////////////////////////////////// /// \brief Check if a point is inside the rectangle's area /// /// This check is non-inclusive. If the point lies on the /// edge of the rectangle, this function will return false. /// /// \param x X coordinate of the point to test /// \param y Y coordinate of the point to test /// /// \return True if the point is inside, false otherwise /// /// \see intersects /// //////////////////////////////////////////////////////////// bool contains(T x, T y) const; //////////////////////////////////////////////////////////// /// \brief Check if a point is inside the rectangle's area /// /// This check is non-inclusive. If the point lies on the /// edge of the rectangle, this function will return false. /// /// \param point Point to test /// /// \return True if the point is inside, false otherwise /// /// \see intersects /// //////////////////////////////////////////////////////////// bool contains(const Vector2& point) const; //////////////////////////////////////////////////////////// /// \brief Check the intersection between two rectangles /// /// \param rectangle Rectangle to test /// /// \return True if rectangles overlap, false otherwise /// /// \see contains /// //////////////////////////////////////////////////////////// bool intersects(const Rect& rectangle) const; //////////////////////////////////////////////////////////// /// \brief Check the intersection between two rectangles /// /// This overload returns the overlapped rectangle in the /// \a intersection parameter. /// /// \param rectangle Rectangle to test /// \param intersection Rectangle to be filled with the intersection /// /// \return True if rectangles overlap, false otherwise /// /// \see contains /// //////////////////////////////////////////////////////////// bool intersects(const Rect& rectangle, Rect& intersection) const; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// T left; ///< Left coordinate of the rectangle T top; ///< Top coordinate of the rectangle T width; ///< Width of the rectangle T height; ///< Height of the rectangle }; //////////////////////////////////////////////////////////// /// \relates Rect /// \brief Overload of binary operator == /// /// This operator compares strict equality between two rectangles. /// /// \param left Left operand (a rectangle) /// \param right Right operand (a rectangle) /// /// \return True if \a left is equal to \a right /// //////////////////////////////////////////////////////////// template bool operator ==(const Rect& left, const Rect& right); //////////////////////////////////////////////////////////// /// \relates Rect /// \brief Overload of binary operator != /// /// This operator compares strict difference between two rectangles. /// /// \param left Left operand (a rectangle) /// \param right Right operand (a rectangle) /// /// \return True if \a left is not equal to \a right /// //////////////////////////////////////////////////////////// template bool operator !=(const Rect& left, const Rect& right); #include // Create typedefs for the most common types typedef Rect IntRect; typedef Rect FloatRect; } // namespace sf #endif // SFML_RECT_HPP //////////////////////////////////////////////////////////// /// \class sf::Rect /// \ingroup graphics /// /// A rectangle is defined by its top-left corner and its size. /// It is a very simple class defined for convenience, so /// its member variables (left, top, width and height) are public /// and can be accessed directly, just like the vector classes /// (Vector2 and Vector3). /// /// To keep things simple, sf::Rect doesn't define /// functions to emulate the properties that are not directly /// members (such as right, bottom, center, etc.), it rather /// only provides intersection functions. /// /// sf::Rect uses the usual rules for its boundaries: /// \li The left and top edges are included in the rectangle's area /// \li The right (left + width) and bottom (top + height) edges are excluded from the rectangle's area /// /// This means that sf::IntRect(0, 0, 1, 1) and sf::IntRect(1, 1, 1, 1) /// don't intersect. /// /// sf::Rect is a template and may be used with any numeric type, but /// for simplicity the instantiations used by SFML are typedef'd: /// \li sf::Rect is sf::IntRect /// \li sf::Rect is sf::FloatRect /// /// So that you don't have to care about the template syntax. /// /// Usage example: /// \code /// // Define a rectangle, located at (0, 0) with a size of 20x5 /// sf::IntRect r1(0, 0, 20, 5); /// /// // Define another rectangle, located at (4, 2) with a size of 18x10 /// sf::Vector2i position(4, 2); /// sf::Vector2i size(18, 10); /// sf::IntRect r2(position, size); /// /// // Test intersections with the point (3, 1) /// bool b1 = r1.contains(3, 1); // true /// bool b2 = r2.contains(3, 1); // false /// /// // Test the intersection between r1 and r2 /// sf::IntRect result; /// bool b3 = r1.intersects(r2, result); // true /// // result == (4, 2, 16, 3) /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Rect.inl ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// template Rect::Rect() : left (0), top (0), width (0), height(0) { } //////////////////////////////////////////////////////////// template Rect::Rect(T rectLeft, T rectTop, T rectWidth, T rectHeight) : left (rectLeft), top (rectTop), width (rectWidth), height(rectHeight) { } //////////////////////////////////////////////////////////// template Rect::Rect(const Vector2& position, const Vector2& size) : left (position.x), top (position.y), width (size.x), height(size.y) { } //////////////////////////////////////////////////////////// template template Rect::Rect(const Rect& rectangle) : left (static_cast(rectangle.left)), top (static_cast(rectangle.top)), width (static_cast(rectangle.width)), height(static_cast(rectangle.height)) { } //////////////////////////////////////////////////////////// template bool Rect::contains(T x, T y) const { // Rectangles with negative dimensions are allowed, so we must handle them correctly // Compute the real min and max of the rectangle on both axes T minX = std::min(left, static_cast(left + width)); T maxX = std::max(left, static_cast(left + width)); T minY = std::min(top, static_cast(top + height)); T maxY = std::max(top, static_cast(top + height)); return (x >= minX) && (x < maxX) && (y >= minY) && (y < maxY); } //////////////////////////////////////////////////////////// template bool Rect::contains(const Vector2& point) const { return contains(point.x, point.y); } //////////////////////////////////////////////////////////// template bool Rect::intersects(const Rect& rectangle) const { Rect intersection; return intersects(rectangle, intersection); } //////////////////////////////////////////////////////////// template bool Rect::intersects(const Rect& rectangle, Rect& intersection) const { // Rectangles with negative dimensions are allowed, so we must handle them correctly // Compute the min and max of the first rectangle on both axes T r1MinX = std::min(left, static_cast(left + width)); T r1MaxX = std::max(left, static_cast(left + width)); T r1MinY = std::min(top, static_cast(top + height)); T r1MaxY = std::max(top, static_cast(top + height)); // Compute the min and max of the second rectangle on both axes T r2MinX = std::min(rectangle.left, static_cast(rectangle.left + rectangle.width)); T r2MaxX = std::max(rectangle.left, static_cast(rectangle.left + rectangle.width)); T r2MinY = std::min(rectangle.top, static_cast(rectangle.top + rectangle.height)); T r2MaxY = std::max(rectangle.top, static_cast(rectangle.top + rectangle.height)); // Compute the intersection boundaries T interLeft = std::max(r1MinX, r2MinX); T interTop = std::max(r1MinY, r2MinY); T interRight = std::min(r1MaxX, r2MaxX); T interBottom = std::min(r1MaxY, r2MaxY); // If the intersection is valid (positive non zero area), then there is an intersection if ((interLeft < interRight) && (interTop < interBottom)) { intersection = Rect(interLeft, interTop, interRight - interLeft, interBottom - interTop); return true; } else { intersection = Rect(0, 0, 0, 0); return false; } } //////////////////////////////////////////////////////////// template inline bool operator ==(const Rect& left, const Rect& right) { return (left.left == right.left) && (left.width == right.width) && (left.top == right.top) && (left.height == right.height); } //////////////////////////////////////////////////////////// template inline bool operator !=(const Rect& left, const Rect& right) { return !(left == right); } ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/RectangleShape.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_RECTANGLESHAPE_HPP #define SFML_RECTANGLESHAPE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Specialized shape representing a rectangle /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API RectangleShape : public Shape { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// \param size Size of the rectangle /// //////////////////////////////////////////////////////////// explicit RectangleShape(const Vector2f& size = Vector2f(0, 0)); //////////////////////////////////////////////////////////// /// \brief Set the size of the rectangle /// /// \param size New size of the rectangle /// /// \see getSize /// //////////////////////////////////////////////////////////// void setSize(const Vector2f& size); //////////////////////////////////////////////////////////// /// \brief Get the size of the rectangle /// /// \return Size of the rectangle /// /// \see setSize /// //////////////////////////////////////////////////////////// const Vector2f& getSize() const; //////////////////////////////////////////////////////////// /// \brief Get the number of points defining the shape /// /// \return Number of points of the shape. For rectangle /// shapes, this number is always 4. /// //////////////////////////////////////////////////////////// virtual std::size_t getPointCount() const; //////////////////////////////////////////////////////////// /// \brief Get a point of the rectangle /// /// The returned point is in local coordinates, that is, /// the shape's transforms (position, rotation, scale) are /// not taken into account. /// The result is undefined if \a index is out of the valid range. /// /// \param index Index of the point to get, in range [0 .. 3] /// /// \return index-th point of the shape /// //////////////////////////////////////////////////////////// virtual Vector2f getPoint(std::size_t index) const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Vector2f m_size; ///< Size of the rectangle }; } // namespace sf #endif // SFML_RECTANGLESHAPE_HPP //////////////////////////////////////////////////////////// /// \class sf::RectangleShape /// \ingroup graphics /// /// This class inherits all the functions of sf::Transformable /// (position, rotation, scale, bounds, ...) as well as the /// functions of sf::Shape (outline, color, texture, ...). /// /// Usage example: /// \code /// sf::RectangleShape rectangle; /// rectangle.setSize(sf::Vector2f(100, 50)); /// rectangle.setOutlineColor(sf::Color::Red); /// rectangle.setOutlineThickness(5); /// rectangle.setPosition(10, 20); /// ... /// window.draw(rectangle); /// \endcode /// /// \see sf::Shape, sf::CircleShape, sf::ConvexShape /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/RenderStates.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_RENDERSTATES_HPP #define SFML_RENDERSTATES_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { class Shader; class Texture; //////////////////////////////////////////////////////////// /// \brief Define the states used for drawing to a RenderTarget /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API RenderStates { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Constructing a default set of render states is equivalent /// to using sf::RenderStates::Default. /// The default set defines: /// \li the BlendAlpha blend mode /// \li the identity transform /// \li a null texture /// \li a null shader /// //////////////////////////////////////////////////////////// RenderStates(); //////////////////////////////////////////////////////////// /// \brief Construct a default set of render states with a custom blend mode /// /// \param theBlendMode Blend mode to use /// //////////////////////////////////////////////////////////// RenderStates(const BlendMode& theBlendMode); //////////////////////////////////////////////////////////// /// \brief Construct a default set of render states with a custom transform /// /// \param theTransform Transform to use /// //////////////////////////////////////////////////////////// RenderStates(const Transform& theTransform); //////////////////////////////////////////////////////////// /// \brief Construct a default set of render states with a custom texture /// /// \param theTexture Texture to use /// //////////////////////////////////////////////////////////// RenderStates(const Texture* theTexture); //////////////////////////////////////////////////////////// /// \brief Construct a default set of render states with a custom shader /// /// \param theShader Shader to use /// //////////////////////////////////////////////////////////// RenderStates(const Shader* theShader); //////////////////////////////////////////////////////////// /// \brief Construct a set of render states with all its attributes /// /// \param theBlendMode Blend mode to use /// \param theTransform Transform to use /// \param theTexture Texture to use /// \param theShader Shader to use /// //////////////////////////////////////////////////////////// RenderStates(const BlendMode& theBlendMode, const Transform& theTransform, const Texture* theTexture, const Shader* theShader); //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// static const RenderStates Default; ///< Special instance holding the default render states //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// BlendMode blendMode; ///< Blending mode Transform transform; ///< Transform const Texture* texture; ///< Texture const Shader* shader; ///< Shader }; } // namespace sf #endif // SFML_RENDERSTATES_HPP //////////////////////////////////////////////////////////// /// \class sf::RenderStates /// \ingroup graphics /// /// There are four global states that can be applied to /// the drawn objects: /// \li the blend mode: how pixels of the object are blended with the background /// \li the transform: how the object is positioned/rotated/scaled /// \li the texture: what image is mapped to the object /// \li the shader: what custom effect is applied to the object /// /// High-level objects such as sprites or text force some of /// these states when they are drawn. For example, a sprite /// will set its own texture, so that you don't have to care /// about it when drawing the sprite. /// /// The transform is a special case: sprites, texts and shapes /// (and it's a good idea to do it with your own drawable classes /// too) combine their transform with the one that is passed in the /// RenderStates structure. So that you can use a "global" transform /// on top of each object's transform. /// /// Most objects, especially high-level drawables, can be drawn /// directly without defining render states explicitly -- the /// default set of states is ok in most cases. /// \code /// window.draw(sprite); /// \endcode /// /// If you want to use a single specific render state, /// for example a shader, you can pass it directly to the Draw /// function: sf::RenderStates has an implicit one-argument /// constructor for each state. /// \code /// window.draw(sprite, shader); /// \endcode /// /// When you're inside the Draw function of a drawable /// object (inherited from sf::Drawable), you can /// either pass the render states unmodified, or change /// some of them. /// For example, a transformable object will combine the /// current transform with its own transform. A sprite will /// set its texture. Etc. /// /// \see sf::RenderTarget, sf::Drawable /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/RenderTarget.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_RENDERTARGET_HPP #define SFML_RENDERTARGET_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include namespace sf { class Drawable; //////////////////////////////////////////////////////////// /// \brief Base class for all render targets (window, texture, ...) /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API RenderTarget : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// virtual ~RenderTarget(); //////////////////////////////////////////////////////////// /// \brief Clear the entire target with a single color /// /// This function is usually called once every frame, /// to clear the previous contents of the target. /// /// \param color Fill color to use to clear the render target /// //////////////////////////////////////////////////////////// void clear(const Color& color = Color(0, 0, 0, 255)); //////////////////////////////////////////////////////////// /// \brief Change the current active view /// /// The view is like a 2D camera, it controls which part of /// the 2D scene is visible, and how it is viewed in the /// render target. /// The new view will affect everything that is drawn, until /// another view is set. /// The render target keeps its own copy of the view object, /// so it is not necessary to keep the original one alive /// after calling this function. /// To restore the original view of the target, you can pass /// the result of getDefaultView() to this function. /// /// \param view New view to use /// /// \see getView, getDefaultView /// //////////////////////////////////////////////////////////// void setView(const View& view); //////////////////////////////////////////////////////////// /// \brief Get the view currently in use in the render target /// /// \return The view object that is currently used /// /// \see setView, getDefaultView /// //////////////////////////////////////////////////////////// const View& getView() const; //////////////////////////////////////////////////////////// /// \brief Get the default view of the render target /// /// The default view has the initial size of the render target, /// and never changes after the target has been created. /// /// \return The default view of the render target /// /// \see setView, getView /// //////////////////////////////////////////////////////////// const View& getDefaultView() const; //////////////////////////////////////////////////////////// /// \brief Get the viewport of a view, applied to this render target /// /// The viewport is defined in the view as a ratio, this function /// simply applies this ratio to the current dimensions of the /// render target to calculate the pixels rectangle that the viewport /// actually covers in the target. /// /// \param view The view for which we want to compute the viewport /// /// \return Viewport rectangle, expressed in pixels /// //////////////////////////////////////////////////////////// IntRect getViewport(const View& view) const; //////////////////////////////////////////////////////////// /// \brief Convert a point from target coordinates to world /// coordinates, using the current view /// /// This function is an overload of the mapPixelToCoords /// function that implicitly uses the current view. /// It is equivalent to: /// \code /// target.mapPixelToCoords(point, target.getView()); /// \endcode /// /// \param point Pixel to convert /// /// \return The converted point, in "world" coordinates /// /// \see mapCoordsToPixel /// //////////////////////////////////////////////////////////// Vector2f mapPixelToCoords(const Vector2i& point) const; //////////////////////////////////////////////////////////// /// \brief Convert a point from target coordinates to world coordinates /// /// This function finds the 2D position that matches the /// given pixel of the render target. In other words, it does /// the inverse of what the graphics card does, to find the /// initial position of a rendered pixel. /// /// Initially, both coordinate systems (world units and target pixels) /// match perfectly. But if you define a custom view or resize your /// render target, this assertion is not true anymore, i.e. a point /// located at (10, 50) in your render target may map to the point /// (150, 75) in your 2D world -- if the view is translated by (140, 25). /// /// For render-windows, this function is typically used to find /// which point (or object) is located below the mouse cursor. /// /// This version uses a custom view for calculations, see the other /// overload of the function if you want to use the current view of the /// render target. /// /// \param point Pixel to convert /// \param view The view to use for converting the point /// /// \return The converted point, in "world" units /// /// \see mapCoordsToPixel /// //////////////////////////////////////////////////////////// Vector2f mapPixelToCoords(const Vector2i& point, const View& view) const; //////////////////////////////////////////////////////////// /// \brief Convert a point from world coordinates to target /// coordinates, using the current view /// /// This function is an overload of the mapCoordsToPixel /// function that implicitly uses the current view. /// It is equivalent to: /// \code /// target.mapCoordsToPixel(point, target.getView()); /// \endcode /// /// \param point Point to convert /// /// \return The converted point, in target coordinates (pixels) /// /// \see mapPixelToCoords /// //////////////////////////////////////////////////////////// Vector2i mapCoordsToPixel(const Vector2f& point) const; //////////////////////////////////////////////////////////// /// \brief Convert a point from world coordinates to target coordinates /// /// This function finds the pixel of the render target that matches /// the given 2D point. In other words, it goes through the same process /// as the graphics card, to compute the final position of a rendered point. /// /// Initially, both coordinate systems (world units and target pixels) /// match perfectly. But if you define a custom view or resize your /// render target, this assertion is not true anymore, i.e. a point /// located at (150, 75) in your 2D world may map to the pixel /// (10, 50) of your render target -- if the view is translated by (140, 25). /// /// This version uses a custom view for calculations, see the other /// overload of the function if you want to use the current view of the /// render target. /// /// \param point Point to convert /// \param view The view to use for converting the point /// /// \return The converted point, in target coordinates (pixels) /// /// \see mapPixelToCoords /// //////////////////////////////////////////////////////////// Vector2i mapCoordsToPixel(const Vector2f& point, const View& view) const; //////////////////////////////////////////////////////////// /// \brief Draw a drawable object to the render target /// /// \param drawable Object to draw /// \param states Render states to use for drawing /// //////////////////////////////////////////////////////////// void draw(const Drawable& drawable, const RenderStates& states = RenderStates::Default); //////////////////////////////////////////////////////////// /// \brief Draw primitives defined by an array of vertices /// /// \param vertices Pointer to the vertices /// \param vertexCount Number of vertices in the array /// \param type Type of primitives to draw /// \param states Render states to use for drawing /// //////////////////////////////////////////////////////////// void draw(const Vertex* vertices, std::size_t vertexCount, PrimitiveType type, const RenderStates& states = RenderStates::Default); //////////////////////////////////////////////////////////// /// \brief Return the size of the rendering region of the target /// /// \return Size in pixels /// //////////////////////////////////////////////////////////// virtual Vector2u getSize() const = 0; //////////////////////////////////////////////////////////// /// \brief Save the current OpenGL render states and matrices /// /// This function can be used when you mix SFML drawing /// and direct OpenGL rendering. Combined with popGLStates, /// it ensures that: /// \li SFML's internal states are not messed up by your OpenGL code /// \li your OpenGL states are not modified by a call to a SFML function /// /// More specifically, it must be used around code that /// calls Draw functions. Example: /// \code /// // OpenGL code here... /// window.pushGLStates(); /// window.draw(...); /// window.draw(...); /// window.popGLStates(); /// // OpenGL code here... /// \endcode /// /// Note that this function is quite expensive: it saves all the /// possible OpenGL states and matrices, even the ones you /// don't care about. Therefore it should be used wisely. /// It is provided for convenience, but the best results will /// be achieved if you handle OpenGL states yourself (because /// you know which states have really changed, and need to be /// saved and restored). Take a look at the resetGLStates /// function if you do so. /// /// \see popGLStates /// //////////////////////////////////////////////////////////// void pushGLStates(); //////////////////////////////////////////////////////////// /// \brief Restore the previously saved OpenGL render states and matrices /// /// See the description of pushGLStates to get a detailed /// description of these functions. /// /// \see pushGLStates /// //////////////////////////////////////////////////////////// void popGLStates(); //////////////////////////////////////////////////////////// /// \brief Reset the internal OpenGL states so that the target is ready for drawing /// /// This function can be used when you mix SFML drawing /// and direct OpenGL rendering, if you choose not to use /// pushGLStates/popGLStates. It makes sure that all OpenGL /// states needed by SFML are set, so that subsequent draw() /// calls will work as expected. /// /// Example: /// \code /// // OpenGL code here... /// glPushAttrib(...); /// window.resetGLStates(); /// window.draw(...); /// window.draw(...); /// glPopAttrib(...); /// // OpenGL code here... /// \endcode /// //////////////////////////////////////////////////////////// void resetGLStates(); protected: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// RenderTarget(); //////////////////////////////////////////////////////////// /// \brief Performs the common initialization step after creation /// /// The derived classes must call this function after the /// target is created and ready for drawing. /// //////////////////////////////////////////////////////////// void initialize(); private: //////////////////////////////////////////////////////////// /// \brief Apply the current view /// //////////////////////////////////////////////////////////// void applyCurrentView(); //////////////////////////////////////////////////////////// /// \brief Apply a new blending mode /// /// \param mode Blending mode to apply /// //////////////////////////////////////////////////////////// void applyBlendMode(const BlendMode& mode); //////////////////////////////////////////////////////////// /// \brief Apply a new transform /// /// \param transform Transform to apply /// //////////////////////////////////////////////////////////// void applyTransform(const Transform& transform); //////////////////////////////////////////////////////////// /// \brief Apply a new texture /// /// \param texture Texture to apply /// //////////////////////////////////////////////////////////// void applyTexture(const Texture* texture); //////////////////////////////////////////////////////////// /// \brief Apply a new shader /// /// \param shader Shader to apply /// //////////////////////////////////////////////////////////// void applyShader(const Shader* shader); //////////////////////////////////////////////////////////// /// \brief Activate the target for rendering /// /// This function must be implemented by derived classes to make /// their OpenGL context current; it is called by the base class /// everytime it's going to use OpenGL calls. /// /// \param active True to make the target active, false to deactivate it /// /// \return True if the function succeeded /// //////////////////////////////////////////////////////////// virtual bool activate(bool active) = 0; //////////////////////////////////////////////////////////// /// \brief Render states cache /// //////////////////////////////////////////////////////////// struct StatesCache { enum {VertexCacheSize = 4}; bool glStatesSet; ///< Are our internal GL states set yet? bool viewChanged; ///< Has the current view changed since last draw? BlendMode lastBlendMode; ///< Cached blending mode Uint64 lastTextureId; ///< Cached texture bool useVertexCache; ///< Did we previously use the vertex cache? Vertex vertexCache[VertexCacheSize]; ///< Pre-transformed vertices cache }; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// View m_defaultView; ///< Default view View m_view; ///< Current view StatesCache m_cache; ///< Render states cache }; } // namespace sf #endif // SFML_RENDERTARGET_HPP //////////////////////////////////////////////////////////// /// \class sf::RenderTarget /// \ingroup graphics /// /// sf::RenderTarget defines the common behavior of all the /// 2D render targets usable in the graphics module. It makes /// it possible to draw 2D entities like sprites, shapes, text /// without using any OpenGL command directly. /// /// A sf::RenderTarget is also able to use views (sf::View), /// which are a kind of 2D cameras. With views you can globally /// scroll, rotate or zoom everything that is drawn, /// without having to transform every single entity. See the /// documentation of sf::View for more details and sample pieces of /// code about this class. /// /// On top of that, render targets are still able to render direct /// OpenGL stuff. It is even possible to mix together OpenGL calls /// and regular SFML drawing commands. When doing so, make sure that /// OpenGL states are not messed up by calling the /// pushGLStates/popGLStates functions. /// /// \see sf::RenderWindow, sf::RenderTexture, sf::View /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/RenderTexture.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_RENDERTEXTURE_HPP #define SFML_RENDERTEXTURE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { namespace priv { class RenderTextureImpl; } //////////////////////////////////////////////////////////// /// \brief Target for off-screen 2D rendering into a texture /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API RenderTexture : public RenderTarget { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Constructs an empty, invalid render-texture. You must /// call create to have a valid render-texture. /// /// \see create /// //////////////////////////////////////////////////////////// RenderTexture(); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// virtual ~RenderTexture(); //////////////////////////////////////////////////////////// /// \brief Create the render-texture /// /// Before calling this function, the render-texture is in /// an invalid state, thus it is mandatory to call it before /// doing anything with the render-texture. /// The last parameter, \a depthBuffer, is useful if you want /// to use the render-texture for 3D OpenGL rendering that requires /// a depth buffer. Otherwise it is unnecessary, and you should /// leave this parameter to false (which is its default value). /// /// \param width Width of the render-texture /// \param height Height of the render-texture /// \param depthBuffer Do you want this render-texture to have a depth buffer? /// /// \return True if creation has been successful /// //////////////////////////////////////////////////////////// bool create(unsigned int width, unsigned int height, bool depthBuffer = false); //////////////////////////////////////////////////////////// /// \brief Enable or disable texture smoothing /// /// This function is similar to Texture::setSmooth. /// This parameter is disabled by default. /// /// \param smooth True to enable smoothing, false to disable it /// /// \see isSmooth /// //////////////////////////////////////////////////////////// void setSmooth(bool smooth); //////////////////////////////////////////////////////////// /// \brief Tell whether the smooth filtering is enabled or not /// /// \return True if texture smoothing is enabled /// /// \see setSmooth /// //////////////////////////////////////////////////////////// bool isSmooth() const; //////////////////////////////////////////////////////////// /// \brief Enable or disable texture repeating /// /// This function is similar to Texture::setRepeated. /// This parameter is disabled by default. /// /// \param repeated True to enable repeating, false to disable it /// /// \see isRepeated /// //////////////////////////////////////////////////////////// void setRepeated(bool repeated); //////////////////////////////////////////////////////////// /// \brief Tell whether the texture is repeated or not /// /// \return True if texture is repeated /// /// \see setRepeated /// //////////////////////////////////////////////////////////// bool isRepeated() const; //////////////////////////////////////////////////////////// /// \brief Generate a mipmap using the current texture data /// /// This function is similar to Texture::generateMipmap and operates /// on the texture used as the target for drawing. /// Be aware that any draw operation may modify the base level image data. /// For this reason, calling this function only makes sense after all /// drawing is completed and display has been called. Not calling display /// after subsequent drawing will lead to undefined behavior if a mipmap /// had been previously generated. /// /// \return True if mipmap generation was successful, false if unsuccessful /// //////////////////////////////////////////////////////////// bool generateMipmap(); //////////////////////////////////////////////////////////// /// \brief Activate or deactivate the render-texture for rendering /// /// This function makes the render-texture's context current for /// future OpenGL rendering operations (so you shouldn't care /// about it if you're not doing direct OpenGL stuff). /// Only one context can be current in a thread, so if you /// want to draw OpenGL geometry to another render target /// (like a RenderWindow) don't forget to activate it again. /// /// \param active True to activate, false to deactivate /// /// \return True if operation was successful, false otherwise /// //////////////////////////////////////////////////////////// bool setActive(bool active = true); //////////////////////////////////////////////////////////// /// \brief Update the contents of the target texture /// /// This function updates the target texture with what /// has been drawn so far. Like for windows, calling this /// function is mandatory at the end of rendering. Not calling /// it may leave the texture in an undefined state. /// //////////////////////////////////////////////////////////// void display(); //////////////////////////////////////////////////////////// /// \brief Return the size of the rendering region of the texture /// /// The returned value is the size that you passed to /// the create function. /// /// \return Size in pixels /// //////////////////////////////////////////////////////////// virtual Vector2u getSize() const; //////////////////////////////////////////////////////////// /// \brief Get a read-only reference to the target texture /// /// After drawing to the render-texture and calling Display, /// you can retrieve the updated texture using this function, /// and draw it using a sprite (for example). /// The internal sf::Texture of a render-texture is always the /// same instance, so that it is possible to call this function /// once and keep a reference to the texture even after it is /// modified. /// /// \return Const reference to the texture /// //////////////////////////////////////////////////////////// const Texture& getTexture() const; private: //////////////////////////////////////////////////////////// /// \brief Activate the target for rendering /// /// This function is called by the base class /// everytime it's going to use OpenGL calls. /// /// \param active True to make the target active, false to deactivate it /// /// \return True if the function succeeded /// //////////////////////////////////////////////////////////// virtual bool activate(bool active); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// priv::RenderTextureImpl* m_impl; ///< Platform/hardware specific implementation Texture m_texture; ///< Target texture to draw on }; } // namespace sf #endif // SFML_RENDERTEXTURE_HPP //////////////////////////////////////////////////////////// /// \class sf::RenderTexture /// \ingroup graphics /// /// sf::RenderTexture is the little brother of sf::RenderWindow. /// It implements the same 2D drawing and OpenGL-related functions /// (see their base class sf::RenderTarget for more details), /// the difference is that the result is stored in an off-screen /// texture rather than being show in a window. /// /// Rendering to a texture can be useful in a variety of situations: /// \li precomputing a complex static texture (like a level's background from multiple tiles) /// \li applying post-effects to the whole scene with shaders /// \li creating a sprite from a 3D object rendered with OpenGL /// \li etc. /// /// Usage example: /// /// \code /// // Create a new render-window /// sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); /// /// // Create a new render-texture /// sf::RenderTexture texture; /// if (!texture.create(500, 500)) /// return -1; /// /// // The main loop /// while (window.isOpen()) /// { /// // Event processing /// // ... /// /// // Clear the whole texture with red color /// texture.clear(sf::Color::Red); /// /// // Draw stuff to the texture /// texture.draw(sprite); // sprite is a sf::Sprite /// texture.draw(shape); // shape is a sf::Shape /// texture.draw(text); // text is a sf::Text /// /// // We're done drawing to the texture /// texture.display(); /// /// // Now we start rendering to the window, clear it first /// window.clear(); /// /// // Draw the texture /// sf::Sprite sprite(texture.getTexture()); /// window.draw(sprite); /// /// // End the current frame and display its contents on screen /// window.display(); /// } /// \endcode /// /// Like sf::RenderWindow, sf::RenderTexture is still able to render direct /// OpenGL stuff. It is even possible to mix together OpenGL calls /// and regular SFML drawing commands. If you need a depth buffer for /// 3D rendering, don't forget to request it when calling RenderTexture::create. /// /// \see sf::RenderTarget, sf::RenderWindow, sf::View, sf::Texture /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/RenderWindow.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_RENDERWINDOW_HPP #define SFML_RENDERWINDOW_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Window that can serve as a target for 2D drawing /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API RenderWindow : public Window, public RenderTarget { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor doesn't actually create the window, /// use the other constructors or call create() to do so. /// //////////////////////////////////////////////////////////// RenderWindow(); //////////////////////////////////////////////////////////// /// \brief Construct a new window /// /// This constructor creates the window with the size and pixel /// depth defined in \a mode. An optional style can be passed to /// customize the look and behavior of the window (borders, /// title bar, resizable, closable, ...). /// /// The fourth parameter is an optional structure specifying /// advanced OpenGL context settings such as antialiasing, /// depth-buffer bits, etc. You shouldn't care about these /// parameters for a regular usage of the graphics module. /// /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param title Title of the window /// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// \param settings Additional settings for the underlying OpenGL context /// //////////////////////////////////////////////////////////// RenderWindow(VideoMode mode, const String& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings()); //////////////////////////////////////////////////////////// /// \brief Construct the window from an existing control /// /// Use this constructor if you want to create an SFML /// rendering area into an already existing control. /// /// The second parameter is an optional structure specifying /// advanced OpenGL context settings such as antialiasing, /// depth-buffer bits, etc. You shouldn't care about these /// parameters for a regular usage of the graphics module. /// /// \param handle Platform-specific handle of the control (\a HWND on /// Windows, \a %Window on Linux/FreeBSD, \a NSWindow on OS X) /// \param settings Additional settings for the underlying OpenGL context /// //////////////////////////////////////////////////////////// explicit RenderWindow(WindowHandle handle, const ContextSettings& settings = ContextSettings()); //////////////////////////////////////////////////////////// /// \brief Destructor /// /// Closes the window and frees all the resources attached to it. /// //////////////////////////////////////////////////////////// virtual ~RenderWindow(); //////////////////////////////////////////////////////////// /// \brief Get the size of the rendering region of the window /// /// The size doesn't include the titlebar and borders /// of the window. /// /// \return Size in pixels /// //////////////////////////////////////////////////////////// virtual Vector2u getSize() const; //////////////////////////////////////////////////////////// /// \brief Copy the current contents of the window to an image /// /// \deprecated /// Use a sf::Texture and its sf::Texture::update(const Window&) /// function and copy its contents into an sf::Image instead. /// \code /// sf::Vector2u windowSize = window.getSize(); /// sf::Texture texture; /// texture.create(windowSize.x, windowSize.y); /// texture.update(window); /// sf::Image screenshot = texture.copyToImage(); /// \endcode /// /// This is a slow operation, whose main purpose is to make /// screenshots of the application. If you want to update an /// image with the contents of the window and then use it for /// drawing, you should rather use a sf::Texture and its /// update(Window&) function. /// You can also draw things directly to a texture with the /// sf::RenderTexture class. /// /// \return Image containing the captured contents /// //////////////////////////////////////////////////////////// SFML_DEPRECATED Image capture() const; protected: //////////////////////////////////////////////////////////// /// \brief Function called after the window has been created /// /// This function is called so that derived classes can /// perform their own specific initialization as soon as /// the window is created. /// //////////////////////////////////////////////////////////// virtual void onCreate(); //////////////////////////////////////////////////////////// /// \brief Function called after the window has been resized /// /// This function is called so that derived classes can /// perform custom actions when the size of the window changes. /// //////////////////////////////////////////////////////////// virtual void onResize(); private: //////////////////////////////////////////////////////////// /// \brief Activate the target for rendering /// /// \param active True to make the target active, false to deactivate it /// /// \return True if the function succeeded /// //////////////////////////////////////////////////////////// virtual bool activate(bool active); }; } // namespace sf #endif // SFML_RENDERWINDOW_HPP //////////////////////////////////////////////////////////// /// \class sf::RenderWindow /// \ingroup graphics /// /// sf::RenderWindow is the main class of the Graphics module. /// It defines an OS window that can be painted using the other /// classes of the graphics module. /// /// sf::RenderWindow is derived from sf::Window, thus it inherits /// all its features: events, window management, OpenGL rendering, /// etc. See the documentation of sf::Window for a more complete /// description of all these features, as well as code examples. /// /// On top of that, sf::RenderWindow adds more features related to /// 2D drawing with the graphics module (see its base class /// sf::RenderTarget for more details). /// Here is a typical rendering and event loop with a sf::RenderWindow: /// /// \code /// // Declare and create a new render-window /// sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window"); /// /// // Limit the framerate to 60 frames per second (this step is optional) /// window.setFramerateLimit(60); /// /// // The main loop - ends as soon as the window is closed /// while (window.isOpen()) /// { /// // Event processing /// sf::Event event; /// while (window.pollEvent(event)) /// { /// // Request for closing the window /// if (event.type == sf::Event::Closed) /// window.close(); /// } /// /// // Clear the whole window before rendering a new frame /// window.clear(); /// /// // Draw some graphical entities /// window.draw(sprite); /// window.draw(circle); /// window.draw(text); /// /// // End the current frame and display its contents on screen /// window.display(); /// } /// \endcode /// /// Like sf::Window, sf::RenderWindow is still able to render direct /// OpenGL stuff. It is even possible to mix together OpenGL calls /// and regular SFML drawing commands. /// /// \code /// // Create the render window /// sf::RenderWindow window(sf::VideoMode(800, 600), "SFML OpenGL"); /// /// // Create a sprite and a text to display /// sf::Sprite sprite; /// sf::Text text; /// ... /// /// // Perform OpenGL initializations /// glMatrixMode(GL_PROJECTION); /// ... /// /// // Start the rendering loop /// while (window.isOpen()) /// { /// // Process events /// ... /// /// // Draw a background sprite /// window.pushGLStates(); /// window.draw(sprite); /// window.popGLStates(); /// /// // Draw a 3D object using OpenGL /// glBegin(GL_QUADS); /// glVertex3f(...); /// ... /// glEnd(); /// /// // Draw text on top of the 3D object /// window.pushGLStates(); /// window.draw(text); /// window.popGLStates(); /// /// // Finally, display the rendered frame on screen /// window.display(); /// } /// \endcode /// /// \see sf::Window, sf::RenderTarget, sf::RenderTexture, sf::View /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Shader.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SHADER_HPP #define SFML_SHADER_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include namespace sf { class Color; class InputStream; class Texture; class Transform; //////////////////////////////////////////////////////////// /// \brief Shader class (vertex, geometry and fragment) /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Shader : GlResource, NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Types of shaders /// //////////////////////////////////////////////////////////// enum Type { Vertex, ///< %Vertex shader Geometry, ///< Geometry shader Fragment ///< Fragment (pixel) shader }; //////////////////////////////////////////////////////////// /// \brief Special type that can be passed to setUniform(), /// and that represents the texture of the object being drawn /// /// \see setUniform(const std::string&, CurrentTextureType) /// //////////////////////////////////////////////////////////// struct CurrentTextureType {}; //////////////////////////////////////////////////////////// /// \brief Represents the texture of the object being drawn /// /// \see setUniform(const std::string&, CurrentTextureType) /// //////////////////////////////////////////////////////////// static CurrentTextureType CurrentTexture; public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor creates an invalid shader. /// //////////////////////////////////////////////////////////// Shader(); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~Shader(); //////////////////////////////////////////////////////////// /// \brief Load the vertex, geometry or fragment shader from a file /// /// This function loads a single shader, vertex, geometry or /// fragment, identified by the second argument. /// The source must be a text file containing a valid /// shader in GLSL language. GLSL is a C-like language /// dedicated to OpenGL shaders; you'll probably need to /// read a good documentation for it before writing your /// own shaders. /// /// \param filename Path of the vertex, geometry or fragment shader file to load /// \param type Type of shader (vertex, geometry or fragment) /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromMemory, loadFromStream /// //////////////////////////////////////////////////////////// bool loadFromFile(const std::string& filename, Type type); //////////////////////////////////////////////////////////// /// \brief Load both the vertex and fragment shaders from files /// /// This function loads both the vertex and the fragment /// shaders. If one of them fails to load, the shader is left /// empty (the valid shader is unloaded). /// The sources must be text files containing valid shaders /// in GLSL language. GLSL is a C-like language dedicated to /// OpenGL shaders; you'll probably need to read a good documentation /// for it before writing your own shaders. /// /// \param vertexShaderFilename Path of the vertex shader file to load /// \param fragmentShaderFilename Path of the fragment shader file to load /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromMemory, loadFromStream /// //////////////////////////////////////////////////////////// bool loadFromFile(const std::string& vertexShaderFilename, const std::string& fragmentShaderFilename); //////////////////////////////////////////////////////////// /// \brief Load the vertex, geometry and fragment shaders from files /// /// This function loads the vertex, geometry and fragment /// shaders. If one of them fails to load, the shader is left /// empty (the valid shader is unloaded). /// The sources must be text files containing valid shaders /// in GLSL language. GLSL is a C-like language dedicated to /// OpenGL shaders; you'll probably need to read a good documentation /// for it before writing your own shaders. /// /// \param vertexShaderFilename Path of the vertex shader file to load /// \param geometryShaderFilename Path of the geometry shader file to load /// \param fragmentShaderFilename Path of the fragment shader file to load /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromMemory, loadFromStream /// //////////////////////////////////////////////////////////// bool loadFromFile(const std::string& vertexShaderFilename, const std::string& geometryShaderFilename, const std::string& fragmentShaderFilename); //////////////////////////////////////////////////////////// /// \brief Load the vertex, geometry or fragment shader from a source code in memory /// /// This function loads a single shader, vertex, geometry /// or fragment, identified by the second argument. /// The source code must be a valid shader in GLSL language. /// GLSL is a C-like language dedicated to OpenGL shaders; /// you'll probably need to read a good documentation for /// it before writing your own shaders. /// /// \param shader String containing the source code of the shader /// \param type Type of shader (vertex, geometry or fragment) /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromStream /// //////////////////////////////////////////////////////////// bool loadFromMemory(const std::string& shader, Type type); //////////////////////////////////////////////////////////// /// \brief Load both the vertex and fragment shaders from source codes in memory /// /// This function loads both the vertex and the fragment /// shaders. If one of them fails to load, the shader is left /// empty (the valid shader is unloaded). /// The sources must be valid shaders in GLSL language. GLSL is /// a C-like language dedicated to OpenGL shaders; you'll /// probably need to read a good documentation for it before /// writing your own shaders. /// /// \param vertexShader String containing the source code of the vertex shader /// \param fragmentShader String containing the source code of the fragment shader /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromStream /// //////////////////////////////////////////////////////////// bool loadFromMemory(const std::string& vertexShader, const std::string& fragmentShader); //////////////////////////////////////////////////////////// /// \brief Load the vertex, geometry and fragment shaders from source codes in memory /// /// This function loads the vertex, geometry and fragment /// shaders. If one of them fails to load, the shader is left /// empty (the valid shader is unloaded). /// The sources must be valid shaders in GLSL language. GLSL is /// a C-like language dedicated to OpenGL shaders; you'll /// probably need to read a good documentation for it before /// writing your own shaders. /// /// \param vertexShader String containing the source code of the vertex shader /// \param geometryShader String containing the source code of the geometry shader /// \param fragmentShader String containing the source code of the fragment shader /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromStream /// //////////////////////////////////////////////////////////// bool loadFromMemory(const std::string& vertexShader, const std::string& geometryShader, const std::string& fragmentShader); //////////////////////////////////////////////////////////// /// \brief Load the vertex, geometry or fragment shader from a custom stream /// /// This function loads a single shader, vertex, geometry /// or fragment, identified by the second argument. /// The source code must be a valid shader in GLSL language. /// GLSL is a C-like language dedicated to OpenGL shaders; /// you'll probably need to read a good documentation for it /// before writing your own shaders. /// /// \param stream Source stream to read from /// \param type Type of shader (vertex, geometry or fragment) /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromMemory /// //////////////////////////////////////////////////////////// bool loadFromStream(InputStream& stream, Type type); //////////////////////////////////////////////////////////// /// \brief Load both the vertex and fragment shaders from custom streams /// /// This function loads both the vertex and the fragment /// shaders. If one of them fails to load, the shader is left /// empty (the valid shader is unloaded). /// The source codes must be valid shaders in GLSL language. /// GLSL is a C-like language dedicated to OpenGL shaders; /// you'll probably need to read a good documentation for /// it before writing your own shaders. /// /// \param vertexShaderStream Source stream to read the vertex shader from /// \param fragmentShaderStream Source stream to read the fragment shader from /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromMemory /// //////////////////////////////////////////////////////////// bool loadFromStream(InputStream& vertexShaderStream, InputStream& fragmentShaderStream); //////////////////////////////////////////////////////////// /// \brief Load the vertex, geometry and fragment shaders from custom streams /// /// This function loads the vertex, geometry and fragment /// shaders. If one of them fails to load, the shader is left /// empty (the valid shader is unloaded). /// The source codes must be valid shaders in GLSL language. /// GLSL is a C-like language dedicated to OpenGL shaders; /// you'll probably need to read a good documentation for /// it before writing your own shaders. /// /// \param vertexShaderStream Source stream to read the vertex shader from /// \param geometryShaderStream Source stream to read the geometry shader from /// \param fragmentShaderStream Source stream to read the fragment shader from /// /// \return True if loading succeeded, false if it failed /// /// \see loadFromFile, loadFromMemory /// //////////////////////////////////////////////////////////// bool loadFromStream(InputStream& vertexShaderStream, InputStream& geometryShaderStream, InputStream& fragmentShaderStream); //////////////////////////////////////////////////////////// /// \brief Specify value for \p float uniform /// /// \param name Name of the uniform variable in GLSL /// \param x Value of the float scalar /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, float x); //////////////////////////////////////////////////////////// /// \brief Specify value for \p vec2 uniform /// /// \param name Name of the uniform variable in GLSL /// \param vector Value of the vec2 vector /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Vec2& vector); //////////////////////////////////////////////////////////// /// \brief Specify value for \p vec3 uniform /// /// \param name Name of the uniform variable in GLSL /// \param vector Value of the vec3 vector /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Vec3& vector); //////////////////////////////////////////////////////////// /// \brief Specify value for \p vec4 uniform /// /// This overload can also be called with sf::Color objects /// that are converted to sf::Glsl::Vec4. /// /// It is important to note that the components of the color are /// normalized before being passed to the shader. Therefore, /// they are converted from range [0 .. 255] to range [0 .. 1]. /// For example, a sf::Color(255, 127, 0, 255) will be transformed /// to a vec4(1.0, 0.5, 0.0, 1.0) in the shader. /// /// \param name Name of the uniform variable in GLSL /// \param vector Value of the vec4 vector /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Vec4& vector); //////////////////////////////////////////////////////////// /// \brief Specify value for \p int uniform /// /// \param name Name of the uniform variable in GLSL /// \param x Value of the int scalar /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, int x); //////////////////////////////////////////////////////////// /// \brief Specify value for \p ivec2 uniform /// /// \param name Name of the uniform variable in GLSL /// \param vector Value of the ivec2 vector /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Ivec2& vector); //////////////////////////////////////////////////////////// /// \brief Specify value for \p ivec3 uniform /// /// \param name Name of the uniform variable in GLSL /// \param vector Value of the ivec3 vector /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Ivec3& vector); //////////////////////////////////////////////////////////// /// \brief Specify value for \p ivec4 uniform /// /// This overload can also be called with sf::Color objects /// that are converted to sf::Glsl::Ivec4. /// /// If color conversions are used, the ivec4 uniform in GLSL /// will hold the same values as the original sf::Color /// instance. For example, sf::Color(255, 127, 0, 255) is /// mapped to ivec4(255, 127, 0, 255). /// /// \param name Name of the uniform variable in GLSL /// \param vector Value of the ivec4 vector /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Ivec4& vector); //////////////////////////////////////////////////////////// /// \brief Specify value for \p bool uniform /// /// \param name Name of the uniform variable in GLSL /// \param x Value of the bool scalar /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, bool x); //////////////////////////////////////////////////////////// /// \brief Specify value for \p bvec2 uniform /// /// \param name Name of the uniform variable in GLSL /// \param vector Value of the bvec2 vector /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Bvec2& vector); //////////////////////////////////////////////////////////// /// \brief Specify value for \p bvec3 uniform /// /// \param name Name of the uniform variable in GLSL /// \param vector Value of the bvec3 vector /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Bvec3& vector); //////////////////////////////////////////////////////////// /// \brief Specify value for \p bvec4 uniform /// /// \param name Name of the uniform variable in GLSL /// \param vector Value of the bvec4 vector /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Bvec4& vector); //////////////////////////////////////////////////////////// /// \brief Specify value for \p mat3 matrix /// /// \param name Name of the uniform variable in GLSL /// \param matrix Value of the mat3 matrix /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Mat3& matrix); //////////////////////////////////////////////////////////// /// \brief Specify value for \p mat4 matrix /// /// \param name Name of the uniform variable in GLSL /// \param matrix Value of the mat4 matrix /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Glsl::Mat4& matrix); //////////////////////////////////////////////////////////// /// \brief Specify a texture as \p sampler2D uniform /// /// \a name is the name of the variable to change in the shader. /// The corresponding parameter in the shader must be a 2D texture /// (\p sampler2D GLSL type). /// /// Example: /// \code /// uniform sampler2D the_texture; // this is the variable in the shader /// \endcode /// \code /// sf::Texture texture; /// ... /// shader.setUniform("the_texture", texture); /// \endcode /// It is important to note that \a texture must remain alive as long /// as the shader uses it, no copy is made internally. /// /// To use the texture of the object being drawn, which cannot be /// known in advance, you can pass the special value /// sf::Shader::CurrentTexture: /// \code /// shader.setUniform("the_texture", sf::Shader::CurrentTexture). /// \endcode /// /// \param name Name of the texture in the shader /// \param texture Texture to assign /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, const Texture& texture); //////////////////////////////////////////////////////////// /// \brief Specify current texture as \p sampler2D uniform /// /// This overload maps a shader texture variable to the /// texture of the object being drawn, which cannot be /// known in advance. The second argument must be /// sf::Shader::CurrentTexture. /// The corresponding parameter in the shader must be a 2D texture /// (\p sampler2D GLSL type). /// /// Example: /// \code /// uniform sampler2D current; // this is the variable in the shader /// \endcode /// \code /// shader.setUniform("current", sf::Shader::CurrentTexture); /// \endcode /// /// \param name Name of the texture in the shader /// //////////////////////////////////////////////////////////// void setUniform(const std::string& name, CurrentTextureType); //////////////////////////////////////////////////////////// /// \brief Specify values for \p float[] array uniform /// /// \param name Name of the uniform variable in GLSL /// \param scalarArray pointer to array of \p float values /// \param length Number of elements in the array /// //////////////////////////////////////////////////////////// void setUniformArray(const std::string& name, const float* scalarArray, std::size_t length); //////////////////////////////////////////////////////////// /// \brief Specify values for \p vec2[] array uniform /// /// \param name Name of the uniform variable in GLSL /// \param vectorArray pointer to array of \p vec2 values /// \param length Number of elements in the array /// //////////////////////////////////////////////////////////// void setUniformArray(const std::string& name, const Glsl::Vec2* vectorArray, std::size_t length); //////////////////////////////////////////////////////////// /// \brief Specify values for \p vec3[] array uniform /// /// \param name Name of the uniform variable in GLSL /// \param vectorArray pointer to array of \p vec3 values /// \param length Number of elements in the array /// //////////////////////////////////////////////////////////// void setUniformArray(const std::string& name, const Glsl::Vec3* vectorArray, std::size_t length); //////////////////////////////////////////////////////////// /// \brief Specify values for \p vec4[] array uniform /// /// \param name Name of the uniform variable in GLSL /// \param vectorArray pointer to array of \p vec4 values /// \param length Number of elements in the array /// //////////////////////////////////////////////////////////// void setUniformArray(const std::string& name, const Glsl::Vec4* vectorArray, std::size_t length); //////////////////////////////////////////////////////////// /// \brief Specify values for \p mat3[] array uniform /// /// \param name Name of the uniform variable in GLSL /// \param matrixArray pointer to array of \p mat3 values /// \param length Number of elements in the array /// //////////////////////////////////////////////////////////// void setUniformArray(const std::string& name, const Glsl::Mat3* matrixArray, std::size_t length); //////////////////////////////////////////////////////////// /// \brief Specify values for \p mat4[] array uniform /// /// \param name Name of the uniform variable in GLSL /// \param matrixArray pointer to array of \p mat4 values /// \param length Number of elements in the array /// //////////////////////////////////////////////////////////// void setUniformArray(const std::string& name, const Glsl::Mat4* matrixArray, std::size_t length); //////////////////////////////////////////////////////////// /// \brief Change a float parameter of the shader /// /// \deprecated Use setUniform(const std::string&, float) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, float x); //////////////////////////////////////////////////////////// /// \brief Change a 2-components vector parameter of the shader /// /// \deprecated Use setUniform(const std::string&, const Glsl::Vec2&) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, float x, float y); //////////////////////////////////////////////////////////// /// \brief Change a 3-components vector parameter of the shader /// /// \deprecated Use setUniform(const std::string&, const Glsl::Vec3&) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, float x, float y, float z); //////////////////////////////////////////////////////////// /// \brief Change a 4-components vector parameter of the shader /// /// \deprecated Use setUniform(const std::string&, const Glsl::Vec4&) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, float x, float y, float z, float w); //////////////////////////////////////////////////////////// /// \brief Change a 2-components vector parameter of the shader /// /// \deprecated Use setUniform(const std::string&, const Glsl::Vec2&) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, const Vector2f& vector); //////////////////////////////////////////////////////////// /// \brief Change a 3-components vector parameter of the shader /// /// \deprecated Use setUniform(const std::string&, const Glsl::Vec3&) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, const Vector3f& vector); //////////////////////////////////////////////////////////// /// \brief Change a color parameter of the shader /// /// \deprecated Use setUniform(const std::string&, const Glsl::Vec4&) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, const Color& color); //////////////////////////////////////////////////////////// /// \brief Change a matrix parameter of the shader /// /// \deprecated Use setUniform(const std::string&, const Glsl::Mat4&) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, const Transform& transform); //////////////////////////////////////////////////////////// /// \brief Change a texture parameter of the shader /// /// \deprecated Use setUniform(const std::string&, const Texture&) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, const Texture& texture); //////////////////////////////////////////////////////////// /// \brief Change a texture parameter of the shader /// /// \deprecated Use setUniform(const std::string&, CurrentTextureType) instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setParameter(const std::string& name, CurrentTextureType); //////////////////////////////////////////////////////////// /// \brief Get the underlying OpenGL handle of the shader. /// /// You shouldn't need to use this function, unless you have /// very specific stuff to implement that SFML doesn't support, /// or implement a temporary workaround until a bug is fixed. /// /// \return OpenGL handle of the shader or 0 if not yet loaded /// //////////////////////////////////////////////////////////// unsigned int getNativeHandle() const; //////////////////////////////////////////////////////////// /// \brief Bind a shader for rendering /// /// This function is not part of the graphics API, it mustn't be /// used when drawing SFML entities. It must be used only if you /// mix sf::Shader with OpenGL code. /// /// \code /// sf::Shader s1, s2; /// ... /// sf::Shader::bind(&s1); /// // draw OpenGL stuff that use s1... /// sf::Shader::bind(&s2); /// // draw OpenGL stuff that use s2... /// sf::Shader::bind(NULL); /// // draw OpenGL stuff that use no shader... /// \endcode /// /// \param shader Shader to bind, can be null to use no shader /// //////////////////////////////////////////////////////////// static void bind(const Shader* shader); //////////////////////////////////////////////////////////// /// \brief Tell whether or not the system supports shaders /// /// This function should always be called before using /// the shader features. If it returns false, then /// any attempt to use sf::Shader will fail. /// /// \return True if shaders are supported, false otherwise /// //////////////////////////////////////////////////////////// static bool isAvailable(); //////////////////////////////////////////////////////////// /// \brief Tell whether or not the system supports geometry shaders /// /// This function should always be called before using /// the geometry shader features. If it returns false, then /// any attempt to use sf::Shader geometry shader features will fail. /// /// This function can only return true if isAvailable() would also /// return true, since shaders in general have to be supported in /// order for geometry shaders to be supported as well. /// /// Note: The first call to this function, whether by your /// code or SFML will result in a context switch. /// /// \return True if geometry shaders are supported, false otherwise /// //////////////////////////////////////////////////////////// static bool isGeometryAvailable(); private: //////////////////////////////////////////////////////////// /// \brief Compile the shader(s) and create the program /// /// If one of the arguments is NULL, the corresponding shader /// is not created. /// /// \param vertexShaderCode Source code of the vertex shader /// \param geometryShaderCode Source code of the geometry shader /// \param fragmentShaderCode Source code of the fragment shader /// /// \return True on success, false if any error happened /// //////////////////////////////////////////////////////////// bool compile(const char* vertexShaderCode, const char* geometryShaderCode, const char* fragmentShaderCode); //////////////////////////////////////////////////////////// /// \brief Bind all the textures used by the shader /// /// This function each texture to a different unit, and /// updates the corresponding variables in the shader accordingly. /// //////////////////////////////////////////////////////////// void bindTextures() const; //////////////////////////////////////////////////////////// /// \brief Get the location ID of a shader uniform /// /// \param name Name of the uniform variable to search /// /// \return Location ID of the uniform, or -1 if not found /// //////////////////////////////////////////////////////////// int getUniformLocation(const std::string& name); //////////////////////////////////////////////////////////// /// \brief RAII object to save and restore the program /// binding while uniforms are being set /// /// Implementation is private in the .cpp file. /// //////////////////////////////////////////////////////////// struct UniformBinder; //////////////////////////////////////////////////////////// // Types //////////////////////////////////////////////////////////// typedef std::map TextureTable; typedef std::map UniformTable; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// unsigned int m_shaderProgram; ///< OpenGL identifier for the program int m_currentTexture; ///< Location of the current texture in the shader TextureTable m_textures; ///< Texture variables in the shader, mapped to their location UniformTable m_uniforms; ///< Parameters location cache }; } // namespace sf #endif // SFML_SHADER_HPP //////////////////////////////////////////////////////////// /// \class sf::Shader /// \ingroup graphics /// /// Shaders are programs written using a specific language, /// executed directly by the graphics card and allowing /// to apply real-time operations to the rendered entities. /// /// There are three kinds of shaders: /// \li %Vertex shaders, that process vertices /// \li Geometry shaders, that process primitives /// \li Fragment (pixel) shaders, that process pixels /// /// A sf::Shader can be composed of either a vertex shader /// alone, a geometry shader alone, a fragment shader alone, /// or any combination of them. (see the variants of the /// load functions). /// /// Shaders are written in GLSL, which is a C-like /// language dedicated to OpenGL shaders. You'll probably /// need to learn its basics before writing your own shaders /// for SFML. /// /// Like any C/C++ program, a GLSL shader has its own variables /// called \a uniforms that you can set from your C++ application. /// sf::Shader handles different types of uniforms: /// \li scalars: \p float, \p int, \p bool /// \li vectors (2, 3 or 4 components) /// \li matrices (3x3 or 4x4) /// \li samplers (textures) /// /// Some SFML-specific types can be converted: /// \li sf::Color as a 4D vector (\p vec4) /// \li sf::Transform as matrices (\p mat3 or \p mat4) /// /// Every uniform variable in a shader can be set through one of the /// setUniform() or setUniformArray() overloads. For example, if you /// have a shader with the following uniforms: /// \code /// uniform float offset; /// uniform vec3 point; /// uniform vec4 color; /// uniform mat4 matrix; /// uniform sampler2D overlay; /// uniform sampler2D current; /// \endcode /// You can set their values from C++ code as follows, using the types /// defined in the sf::Glsl namespace: /// \code /// shader.setUniform("offset", 2.f); /// shader.setUniform("point", sf::Vector3f(0.5f, 0.8f, 0.3f)); /// shader.setUniform("color", sf::Glsl::Vec4(color)); // color is a sf::Color /// shader.setUniform("matrix", sf::Glsl::Mat4(transform)); // transform is a sf::Transform /// shader.setUniform("overlay", texture); // texture is a sf::Texture /// shader.setUniform("current", sf::Shader::CurrentTexture); /// \endcode /// /// The old setParameter() overloads are deprecated and will be removed in a /// future version. You should use their setUniform() equivalents instead. /// /// The special Shader::CurrentTexture argument maps the /// given \p sampler2D uniform to the current texture of the /// object being drawn (which cannot be known in advance). /// /// To apply a shader to a drawable, you must pass it as an /// additional parameter to the \ref Window::draw() draw() function: /// \code /// window.draw(sprite, &shader); /// \endcode /// /// ... which is in fact just a shortcut for this: /// \code /// sf::RenderStates states; /// states.shader = &shader; /// window.draw(sprite, states); /// \endcode /// /// In the code above we pass a pointer to the shader, because it may /// be null (which means "no shader"). /// /// Shaders can be used on any drawable, but some combinations are /// not interesting. For example, using a vertex shader on a sf::Sprite /// is limited because there are only 4 vertices, the sprite would /// have to be subdivided in order to apply wave effects. /// Another bad example is a fragment shader with sf::Text: the texture /// of the text is not the actual text that you see on screen, it is /// a big texture containing all the characters of the font in an /// arbitrary order; thus, texture lookups on pixels other than the /// current one may not give you the expected result. /// /// Shaders can also be used to apply global post-effects to the /// current contents of the target (like the old sf::PostFx class /// in SFML 1). This can be done in two different ways: /// \li draw everything to a sf::RenderTexture, then draw it to /// the main target using the shader /// \li draw everything directly to the main target, then use /// sf::Texture::update(Window&) to copy its contents to a texture /// and draw it to the main target using the shader /// /// The first technique is more optimized because it doesn't involve /// retrieving the target's pixels to system memory, but the /// second one doesn't impact the rendering process and can be /// easily inserted anywhere without impacting all the code. /// /// Like sf::Texture that can be used as a raw OpenGL texture, /// sf::Shader can also be used directly as a raw shader for /// custom OpenGL geometry. /// \code /// sf::Shader::bind(&shader); /// ... render OpenGL geometry ... /// sf::Shader::bind(NULL); /// \endcode /// /// \see sf::Glsl /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Shape.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SHAPE_HPP #define SFML_SHAPE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Base class for textured shapes with outline /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Shape : public Drawable, public Transformable { public: //////////////////////////////////////////////////////////// /// \brief Virtual destructor /// //////////////////////////////////////////////////////////// virtual ~Shape(); //////////////////////////////////////////////////////////// /// \brief Change the source texture of the shape /// /// The \a texture argument refers to a texture that must /// exist as long as the shape uses it. Indeed, the shape /// doesn't store its own copy of the texture, but rather keeps /// a pointer to the one that you passed to this function. /// If the source texture is destroyed and the shape tries to /// use it, the behavior is undefined. /// \a texture can be NULL to disable texturing. /// If \a resetRect is true, the TextureRect property of /// the shape is automatically adjusted to the size of the new /// texture. If it is false, the texture rect is left unchanged. /// /// \param texture New texture /// \param resetRect Should the texture rect be reset to the size of the new texture? /// /// \see getTexture, setTextureRect /// //////////////////////////////////////////////////////////// void setTexture(const Texture* texture, bool resetRect = false); //////////////////////////////////////////////////////////// /// \brief Set the sub-rectangle of the texture that the shape will display /// /// The texture rect is useful when you don't want to display /// the whole texture, but rather a part of it. /// By default, the texture rect covers the entire texture. /// /// \param rect Rectangle defining the region of the texture to display /// /// \see getTextureRect, setTexture /// //////////////////////////////////////////////////////////// void setTextureRect(const IntRect& rect); //////////////////////////////////////////////////////////// /// \brief Set the fill color of the shape /// /// This color is modulated (multiplied) with the shape's /// texture if any. It can be used to colorize the shape, /// or change its global opacity. /// You can use sf::Color::Transparent to make the inside of /// the shape transparent, and have the outline alone. /// By default, the shape's fill color is opaque white. /// /// \param color New color of the shape /// /// \see getFillColor, setOutlineColor /// //////////////////////////////////////////////////////////// void setFillColor(const Color& color); //////////////////////////////////////////////////////////// /// \brief Set the outline color of the shape /// /// By default, the shape's outline color is opaque white. /// /// \param color New outline color of the shape /// /// \see getOutlineColor, setFillColor /// //////////////////////////////////////////////////////////// void setOutlineColor(const Color& color); //////////////////////////////////////////////////////////// /// \brief Set the thickness of the shape's outline /// /// Note that negative values are allowed (so that the outline /// expands towards the center of the shape), and using zero /// disables the outline. /// By default, the outline thickness is 0. /// /// \param thickness New outline thickness /// /// \see getOutlineThickness /// //////////////////////////////////////////////////////////// void setOutlineThickness(float thickness); //////////////////////////////////////////////////////////// /// \brief Get the source texture of the shape /// /// If the shape has no source texture, a NULL pointer is returned. /// The returned pointer is const, which means that you can't /// modify the texture when you retrieve it with this function. /// /// \return Pointer to the shape's texture /// /// \see setTexture /// //////////////////////////////////////////////////////////// const Texture* getTexture() const; //////////////////////////////////////////////////////////// /// \brief Get the sub-rectangle of the texture displayed by the shape /// /// \return Texture rectangle of the shape /// /// \see setTextureRect /// //////////////////////////////////////////////////////////// const IntRect& getTextureRect() const; //////////////////////////////////////////////////////////// /// \brief Get the fill color of the shape /// /// \return Fill color of the shape /// /// \see setFillColor /// //////////////////////////////////////////////////////////// const Color& getFillColor() const; //////////////////////////////////////////////////////////// /// \brief Get the outline color of the shape /// /// \return Outline color of the shape /// /// \see setOutlineColor /// //////////////////////////////////////////////////////////// const Color& getOutlineColor() const; //////////////////////////////////////////////////////////// /// \brief Get the outline thickness of the shape /// /// \return Outline thickness of the shape /// /// \see setOutlineThickness /// //////////////////////////////////////////////////////////// float getOutlineThickness() const; //////////////////////////////////////////////////////////// /// \brief Get the total number of points of the shape /// /// \return Number of points of the shape /// /// \see getPoint /// //////////////////////////////////////////////////////////// virtual std::size_t getPointCount() const = 0; //////////////////////////////////////////////////////////// /// \brief Get a point of the shape /// /// The returned point is in local coordinates, that is, /// the shape's transforms (position, rotation, scale) are /// not taken into account. /// The result is undefined if \a index is out of the valid range. /// /// \param index Index of the point to get, in range [0 .. getPointCount() - 1] /// /// \return index-th point of the shape /// /// \see getPointCount /// //////////////////////////////////////////////////////////// virtual Vector2f getPoint(std::size_t index) const = 0; //////////////////////////////////////////////////////////// /// \brief Get the local bounding rectangle of the entity /// /// The returned rectangle is in local coordinates, which means /// that it ignores the transformations (translation, rotation, /// scale, ...) that are applied to the entity. /// In other words, this function returns the bounds of the /// entity in the entity's coordinate system. /// /// \return Local bounding rectangle of the entity /// //////////////////////////////////////////////////////////// FloatRect getLocalBounds() const; //////////////////////////////////////////////////////////// /// \brief Get the global (non-minimal) bounding rectangle of the entity /// /// The returned rectangle is in global coordinates, which means /// that it takes into account the transformations (translation, /// rotation, scale, ...) that are applied to the entity. /// In other words, this function returns the bounds of the /// shape in the global 2D world's coordinate system. /// /// This function does not necessarily return the \a minimal /// bounding rectangle. It merely ensures that the returned /// rectangle covers all the vertices (but possibly more). /// This allows for a fast approximation of the bounds as a /// first check; you may want to use more precise checks /// on top of that. /// /// \return Global bounding rectangle of the entity /// //////////////////////////////////////////////////////////// FloatRect getGlobalBounds() const; protected: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// Shape(); //////////////////////////////////////////////////////////// /// \brief Recompute the internal geometry of the shape /// /// This function must be called by the derived class everytime /// the shape's points change (i.e. the result of either /// getPointCount or getPoint is different). /// //////////////////////////////////////////////////////////// void update(); private: //////////////////////////////////////////////////////////// /// \brief Draw the shape to a render target /// /// \param target Render target to draw to /// \param states Current render states /// //////////////////////////////////////////////////////////// virtual void draw(RenderTarget& target, RenderStates states) const; //////////////////////////////////////////////////////////// /// \brief Update the fill vertices' color /// //////////////////////////////////////////////////////////// void updateFillColors(); //////////////////////////////////////////////////////////// /// \brief Update the fill vertices' texture coordinates /// //////////////////////////////////////////////////////////// void updateTexCoords(); //////////////////////////////////////////////////////////// /// \brief Update the outline vertices' position /// //////////////////////////////////////////////////////////// void updateOutline(); //////////////////////////////////////////////////////////// /// \brief Update the outline vertices' color /// //////////////////////////////////////////////////////////// void updateOutlineColors(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// const Texture* m_texture; ///< Texture of the shape IntRect m_textureRect; ///< Rectangle defining the area of the source texture to display Color m_fillColor; ///< Fill color Color m_outlineColor; ///< Outline color float m_outlineThickness; ///< Thickness of the shape's outline VertexArray m_vertices; ///< Vertex array containing the fill geometry VertexArray m_outlineVertices; ///< Vertex array containing the outline geometry FloatRect m_insideBounds; ///< Bounding rectangle of the inside (fill) FloatRect m_bounds; ///< Bounding rectangle of the whole shape (outline + fill) }; } // namespace sf #endif // SFML_SHAPE_HPP //////////////////////////////////////////////////////////// /// \class sf::Shape /// \ingroup graphics /// /// sf::Shape is a drawable class that allows to define and /// display a custom convex shape on a render target. /// It's only an abstract base, it needs to be specialized for /// concrete types of shapes (circle, rectangle, convex polygon, /// star, ...). /// /// In addition to the attributes provided by the specialized /// shape classes, a shape always has the following attributes: /// \li a texture /// \li a texture rectangle /// \li a fill color /// \li an outline color /// \li an outline thickness /// /// Each feature is optional, and can be disabled easily: /// \li the texture can be null /// \li the fill/outline colors can be sf::Color::Transparent /// \li the outline thickness can be zero /// /// You can write your own derived shape class, there are only /// two virtual functions to override: /// \li getPointCount must return the number of points of the shape /// \li getPoint must return the points of the shape /// /// \see sf::RectangleShape, sf::CircleShape, sf::ConvexShape, sf::Transformable /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Sprite.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SPRITE_HPP #define SFML_SPRITE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include namespace sf { class Texture; //////////////////////////////////////////////////////////// /// \brief Drawable representation of a texture, with its /// own transformations, color, etc. /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Sprite : public Drawable, public Transformable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates an empty sprite with no source texture. /// //////////////////////////////////////////////////////////// Sprite(); //////////////////////////////////////////////////////////// /// \brief Construct the sprite from a source texture /// /// \param texture Source texture /// /// \see setTexture /// //////////////////////////////////////////////////////////// explicit Sprite(const Texture& texture); //////////////////////////////////////////////////////////// /// \brief Construct the sprite from a sub-rectangle of a source texture /// /// \param texture Source texture /// \param rectangle Sub-rectangle of the texture to assign to the sprite /// /// \see setTexture, setTextureRect /// //////////////////////////////////////////////////////////// Sprite(const Texture& texture, const IntRect& rectangle); //////////////////////////////////////////////////////////// /// \brief Change the source texture of the sprite /// /// The \a texture argument refers to a texture that must /// exist as long as the sprite uses it. Indeed, the sprite /// doesn't store its own copy of the texture, but rather keeps /// a pointer to the one that you passed to this function. /// If the source texture is destroyed and the sprite tries to /// use it, the behavior is undefined. /// If \a resetRect is true, the TextureRect property of /// the sprite is automatically adjusted to the size of the new /// texture. If it is false, the texture rect is left unchanged. /// /// \param texture New texture /// \param resetRect Should the texture rect be reset to the size of the new texture? /// /// \see getTexture, setTextureRect /// //////////////////////////////////////////////////////////// void setTexture(const Texture& texture, bool resetRect = false); //////////////////////////////////////////////////////////// /// \brief Set the sub-rectangle of the texture that the sprite will display /// /// The texture rect is useful when you don't want to display /// the whole texture, but rather a part of it. /// By default, the texture rect covers the entire texture. /// /// \param rectangle Rectangle defining the region of the texture to display /// /// \see getTextureRect, setTexture /// //////////////////////////////////////////////////////////// void setTextureRect(const IntRect& rectangle); //////////////////////////////////////////////////////////// /// \brief Set the global color of the sprite /// /// This color is modulated (multiplied) with the sprite's /// texture. It can be used to colorize the sprite, or change /// its global opacity. /// By default, the sprite's color is opaque white. /// /// \param color New color of the sprite /// /// \see getColor /// //////////////////////////////////////////////////////////// void setColor(const Color& color); //////////////////////////////////////////////////////////// /// \brief Get the source texture of the sprite /// /// If the sprite has no source texture, a NULL pointer is returned. /// The returned pointer is const, which means that you can't /// modify the texture when you retrieve it with this function. /// /// \return Pointer to the sprite's texture /// /// \see setTexture /// //////////////////////////////////////////////////////////// const Texture* getTexture() const; //////////////////////////////////////////////////////////// /// \brief Get the sub-rectangle of the texture displayed by the sprite /// /// \return Texture rectangle of the sprite /// /// \see setTextureRect /// //////////////////////////////////////////////////////////// const IntRect& getTextureRect() const; //////////////////////////////////////////////////////////// /// \brief Get the global color of the sprite /// /// \return Global color of the sprite /// /// \see setColor /// //////////////////////////////////////////////////////////// const Color& getColor() const; //////////////////////////////////////////////////////////// /// \brief Get the local bounding rectangle of the entity /// /// The returned rectangle is in local coordinates, which means /// that it ignores the transformations (translation, rotation, /// scale, ...) that are applied to the entity. /// In other words, this function returns the bounds of the /// entity in the entity's coordinate system. /// /// \return Local bounding rectangle of the entity /// //////////////////////////////////////////////////////////// FloatRect getLocalBounds() const; //////////////////////////////////////////////////////////// /// \brief Get the global bounding rectangle of the entity /// /// The returned rectangle is in global coordinates, which means /// that it takes into account the transformations (translation, /// rotation, scale, ...) that are applied to the entity. /// In other words, this function returns the bounds of the /// sprite in the global 2D world's coordinate system. /// /// \return Global bounding rectangle of the entity /// //////////////////////////////////////////////////////////// FloatRect getGlobalBounds() const; private: //////////////////////////////////////////////////////////// /// \brief Draw the sprite to a render target /// /// \param target Render target to draw to /// \param states Current render states /// //////////////////////////////////////////////////////////// virtual void draw(RenderTarget& target, RenderStates states) const; //////////////////////////////////////////////////////////// /// \brief Update the vertices' positions /// //////////////////////////////////////////////////////////// void updatePositions(); //////////////////////////////////////////////////////////// /// \brief Update the vertices' texture coordinates /// //////////////////////////////////////////////////////////// void updateTexCoords(); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Vertex m_vertices[4]; ///< Vertices defining the sprite's geometry const Texture* m_texture; ///< Texture of the sprite IntRect m_textureRect; ///< Rectangle defining the area of the source texture to display }; } // namespace sf #endif // SFML_SPRITE_HPP //////////////////////////////////////////////////////////// /// \class sf::Sprite /// \ingroup graphics /// /// sf::Sprite is a drawable class that allows to easily display /// a texture (or a part of it) on a render target. /// /// It inherits all the functions from sf::Transformable: /// position, rotation, scale, origin. It also adds sprite-specific /// properties such as the texture to use, the part of it to display, /// and some convenience functions to change the overall color of the /// sprite, or to get its bounding rectangle. /// /// sf::Sprite works in combination with the sf::Texture class, which /// loads and provides the pixel data of a given texture. /// /// The separation of sf::Sprite and sf::Texture allows more flexibility /// and better performances: indeed a sf::Texture is a heavy resource, /// and any operation on it is slow (often too slow for real-time /// applications). On the other side, a sf::Sprite is a lightweight /// object which can use the pixel data of a sf::Texture and draw /// it with its own transformation/color/blending attributes. /// /// It is important to note that the sf::Sprite instance doesn't /// copy the texture that it uses, it only keeps a reference to it. /// Thus, a sf::Texture must not be destroyed while it is /// used by a sf::Sprite (i.e. never write a function that /// uses a local sf::Texture instance for creating a sprite). /// /// See also the note on coordinates and undistorted rendering in sf::Transformable. /// /// Usage example: /// \code /// // Declare and load a texture /// sf::Texture texture; /// texture.loadFromFile("texture.png"); /// /// // Create a sprite /// sf::Sprite sprite; /// sprite.setTexture(texture); /// sprite.setTextureRect(sf::IntRect(10, 10, 50, 30)); /// sprite.setColor(sf::Color(255, 255, 255, 200)); /// sprite.setPosition(100, 25); /// /// // Draw it /// window.draw(sprite); /// \endcode /// /// \see sf::Texture, sf::Transformable /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Text.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_TEXT_HPP #define SFML_TEXT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Graphical text that can be drawn to a render target /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Text : public Drawable, public Transformable { public: //////////////////////////////////////////////////////////// /// \brief Enumeration of the string drawing styles /// //////////////////////////////////////////////////////////// enum Style { Regular = 0, ///< Regular characters, no style Bold = 1 << 0, ///< Bold characters Italic = 1 << 1, ///< Italic characters Underlined = 1 << 2, ///< Underlined characters StrikeThrough = 1 << 3 ///< Strike through characters }; //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates an empty text. /// //////////////////////////////////////////////////////////// Text(); //////////////////////////////////////////////////////////// /// \brief Construct the text from a string, font and size /// /// Note that if the used font is a bitmap font, it is not /// scalable, thus not all requested sizes will be available /// to use. This needs to be taken into consideration when /// setting the character size. If you need to display text /// of a certain size, make sure the corresponding bitmap /// font that supports that size is used. /// /// \param string Text assigned to the string /// \param font Font used to draw the string /// \param characterSize Base size of characters, in pixels /// //////////////////////////////////////////////////////////// Text(const String& string, const Font& font, unsigned int characterSize = 30); //////////////////////////////////////////////////////////// /// \brief Set the text's string /// /// The \a string argument is a sf::String, which can /// automatically be constructed from standard string types. /// So, the following calls are all valid: /// \code /// text.setString("hello"); /// text.setString(L"hello"); /// text.setString(std::string("hello")); /// text.setString(std::wstring(L"hello")); /// \endcode /// A text's string is empty by default. /// /// \param string New string /// /// \see getString /// //////////////////////////////////////////////////////////// void setString(const String& string); //////////////////////////////////////////////////////////// /// \brief Set the text's font /// /// The \a font argument refers to a font that must /// exist as long as the text uses it. Indeed, the text /// doesn't store its own copy of the font, but rather keeps /// a pointer to the one that you passed to this function. /// If the font is destroyed and the text tries to /// use it, the behavior is undefined. /// /// \param font New font /// /// \see getFont /// //////////////////////////////////////////////////////////// void setFont(const Font& font); //////////////////////////////////////////////////////////// /// \brief Set the character size /// /// The default size is 30. /// /// Note that if the used font is a bitmap font, it is not /// scalable, thus not all requested sizes will be available /// to use. This needs to be taken into consideration when /// setting the character size. If you need to display text /// of a certain size, make sure the corresponding bitmap /// font that supports that size is used. /// /// \param size New character size, in pixels /// /// \see getCharacterSize /// //////////////////////////////////////////////////////////// void setCharacterSize(unsigned int size); //////////////////////////////////////////////////////////// /// \brief Set the text's style /// /// You can pass a combination of one or more styles, for /// example sf::Text::Bold | sf::Text::Italic. /// The default style is sf::Text::Regular. /// /// \param style New style /// /// \see getStyle /// //////////////////////////////////////////////////////////// void setStyle(Uint32 style); //////////////////////////////////////////////////////////// /// \brief Set the fill color of the text /// /// By default, the text's fill color is opaque white. /// Setting the fill color to a transparent color with an outline /// will cause the outline to be displayed in the fill area of the text. /// /// \param color New fill color of the text /// /// \see getFillColor /// /// \deprecated There is now fill and outline colors instead /// of a single global color. /// Use setFillColor() or setOutlineColor() instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED void setColor(const Color& color); //////////////////////////////////////////////////////////// /// \brief Set the fill color of the text /// /// By default, the text's fill color is opaque white. /// Setting the fill color to a transparent color with an outline /// will cause the outline to be displayed in the fill area of the text. /// /// \param color New fill color of the text /// /// \see getFillColor /// //////////////////////////////////////////////////////////// void setFillColor(const Color& color); //////////////////////////////////////////////////////////// /// \brief Set the outline color of the text /// /// By default, the text's outline color is opaque black. /// /// \param color New outline color of the text /// /// \see getOutlineColor /// //////////////////////////////////////////////////////////// void setOutlineColor(const Color& color); //////////////////////////////////////////////////////////// /// \brief Set the thickness of the text's outline /// /// By default, the outline thickness is 0. /// /// Be aware that using a negative value for the outline /// thickness will cause distorted rendering. /// /// \param thickness New outline thickness, in pixels /// /// \see getOutlineThickness /// //////////////////////////////////////////////////////////// void setOutlineThickness(float thickness); //////////////////////////////////////////////////////////// /// \brief Get the text's string /// /// The returned string is a sf::String, which can automatically /// be converted to standard string types. So, the following /// lines of code are all valid: /// \code /// sf::String s1 = text.getString(); /// std::string s2 = text.getString(); /// std::wstring s3 = text.getString(); /// \endcode /// /// \return Text's string /// /// \see setString /// //////////////////////////////////////////////////////////// const String& getString() const; //////////////////////////////////////////////////////////// /// \brief Get the text's font /// /// If the text has no font attached, a NULL pointer is returned. /// The returned pointer is const, which means that you /// cannot modify the font when you get it from this function. /// /// \return Pointer to the text's font /// /// \see setFont /// //////////////////////////////////////////////////////////// const Font* getFont() const; //////////////////////////////////////////////////////////// /// \brief Get the character size /// /// \return Size of the characters, in pixels /// /// \see setCharacterSize /// //////////////////////////////////////////////////////////// unsigned int getCharacterSize() const; //////////////////////////////////////////////////////////// /// \brief Get the text's style /// /// \return Text's style /// /// \see setStyle /// //////////////////////////////////////////////////////////// Uint32 getStyle() const; //////////////////////////////////////////////////////////// /// \brief Get the fill color of the text /// /// \return Fill color of the text /// /// \see setFillColor /// /// \deprecated There is now fill and outline colors instead /// of a single global color. /// Use getFillColor() or getOutlineColor() instead. /// //////////////////////////////////////////////////////////// SFML_DEPRECATED const Color& getColor() const; //////////////////////////////////////////////////////////// /// \brief Get the fill color of the text /// /// \return Fill color of the text /// /// \see setFillColor /// //////////////////////////////////////////////////////////// const Color& getFillColor() const; //////////////////////////////////////////////////////////// /// \brief Get the outline color of the text /// /// \return Outline color of the text /// /// \see setOutlineColor /// //////////////////////////////////////////////////////////// const Color& getOutlineColor() const; //////////////////////////////////////////////////////////// /// \brief Get the outline thickness of the text /// /// \return Outline thickness of the text, in pixels /// /// \see setOutlineThickness /// //////////////////////////////////////////////////////////// float getOutlineThickness() const; //////////////////////////////////////////////////////////// /// \brief Return the position of the \a index-th character /// /// This function computes the visual position of a character /// from its index in the string. The returned position is /// in global coordinates (translation, rotation, scale and /// origin are applied). /// If \a index is out of range, the position of the end of /// the string is returned. /// /// \param index Index of the character /// /// \return Position of the character /// //////////////////////////////////////////////////////////// Vector2f findCharacterPos(std::size_t index) const; //////////////////////////////////////////////////////////// /// \brief Get the local bounding rectangle of the entity /// /// The returned rectangle is in local coordinates, which means /// that it ignores the transformations (translation, rotation, /// scale, ...) that are applied to the entity. /// In other words, this function returns the bounds of the /// entity in the entity's coordinate system. /// /// \return Local bounding rectangle of the entity /// //////////////////////////////////////////////////////////// FloatRect getLocalBounds() const; //////////////////////////////////////////////////////////// /// \brief Get the global bounding rectangle of the entity /// /// The returned rectangle is in global coordinates, which means /// that it takes into account the transformations (translation, /// rotation, scale, ...) that are applied to the entity. /// In other words, this function returns the bounds of the /// text in the global 2D world's coordinate system. /// /// \return Global bounding rectangle of the entity /// //////////////////////////////////////////////////////////// FloatRect getGlobalBounds() const; private: //////////////////////////////////////////////////////////// /// \brief Draw the text to a render target /// /// \param target Render target to draw to /// \param states Current render states /// //////////////////////////////////////////////////////////// virtual void draw(RenderTarget& target, RenderStates states) const; //////////////////////////////////////////////////////////// /// \brief Make sure the text's geometry is updated /// /// All the attributes related to rendering are cached, such /// that the geometry is only updated when necessary. /// //////////////////////////////////////////////////////////// void ensureGeometryUpdate() const; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// String m_string; ///< String to display const Font* m_font; ///< Font used to display the string unsigned int m_characterSize; ///< Base size of characters, in pixels Uint32 m_style; ///< Text style (see Style enum) Color m_fillColor; ///< Text fill color Color m_outlineColor; ///< Text outline color float m_outlineThickness; ///< Thickness of the text's outline mutable VertexArray m_vertices; ///< Vertex array containing the fill geometry mutable VertexArray m_outlineVertices; ///< Vertex array containing the outline geometry mutable FloatRect m_bounds; ///< Bounding rectangle of the text (in local coordinates) mutable bool m_geometryNeedUpdate; ///< Does the geometry need to be recomputed? }; } // namespace sf #endif // SFML_TEXT_HPP //////////////////////////////////////////////////////////// /// \class sf::Text /// \ingroup graphics /// /// sf::Text is a drawable class that allows to easily display /// some text with custom style and color on a render target. /// /// It inherits all the functions from sf::Transformable: /// position, rotation, scale, origin. It also adds text-specific /// properties such as the font to use, the character size, /// the font style (bold, italic, underlined, strike through), the /// global color and the text to display of course. /// It also provides convenience functions to calculate the /// graphical size of the text, or to get the global position /// of a given character. /// /// sf::Text works in combination with the sf::Font class, which /// loads and provides the glyphs (visual characters) of a given font. /// /// The separation of sf::Font and sf::Text allows more flexibility /// and better performances: indeed a sf::Font is a heavy resource, /// and any operation on it is slow (often too slow for real-time /// applications). On the other side, a sf::Text is a lightweight /// object which can combine the glyphs data and metrics of a sf::Font /// to display any text on a render target. /// /// It is important to note that the sf::Text instance doesn't /// copy the font that it uses, it only keeps a reference to it. /// Thus, a sf::Font must not be destructed while it is /// used by a sf::Text (i.e. never write a function that /// uses a local sf::Font instance for creating a text). /// /// See also the note on coordinates and undistorted rendering in sf::Transformable. /// /// Usage example: /// \code /// // Declare and load a font /// sf::Font font; /// font.loadFromFile("arial.ttf"); /// /// // Create a text /// sf::Text text("hello", font); /// text.setCharacterSize(30); /// text.setStyle(sf::Text::Bold); /// text.setColor(sf::Color::Red); /// /// // Draw it /// window.draw(text); /// \endcode /// /// \see sf::Font, sf::Transformable /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Texture.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_TEXTURE_HPP #define SFML_TEXTURE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { class Window; class RenderTarget; class RenderTexture; class InputStream; //////////////////////////////////////////////////////////// /// \brief Image living on the graphics card that can be used for drawing /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Texture : GlResource { public: //////////////////////////////////////////////////////////// /// \brief Types of texture coordinates that can be used for rendering /// //////////////////////////////////////////////////////////// enum CoordinateType { Normalized, ///< Texture coordinates in range [0 .. 1] Pixels ///< Texture coordinates in range [0 .. size] }; public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates an empty texture. /// //////////////////////////////////////////////////////////// Texture(); //////////////////////////////////////////////////////////// /// \brief Copy constructor /// /// \param copy instance to copy /// //////////////////////////////////////////////////////////// Texture(const Texture& copy); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~Texture(); //////////////////////////////////////////////////////////// /// \brief Create the texture /// /// If this function fails, the texture is left unchanged. /// /// \param width Width of the texture /// \param height Height of the texture /// /// \return True if creation was successful /// //////////////////////////////////////////////////////////// bool create(unsigned int width, unsigned int height); //////////////////////////////////////////////////////////// /// \brief Load the texture from a file on disk /// /// This function is a shortcut for the following code: /// \code /// sf::Image image; /// image.loadFromFile(filename); /// texture.loadFromImage(image, area); /// \endcode /// /// The \a area argument can be used to load only a sub-rectangle /// of the whole image. If you want the entire image then leave /// the default value (which is an empty IntRect). /// If the \a area rectangle crosses the bounds of the image, it /// is adjusted to fit the image size. /// /// The maximum size for a texture depends on the graphics /// driver and can be retrieved with the getMaximumSize function. /// /// If this function fails, the texture is left unchanged. /// /// \param filename Path of the image file to load /// \param area Area of the image to load /// /// \return True if loading was successful /// /// \see loadFromMemory, loadFromStream, loadFromImage /// //////////////////////////////////////////////////////////// bool loadFromFile(const std::string& filename, const IntRect& area = IntRect()); //////////////////////////////////////////////////////////// /// \brief Load the texture from a file in memory /// /// This function is a shortcut for the following code: /// \code /// sf::Image image; /// image.loadFromMemory(data, size); /// texture.loadFromImage(image, area); /// \endcode /// /// The \a area argument can be used to load only a sub-rectangle /// of the whole image. If you want the entire image then leave /// the default value (which is an empty IntRect). /// If the \a area rectangle crosses the bounds of the image, it /// is adjusted to fit the image size. /// /// The maximum size for a texture depends on the graphics /// driver and can be retrieved with the getMaximumSize function. /// /// If this function fails, the texture is left unchanged. /// /// \param data Pointer to the file data in memory /// \param size Size of the data to load, in bytes /// \param area Area of the image to load /// /// \return True if loading was successful /// /// \see loadFromFile, loadFromStream, loadFromImage /// //////////////////////////////////////////////////////////// bool loadFromMemory(const void* data, std::size_t size, const IntRect& area = IntRect()); //////////////////////////////////////////////////////////// /// \brief Load the texture from a custom stream /// /// This function is a shortcut for the following code: /// \code /// sf::Image image; /// image.loadFromStream(stream); /// texture.loadFromImage(image, area); /// \endcode /// /// The \a area argument can be used to load only a sub-rectangle /// of the whole image. If you want the entire image then leave /// the default value (which is an empty IntRect). /// If the \a area rectangle crosses the bounds of the image, it /// is adjusted to fit the image size. /// /// The maximum size for a texture depends on the graphics /// driver and can be retrieved with the getMaximumSize function. /// /// If this function fails, the texture is left unchanged. /// /// \param stream Source stream to read from /// \param area Area of the image to load /// /// \return True if loading was successful /// /// \see loadFromFile, loadFromMemory, loadFromImage /// //////////////////////////////////////////////////////////// bool loadFromStream(InputStream& stream, const IntRect& area = IntRect()); //////////////////////////////////////////////////////////// /// \brief Load the texture from an image /// /// The \a area argument can be used to load only a sub-rectangle /// of the whole image. If you want the entire image then leave /// the default value (which is an empty IntRect). /// If the \a area rectangle crosses the bounds of the image, it /// is adjusted to fit the image size. /// /// The maximum size for a texture depends on the graphics /// driver and can be retrieved with the getMaximumSize function. /// /// If this function fails, the texture is left unchanged. /// /// \param image Image to load into the texture /// \param area Area of the image to load /// /// \return True if loading was successful /// /// \see loadFromFile, loadFromMemory /// //////////////////////////////////////////////////////////// bool loadFromImage(const Image& image, const IntRect& area = IntRect()); //////////////////////////////////////////////////////////// /// \brief Return the size of the texture /// /// \return Size in pixels /// //////////////////////////////////////////////////////////// Vector2u getSize() const; //////////////////////////////////////////////////////////// /// \brief Copy the texture pixels to an image /// /// This function performs a slow operation that downloads /// the texture's pixels from the graphics card and copies /// them to a new image, potentially applying transformations /// to pixels if necessary (texture may be padded or flipped). /// /// \return Image containing the texture's pixels /// /// \see loadFromImage /// //////////////////////////////////////////////////////////// Image copyToImage() const; //////////////////////////////////////////////////////////// /// \brief Update the whole texture from an array of pixels /// /// The \a pixel array is assumed to have the same size as /// the \a area rectangle, and to contain 32-bits RGBA pixels. /// /// No additional check is performed on the size of the pixel /// array, passing invalid arguments will lead to an undefined /// behavior. /// /// This function does nothing if \a pixels is null or if the /// texture was not previously created. /// /// \param pixels Array of pixels to copy to the texture /// //////////////////////////////////////////////////////////// void update(const Uint8* pixels); //////////////////////////////////////////////////////////// /// \brief Update a part of the texture from an array of pixels /// /// The size of the \a pixel array must match the \a width and /// \a height arguments, and it must contain 32-bits RGBA pixels. /// /// No additional check is performed on the size of the pixel /// array or the bounds of the area to update, passing invalid /// arguments will lead to an undefined behavior. /// /// This function does nothing if \a pixels is null or if the /// texture was not previously created. /// /// \param pixels Array of pixels to copy to the texture /// \param width Width of the pixel region contained in \a pixels /// \param height Height of the pixel region contained in \a pixels /// \param x X offset in the texture where to copy the source pixels /// \param y Y offset in the texture where to copy the source pixels /// //////////////////////////////////////////////////////////// void update(const Uint8* pixels, unsigned int width, unsigned int height, unsigned int x, unsigned int y); //////////////////////////////////////////////////////////// /// \brief Update the texture from an image /// /// Although the source image can be smaller than the texture, /// this function is usually used for updating the whole texture. /// The other overload, which has (x, y) additional arguments, /// is more convenient for updating a sub-area of the texture. /// /// No additional check is performed on the size of the image, /// passing an image bigger than the texture will lead to an /// undefined behavior. /// /// This function does nothing if the texture was not /// previously created. /// /// \param image Image to copy to the texture /// //////////////////////////////////////////////////////////// void update(const Image& image); //////////////////////////////////////////////////////////// /// \brief Update a part of the texture from an image /// /// No additional check is performed on the size of the image, /// passing an invalid combination of image size and offset /// will lead to an undefined behavior. /// /// This function does nothing if the texture was not /// previously created. /// /// \param image Image to copy to the texture /// \param x X offset in the texture where to copy the source image /// \param y Y offset in the texture where to copy the source image /// //////////////////////////////////////////////////////////// void update(const Image& image, unsigned int x, unsigned int y); //////////////////////////////////////////////////////////// /// \brief Update the texture from the contents of a window /// /// Although the source window can be smaller than the texture, /// this function is usually used for updating the whole texture. /// The other overload, which has (x, y) additional arguments, /// is more convenient for updating a sub-area of the texture. /// /// No additional check is performed on the size of the window, /// passing a window bigger than the texture will lead to an /// undefined behavior. /// /// This function does nothing if either the texture or the window /// was not previously created. /// /// \param window Window to copy to the texture /// //////////////////////////////////////////////////////////// void update(const Window& window); //////////////////////////////////////////////////////////// /// \brief Update a part of the texture from the contents of a window /// /// No additional check is performed on the size of the window, /// passing an invalid combination of window size and offset /// will lead to an undefined behavior. /// /// This function does nothing if either the texture or the window /// was not previously created. /// /// \param window Window to copy to the texture /// \param x X offset in the texture where to copy the source window /// \param y Y offset in the texture where to copy the source window /// //////////////////////////////////////////////////////////// void update(const Window& window, unsigned int x, unsigned int y); //////////////////////////////////////////////////////////// /// \brief Enable or disable the smooth filter /// /// When the filter is activated, the texture appears smoother /// so that pixels are less noticeable. However if you want /// the texture to look exactly the same as its source file, /// you should leave it disabled. /// The smooth filter is disabled by default. /// /// \param smooth True to enable smoothing, false to disable it /// /// \see isSmooth /// //////////////////////////////////////////////////////////// void setSmooth(bool smooth); //////////////////////////////////////////////////////////// /// \brief Tell whether the smooth filter is enabled or not /// /// \return True if smoothing is enabled, false if it is disabled /// /// \see setSmooth /// //////////////////////////////////////////////////////////// bool isSmooth() const; //////////////////////////////////////////////////////////// /// \brief Enable or disable conversion from sRGB /// /// When providing texture data from an image file or memory, it can /// either be stored in a linear color space or an sRGB color space. /// Most digital images account for gamma correction already, so they /// would need to be "uncorrected" back to linear color space before /// being processed by the hardware. The hardware can automatically /// convert it from the sRGB color space to a linear color space when /// it gets sampled. When the rendered image gets output to the final /// framebuffer, it gets converted back to sRGB. /// /// After enabling or disabling sRGB conversion, make sure to reload /// the texture data in order for the setting to take effect. /// /// This option is only useful in conjunction with an sRGB capable /// framebuffer. This can be requested during window creation. /// /// \param sRgb True to enable sRGB conversion, false to disable it /// /// \see isSrgb /// //////////////////////////////////////////////////////////// void setSrgb(bool sRgb); //////////////////////////////////////////////////////////// /// \brief Tell whether the texture source is converted from sRGB or not /// /// \return True if the texture source is converted from sRGB, false if not /// /// \see setSrgb /// //////////////////////////////////////////////////////////// bool isSrgb() const; //////////////////////////////////////////////////////////// /// \brief Enable or disable repeating /// /// Repeating is involved when using texture coordinates /// outside the texture rectangle [0, 0, width, height]. /// In this case, if repeat mode is enabled, the whole texture /// will be repeated as many times as needed to reach the /// coordinate (for example, if the X texture coordinate is /// 3 * width, the texture will be repeated 3 times). /// If repeat mode is disabled, the "extra space" will instead /// be filled with border pixels. /// Warning: on very old graphics cards, white pixels may appear /// when the texture is repeated. With such cards, repeat mode /// can be used reliably only if the texture has power-of-two /// dimensions (such as 256x128). /// Repeating is disabled by default. /// /// \param repeated True to repeat the texture, false to disable repeating /// /// \see isRepeated /// //////////////////////////////////////////////////////////// void setRepeated(bool repeated); //////////////////////////////////////////////////////////// /// \brief Tell whether the texture is repeated or not /// /// \return True if repeat mode is enabled, false if it is disabled /// /// \see setRepeated /// //////////////////////////////////////////////////////////// bool isRepeated() const; //////////////////////////////////////////////////////////// /// \brief Generate a mipmap using the current texture data /// /// Mipmaps are pre-computed chains of optimized textures. Each /// level of texture in a mipmap is generated by halving each of /// the previous level's dimensions. This is done until the final /// level has the size of 1x1. The textures generated in this process may /// make use of more advanced filters which might improve the visual quality /// of textures when they are applied to objects much smaller than they are. /// This is known as minification. Because fewer texels (texture elements) /// have to be sampled from when heavily minified, usage of mipmaps /// can also improve rendering performance in certain scenarios. /// /// Mipmap generation relies on the necessary OpenGL extension being /// available. If it is unavailable or generation fails due to another /// reason, this function will return false. Mipmap data is only valid from /// the time it is generated until the next time the base level image is /// modified, at which point this function will have to be called again to /// regenerate it. /// /// \return True if mipmap generation was successful, false if unsuccessful /// //////////////////////////////////////////////////////////// bool generateMipmap(); //////////////////////////////////////////////////////////// /// \brief Overload of assignment operator /// /// \param right Instance to assign /// /// \return Reference to self /// //////////////////////////////////////////////////////////// Texture& operator =(const Texture& right); //////////////////////////////////////////////////////////// /// \brief Get the underlying OpenGL handle of the texture. /// /// You shouldn't need to use this function, unless you have /// very specific stuff to implement that SFML doesn't support, /// or implement a temporary workaround until a bug is fixed. /// /// \return OpenGL handle of the texture or 0 if not yet created /// //////////////////////////////////////////////////////////// unsigned int getNativeHandle() const; //////////////////////////////////////////////////////////// /// \brief Bind a texture for rendering /// /// This function is not part of the graphics API, it mustn't be /// used when drawing SFML entities. It must be used only if you /// mix sf::Texture with OpenGL code. /// /// \code /// sf::Texture t1, t2; /// ... /// sf::Texture::bind(&t1); /// // draw OpenGL stuff that use t1... /// sf::Texture::bind(&t2); /// // draw OpenGL stuff that use t2... /// sf::Texture::bind(NULL); /// // draw OpenGL stuff that use no texture... /// \endcode /// /// The \a coordinateType argument controls how texture /// coordinates will be interpreted. If Normalized (the default), they /// must be in range [0 .. 1], which is the default way of handling /// texture coordinates with OpenGL. If Pixels, they must be given /// in pixels (range [0 .. size]). This mode is used internally by /// the graphics classes of SFML, it makes the definition of texture /// coordinates more intuitive for the high-level API, users don't need /// to compute normalized values. /// /// \param texture Pointer to the texture to bind, can be null to use no texture /// \param coordinateType Type of texture coordinates to use /// //////////////////////////////////////////////////////////// static void bind(const Texture* texture, CoordinateType coordinateType = Normalized); //////////////////////////////////////////////////////////// /// \brief Get the maximum texture size allowed /// /// This maximum size is defined by the graphics driver. /// You can expect a value of 512 pixels for low-end graphics /// card, and up to 8192 pixels or more for newer hardware. /// /// \return Maximum size allowed for textures, in pixels /// //////////////////////////////////////////////////////////// static unsigned int getMaximumSize(); private: friend class RenderTexture; friend class RenderTarget; //////////////////////////////////////////////////////////// /// \brief Get a valid image size according to hardware support /// /// This function checks whether the graphics driver supports /// non power of two sizes or not, and adjusts the size /// accordingly. /// The returned size is greater than or equal to the original size. /// /// \param size size to convert /// /// \return Valid nearest size (greater than or equal to specified size) /// //////////////////////////////////////////////////////////// static unsigned int getValidSize(unsigned int size); //////////////////////////////////////////////////////////// /// \brief Invalidate the mipmap if one exists /// /// This also resets the texture's minifying function. /// This function is mainly for internal use by RenderTexture. /// //////////////////////////////////////////////////////////// void invalidateMipmap(); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Vector2u m_size; ///< Public texture size Vector2u m_actualSize; ///< Actual texture size (can be greater than public size because of padding) unsigned int m_texture; ///< Internal texture identifier bool m_isSmooth; ///< Status of the smooth filter bool m_sRgb; ///< Should the texture source be converted from sRGB? bool m_isRepeated; ///< Is the texture in repeat mode? mutable bool m_pixelsFlipped; ///< To work around the inconsistency in Y orientation bool m_fboAttachment; ///< Is this texture owned by a framebuffer object? bool m_hasMipmap; ///< Has the mipmap been generated? Uint64 m_cacheId; ///< Unique number that identifies the texture to the render target's cache }; } // namespace sf #endif // SFML_TEXTURE_HPP //////////////////////////////////////////////////////////// /// \class sf::Texture /// \ingroup graphics /// /// sf::Texture stores pixels that can be drawn, with a sprite /// for example. A texture lives in the graphics card memory, /// therefore it is very fast to draw a texture to a render target, /// or copy a render target to a texture (the graphics card can /// access both directly). /// /// Being stored in the graphics card memory has some drawbacks. /// A texture cannot be manipulated as freely as a sf::Image, /// you need to prepare the pixels first and then upload them /// to the texture in a single operation (see Texture::update). /// /// sf::Texture makes it easy to convert from/to sf::Image, but /// keep in mind that these calls require transfers between /// the graphics card and the central memory, therefore they are /// slow operations. /// /// A texture can be loaded from an image, but also directly /// from a file/memory/stream. The necessary shortcuts are defined /// so that you don't need an image first for the most common cases. /// However, if you want to perform some modifications on the pixels /// before creating the final texture, you can load your file to a /// sf::Image, do whatever you need with the pixels, and then call /// Texture::loadFromImage. /// /// Since they live in the graphics card memory, the pixels of a texture /// cannot be accessed without a slow copy first. And they cannot be /// accessed individually. Therefore, if you need to read the texture's /// pixels (like for pixel-perfect collisions), it is recommended to /// store the collision information separately, for example in an array /// of booleans. /// /// Like sf::Image, sf::Texture can handle a unique internal /// representation of pixels, which is RGBA 32 bits. This means /// that a pixel must be composed of 8 bits red, green, blue and /// alpha channels -- just like a sf::Color. /// /// Usage example: /// \code /// // This example shows the most common use of sf::Texture: /// // drawing a sprite /// /// // Load a texture from a file /// sf::Texture texture; /// if (!texture.loadFromFile("texture.png")) /// return -1; /// /// // Assign it to a sprite /// sf::Sprite sprite; /// sprite.setTexture(texture); /// /// // Draw the textured sprite /// window.draw(sprite); /// \endcode /// /// \code /// // This example shows another common use of sf::Texture: /// // streaming real-time data, like video frames /// /// // Create an empty texture /// sf::Texture texture; /// if (!texture.create(640, 480)) /// return -1; /// /// // Create a sprite that will display the texture /// sf::Sprite sprite(texture); /// /// while (...) // the main loop /// { /// ... /// /// // update the texture /// sf::Uint8* pixels = ...; // get a fresh chunk of pixels (the next frame of a movie, for example) /// texture.update(pixels); /// /// // draw it /// window.draw(sprite); /// /// ... /// } /// /// \endcode /// /// Like sf::Shader that can be used as a raw OpenGL shader, /// sf::Texture can also be used directly as a raw texture for /// custom OpenGL geometry. /// \code /// sf::Texture::bind(&texture); /// ... render OpenGL geometry ... /// sf::Texture::bind(NULL); /// \endcode /// /// \see sf::Sprite, sf::Image, sf::RenderTexture /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Transform.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_TRANSFORM_HPP #define SFML_TRANSFORM_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Define a 3x3 transform matrix /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Transform { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates an identity transform (a transform that does nothing). /// //////////////////////////////////////////////////////////// Transform(); //////////////////////////////////////////////////////////// /// \brief Construct a transform from a 3x3 matrix /// /// \param a00 Element (0, 0) of the matrix /// \param a01 Element (0, 1) of the matrix /// \param a02 Element (0, 2) of the matrix /// \param a10 Element (1, 0) of the matrix /// \param a11 Element (1, 1) of the matrix /// \param a12 Element (1, 2) of the matrix /// \param a20 Element (2, 0) of the matrix /// \param a21 Element (2, 1) of the matrix /// \param a22 Element (2, 2) of the matrix /// //////////////////////////////////////////////////////////// Transform(float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22); //////////////////////////////////////////////////////////// /// \brief Return the transform as a 4x4 matrix /// /// This function returns a pointer to an array of 16 floats /// containing the transform elements as a 4x4 matrix, which /// is directly compatible with OpenGL functions. /// /// \code /// sf::Transform transform = ...; /// glLoadMatrixf(transform.getMatrix()); /// \endcode /// /// \return Pointer to a 4x4 matrix /// //////////////////////////////////////////////////////////// const float* getMatrix() const; //////////////////////////////////////////////////////////// /// \brief Return the inverse of the transform /// /// If the inverse cannot be computed, an identity transform /// is returned. /// /// \return A new transform which is the inverse of self /// //////////////////////////////////////////////////////////// Transform getInverse() const; //////////////////////////////////////////////////////////// /// \brief Transform a 2D point /// /// \param x X coordinate of the point to transform /// \param y Y coordinate of the point to transform /// /// \return Transformed point /// //////////////////////////////////////////////////////////// Vector2f transformPoint(float x, float y) const; //////////////////////////////////////////////////////////// /// \brief Transform a 2D point /// /// \param point Point to transform /// /// \return Transformed point /// //////////////////////////////////////////////////////////// Vector2f transformPoint(const Vector2f& point) const; //////////////////////////////////////////////////////////// /// \brief Transform a rectangle /// /// Since SFML doesn't provide support for oriented rectangles, /// the result of this function is always an axis-aligned /// rectangle. Which means that if the transform contains a /// rotation, the bounding rectangle of the transformed rectangle /// is returned. /// /// \param rectangle Rectangle to transform /// /// \return Transformed rectangle /// //////////////////////////////////////////////////////////// FloatRect transformRect(const FloatRect& rectangle) const; //////////////////////////////////////////////////////////// /// \brief Combine the current transform with another one /// /// The result is a transform that is equivalent to applying /// *this followed by \a transform. Mathematically, it is /// equivalent to a matrix multiplication. /// /// \param transform Transform to combine with this transform /// /// \return Reference to *this /// //////////////////////////////////////////////////////////// Transform& combine(const Transform& transform); //////////////////////////////////////////////////////////// /// \brief Combine the current transform with a translation /// /// This function returns a reference to *this, so that calls /// can be chained. /// \code /// sf::Transform transform; /// transform.translate(100, 200).rotate(45); /// \endcode /// /// \param x Offset to apply on X axis /// \param y Offset to apply on Y axis /// /// \return Reference to *this /// /// \see rotate, scale /// //////////////////////////////////////////////////////////// Transform& translate(float x, float y); //////////////////////////////////////////////////////////// /// \brief Combine the current transform with a translation /// /// This function returns a reference to *this, so that calls /// can be chained. /// \code /// sf::Transform transform; /// transform.translate(sf::Vector2f(100, 200)).rotate(45); /// \endcode /// /// \param offset Translation offset to apply /// /// \return Reference to *this /// /// \see rotate, scale /// //////////////////////////////////////////////////////////// Transform& translate(const Vector2f& offset); //////////////////////////////////////////////////////////// /// \brief Combine the current transform with a rotation /// /// This function returns a reference to *this, so that calls /// can be chained. /// \code /// sf::Transform transform; /// transform.rotate(90).translate(50, 20); /// \endcode /// /// \param angle Rotation angle, in degrees /// /// \return Reference to *this /// /// \see translate, scale /// //////////////////////////////////////////////////////////// Transform& rotate(float angle); //////////////////////////////////////////////////////////// /// \brief Combine the current transform with a rotation /// /// The center of rotation is provided for convenience as a second /// argument, so that you can build rotations around arbitrary points /// more easily (and efficiently) than the usual /// translate(-center).rotate(angle).translate(center). /// /// This function returns a reference to *this, so that calls /// can be chained. /// \code /// sf::Transform transform; /// transform.rotate(90, 8, 3).translate(50, 20); /// \endcode /// /// \param angle Rotation angle, in degrees /// \param centerX X coordinate of the center of rotation /// \param centerY Y coordinate of the center of rotation /// /// \return Reference to *this /// /// \see translate, scale /// //////////////////////////////////////////////////////////// Transform& rotate(float angle, float centerX, float centerY); //////////////////////////////////////////////////////////// /// \brief Combine the current transform with a rotation /// /// The center of rotation is provided for convenience as a second /// argument, so that you can build rotations around arbitrary points /// more easily (and efficiently) than the usual /// translate(-center).rotate(angle).translate(center). /// /// This function returns a reference to *this, so that calls /// can be chained. /// \code /// sf::Transform transform; /// transform.rotate(90, sf::Vector2f(8, 3)).translate(sf::Vector2f(50, 20)); /// \endcode /// /// \param angle Rotation angle, in degrees /// \param center Center of rotation /// /// \return Reference to *this /// /// \see translate, scale /// //////////////////////////////////////////////////////////// Transform& rotate(float angle, const Vector2f& center); //////////////////////////////////////////////////////////// /// \brief Combine the current transform with a scaling /// /// This function returns a reference to *this, so that calls /// can be chained. /// \code /// sf::Transform transform; /// transform.scale(2, 1).rotate(45); /// \endcode /// /// \param scaleX Scaling factor on the X axis /// \param scaleY Scaling factor on the Y axis /// /// \return Reference to *this /// /// \see translate, rotate /// //////////////////////////////////////////////////////////// Transform& scale(float scaleX, float scaleY); //////////////////////////////////////////////////////////// /// \brief Combine the current transform with a scaling /// /// The center of scaling is provided for convenience as a second /// argument, so that you can build scaling around arbitrary points /// more easily (and efficiently) than the usual /// translate(-center).scale(factors).translate(center). /// /// This function returns a reference to *this, so that calls /// can be chained. /// \code /// sf::Transform transform; /// transform.scale(2, 1, 8, 3).rotate(45); /// \endcode /// /// \param scaleX Scaling factor on X axis /// \param scaleY Scaling factor on Y axis /// \param centerX X coordinate of the center of scaling /// \param centerY Y coordinate of the center of scaling /// /// \return Reference to *this /// /// \see translate, rotate /// //////////////////////////////////////////////////////////// Transform& scale(float scaleX, float scaleY, float centerX, float centerY); //////////////////////////////////////////////////////////// /// \brief Combine the current transform with a scaling /// /// This function returns a reference to *this, so that calls /// can be chained. /// \code /// sf::Transform transform; /// transform.scale(sf::Vector2f(2, 1)).rotate(45); /// \endcode /// /// \param factors Scaling factors /// /// \return Reference to *this /// /// \see translate, rotate /// //////////////////////////////////////////////////////////// Transform& scale(const Vector2f& factors); //////////////////////////////////////////////////////////// /// \brief Combine the current transform with a scaling /// /// The center of scaling is provided for convenience as a second /// argument, so that you can build scaling around arbitrary points /// more easily (and efficiently) than the usual /// translate(-center).scale(factors).translate(center). /// /// This function returns a reference to *this, so that calls /// can be chained. /// \code /// sf::Transform transform; /// transform.scale(sf::Vector2f(2, 1), sf::Vector2f(8, 3)).rotate(45); /// \endcode /// /// \param factors Scaling factors /// \param center Center of scaling /// /// \return Reference to *this /// /// \see translate, rotate /// //////////////////////////////////////////////////////////// Transform& scale(const Vector2f& factors, const Vector2f& center); //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// static const Transform Identity; ///< The identity transform (does nothing) private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// float m_matrix[16]; ///< 4x4 matrix defining the transformation }; //////////////////////////////////////////////////////////// /// \relates sf::Transform /// \brief Overload of binary operator * to combine two transforms /// /// This call is equivalent to calling Transform(left).combine(right). /// /// \param left Left operand (the first transform) /// \param right Right operand (the second transform) /// /// \return New combined transform /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API Transform operator *(const Transform& left, const Transform& right); //////////////////////////////////////////////////////////// /// \relates sf::Transform /// \brief Overload of binary operator *= to combine two transforms /// /// This call is equivalent to calling left.combine(right). /// /// \param left Left operand (the first transform) /// \param right Right operand (the second transform) /// /// \return The combined transform /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API Transform& operator *=(Transform& left, const Transform& right); //////////////////////////////////////////////////////////// /// \relates sf::Transform /// \brief Overload of binary operator * to transform a point /// /// This call is equivalent to calling left.transformPoint(right). /// /// \param left Left operand (the transform) /// \param right Right operand (the point to transform) /// /// \return New transformed point /// //////////////////////////////////////////////////////////// SFML_GRAPHICS_API Vector2f operator *(const Transform& left, const Vector2f& right); } // namespace sf #endif // SFML_TRANSFORM_HPP //////////////////////////////////////////////////////////// /// \class sf::Transform /// \ingroup graphics /// /// A sf::Transform specifies how to translate, rotate, scale, /// shear, project, whatever things. In mathematical terms, it defines /// how to transform a coordinate system into another. /// /// For example, if you apply a rotation transform to a sprite, the /// result will be a rotated sprite. And anything that is transformed /// by this rotation transform will be rotated the same way, according /// to its initial position. /// /// Transforms are typically used for drawing. But they can also be /// used for any computation that requires to transform points between /// the local and global coordinate systems of an entity (like collision /// detection). /// /// Example: /// \code /// // define a translation transform /// sf::Transform translation; /// translation.translate(20, 50); /// /// // define a rotation transform /// sf::Transform rotation; /// rotation.rotate(45); /// /// // combine them /// sf::Transform transform = translation * rotation; /// /// // use the result to transform stuff... /// sf::Vector2f point = transform.transformPoint(10, 20); /// sf::FloatRect rect = transform.transformRect(sf::FloatRect(0, 0, 10, 100)); /// \endcode /// /// \see sf::Transformable, sf::RenderStates /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Transformable.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_TRANSFORMABLE_HPP #define SFML_TRANSFORMABLE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Decomposed transform defined by a position, a rotation and a scale /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Transformable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// Transformable(); //////////////////////////////////////////////////////////// /// \brief Virtual destructor /// //////////////////////////////////////////////////////////// virtual ~Transformable(); //////////////////////////////////////////////////////////// /// \brief set the position of the object /// /// This function completely overwrites the previous position. /// See the move function to apply an offset based on the previous position instead. /// The default position of a transformable object is (0, 0). /// /// \param x X coordinate of the new position /// \param y Y coordinate of the new position /// /// \see move, getPosition /// //////////////////////////////////////////////////////////// void setPosition(float x, float y); //////////////////////////////////////////////////////////// /// \brief set the position of the object /// /// This function completely overwrites the previous position. /// See the move function to apply an offset based on the previous position instead. /// The default position of a transformable object is (0, 0). /// /// \param position New position /// /// \see move, getPosition /// //////////////////////////////////////////////////////////// void setPosition(const Vector2f& position); //////////////////////////////////////////////////////////// /// \brief set the orientation of the object /// /// This function completely overwrites the previous rotation. /// See the rotate function to add an angle based on the previous rotation instead. /// The default rotation of a transformable object is 0. /// /// \param angle New rotation, in degrees /// /// \see rotate, getRotation /// //////////////////////////////////////////////////////////// void setRotation(float angle); //////////////////////////////////////////////////////////// /// \brief set the scale factors of the object /// /// This function completely overwrites the previous scale. /// See the scale function to add a factor based on the previous scale instead. /// The default scale of a transformable object is (1, 1). /// /// \param factorX New horizontal scale factor /// \param factorY New vertical scale factor /// /// \see scale, getScale /// //////////////////////////////////////////////////////////// void setScale(float factorX, float factorY); //////////////////////////////////////////////////////////// /// \brief set the scale factors of the object /// /// This function completely overwrites the previous scale. /// See the scale function to add a factor based on the previous scale instead. /// The default scale of a transformable object is (1, 1). /// /// \param factors New scale factors /// /// \see scale, getScale /// //////////////////////////////////////////////////////////// void setScale(const Vector2f& factors); //////////////////////////////////////////////////////////// /// \brief set the local origin of the object /// /// The origin of an object defines the center point for /// all transformations (position, scale, rotation). /// The coordinates of this point must be relative to the /// top-left corner of the object, and ignore all /// transformations (position, scale, rotation). /// The default origin of a transformable object is (0, 0). /// /// \param x X coordinate of the new origin /// \param y Y coordinate of the new origin /// /// \see getOrigin /// //////////////////////////////////////////////////////////// void setOrigin(float x, float y); //////////////////////////////////////////////////////////// /// \brief set the local origin of the object /// /// The origin of an object defines the center point for /// all transformations (position, scale, rotation). /// The coordinates of this point must be relative to the /// top-left corner of the object, and ignore all /// transformations (position, scale, rotation). /// The default origin of a transformable object is (0, 0). /// /// \param origin New origin /// /// \see getOrigin /// //////////////////////////////////////////////////////////// void setOrigin(const Vector2f& origin); //////////////////////////////////////////////////////////// /// \brief get the position of the object /// /// \return Current position /// /// \see setPosition /// //////////////////////////////////////////////////////////// const Vector2f& getPosition() const; //////////////////////////////////////////////////////////// /// \brief get the orientation of the object /// /// The rotation is always in the range [0, 360]. /// /// \return Current rotation, in degrees /// /// \see setRotation /// //////////////////////////////////////////////////////////// float getRotation() const; //////////////////////////////////////////////////////////// /// \brief get the current scale of the object /// /// \return Current scale factors /// /// \see setScale /// //////////////////////////////////////////////////////////// const Vector2f& getScale() const; //////////////////////////////////////////////////////////// /// \brief get the local origin of the object /// /// \return Current origin /// /// \see setOrigin /// //////////////////////////////////////////////////////////// const Vector2f& getOrigin() const; //////////////////////////////////////////////////////////// /// \brief Move the object by a given offset /// /// This function adds to the current position of the object, /// unlike setPosition which overwrites it. /// Thus, it is equivalent to the following code: /// \code /// sf::Vector2f pos = object.getPosition(); /// object.setPosition(pos.x + offsetX, pos.y + offsetY); /// \endcode /// /// \param offsetX X offset /// \param offsetY Y offset /// /// \see setPosition /// //////////////////////////////////////////////////////////// void move(float offsetX, float offsetY); //////////////////////////////////////////////////////////// /// \brief Move the object by a given offset /// /// This function adds to the current position of the object, /// unlike setPosition which overwrites it. /// Thus, it is equivalent to the following code: /// \code /// object.setPosition(object.getPosition() + offset); /// \endcode /// /// \param offset Offset /// /// \see setPosition /// //////////////////////////////////////////////////////////// void move(const Vector2f& offset); //////////////////////////////////////////////////////////// /// \brief Rotate the object /// /// This function adds to the current rotation of the object, /// unlike setRotation which overwrites it. /// Thus, it is equivalent to the following code: /// \code /// object.setRotation(object.getRotation() + angle); /// \endcode /// /// \param angle Angle of rotation, in degrees /// //////////////////////////////////////////////////////////// void rotate(float angle); //////////////////////////////////////////////////////////// /// \brief Scale the object /// /// This function multiplies the current scale of the object, /// unlike setScale which overwrites it. /// Thus, it is equivalent to the following code: /// \code /// sf::Vector2f scale = object.getScale(); /// object.setScale(scale.x * factorX, scale.y * factorY); /// \endcode /// /// \param factorX Horizontal scale factor /// \param factorY Vertical scale factor /// /// \see setScale /// //////////////////////////////////////////////////////////// void scale(float factorX, float factorY); //////////////////////////////////////////////////////////// /// \brief Scale the object /// /// This function multiplies the current scale of the object, /// unlike setScale which overwrites it. /// Thus, it is equivalent to the following code: /// \code /// sf::Vector2f scale = object.getScale(); /// object.setScale(scale.x * factor.x, scale.y * factor.y); /// \endcode /// /// \param factor Scale factors /// /// \see setScale /// //////////////////////////////////////////////////////////// void scale(const Vector2f& factor); //////////////////////////////////////////////////////////// /// \brief get the combined transform of the object /// /// \return Transform combining the position/rotation/scale/origin of the object /// /// \see getInverseTransform /// //////////////////////////////////////////////////////////// const Transform& getTransform() const; //////////////////////////////////////////////////////////// /// \brief get the inverse of the combined transform of the object /// /// \return Inverse of the combined transformations applied to the object /// /// \see getTransform /// //////////////////////////////////////////////////////////// const Transform& getInverseTransform() const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Vector2f m_origin; ///< Origin of translation/rotation/scaling of the object Vector2f m_position; ///< Position of the object in the 2D world float m_rotation; ///< Orientation of the object, in degrees Vector2f m_scale; ///< Scale of the object mutable Transform m_transform; ///< Combined transformation of the object mutable bool m_transformNeedUpdate; ///< Does the transform need to be recomputed? mutable Transform m_inverseTransform; ///< Combined transformation of the object mutable bool m_inverseTransformNeedUpdate; ///< Does the transform need to be recomputed? }; } // namespace sf #endif // SFML_TRANSFORMABLE_HPP //////////////////////////////////////////////////////////// /// \class sf::Transformable /// \ingroup graphics /// /// This class is provided for convenience, on top of sf::Transform. /// /// sf::Transform, as a low-level class, offers a great level of /// flexibility but it is not always convenient to manage. Indeed, /// one can easily combine any kind of operation, such as a translation /// followed by a rotation followed by a scaling, but once the result /// transform is built, there's no way to go backward and, let's say, /// change only the rotation without modifying the translation and scaling. /// The entire transform must be recomputed, which means that you /// need to retrieve the initial translation and scale factors as /// well, and combine them the same way you did before updating the /// rotation. This is a tedious operation, and it requires to store /// all the individual components of the final transform. /// /// That's exactly what sf::Transformable was written for: it hides /// these variables and the composed transform behind an easy to use /// interface. You can set or get any of the individual components /// without worrying about the others. It also provides the composed /// transform (as a sf::Transform), and keeps it up-to-date. /// /// In addition to the position, rotation and scale, sf::Transformable /// provides an "origin" component, which represents the local origin /// of the three other components. Let's take an example with a 10x10 /// pixels sprite. By default, the sprite is positioned/rotated/scaled /// relatively to its top-left corner, because it is the local point /// (0, 0). But if we change the origin to be (5, 5), the sprite will /// be positioned/rotated/scaled around its center instead. And if /// we set the origin to (10, 10), it will be transformed around its /// bottom-right corner. /// /// To keep the sf::Transformable class simple, there's only one /// origin for all the components. You cannot position the sprite /// relatively to its top-left corner while rotating it around its /// center, for example. To do such things, use sf::Transform directly. /// /// sf::Transformable can be used as a base class. It is often /// combined with sf::Drawable -- that's what SFML's sprites, /// texts and shapes do. /// \code /// class MyEntity : public sf::Transformable, public sf::Drawable /// { /// virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const /// { /// states.transform *= getTransform(); /// target.draw(..., states); /// } /// }; /// /// MyEntity entity; /// entity.setPosition(10, 20); /// entity.setRotation(45); /// window.draw(entity); /// \endcode /// /// It can also be used as a member, if you don't want to use /// its API directly (because you don't need all its functions, /// or you have different naming conventions for example). /// \code /// class MyEntity /// { /// public: /// void SetPosition(const MyVector& v) /// { /// myTransform.setPosition(v.x(), v.y()); /// } /// /// void Draw(sf::RenderTarget& target) const /// { /// target.draw(..., myTransform.getTransform()); /// } /// /// private: /// sf::Transformable myTransform; /// }; /// \endcode /// /// A note on coordinates and undistorted rendering: \n /// By default, SFML (or more exactly, OpenGL) may interpolate drawable objects /// such as sprites or texts when rendering. While this allows transitions /// like slow movements or rotations to appear smoothly, it can lead to /// unwanted results in some cases, for example blurred or distorted objects. /// In order to render a sf::Drawable object pixel-perfectly, make sure /// the involved coordinates allow a 1:1 mapping of pixels in the window /// to texels (pixels in the texture). More specifically, this means: /// * The object's position, origin and scale have no fractional part /// * The object's and the view's rotation are a multiple of 90 degrees /// * The view's center and size have no fractional part /// /// \see sf::Transform /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/Vertex.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_VERTEX_HPP #define SFML_VERTEX_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Define a point with color and texture coordinates /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API Vertex { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// Vertex(); //////////////////////////////////////////////////////////// /// \brief Construct the vertex from its position /// /// The vertex color is white and texture coordinates are (0, 0). /// /// \param thePosition Vertex position /// //////////////////////////////////////////////////////////// Vertex(const Vector2f& thePosition); //////////////////////////////////////////////////////////// /// \brief Construct the vertex from its position and color /// /// The texture coordinates are (0, 0). /// /// \param thePosition Vertex position /// \param theColor Vertex color /// //////////////////////////////////////////////////////////// Vertex(const Vector2f& thePosition, const Color& theColor); //////////////////////////////////////////////////////////// /// \brief Construct the vertex from its position and texture coordinates /// /// The vertex color is white. /// /// \param thePosition Vertex position /// \param theTexCoords Vertex texture coordinates /// //////////////////////////////////////////////////////////// Vertex(const Vector2f& thePosition, const Vector2f& theTexCoords); //////////////////////////////////////////////////////////// /// \brief Construct the vertex from its position, color and texture coordinates /// /// \param thePosition Vertex position /// \param theColor Vertex color /// \param theTexCoords Vertex texture coordinates /// //////////////////////////////////////////////////////////// Vertex(const Vector2f& thePosition, const Color& theColor, const Vector2f& theTexCoords); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Vector2f position; ///< 2D position of the vertex Color color; ///< Color of the vertex Vector2f texCoords; ///< Coordinates of the texture's pixel to map to the vertex }; } // namespace sf #endif // SFML_VERTEX_HPP //////////////////////////////////////////////////////////// /// \class sf::Vertex /// \ingroup graphics /// /// A vertex is an improved point. It has a position and other /// extra attributes that will be used for drawing: in SFML, /// vertices also have a color and a pair of texture coordinates. /// /// The vertex is the building block of drawing. Everything which /// is visible on screen is made of vertices. They are grouped /// as 2D primitives (triangles, quads, ...), and these primitives /// are grouped to create even more complex 2D entities such as /// sprites, texts, etc. /// /// If you use the graphical entities of SFML (sprite, text, shape) /// you won't have to deal with vertices directly. But if you want /// to define your own 2D entities, such as tiled maps or particle /// systems, using vertices will allow you to get maximum performances. /// /// Example: /// \code /// // define a 100x100 square, red, with a 10x10 texture mapped on it /// sf::Vertex vertices[] = /// { /// sf::Vertex(sf::Vector2f( 0, 0), sf::Color::Red, sf::Vector2f( 0, 0)), /// sf::Vertex(sf::Vector2f( 0, 100), sf::Color::Red, sf::Vector2f( 0, 10)), /// sf::Vertex(sf::Vector2f(100, 100), sf::Color::Red, sf::Vector2f(10, 10)), /// sf::Vertex(sf::Vector2f(100, 0), sf::Color::Red, sf::Vector2f(10, 0)) /// }; /// /// // draw it /// window.draw(vertices, 4, sf::Quads); /// \endcode /// /// Note: although texture coordinates are supposed to be an integer /// amount of pixels, their type is float because of some buggy graphics /// drivers that are not able to process integer coordinates correctly. /// /// \see sf::VertexArray /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/VertexArray.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_VERTEXARRAY_HPP #define SFML_VERTEXARRAY_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Define a set of one or more 2D primitives /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API VertexArray : public Drawable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates an empty vertex array. /// //////////////////////////////////////////////////////////// VertexArray(); //////////////////////////////////////////////////////////// /// \brief Construct the vertex array with a type and an initial number of vertices /// /// \param type Type of primitives /// \param vertexCount Initial number of vertices in the array /// //////////////////////////////////////////////////////////// explicit VertexArray(PrimitiveType type, std::size_t vertexCount = 0); //////////////////////////////////////////////////////////// /// \brief Return the vertex count /// /// \return Number of vertices in the array /// //////////////////////////////////////////////////////////// std::size_t getVertexCount() const; //////////////////////////////////////////////////////////// /// \brief Get a read-write access to a vertex by its index /// /// This function doesn't check \a index, it must be in range /// [0, getVertexCount() - 1]. The behavior is undefined /// otherwise. /// /// \param index Index of the vertex to get /// /// \return Reference to the index-th vertex /// /// \see getVertexCount /// //////////////////////////////////////////////////////////// Vertex& operator [](std::size_t index); //////////////////////////////////////////////////////////// /// \brief Get a read-only access to a vertex by its index /// /// This function doesn't check \a index, it must be in range /// [0, getVertexCount() - 1]. The behavior is undefined /// otherwise. /// /// \param index Index of the vertex to get /// /// \return Const reference to the index-th vertex /// /// \see getVertexCount /// //////////////////////////////////////////////////////////// const Vertex& operator [](std::size_t index) const; //////////////////////////////////////////////////////////// /// \brief Clear the vertex array /// /// This function removes all the vertices from the array. /// It doesn't deallocate the corresponding memory, so that /// adding new vertices after clearing doesn't involve /// reallocating all the memory. /// //////////////////////////////////////////////////////////// void clear(); //////////////////////////////////////////////////////////// /// \brief Resize the vertex array /// /// If \a vertexCount is greater than the current size, the previous /// vertices are kept and new (default-constructed) vertices are /// added. /// If \a vertexCount is less than the current size, existing vertices /// are removed from the array. /// /// \param vertexCount New size of the array (number of vertices) /// //////////////////////////////////////////////////////////// void resize(std::size_t vertexCount); //////////////////////////////////////////////////////////// /// \brief Add a vertex to the array /// /// \param vertex Vertex to add /// //////////////////////////////////////////////////////////// void append(const Vertex& vertex); //////////////////////////////////////////////////////////// /// \brief Set the type of primitives to draw /// /// This function defines how the vertices must be interpreted /// when it's time to draw them: /// \li As points /// \li As lines /// \li As triangles /// \li As quads /// The default primitive type is sf::Points. /// /// \param type Type of primitive /// //////////////////////////////////////////////////////////// void setPrimitiveType(PrimitiveType type); //////////////////////////////////////////////////////////// /// \brief Get the type of primitives drawn by the vertex array /// /// \return Primitive type /// //////////////////////////////////////////////////////////// PrimitiveType getPrimitiveType() const; //////////////////////////////////////////////////////////// /// \brief Compute the bounding rectangle of the vertex array /// /// This function returns the minimal axis-aligned rectangle /// that contains all the vertices of the array. /// /// \return Bounding rectangle of the vertex array /// //////////////////////////////////////////////////////////// FloatRect getBounds() const; private: //////////////////////////////////////////////////////////// /// \brief Draw the vertex array to a render target /// /// \param target Render target to draw to /// \param states Current render states /// //////////////////////////////////////////////////////////// virtual void draw(RenderTarget& target, RenderStates states) const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// std::vector m_vertices; ///< Vertices contained in the array PrimitiveType m_primitiveType; ///< Type of primitives to draw }; } // namespace sf #endif // SFML_VERTEXARRAY_HPP //////////////////////////////////////////////////////////// /// \class sf::VertexArray /// \ingroup graphics /// /// sf::VertexArray is a very simple wrapper around a dynamic /// array of vertices and a primitives type. /// /// It inherits sf::Drawable, but unlike other drawables it /// is not transformable. /// /// Example: /// \code /// sf::VertexArray lines(sf::LineStrip, 4); /// lines[0].position = sf::Vector2f(10, 0); /// lines[1].position = sf::Vector2f(20, 0); /// lines[2].position = sf::Vector2f(30, 5); /// lines[3].position = sf::Vector2f(40, 2); /// /// window.draw(lines); /// \endcode /// /// \see sf::Vertex /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics/View.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_VIEW_HPP #define SFML_VIEW_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief 2D camera that defines what region is shown on screen /// //////////////////////////////////////////////////////////// class SFML_GRAPHICS_API View { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor creates a default view of (0, 0, 1000, 1000) /// //////////////////////////////////////////////////////////// View(); //////////////////////////////////////////////////////////// /// \brief Construct the view from a rectangle /// /// \param rectangle Rectangle defining the zone to display /// //////////////////////////////////////////////////////////// explicit View(const FloatRect& rectangle); //////////////////////////////////////////////////////////// /// \brief Construct the view from its center and size /// /// \param center Center of the zone to display /// \param size Size of zone to display /// //////////////////////////////////////////////////////////// View(const Vector2f& center, const Vector2f& size); //////////////////////////////////////////////////////////// /// \brief Set the center of the view /// /// \param x X coordinate of the new center /// \param y Y coordinate of the new center /// /// \see setSize, getCenter /// //////////////////////////////////////////////////////////// void setCenter(float x, float y); //////////////////////////////////////////////////////////// /// \brief Set the center of the view /// /// \param center New center /// /// \see setSize, getCenter /// //////////////////////////////////////////////////////////// void setCenter(const Vector2f& center); //////////////////////////////////////////////////////////// /// \brief Set the size of the view /// /// \param width New width of the view /// \param height New height of the view /// /// \see setCenter, getCenter /// //////////////////////////////////////////////////////////// void setSize(float width, float height); //////////////////////////////////////////////////////////// /// \brief Set the size of the view /// /// \param size New size /// /// \see setCenter, getCenter /// //////////////////////////////////////////////////////////// void setSize(const Vector2f& size); //////////////////////////////////////////////////////////// /// \brief Set the orientation of the view /// /// The default rotation of a view is 0 degree. /// /// \param angle New angle, in degrees /// /// \see getRotation /// //////////////////////////////////////////////////////////// void setRotation(float angle); //////////////////////////////////////////////////////////// /// \brief Set the target viewport /// /// The viewport is the rectangle into which the contents of the /// view are displayed, expressed as a factor (between 0 and 1) /// of the size of the RenderTarget to which the view is applied. /// For example, a view which takes the left side of the target would /// be defined with View.setViewport(sf::FloatRect(0, 0, 0.5, 1)). /// By default, a view has a viewport which covers the entire target. /// /// \param viewport New viewport rectangle /// /// \see getViewport /// //////////////////////////////////////////////////////////// void setViewport(const FloatRect& viewport); //////////////////////////////////////////////////////////// /// \brief Reset the view to the given rectangle /// /// Note that this function resets the rotation angle to 0. /// /// \param rectangle Rectangle defining the zone to display /// /// \see setCenter, setSize, setRotation /// //////////////////////////////////////////////////////////// void reset(const FloatRect& rectangle); //////////////////////////////////////////////////////////// /// \brief Get the center of the view /// /// \return Center of the view /// /// \see getSize, setCenter /// //////////////////////////////////////////////////////////// const Vector2f& getCenter() const; //////////////////////////////////////////////////////////// /// \brief Get the size of the view /// /// \return Size of the view /// /// \see getCenter, setSize /// //////////////////////////////////////////////////////////// const Vector2f& getSize() const; //////////////////////////////////////////////////////////// /// \brief Get the current orientation of the view /// /// \return Rotation angle of the view, in degrees /// /// \see setRotation /// //////////////////////////////////////////////////////////// float getRotation() const; //////////////////////////////////////////////////////////// /// \brief Get the target viewport rectangle of the view /// /// \return Viewport rectangle, expressed as a factor of the target size /// /// \see setViewport /// //////////////////////////////////////////////////////////// const FloatRect& getViewport() const; //////////////////////////////////////////////////////////// /// \brief Move the view relatively to its current position /// /// \param offsetX X coordinate of the move offset /// \param offsetY Y coordinate of the move offset /// /// \see setCenter, rotate, zoom /// //////////////////////////////////////////////////////////// void move(float offsetX, float offsetY); //////////////////////////////////////////////////////////// /// \brief Move the view relatively to its current position /// /// \param offset Move offset /// /// \see setCenter, rotate, zoom /// //////////////////////////////////////////////////////////// void move(const Vector2f& offset); //////////////////////////////////////////////////////////// /// \brief Rotate the view relatively to its current orientation /// /// \param angle Angle to rotate, in degrees /// /// \see setRotation, move, zoom /// //////////////////////////////////////////////////////////// void rotate(float angle); //////////////////////////////////////////////////////////// /// \brief Resize the view rectangle relatively to its current size /// /// Resizing the view simulates a zoom, as the zone displayed on /// screen grows or shrinks. /// \a factor is a multiplier: /// \li 1 keeps the size unchanged /// \li > 1 makes the view bigger (objects appear smaller) /// \li < 1 makes the view smaller (objects appear bigger) /// /// \param factor Zoom factor to apply /// /// \see setSize, move, rotate /// //////////////////////////////////////////////////////////// void zoom(float factor); //////////////////////////////////////////////////////////// /// \brief Get the projection transform of the view /// /// This function is meant for internal use only. /// /// \return Projection transform defining the view /// /// \see getInverseTransform /// //////////////////////////////////////////////////////////// const Transform& getTransform() const; //////////////////////////////////////////////////////////// /// \brief Get the inverse projection transform of the view /// /// This function is meant for internal use only. /// /// \return Inverse of the projection transform defining the view /// /// \see getTransform /// //////////////////////////////////////////////////////////// const Transform& getInverseTransform() const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Vector2f m_center; ///< Center of the view, in scene coordinates Vector2f m_size; ///< Size of the view, in scene coordinates float m_rotation; ///< Angle of rotation of the view rectangle, in degrees FloatRect m_viewport; ///< Viewport rectangle, expressed as a factor of the render-target's size mutable Transform m_transform; ///< Precomputed projection transform corresponding to the view mutable Transform m_inverseTransform; ///< Precomputed inverse projection transform corresponding to the view mutable bool m_transformUpdated; ///< Internal state telling if the transform needs to be updated mutable bool m_invTransformUpdated; ///< Internal state telling if the inverse transform needs to be updated }; } // namespace sf #endif // SFML_VIEW_HPP //////////////////////////////////////////////////////////// /// \class sf::View /// \ingroup graphics /// /// sf::View defines a camera in the 2D scene. This is a /// very powerful concept: you can scroll, rotate or zoom /// the entire scene without altering the way that your /// drawable objects are drawn. /// /// A view is composed of a source rectangle, which defines /// what part of the 2D scene is shown, and a target viewport, /// which defines where the contents of the source rectangle /// will be displayed on the render target (window or texture). /// /// The viewport allows to map the scene to a custom part /// of the render target, and can be used for split-screen /// or for displaying a minimap, for example. If the source /// rectangle doesn't have the same size as the viewport, its /// contents will be stretched to fit in. /// /// To apply a view, you have to assign it to the render target. /// Then, objects drawn in this render target will be /// affected by the view until you use another view. /// /// Usage example: /// \code /// sf::RenderWindow window; /// sf::View view; /// /// // Initialize the view to a rectangle located at (100, 100) and with a size of 400x200 /// view.reset(sf::FloatRect(100, 100, 400, 200)); /// /// // Rotate it by 45 degrees /// view.rotate(45); /// /// // Set its target viewport to be half of the window /// view.setViewport(sf::FloatRect(0.f, 0.f, 0.5f, 1.f)); /// /// // Apply it /// window.setView(view); /// /// // Render stuff /// window.draw(someSprite); /// /// // Set the default view back /// window.setView(window.getDefaultView()); /// /// // Render stuff not affected by the view /// window.draw(someText); /// \endcode /// /// See also the note on coordinates and undistorted rendering in sf::Transformable. /// /// \see sf::RenderWindow, sf::RenderTexture /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Graphics.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_GRAPHICS_HPP #define SFML_GRAPHICS_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif // SFML_GRAPHICS_HPP //////////////////////////////////////////////////////////// /// \defgroup graphics Graphics module /// /// 2D graphics module: sprites, text, shapes, ... /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Main.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_MAIN_HPP #define SFML_MAIN_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #if defined(SFML_SYSTEM_IOS) // On iOS, we have no choice but to have our own main, // so we need to rename the user one and call it later #define main sfmlMain #endif #endif // SFML_MAIN_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/Export.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_NETWORK_EXPORT_HPP #define SFML_NETWORK_EXPORT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include //////////////////////////////////////////////////////////// // Define portable import / export macros //////////////////////////////////////////////////////////// #if defined(SFML_NETWORK_EXPORTS) #define SFML_NETWORK_API SFML_API_EXPORT #else #define SFML_NETWORK_API SFML_API_IMPORT #endif #endif // SFML_NETWORK_EXPORT_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/Ftp.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_FTP_HPP #define SFML_FTP_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include namespace sf { class IpAddress; //////////////////////////////////////////////////////////// /// \brief A FTP client /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API Ftp : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Enumeration of transfer modes /// //////////////////////////////////////////////////////////// enum TransferMode { Binary, ///< Binary mode (file is transfered as a sequence of bytes) Ascii, ///< Text mode using ASCII encoding Ebcdic ///< Text mode using EBCDIC encoding }; //////////////////////////////////////////////////////////// /// \brief Define a FTP response /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API Response { public: //////////////////////////////////////////////////////////// /// \brief Status codes possibly returned by a FTP response /// //////////////////////////////////////////////////////////// enum Status { // 1xx: the requested action is being initiated, // expect another reply before proceeding with a new command RestartMarkerReply = 110, ///< Restart marker reply ServiceReadySoon = 120, ///< Service ready in N minutes DataConnectionAlreadyOpened = 125, ///< Data connection already opened, transfer starting OpeningDataConnection = 150, ///< File status ok, about to open data connection // 2xx: the requested action has been successfully completed Ok = 200, ///< Command ok PointlessCommand = 202, ///< Command not implemented SystemStatus = 211, ///< System status, or system help reply DirectoryStatus = 212, ///< Directory status FileStatus = 213, ///< File status HelpMessage = 214, ///< Help message SystemType = 215, ///< NAME system type, where NAME is an official system name from the list in the Assigned Numbers document ServiceReady = 220, ///< Service ready for new user ClosingConnection = 221, ///< Service closing control connection DataConnectionOpened = 225, ///< Data connection open, no transfer in progress ClosingDataConnection = 226, ///< Closing data connection, requested file action successful EnteringPassiveMode = 227, ///< Entering passive mode LoggedIn = 230, ///< User logged in, proceed. Logged out if appropriate FileActionOk = 250, ///< Requested file action ok DirectoryOk = 257, ///< PATHNAME created // 3xx: the command has been accepted, but the requested action // is dormant, pending receipt of further information NeedPassword = 331, ///< User name ok, need password NeedAccountToLogIn = 332, ///< Need account for login NeedInformation = 350, ///< Requested file action pending further information // 4xx: the command was not accepted and the requested action did not take place, // but the error condition is temporary and the action may be requested again ServiceUnavailable = 421, ///< Service not available, closing control connection DataConnectionUnavailable = 425, ///< Can't open data connection TransferAborted = 426, ///< Connection closed, transfer aborted FileActionAborted = 450, ///< Requested file action not taken LocalError = 451, ///< Requested action aborted, local error in processing InsufficientStorageSpace = 452, ///< Requested action not taken; insufficient storage space in system, file unavailable // 5xx: the command was not accepted and // the requested action did not take place CommandUnknown = 500, ///< Syntax error, command unrecognized ParametersUnknown = 501, ///< Syntax error in parameters or arguments CommandNotImplemented = 502, ///< Command not implemented BadCommandSequence = 503, ///< Bad sequence of commands ParameterNotImplemented = 504, ///< Command not implemented for that parameter NotLoggedIn = 530, ///< Not logged in NeedAccountToStore = 532, ///< Need account for storing files FileUnavailable = 550, ///< Requested action not taken, file unavailable PageTypeUnknown = 551, ///< Requested action aborted, page type unknown NotEnoughMemory = 552, ///< Requested file action aborted, exceeded storage allocation FilenameNotAllowed = 553, ///< Requested action not taken, file name not allowed // 10xx: SFML custom codes InvalidResponse = 1000, ///< Not part of the FTP standard, generated by SFML when a received response cannot be parsed ConnectionFailed = 1001, ///< Not part of the FTP standard, generated by SFML when the low-level socket connection with the server fails ConnectionClosed = 1002, ///< Not part of the FTP standard, generated by SFML when the low-level socket connection is unexpectedly closed InvalidFile = 1003 ///< Not part of the FTP standard, generated by SFML when a local file cannot be read or written }; //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor is used by the FTP client to build /// the response. /// /// \param code Response status code /// \param message Response message /// //////////////////////////////////////////////////////////// explicit Response(Status code = InvalidResponse, const std::string& message = ""); //////////////////////////////////////////////////////////// /// \brief Check if the status code means a success /// /// This function is defined for convenience, it is /// equivalent to testing if the status code is < 400. /// /// \return True if the status is a success, false if it is a failure /// //////////////////////////////////////////////////////////// bool isOk() const; //////////////////////////////////////////////////////////// /// \brief Get the status code of the response /// /// \return Status code /// //////////////////////////////////////////////////////////// Status getStatus() const; //////////////////////////////////////////////////////////// /// \brief Get the full message contained in the response /// /// \return The response message /// //////////////////////////////////////////////////////////// const std::string& getMessage() const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Status m_status; ///< Status code returned from the server std::string m_message; ///< Last message received from the server }; //////////////////////////////////////////////////////////// /// \brief Specialization of FTP response returning a directory /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API DirectoryResponse : public Response { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// \param response Source response /// //////////////////////////////////////////////////////////// DirectoryResponse(const Response& response); //////////////////////////////////////////////////////////// /// \brief Get the directory returned in the response /// /// \return Directory name /// //////////////////////////////////////////////////////////// const std::string& getDirectory() const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// std::string m_directory; ///< Directory extracted from the response message }; //////////////////////////////////////////////////////////// /// \brief Specialization of FTP response returning a /// filename listing //////////////////////////////////////////////////////////// class SFML_NETWORK_API ListingResponse : public Response { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// \param response Source response /// \param data Data containing the raw listing /// //////////////////////////////////////////////////////////// ListingResponse(const Response& response, const std::string& data); //////////////////////////////////////////////////////////// /// \brief Return the array of directory/file names /// /// \return Array containing the requested listing /// //////////////////////////////////////////////////////////// const std::vector& getListing() const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// std::vector m_listing; ///< Directory/file names extracted from the data }; //////////////////////////////////////////////////////////// /// \brief Destructor /// /// Automatically closes the connection with the server if /// it is still opened. /// //////////////////////////////////////////////////////////// ~Ftp(); //////////////////////////////////////////////////////////// /// \brief Connect to the specified FTP server /// /// The port has a default value of 21, which is the standard /// port used by the FTP protocol. You shouldn't use a different /// value, unless you really know what you do. /// This function tries to connect to the server so it may take /// a while to complete, especially if the server is not /// reachable. To avoid blocking your application for too long, /// you can use a timeout. The default value, Time::Zero, means that the /// system timeout will be used (which is usually pretty long). /// /// \param server Name or address of the FTP server to connect to /// \param port Port used for the connection /// \param timeout Maximum time to wait /// /// \return Server response to the request /// /// \see disconnect /// //////////////////////////////////////////////////////////// Response connect(const IpAddress& server, unsigned short port = 21, Time timeout = Time::Zero); //////////////////////////////////////////////////////////// /// \brief Close the connection with the server /// /// \return Server response to the request /// /// \see connect /// //////////////////////////////////////////////////////////// Response disconnect(); //////////////////////////////////////////////////////////// /// \brief Log in using an anonymous account /// /// Logging in is mandatory after connecting to the server. /// Users that are not logged in cannot perform any operation. /// /// \return Server response to the request /// //////////////////////////////////////////////////////////// Response login(); //////////////////////////////////////////////////////////// /// \brief Log in using a username and a password /// /// Logging in is mandatory after connecting to the server. /// Users that are not logged in cannot perform any operation. /// /// \param name User name /// \param password Password /// /// \return Server response to the request /// //////////////////////////////////////////////////////////// Response login(const std::string& name, const std::string& password); //////////////////////////////////////////////////////////// /// \brief Send a null command to keep the connection alive /// /// This command is useful because the server may close the /// connection automatically if no command is sent. /// /// \return Server response to the request /// //////////////////////////////////////////////////////////// Response keepAlive(); //////////////////////////////////////////////////////////// /// \brief Get the current working directory /// /// The working directory is the root path for subsequent /// operations involving directories and/or filenames. /// /// \return Server response to the request /// /// \see getDirectoryListing, changeDirectory, parentDirectory /// //////////////////////////////////////////////////////////// DirectoryResponse getWorkingDirectory(); //////////////////////////////////////////////////////////// /// \brief Get the contents of the given directory /// /// This function retrieves the sub-directories and files /// contained in the given directory. It is not recursive. /// The \a directory parameter is relative to the current /// working directory. /// /// \param directory Directory to list /// /// \return Server response to the request /// /// \see getWorkingDirectory, changeDirectory, parentDirectory /// //////////////////////////////////////////////////////////// ListingResponse getDirectoryListing(const std::string& directory = ""); //////////////////////////////////////////////////////////// /// \brief Change the current working directory /// /// The new directory must be relative to the current one. /// /// \param directory New working directory /// /// \return Server response to the request /// /// \see getWorkingDirectory, getDirectoryListing, parentDirectory /// //////////////////////////////////////////////////////////// Response changeDirectory(const std::string& directory); //////////////////////////////////////////////////////////// /// \brief Go to the parent directory of the current one /// /// \return Server response to the request /// /// \see getWorkingDirectory, getDirectoryListing, changeDirectory /// //////////////////////////////////////////////////////////// Response parentDirectory(); //////////////////////////////////////////////////////////// /// \brief Create a new directory /// /// The new directory is created as a child of the current /// working directory. /// /// \param name Name of the directory to create /// /// \return Server response to the request /// /// \see deleteDirectory /// //////////////////////////////////////////////////////////// Response createDirectory(const std::string& name); //////////////////////////////////////////////////////////// /// \brief Remove an existing directory /// /// The directory to remove must be relative to the /// current working directory. /// Use this function with caution, the directory will /// be removed permanently! /// /// \param name Name of the directory to remove /// /// \return Server response to the request /// /// \see createDirectory /// //////////////////////////////////////////////////////////// Response deleteDirectory(const std::string& name); //////////////////////////////////////////////////////////// /// \brief Rename an existing file /// /// The filenames must be relative to the current working /// directory. /// /// \param file File to rename /// \param newName New name of the file /// /// \return Server response to the request /// /// \see deleteFile /// //////////////////////////////////////////////////////////// Response renameFile(const std::string& file, const std::string& newName); //////////////////////////////////////////////////////////// /// \brief Remove an existing file /// /// The file name must be relative to the current working /// directory. /// Use this function with caution, the file will be /// removed permanently! /// /// \param name File to remove /// /// \return Server response to the request /// /// \see renameFile /// //////////////////////////////////////////////////////////// Response deleteFile(const std::string& name); //////////////////////////////////////////////////////////// /// \brief Download a file from the server /// /// The filename of the distant file is relative to the /// current working directory of the server, and the local /// destination path is relative to the current directory /// of your application. /// If a file with the same filename as the distant file /// already exists in the local destination path, it will /// be overwritten. /// /// \param remoteFile Filename of the distant file to download /// \param localPath The directory in which to put the file on the local computer /// \param mode Transfer mode /// /// \return Server response to the request /// /// \see upload /// //////////////////////////////////////////////////////////// Response download(const std::string& remoteFile, const std::string& localPath, TransferMode mode = Binary); //////////////////////////////////////////////////////////// /// \brief Upload a file to the server /// /// The name of the local file is relative to the current /// working directory of your application, and the /// remote path is relative to the current directory of the /// FTP server. /// /// \param localFile Path of the local file to upload /// \param remotePath The directory in which to put the file on the server /// \param mode Transfer mode /// /// \return Server response to the request /// /// \see download /// //////////////////////////////////////////////////////////// Response upload(const std::string& localFile, const std::string& remotePath, TransferMode mode = Binary); //////////////////////////////////////////////////////////// /// \brief Send a command to the FTP server /// /// While the most often used commands are provided as member /// functions in the sf::Ftp class, this method can be used /// to send any FTP command to the server. If the command /// requires one or more parameters, they can be specified /// in \a parameter. If the server returns information, you /// can extract it from the response using Response::getMessage(). /// /// \param command Command to send /// \param parameter Command parameter /// /// \return Server response to the request /// //////////////////////////////////////////////////////////// Response sendCommand(const std::string& command, const std::string& parameter = ""); private: //////////////////////////////////////////////////////////// /// \brief Receive a response from the server /// /// This function must be called after each call to /// sendCommand that expects a response. /// /// \return Server response to the request /// //////////////////////////////////////////////////////////// Response getResponse(); //////////////////////////////////////////////////////////// /// \brief Utility class for exchanging datas with the server /// on the data channel /// //////////////////////////////////////////////////////////// class DataChannel; friend class DataChannel; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// TcpSocket m_commandSocket; ///< Socket holding the control connection with the server std::string m_receiveBuffer; ///< Received command data that is yet to be processed }; } // namespace sf #endif // SFML_FTP_HPP //////////////////////////////////////////////////////////// /// \class sf::Ftp /// \ingroup network /// /// sf::Ftp is a very simple FTP client that allows you /// to communicate with a FTP server. The FTP protocol allows /// you to manipulate a remote file system (list files, /// upload, download, create, remove, ...). /// /// Using the FTP client consists of 4 parts: /// \li Connecting to the FTP server /// \li Logging in (either as a registered user or anonymously) /// \li Sending commands to the server /// \li Disconnecting (this part can be done implicitly by the destructor) /// /// Every command returns a FTP response, which contains the /// status code as well as a message from the server. Some /// commands such as getWorkingDirectory() and getDirectoryListing() /// return additional data, and use a class derived from /// sf::Ftp::Response to provide this data. The most often used /// commands are directly provided as member functions, but it is /// also possible to use specific commands with the sendCommand() function. /// /// Note that response statuses >= 1000 are not part of the FTP standard, /// they are generated by SFML when an internal error occurs. /// /// All commands, especially upload and download, may take some /// time to complete. This is important to know if you don't want /// to block your application while the server is completing /// the task. /// /// Usage example: /// \code /// // Create a new FTP client /// sf::Ftp ftp; /// /// // Connect to the server /// sf::Ftp::Response response = ftp.connect("ftp://ftp.myserver.com"); /// if (response.isOk()) /// std::cout << "Connected" << std::endl; /// /// // Log in /// response = ftp.login("laurent", "dF6Zm89D"); /// if (response.isOk()) /// std::cout << "Logged in" << std::endl; /// /// // Print the working directory /// sf::Ftp::DirectoryResponse directory = ftp.getWorkingDirectory(); /// if (directory.isOk()) /// std::cout << "Working directory: " << directory.getDirectory() << std::endl; /// /// // Create a new directory /// response = ftp.createDirectory("files"); /// if (response.isOk()) /// std::cout << "Created new directory" << std::endl; /// /// // Upload a file to this new directory /// response = ftp.upload("local-path/file.txt", "files", sf::Ftp::Ascii); /// if (response.isOk()) /// std::cout << "File uploaded" << std::endl; /// /// // Send specific commands (here: FEAT to list supported FTP features) /// response = ftp.sendCommand("FEAT"); /// if (response.isOk()) /// std::cout << "Feature list:\n" << response.getMessage() << std::endl; /// /// // Disconnect from the server (optional) /// ftp.disconnect(); /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/Http.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_HTTP_HPP #define SFML_HTTP_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief A HTTP client /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API Http : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Define a HTTP request /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API Request { public: //////////////////////////////////////////////////////////// /// \brief Enumerate the available HTTP methods for a request /// //////////////////////////////////////////////////////////// enum Method { Get, ///< Request in get mode, standard method to retrieve a page Post, ///< Request in post mode, usually to send data to a page Head, ///< Request a page's header only Put, ///< Request in put mode, useful for a REST API Delete ///< Request in delete mode, useful for a REST API }; //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor creates a GET request, with the root /// URI ("/") and an empty body. /// /// \param uri Target URI /// \param method Method to use for the request /// \param body Content of the request's body /// //////////////////////////////////////////////////////////// Request(const std::string& uri = "/", Method method = Get, const std::string& body = ""); //////////////////////////////////////////////////////////// /// \brief Set the value of a field /// /// The field is created if it doesn't exist. The name of /// the field is case-insensitive. /// By default, a request doesn't contain any field (but the /// mandatory fields are added later by the HTTP client when /// sending the request). /// /// \param field Name of the field to set /// \param value Value of the field /// //////////////////////////////////////////////////////////// void setField(const std::string& field, const std::string& value); //////////////////////////////////////////////////////////// /// \brief Set the request method /// /// See the Method enumeration for a complete list of all /// the availale methods. /// The method is Http::Request::Get by default. /// /// \param method Method to use for the request /// //////////////////////////////////////////////////////////// void setMethod(Method method); //////////////////////////////////////////////////////////// /// \brief Set the requested URI /// /// The URI is the resource (usually a web page or a file) /// that you want to get or post. /// The URI is "/" (the root page) by default. /// /// \param uri URI to request, relative to the host /// //////////////////////////////////////////////////////////// void setUri(const std::string& uri); //////////////////////////////////////////////////////////// /// \brief Set the HTTP version for the request /// /// The HTTP version is 1.0 by default. /// /// \param major Major HTTP version number /// \param minor Minor HTTP version number /// //////////////////////////////////////////////////////////// void setHttpVersion(unsigned int major, unsigned int minor); //////////////////////////////////////////////////////////// /// \brief Set the body of the request /// /// The body of a request is optional and only makes sense /// for POST requests. It is ignored for all other methods. /// The body is empty by default. /// /// \param body Content of the body /// //////////////////////////////////////////////////////////// void setBody(const std::string& body); private: friend class Http; //////////////////////////////////////////////////////////// /// \brief Prepare the final request to send to the server /// /// This is used internally by Http before sending the /// request to the web server. /// /// \return String containing the request, ready to be sent /// //////////////////////////////////////////////////////////// std::string prepare() const; //////////////////////////////////////////////////////////// /// \brief Check if the request defines a field /// /// This function uses case-insensitive comparisons. /// /// \param field Name of the field to test /// /// \return True if the field exists, false otherwise /// //////////////////////////////////////////////////////////// bool hasField(const std::string& field) const; //////////////////////////////////////////////////////////// // Types //////////////////////////////////////////////////////////// typedef std::map FieldTable; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// FieldTable m_fields; ///< Fields of the header associated to their value Method m_method; ///< Method to use for the request std::string m_uri; ///< Target URI of the request unsigned int m_majorVersion; ///< Major HTTP version unsigned int m_minorVersion; ///< Minor HTTP version std::string m_body; ///< Body of the request }; //////////////////////////////////////////////////////////// /// \brief Define a HTTP response /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API Response { public: //////////////////////////////////////////////////////////// /// \brief Enumerate all the valid status codes for a response /// //////////////////////////////////////////////////////////// enum Status { // 2xx: success Ok = 200, ///< Most common code returned when operation was successful Created = 201, ///< The resource has successfully been created Accepted = 202, ///< The request has been accepted, but will be processed later by the server NoContent = 204, ///< The server didn't send any data in return ResetContent = 205, ///< The server informs the client that it should clear the view (form) that caused the request to be sent PartialContent = 206, ///< The server has sent a part of the resource, as a response to a partial GET request // 3xx: redirection MultipleChoices = 300, ///< The requested page can be accessed from several locations MovedPermanently = 301, ///< The requested page has permanently moved to a new location MovedTemporarily = 302, ///< The requested page has temporarily moved to a new location NotModified = 304, ///< For conditional requests, means the requested page hasn't changed and doesn't need to be refreshed // 4xx: client error BadRequest = 400, ///< The server couldn't understand the request (syntax error) Unauthorized = 401, ///< The requested page needs an authentication to be accessed Forbidden = 403, ///< The requested page cannot be accessed at all, even with authentication NotFound = 404, ///< The requested page doesn't exist RangeNotSatisfiable = 407, ///< The server can't satisfy the partial GET request (with a "Range" header field) // 5xx: server error InternalServerError = 500, ///< The server encountered an unexpected error NotImplemented = 501, ///< The server doesn't implement a requested feature BadGateway = 502, ///< The gateway server has received an error from the source server ServiceNotAvailable = 503, ///< The server is temporarily unavailable (overloaded, in maintenance, ...) GatewayTimeout = 504, ///< The gateway server couldn't receive a response from the source server VersionNotSupported = 505, ///< The server doesn't support the requested HTTP version // 10xx: SFML custom codes InvalidResponse = 1000, ///< Response is not a valid HTTP one ConnectionFailed = 1001 ///< Connection with server failed }; //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Constructs an empty response. /// //////////////////////////////////////////////////////////// Response(); //////////////////////////////////////////////////////////// /// \brief Get the value of a field /// /// If the field \a field is not found in the response header, /// the empty string is returned. This function uses /// case-insensitive comparisons. /// /// \param field Name of the field to get /// /// \return Value of the field, or empty string if not found /// //////////////////////////////////////////////////////////// const std::string& getField(const std::string& field) const; //////////////////////////////////////////////////////////// /// \brief Get the response status code /// /// The status code should be the first thing to be checked /// after receiving a response, it defines whether it is a /// success, a failure or anything else (see the Status /// enumeration). /// /// \return Status code of the response /// //////////////////////////////////////////////////////////// Status getStatus() const; //////////////////////////////////////////////////////////// /// \brief Get the major HTTP version number of the response /// /// \return Major HTTP version number /// /// \see getMinorHttpVersion /// //////////////////////////////////////////////////////////// unsigned int getMajorHttpVersion() const; //////////////////////////////////////////////////////////// /// \brief Get the minor HTTP version number of the response /// /// \return Minor HTTP version number /// /// \see getMajorHttpVersion /// //////////////////////////////////////////////////////////// unsigned int getMinorHttpVersion() const; //////////////////////////////////////////////////////////// /// \brief Get the body of the response /// /// The body of a response may contain: /// \li the requested page (for GET requests) /// \li a response from the server (for POST requests) /// \li nothing (for HEAD requests) /// \li an error message (in case of an error) /// /// \return The response body /// //////////////////////////////////////////////////////////// const std::string& getBody() const; private: friend class Http; //////////////////////////////////////////////////////////// /// \brief Construct the header from a response string /// /// This function is used by Http to build the response /// of a request. /// /// \param data Content of the response to parse /// //////////////////////////////////////////////////////////// void parse(const std::string& data); //////////////////////////////////////////////////////////// /// \brief Read values passed in the answer header /// /// This function is used by Http to extract values passed /// in the response. /// /// \param in String stream containing the header values /// //////////////////////////////////////////////////////////// void parseFields(std::istream &in); //////////////////////////////////////////////////////////// // Types //////////////////////////////////////////////////////////// typedef std::map FieldTable; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// FieldTable m_fields; ///< Fields of the header Status m_status; ///< Status code unsigned int m_majorVersion; ///< Major HTTP version unsigned int m_minorVersion; ///< Minor HTTP version std::string m_body; ///< Body of the response }; //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// Http(); //////////////////////////////////////////////////////////// /// \brief Construct the HTTP client with the target host /// /// This is equivalent to calling setHost(host, port). /// The port has a default value of 0, which means that the /// HTTP client will use the right port according to the /// protocol used (80 for HTTP). You should leave it like /// this unless you really need a port other than the /// standard one, or use an unknown protocol. /// /// \param host Web server to connect to /// \param port Port to use for connection /// //////////////////////////////////////////////////////////// Http(const std::string& host, unsigned short port = 0); //////////////////////////////////////////////////////////// /// \brief Set the target host /// /// This function just stores the host address and port, it /// doesn't actually connect to it until you send a request. /// The port has a default value of 0, which means that the /// HTTP client will use the right port according to the /// protocol used (80 for HTTP). You should leave it like /// this unless you really need a port other than the /// standard one, or use an unknown protocol. /// /// \param host Web server to connect to /// \param port Port to use for connection /// //////////////////////////////////////////////////////////// void setHost(const std::string& host, unsigned short port = 0); //////////////////////////////////////////////////////////// /// \brief Send a HTTP request and return the server's response. /// /// You must have a valid host before sending a request (see setHost). /// Any missing mandatory header field in the request will be added /// with an appropriate value. /// Warning: this function waits for the server's response and may /// not return instantly; use a thread if you don't want to block your /// application, or use a timeout to limit the time to wait. A value /// of Time::Zero means that the client will use the system default timeout /// (which is usually pretty long). /// /// \param request Request to send /// \param timeout Maximum time to wait /// /// \return Server's response /// //////////////////////////////////////////////////////////// Response sendRequest(const Request& request, Time timeout = Time::Zero); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// TcpSocket m_connection; ///< Connection to the host IpAddress m_host; ///< Web host address std::string m_hostName; ///< Web host name unsigned short m_port; ///< Port used for connection with host }; } // namespace sf #endif // SFML_HTTP_HPP //////////////////////////////////////////////////////////// /// \class sf::Http /// \ingroup network /// /// sf::Http is a very simple HTTP client that allows you /// to communicate with a web server. You can retrieve /// web pages, send data to an interactive resource, /// download a remote file, etc. The HTTPS protocol is /// not supported. /// /// The HTTP client is split into 3 classes: /// \li sf::Http::Request /// \li sf::Http::Response /// \li sf::Http /// /// sf::Http::Request builds the request that will be /// sent to the server. A request is made of: /// \li a method (what you want to do) /// \li a target URI (usually the name of the web page or file) /// \li one or more header fields (options that you can pass to the server) /// \li an optional body (for POST requests) /// /// sf::Http::Response parse the response from the web server /// and provides getters to read them. The response contains: /// \li a status code /// \li header fields (that may be answers to the ones that you requested) /// \li a body, which contains the contents of the requested resource /// /// sf::Http provides a simple function, SendRequest, to send a /// sf::Http::Request and return the corresponding sf::Http::Response /// from the server. /// /// Usage example: /// \code /// // Create a new HTTP client /// sf::Http http; /// /// // We'll work on http://www.sfml-dev.org /// http.setHost("http://www.sfml-dev.org"); /// /// // Prepare a request to get the 'features.php' page /// sf::Http::Request request("features.php"); /// /// // Send the request /// sf::Http::Response response = http.sendRequest(request); /// /// // Check the status code and display the result /// sf::Http::Response::Status status = response.getStatus(); /// if (status == sf::Http::Response::Ok) /// { /// std::cout << response.getBody() << std::endl; /// } /// else /// { /// std::cout << "Error " << status << std::endl; /// } /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/IpAddress.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_IPADDRESS_HPP #define SFML_IPADDRESS_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Encapsulate an IPv4 network address /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API IpAddress { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor creates an empty (invalid) address /// //////////////////////////////////////////////////////////// IpAddress(); //////////////////////////////////////////////////////////// /// \brief Construct the address from a string /// /// Here \a address can be either a decimal address /// (ex: "192.168.1.56") or a network name (ex: "localhost"). /// /// \param address IP address or network name /// //////////////////////////////////////////////////////////// IpAddress(const std::string& address); //////////////////////////////////////////////////////////// /// \brief Construct the address from a string /// /// Here \a address can be either a decimal address /// (ex: "192.168.1.56") or a network name (ex: "localhost"). /// This is equivalent to the constructor taking a std::string /// parameter, it is defined for convenience so that the /// implicit conversions from literal strings to IpAddress work. /// /// \param address IP address or network name /// //////////////////////////////////////////////////////////// IpAddress(const char* address); //////////////////////////////////////////////////////////// /// \brief Construct the address from 4 bytes /// /// Calling IpAddress(a, b, c, d) is equivalent to calling /// IpAddress("a.b.c.d"), but safer as it doesn't have to /// parse a string to get the address components. /// /// \param byte0 First byte of the address /// \param byte1 Second byte of the address /// \param byte2 Third byte of the address /// \param byte3 Fourth byte of the address /// //////////////////////////////////////////////////////////// IpAddress(Uint8 byte0, Uint8 byte1, Uint8 byte2, Uint8 byte3); //////////////////////////////////////////////////////////// /// \brief Construct the address from a 32-bits integer /// /// This constructor uses the internal representation of /// the address directly. It should be used for optimization /// purposes, and only if you got that representation from /// IpAddress::toInteger(). /// /// \param address 4 bytes of the address packed into a 32-bits integer /// /// \see toInteger /// //////////////////////////////////////////////////////////// explicit IpAddress(Uint32 address); //////////////////////////////////////////////////////////// /// \brief Get a string representation of the address /// /// The returned string is the decimal representation of the /// IP address (like "192.168.1.56"), even if it was constructed /// from a host name. /// /// \return String representation of the address /// /// \see toInteger /// //////////////////////////////////////////////////////////// std::string toString() const; //////////////////////////////////////////////////////////// /// \brief Get an integer representation of the address /// /// The returned number is the internal representation of the /// address, and should be used for optimization purposes only /// (like sending the address through a socket). /// The integer produced by this function can then be converted /// back to a sf::IpAddress with the proper constructor. /// /// \return 32-bits unsigned integer representation of the address /// /// \see toString /// //////////////////////////////////////////////////////////// Uint32 toInteger() const; //////////////////////////////////////////////////////////// /// \brief Get the computer's local address /// /// The local address is the address of the computer from the /// LAN point of view, i.e. something like 192.168.1.56. It is /// meaningful only for communications over the local network. /// Unlike getPublicAddress, this function is fast and may be /// used safely anywhere. /// /// \return Local IP address of the computer /// /// \see getPublicAddress /// //////////////////////////////////////////////////////////// static IpAddress getLocalAddress(); //////////////////////////////////////////////////////////// /// \brief Get the computer's public address /// /// The public address is the address of the computer from the /// internet point of view, i.e. something like 89.54.1.169. /// It is necessary for communications over the world wide web. /// The only way to get a public address is to ask it to a /// distant website; as a consequence, this function depends on /// both your network connection and the server, and may be /// very slow. You should use it as few as possible. Because /// this function depends on the network connection and on a distant /// server, you may use a time limit if you don't want your program /// to be possibly stuck waiting in case there is a problem; this /// limit is deactivated by default. /// /// \param timeout Maximum time to wait /// /// \return Public IP address of the computer /// /// \see getLocalAddress /// //////////////////////////////////////////////////////////// static IpAddress getPublicAddress(Time timeout = Time::Zero); //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// static const IpAddress None; ///< Value representing an empty/invalid address static const IpAddress Any; ///< Value representing any address (0.0.0.0) static const IpAddress LocalHost; ///< The "localhost" address (for connecting a computer to itself locally) static const IpAddress Broadcast; ///< The "broadcast" address (for sending UDP messages to everyone on a local network) private: friend SFML_NETWORK_API bool operator <(const IpAddress& left, const IpAddress& right); //////////////////////////////////////////////////////////// /// \brief Resolve the given address string /// /// \param address Address string /// //////////////////////////////////////////////////////////// void resolve(const std::string& address); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Uint32 m_address; ///< Address stored as an unsigned 32 bits integer bool m_valid; ///< Is the address valid? }; //////////////////////////////////////////////////////////// /// \brief Overload of == operator to compare two IP addresses /// /// \param left Left operand (a IP address) /// \param right Right operand (a IP address) /// /// \return True if both addresses are equal /// //////////////////////////////////////////////////////////// SFML_NETWORK_API bool operator ==(const IpAddress& left, const IpAddress& right); //////////////////////////////////////////////////////////// /// \brief Overload of != operator to compare two IP addresses /// /// \param left Left operand (a IP address) /// \param right Right operand (a IP address) /// /// \return True if both addresses are different /// //////////////////////////////////////////////////////////// SFML_NETWORK_API bool operator !=(const IpAddress& left, const IpAddress& right); //////////////////////////////////////////////////////////// /// \brief Overload of < operator to compare two IP addresses /// /// \param left Left operand (a IP address) /// \param right Right operand (a IP address) /// /// \return True if \a left is lesser than \a right /// //////////////////////////////////////////////////////////// SFML_NETWORK_API bool operator <(const IpAddress& left, const IpAddress& right); //////////////////////////////////////////////////////////// /// \brief Overload of > operator to compare two IP addresses /// /// \param left Left operand (a IP address) /// \param right Right operand (a IP address) /// /// \return True if \a left is greater than \a right /// //////////////////////////////////////////////////////////// SFML_NETWORK_API bool operator >(const IpAddress& left, const IpAddress& right); //////////////////////////////////////////////////////////// /// \brief Overload of <= operator to compare two IP addresses /// /// \param left Left operand (a IP address) /// \param right Right operand (a IP address) /// /// \return True if \a left is lesser or equal than \a right /// //////////////////////////////////////////////////////////// SFML_NETWORK_API bool operator <=(const IpAddress& left, const IpAddress& right); //////////////////////////////////////////////////////////// /// \brief Overload of >= operator to compare two IP addresses /// /// \param left Left operand (a IP address) /// \param right Right operand (a IP address) /// /// \return True if \a left is greater or equal than \a right /// //////////////////////////////////////////////////////////// SFML_NETWORK_API bool operator >=(const IpAddress& left, const IpAddress& right); //////////////////////////////////////////////////////////// /// \brief Overload of >> operator to extract an IP address from an input stream /// /// \param stream Input stream /// \param address IP address to extract /// /// \return Reference to the input stream /// //////////////////////////////////////////////////////////// SFML_NETWORK_API std::istream& operator >>(std::istream& stream, IpAddress& address); //////////////////////////////////////////////////////////// /// \brief Overload of << operator to print an IP address to an output stream /// /// \param stream Output stream /// \param address IP address to print /// /// \return Reference to the output stream /// //////////////////////////////////////////////////////////// SFML_NETWORK_API std::ostream& operator <<(std::ostream& stream, const IpAddress& address); } // namespace sf #endif // SFML_IPADDRESS_HPP //////////////////////////////////////////////////////////// /// \class sf::IpAddress /// \ingroup network /// /// sf::IpAddress is a utility class for manipulating network /// addresses. It provides a set a implicit constructors and /// conversion functions to easily build or transform an IP /// address from/to various representations. /// /// Usage example: /// \code /// sf::IpAddress a0; // an invalid address /// sf::IpAddress a1 = sf::IpAddress::None; // an invalid address (same as a0) /// sf::IpAddress a2("127.0.0.1"); // the local host address /// sf::IpAddress a3 = sf::IpAddress::Broadcast; // the broadcast address /// sf::IpAddress a4(192, 168, 1, 56); // a local address /// sf::IpAddress a5("my_computer"); // a local address created from a network name /// sf::IpAddress a6("89.54.1.169"); // a distant address /// sf::IpAddress a7("www.google.com"); // a distant address created from a network name /// sf::IpAddress a8 = sf::IpAddress::getLocalAddress(); // my address on the local network /// sf::IpAddress a9 = sf::IpAddress::getPublicAddress(); // my address on the internet /// \endcode /// /// Note that sf::IpAddress currently doesn't support IPv6 /// nor other types of network addresses. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/Packet.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_PACKET_HPP #define SFML_PACKET_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { class String; class TcpSocket; class UdpSocket; //////////////////////////////////////////////////////////// /// \brief Utility class to build blocks of data to transfer /// over the network /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API Packet { // A bool-like type that cannot be converted to integer or pointer types typedef bool (Packet::*BoolType)(std::size_t); public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates an empty packet. /// //////////////////////////////////////////////////////////// Packet(); //////////////////////////////////////////////////////////// /// \brief Virtual destructor /// //////////////////////////////////////////////////////////// virtual ~Packet(); //////////////////////////////////////////////////////////// /// \brief Append data to the end of the packet /// /// \param data Pointer to the sequence of bytes to append /// \param sizeInBytes Number of bytes to append /// /// \see clear /// //////////////////////////////////////////////////////////// void append(const void* data, std::size_t sizeInBytes); //////////////////////////////////////////////////////////// /// \brief Clear the packet /// /// After calling Clear, the packet is empty. /// /// \see append /// //////////////////////////////////////////////////////////// void clear(); //////////////////////////////////////////////////////////// /// \brief Get a pointer to the data contained in the packet /// /// Warning: the returned pointer may become invalid after /// you append data to the packet, therefore it should never /// be stored. /// The return pointer is NULL if the packet is empty. /// /// \return Pointer to the data /// /// \see getDataSize /// //////////////////////////////////////////////////////////// const void* getData() const; //////////////////////////////////////////////////////////// /// \brief Get the size of the data contained in the packet /// /// This function returns the number of bytes pointed to by /// what getData returns. /// /// \return Data size, in bytes /// /// \see getData /// //////////////////////////////////////////////////////////// std::size_t getDataSize() const; //////////////////////////////////////////////////////////// /// \brief Tell if the reading position has reached the /// end of the packet /// /// This function is useful to know if there is some data /// left to be read, without actually reading it. /// /// \return True if all data was read, false otherwise /// /// \see operator bool /// //////////////////////////////////////////////////////////// bool endOfPacket() const; public: //////////////////////////////////////////////////////////// /// \brief Test the validity of the packet, for reading /// /// This operator allows to test the packet as a boolean /// variable, to check if a reading operation was successful. /// /// A packet will be in an invalid state if it has no more /// data to read. /// /// This behavior is the same as standard C++ streams. /// /// Usage example: /// \code /// float x; /// packet >> x; /// if (packet) /// { /// // ok, x was extracted successfully /// } /// /// // -- or -- /// /// float x; /// if (packet >> x) /// { /// // ok, x was extracted successfully /// } /// \endcode /// /// Don't focus on the return type, it's equivalent to bool but /// it disallows unwanted implicit conversions to integer or /// pointer types. /// /// \return True if last data extraction from packet was successful /// /// \see endOfPacket /// //////////////////////////////////////////////////////////// operator BoolType() const; //////////////////////////////////////////////////////////// /// Overloads of operator >> to read data from the packet /// //////////////////////////////////////////////////////////// Packet& operator >>(bool& data); Packet& operator >>(Int8& data); Packet& operator >>(Uint8& data); Packet& operator >>(Int16& data); Packet& operator >>(Uint16& data); Packet& operator >>(Int32& data); Packet& operator >>(Uint32& data); Packet& operator >>(Int64& data); Packet& operator >>(Uint64& data); Packet& operator >>(float& data); Packet& operator >>(double& data); Packet& operator >>(char* data); Packet& operator >>(std::string& data); Packet& operator >>(wchar_t* data); Packet& operator >>(std::wstring& data); Packet& operator >>(String& data); //////////////////////////////////////////////////////////// /// Overloads of operator << to write data into the packet /// //////////////////////////////////////////////////////////// Packet& operator <<(bool data); Packet& operator <<(Int8 data); Packet& operator <<(Uint8 data); Packet& operator <<(Int16 data); Packet& operator <<(Uint16 data); Packet& operator <<(Int32 data); Packet& operator <<(Uint32 data); Packet& operator <<(Int64 data); Packet& operator <<(Uint64 data); Packet& operator <<(float data); Packet& operator <<(double data); Packet& operator <<(const char* data); Packet& operator <<(const std::string& data); Packet& operator <<(const wchar_t* data); Packet& operator <<(const std::wstring& data); Packet& operator <<(const String& data); protected: friend class TcpSocket; friend class UdpSocket; //////////////////////////////////////////////////////////// /// \brief Called before the packet is sent over the network /// /// This function can be defined by derived classes to /// transform the data before it is sent; this can be /// used for compression, encryption, etc. /// The function must return a pointer to the modified data, /// as well as the number of bytes pointed. /// The default implementation provides the packet's data /// without transforming it. /// /// \param size Variable to fill with the size of data to send /// /// \return Pointer to the array of bytes to send /// /// \see onReceive /// //////////////////////////////////////////////////////////// virtual const void* onSend(std::size_t& size); //////////////////////////////////////////////////////////// /// \brief Called after the packet is received over the network /// /// This function can be defined by derived classes to /// transform the data after it is received; this can be /// used for decompression, decryption, etc. /// The function receives a pointer to the received data, /// and must fill the packet with the transformed bytes. /// The default implementation fills the packet directly /// without transforming the data. /// /// \param data Pointer to the received bytes /// \param size Number of bytes /// /// \see onSend /// //////////////////////////////////////////////////////////// virtual void onReceive(const void* data, std::size_t size); private: //////////////////////////////////////////////////////////// /// Disallow comparisons between packets /// //////////////////////////////////////////////////////////// bool operator ==(const Packet& right) const; bool operator !=(const Packet& right) const; //////////////////////////////////////////////////////////// /// \brief Check if the packet can extract a given number of bytes /// /// This function updates accordingly the state of the packet. /// /// \param size Size to check /// /// \return True if \a size bytes can be read from the packet /// //////////////////////////////////////////////////////////// bool checkSize(std::size_t size); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// std::vector m_data; ///< Data stored in the packet std::size_t m_readPos; ///< Current reading position in the packet std::size_t m_sendPos; ///< Current send position in the packet (for handling partial sends) bool m_isValid; ///< Reading state of the packet }; } // namespace sf #endif // SFML_PACKET_HPP //////////////////////////////////////////////////////////// /// \class sf::Packet /// \ingroup network /// /// Packets provide a safe and easy way to serialize data, /// in order to send it over the network using sockets /// (sf::TcpSocket, sf::UdpSocket). /// /// Packets solve 2 fundamental problems that arise when /// transferring data over the network: /// \li data is interpreted correctly according to the endianness /// \li the bounds of the packet are preserved (one send == one receive) /// /// The sf::Packet class provides both input and output modes. /// It is designed to follow the behavior of standard C++ streams, /// using operators >> and << to extract and insert data. /// /// It is recommended to use only fixed-size types (like sf::Int32, etc.), /// to avoid possible differences between the sender and the receiver. /// Indeed, the native C++ types may have different sizes on two platforms /// and your data may be corrupted if that happens. /// /// Usage example: /// \code /// sf::Uint32 x = 24; /// std::string s = "hello"; /// double d = 5.89; /// /// // Group the variables to send into a packet /// sf::Packet packet; /// packet << x << s << d; /// /// // Send it over the network (socket is a valid sf::TcpSocket) /// socket.send(packet); /// /// ----------------------------------------------------------------- /// /// // Receive the packet at the other end /// sf::Packet packet; /// socket.receive(packet); /// /// // Extract the variables contained in the packet /// sf::Uint32 x; /// std::string s; /// double d; /// if (packet >> x >> s >> d) /// { /// // Data extracted successfully... /// } /// \endcode /// /// Packets have built-in operator >> and << overloads for /// standard types: /// \li bool /// \li fixed-size integer types (sf::Int8/16/32, sf::Uint8/16/32) /// \li floating point numbers (float, double) /// \li string types (char*, wchar_t*, std::string, std::wstring, sf::String) /// /// Like standard streams, it is also possible to define your own /// overloads of operators >> and << in order to handle your /// custom types. /// /// \code /// struct MyStruct /// { /// float number; /// sf::Int8 integer; /// std::string str; /// }; /// /// sf::Packet& operator <<(sf::Packet& packet, const MyStruct& m) /// { /// return packet << m.number << m.integer << m.str; /// } /// /// sf::Packet& operator >>(sf::Packet& packet, MyStruct& m) /// { /// return packet >> m.number >> m.integer >> m.str; /// } /// \endcode /// /// Packets also provide an extra feature that allows to apply /// custom transformations to the data before it is sent, /// and after it is received. This is typically used to /// handle automatic compression or encryption of the data. /// This is achieved by inheriting from sf::Packet, and overriding /// the onSend and onReceive functions. /// /// Here is an example: /// \code /// class ZipPacket : public sf::Packet /// { /// virtual const void* onSend(std::size_t& size) /// { /// const void* srcData = getData(); /// std::size_t srcSize = getDataSize(); /// /// return MySuperZipFunction(srcData, srcSize, &size); /// } /// /// virtual void onReceive(const void* data, std::size_t size) /// { /// std::size_t dstSize; /// const void* dstData = MySuperUnzipFunction(data, size, &dstSize); /// /// append(dstData, dstSize); /// } /// }; /// /// // Use like regular packets: /// ZipPacket packet; /// packet << x << s << d; /// ... /// \endcode /// /// \see sf::TcpSocket, sf::UdpSocket /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/Socket.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOCKET_HPP #define SFML_SOCKET_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include namespace sf { class SocketSelector; //////////////////////////////////////////////////////////// /// \brief Base class for all the socket types /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API Socket : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Status codes that may be returned by socket functions /// //////////////////////////////////////////////////////////// enum Status { Done, ///< The socket has sent / received the data NotReady, ///< The socket is not ready to send / receive data yet Partial, ///< The socket sent a part of the data Disconnected, ///< The TCP socket has been disconnected Error ///< An unexpected error happened }; //////////////////////////////////////////////////////////// /// \brief Some special values used by sockets /// //////////////////////////////////////////////////////////// enum { AnyPort = 0 ///< Special value that tells the system to pick any available port }; public: //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// virtual ~Socket(); //////////////////////////////////////////////////////////// /// \brief Set the blocking state of the socket /// /// In blocking mode, calls will not return until they have /// completed their task. For example, a call to Receive in /// blocking mode won't return until some data was actually /// received. /// In non-blocking mode, calls will always return immediately, /// using the return code to signal whether there was data /// available or not. /// By default, all sockets are blocking. /// /// \param blocking True to set the socket as blocking, false for non-blocking /// /// \see isBlocking /// //////////////////////////////////////////////////////////// void setBlocking(bool blocking); //////////////////////////////////////////////////////////// /// \brief Tell whether the socket is in blocking or non-blocking mode /// /// \return True if the socket is blocking, false otherwise /// /// \see setBlocking /// //////////////////////////////////////////////////////////// bool isBlocking() const; protected: //////////////////////////////////////////////////////////// /// \brief Types of protocols that the socket can use /// //////////////////////////////////////////////////////////// enum Type { Tcp, ///< TCP protocol Udp ///< UDP protocol }; //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor can only be accessed by derived classes. /// /// \param type Type of the socket (TCP or UDP) /// //////////////////////////////////////////////////////////// Socket(Type type); //////////////////////////////////////////////////////////// /// \brief Return the internal handle of the socket /// /// The returned handle may be invalid if the socket /// was not created yet (or already destroyed). /// This function can only be accessed by derived classes. /// /// \return The internal (OS-specific) handle of the socket /// //////////////////////////////////////////////////////////// SocketHandle getHandle() const; //////////////////////////////////////////////////////////// /// \brief Create the internal representation of the socket /// /// This function can only be accessed by derived classes. /// //////////////////////////////////////////////////////////// void create(); //////////////////////////////////////////////////////////// /// \brief Create the internal representation of the socket /// from a socket handle /// /// This function can only be accessed by derived classes. /// /// \param handle OS-specific handle of the socket to wrap /// //////////////////////////////////////////////////////////// void create(SocketHandle handle); //////////////////////////////////////////////////////////// /// \brief Close the socket gracefully /// /// This function can only be accessed by derived classes. /// //////////////////////////////////////////////////////////// void close(); private: friend class SocketSelector; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Type m_type; ///< Type of the socket (TCP or UDP) SocketHandle m_socket; ///< Socket descriptor bool m_isBlocking; ///< Current blocking mode of the socket }; } // namespace sf #endif // SFML_SOCKET_HPP //////////////////////////////////////////////////////////// /// \class sf::Socket /// \ingroup network /// /// This class mainly defines internal stuff to be used by /// derived classes. /// /// The only public features that it defines, and which /// is therefore common to all the socket classes, is the /// blocking state. All sockets can be set as blocking or /// non-blocking. /// /// In blocking mode, socket functions will hang until /// the operation completes, which means that the entire /// program (well, in fact the current thread if you use /// multiple ones) will be stuck waiting for your socket /// operation to complete. /// /// In non-blocking mode, all the socket functions will /// return immediately. If the socket is not ready to complete /// the requested operation, the function simply returns /// the proper status code (Socket::NotReady). /// /// The default mode, which is blocking, is the one that is /// generally used, in combination with threads or selectors. /// The non-blocking mode is rather used in real-time /// applications that run an endless loop that can poll /// the socket often enough, and cannot afford blocking /// this loop. /// /// \see sf::TcpListener, sf::TcpSocket, sf::UdpSocket /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/SocketHandle.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOCKETHANDLE_HPP #define SFML_SOCKETHANDLE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #if defined(SFML_SYSTEM_WINDOWS) #include #endif namespace sf { //////////////////////////////////////////////////////////// // Define the low-level socket handle type, specific to // each platform //////////////////////////////////////////////////////////// #if defined(SFML_SYSTEM_WINDOWS) typedef UINT_PTR SocketHandle; #else typedef int SocketHandle; #endif } // namespace sf #endif // SFML_SOCKETHANDLE_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/SocketSelector.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SOCKETSELECTOR_HPP #define SFML_SOCKETSELECTOR_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { class Socket; //////////////////////////////////////////////////////////// /// \brief Multiplexer that allows to read from multiple sockets /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API SocketSelector { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// SocketSelector(); //////////////////////////////////////////////////////////// /// \brief Copy constructor /// /// \param copy Instance to copy /// //////////////////////////////////////////////////////////// SocketSelector(const SocketSelector& copy); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~SocketSelector(); //////////////////////////////////////////////////////////// /// \brief Add a new socket to the selector /// /// This function keeps a weak reference to the socket, /// so you have to make sure that the socket is not destroyed /// while it is stored in the selector. /// This function does nothing if the socket is not valid. /// /// \param socket Reference to the socket to add /// /// \see remove, clear /// //////////////////////////////////////////////////////////// void add(Socket& socket); //////////////////////////////////////////////////////////// /// \brief Remove a socket from the selector /// /// This function doesn't destroy the socket, it simply /// removes the reference that the selector has to it. /// /// \param socket Reference to the socket to remove /// /// \see add, clear /// //////////////////////////////////////////////////////////// void remove(Socket& socket); //////////////////////////////////////////////////////////// /// \brief Remove all the sockets stored in the selector /// /// This function doesn't destroy any instance, it simply /// removes all the references that the selector has to /// external sockets. /// /// \see add, remove /// //////////////////////////////////////////////////////////// void clear(); //////////////////////////////////////////////////////////// /// \brief Wait until one or more sockets are ready to receive /// /// This function returns as soon as at least one socket has /// some data available to be received. To know which sockets are /// ready, use the isReady function. /// If you use a timeout and no socket is ready before the timeout /// is over, the function returns false. /// /// \param timeout Maximum time to wait, (use Time::Zero for infinity) /// /// \return True if there are sockets ready, false otherwise /// /// \see isReady /// //////////////////////////////////////////////////////////// bool wait(Time timeout = Time::Zero); //////////////////////////////////////////////////////////// /// \brief Test a socket to know if it is ready to receive data /// /// This function must be used after a call to Wait, to know /// which sockets are ready to receive data. If a socket is /// ready, a call to receive will never block because we know /// that there is data available to read. /// Note that if this function returns true for a TcpListener, /// this means that it is ready to accept a new connection. /// /// \param socket Socket to test /// /// \return True if the socket is ready to read, false otherwise /// /// \see isReady /// //////////////////////////////////////////////////////////// bool isReady(Socket& socket) const; //////////////////////////////////////////////////////////// /// \brief Overload of assignment operator /// /// \param right Instance to assign /// /// \return Reference to self /// //////////////////////////////////////////////////////////// SocketSelector& operator =(const SocketSelector& right); private: struct SocketSelectorImpl; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// SocketSelectorImpl* m_impl; ///< Opaque pointer to the implementation (which requires OS-specific types) }; } // namespace sf #endif // SFML_SOCKETSELECTOR_HPP //////////////////////////////////////////////////////////// /// \class sf::SocketSelector /// \ingroup network /// /// Socket selectors provide a way to wait until some data is /// available on a set of sockets, instead of just one. This /// is convenient when you have multiple sockets that may /// possibly receive data, but you don't know which one will /// be ready first. In particular, it avoids to use a thread /// for each socket; with selectors, a single thread can handle /// all the sockets. /// /// All types of sockets can be used in a selector: /// \li sf::TcpListener /// \li sf::TcpSocket /// \li sf::UdpSocket /// /// A selector doesn't store its own copies of the sockets /// (socket classes are not copyable anyway), it simply keeps /// a reference to the original sockets that you pass to the /// "add" function. Therefore, you can't use the selector as a /// socket container, you must store them outside and make sure /// that they are alive as long as they are used in the selector. /// /// Using a selector is simple: /// \li populate the selector with all the sockets that you want to observe /// \li make it wait until there is data available on any of the sockets /// \li test each socket to find out which ones are ready /// /// Usage example: /// \code /// // Create a socket to listen to new connections /// sf::TcpListener listener; /// listener.listen(55001); /// /// // Create a list to store the future clients /// std::list clients; /// /// // Create a selector /// sf::SocketSelector selector; /// /// // Add the listener to the selector /// selector.add(listener); /// /// // Endless loop that waits for new connections /// while (running) /// { /// // Make the selector wait for data on any socket /// if (selector.wait()) /// { /// // Test the listener /// if (selector.isReady(listener)) /// { /// // The listener is ready: there is a pending connection /// sf::TcpSocket* client = new sf::TcpSocket; /// if (listener.accept(*client) == sf::Socket::Done) /// { /// // Add the new client to the clients list /// clients.push_back(client); /// /// // Add the new client to the selector so that we will /// // be notified when he sends something /// selector.add(*client); /// } /// else /// { /// // Error, we won't get a new connection, delete the socket /// delete client; /// } /// } /// else /// { /// // The listener socket is not ready, test all other sockets (the clients) /// for (std::list::iterator it = clients.begin(); it != clients.end(); ++it) /// { /// sf::TcpSocket& client = **it; /// if (selector.isReady(client)) /// { /// // The client has sent some data, we can receive it /// sf::Packet packet; /// if (client.receive(packet) == sf::Socket::Done) /// { /// ... /// } /// } /// } /// } /// } /// } /// \endcode /// /// \see sf::Socket /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/TcpListener.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_TCPLISTENER_HPP #define SFML_TCPLISTENER_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { class TcpSocket; //////////////////////////////////////////////////////////// /// \brief Socket that listens to new TCP connections /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API TcpListener : public Socket { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// TcpListener(); //////////////////////////////////////////////////////////// /// \brief Get the port to which the socket is bound locally /// /// If the socket is not listening to a port, this function /// returns 0. /// /// \return Port to which the socket is bound /// /// \see listen /// //////////////////////////////////////////////////////////// unsigned short getLocalPort() const; //////////////////////////////////////////////////////////// /// \brief Start listening for connections /// /// This functions makes the socket listen to the specified /// port, waiting for new connections. /// If the socket was previously listening to another port, /// it will be stopped first and bound to the new port. /// /// \param port Port to listen for new connections /// \param address Address of the interface to listen on /// /// \return Status code /// /// \see accept, close /// //////////////////////////////////////////////////////////// Status listen(unsigned short port, const IpAddress& address = IpAddress::Any); //////////////////////////////////////////////////////////// /// \brief Stop listening and close the socket /// /// This function gracefully stops the listener. If the /// socket is not listening, this function has no effect. /// /// \see listen /// //////////////////////////////////////////////////////////// void close(); //////////////////////////////////////////////////////////// /// \brief Accept a new connection /// /// If the socket is in blocking mode, this function will /// not return until a connection is actually received. /// /// \param socket Socket that will hold the new connection /// /// \return Status code /// /// \see listen /// //////////////////////////////////////////////////////////// Status accept(TcpSocket& socket); }; } // namespace sf #endif // SFML_TCPLISTENER_HPP //////////////////////////////////////////////////////////// /// \class sf::TcpListener /// \ingroup network /// /// A listener socket is a special type of socket that listens to /// a given port and waits for connections on that port. /// This is all it can do. /// /// When a new connection is received, you must call accept and /// the listener returns a new instance of sf::TcpSocket that /// is properly initialized and can be used to communicate with /// the new client. /// /// Listener sockets are specific to the TCP protocol, /// UDP sockets are connectionless and can therefore communicate /// directly. As a consequence, a listener socket will always /// return the new connections as sf::TcpSocket instances. /// /// A listener is automatically closed on destruction, like all /// other types of socket. However if you want to stop listening /// before the socket is destroyed, you can call its close() /// function. /// /// Usage example: /// \code /// // Create a listener socket and make it wait for new /// // connections on port 55001 /// sf::TcpListener listener; /// listener.listen(55001); /// /// // Endless loop that waits for new connections /// while (running) /// { /// sf::TcpSocket client; /// if (listener.accept(client) == sf::Socket::Done) /// { /// // A new client just connected! /// std::cout << "New connection received from " << client.getRemoteAddress() << std::endl; /// doSomethingWith(client); /// } /// } /// \endcode /// /// \see sf::TcpSocket, sf::Socket /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/TcpSocket.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_TCPSOCKET_HPP #define SFML_TCPSOCKET_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { class TcpListener; class IpAddress; class Packet; //////////////////////////////////////////////////////////// /// \brief Specialized socket using the TCP protocol /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API TcpSocket : public Socket { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// TcpSocket(); //////////////////////////////////////////////////////////// /// \brief Get the port to which the socket is bound locally /// /// If the socket is not connected, this function returns 0. /// /// \return Port to which the socket is bound /// /// \see connect, getRemotePort /// //////////////////////////////////////////////////////////// unsigned short getLocalPort() const; //////////////////////////////////////////////////////////// /// \brief Get the address of the connected peer /// /// It the socket is not connected, this function returns /// sf::IpAddress::None. /// /// \return Address of the remote peer /// /// \see getRemotePort /// //////////////////////////////////////////////////////////// IpAddress getRemoteAddress() const; //////////////////////////////////////////////////////////// /// \brief Get the port of the connected peer to which /// the socket is connected /// /// If the socket is not connected, this function returns 0. /// /// \return Remote port to which the socket is connected /// /// \see getRemoteAddress /// //////////////////////////////////////////////////////////// unsigned short getRemotePort() const; //////////////////////////////////////////////////////////// /// \brief Connect the socket to a remote peer /// /// In blocking mode, this function may take a while, especially /// if the remote peer is not reachable. The last parameter allows /// you to stop trying to connect after a given timeout. /// If the socket was previously connected, it is first disconnected. /// /// \param remoteAddress Address of the remote peer /// \param remotePort Port of the remote peer /// \param timeout Optional maximum time to wait /// /// \return Status code /// /// \see disconnect /// //////////////////////////////////////////////////////////// Status connect(const IpAddress& remoteAddress, unsigned short remotePort, Time timeout = Time::Zero); //////////////////////////////////////////////////////////// /// \brief Disconnect the socket from its remote peer /// /// This function gracefully closes the connection. If the /// socket is not connected, this function has no effect. /// /// \see connect /// //////////////////////////////////////////////////////////// void disconnect(); //////////////////////////////////////////////////////////// /// \brief Send raw data to the remote peer /// /// To be able to handle partial sends over non-blocking /// sockets, use the send(const void*, std::size_t, std::size_t&) /// overload instead. /// This function will fail if the socket is not connected. /// /// \param data Pointer to the sequence of bytes to send /// \param size Number of bytes to send /// /// \return Status code /// /// \see receive /// //////////////////////////////////////////////////////////// Status send(const void* data, std::size_t size); //////////////////////////////////////////////////////////// /// \brief Send raw data to the remote peer /// /// This function will fail if the socket is not connected. /// /// \param data Pointer to the sequence of bytes to send /// \param size Number of bytes to send /// \param sent The number of bytes sent will be written here /// /// \return Status code /// /// \see receive /// //////////////////////////////////////////////////////////// Status send(const void* data, std::size_t size, std::size_t& sent); //////////////////////////////////////////////////////////// /// \brief Receive raw data from the remote peer /// /// In blocking mode, this function will wait until some /// bytes are actually received. /// This function will fail if the socket is not connected. /// /// \param data Pointer to the array to fill with the received bytes /// \param size Maximum number of bytes that can be received /// \param received This variable is filled with the actual number of bytes received /// /// \return Status code /// /// \see send /// //////////////////////////////////////////////////////////// Status receive(void* data, std::size_t size, std::size_t& received); //////////////////////////////////////////////////////////// /// \brief Send a formatted packet of data to the remote peer /// /// In non-blocking mode, if this function returns sf::Socket::Partial, /// you \em must retry sending the same unmodified packet before sending /// anything else in order to guarantee the packet arrives at the remote /// peer uncorrupted. /// This function will fail if the socket is not connected. /// /// \param packet Packet to send /// /// \return Status code /// /// \see receive /// //////////////////////////////////////////////////////////// Status send(Packet& packet); //////////////////////////////////////////////////////////// /// \brief Receive a formatted packet of data from the remote peer /// /// In blocking mode, this function will wait until the whole packet /// has been received. /// This function will fail if the socket is not connected. /// /// \param packet Packet to fill with the received data /// /// \return Status code /// /// \see send /// //////////////////////////////////////////////////////////// Status receive(Packet& packet); private: friend class TcpListener; //////////////////////////////////////////////////////////// /// \brief Structure holding the data of a pending packet /// //////////////////////////////////////////////////////////// struct PendingPacket { PendingPacket(); Uint32 Size; ///< Data of packet size std::size_t SizeReceived; ///< Number of size bytes received so far std::vector Data; ///< Data of the packet }; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// PendingPacket m_pendingPacket; ///< Temporary data of the packet currently being received }; } // namespace sf #endif // SFML_TCPSOCKET_HPP //////////////////////////////////////////////////////////// /// \class sf::TcpSocket /// \ingroup network /// /// TCP is a connected protocol, which means that a TCP /// socket can only communicate with the host it is connected /// to. It can't send or receive anything if it is not connected. /// /// The TCP protocol is reliable but adds a slight overhead. /// It ensures that your data will always be received in order /// and without errors (no data corrupted, lost or duplicated). /// /// When a socket is connected to a remote host, you can /// retrieve informations about this host with the /// getRemoteAddress and getRemotePort functions. You can /// also get the local port to which the socket is bound /// (which is automatically chosen when the socket is connected), /// with the getLocalPort function. /// /// Sending and receiving data can use either the low-level /// or the high-level functions. The low-level functions /// process a raw sequence of bytes, and cannot ensure that /// one call to Send will exactly match one call to Receive /// at the other end of the socket. /// /// The high-level interface uses packets (see sf::Packet), /// which are easier to use and provide more safety regarding /// the data that is exchanged. You can look at the sf::Packet /// class to get more details about how they work. /// /// The socket is automatically disconnected when it is destroyed, /// but if you want to explicitly close the connection while /// the socket instance is still alive, you can call disconnect. /// /// Usage example: /// \code /// // ----- The client ----- /// /// // Create a socket and connect it to 192.168.1.50 on port 55001 /// sf::TcpSocket socket; /// socket.connect("192.168.1.50", 55001); /// /// // Send a message to the connected host /// std::string message = "Hi, I am a client"; /// socket.send(message.c_str(), message.size() + 1); /// /// // Receive an answer from the server /// char buffer[1024]; /// std::size_t received = 0; /// socket.receive(buffer, sizeof(buffer), received); /// std::cout << "The server said: " << buffer << std::endl; /// /// // ----- The server ----- /// /// // Create a listener to wait for incoming connections on port 55001 /// sf::TcpListener listener; /// listener.listen(55001); /// /// // Wait for a connection /// sf::TcpSocket socket; /// listener.accept(socket); /// std::cout << "New client connected: " << socket.getRemoteAddress() << std::endl; /// /// // Receive a message from the client /// char buffer[1024]; /// std::size_t received = 0; /// socket.receive(buffer, sizeof(buffer), received); /// std::cout << "The client said: " << buffer << std::endl; /// /// // Send an answer /// std::string message = "Welcome, client"; /// socket.send(message.c_str(), message.size() + 1); /// \endcode /// /// \see sf::Socket, sf::UdpSocket, sf::Packet /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network/UdpSocket.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_UDPSOCKET_HPP #define SFML_UDPSOCKET_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include namespace sf { class Packet; //////////////////////////////////////////////////////////// /// \brief Specialized socket using the UDP protocol /// //////////////////////////////////////////////////////////// class SFML_NETWORK_API UdpSocket : public Socket { public: //////////////////////////////////////////////////////////// // Constants //////////////////////////////////////////////////////////// enum { MaxDatagramSize = 65507 ///< The maximum number of bytes that can be sent in a single UDP datagram }; //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// UdpSocket(); //////////////////////////////////////////////////////////// /// \brief Get the port to which the socket is bound locally /// /// If the socket is not bound to a port, this function /// returns 0. /// /// \return Port to which the socket is bound /// /// \see bind /// //////////////////////////////////////////////////////////// unsigned short getLocalPort() const; //////////////////////////////////////////////////////////// /// \brief Bind the socket to a specific port /// /// Binding the socket to a port is necessary for being /// able to receive data on that port. /// You can use the special value Socket::AnyPort to tell the /// system to automatically pick an available port, and then /// call getLocalPort to retrieve the chosen port. /// /// \param port Port to bind the socket to /// \param address Address of the interface to bind to /// /// \return Status code /// /// \see unbind, getLocalPort /// //////////////////////////////////////////////////////////// Status bind(unsigned short port, const IpAddress& address = IpAddress::Any); //////////////////////////////////////////////////////////// /// \brief Unbind the socket from the local port to which it is bound /// /// The port that the socket was previously bound to is immediately /// made available to the operating system after this function is called. /// This means that a subsequent call to bind() will be able to re-bind /// the port if no other process has done so in the mean time. /// If the socket is not bound to a port, this function has no effect. /// /// \see bind /// //////////////////////////////////////////////////////////// void unbind(); //////////////////////////////////////////////////////////// /// \brief Send raw data to a remote peer /// /// Make sure that \a size is not greater than /// UdpSocket::MaxDatagramSize, otherwise this function will /// fail and no data will be sent. /// /// \param data Pointer to the sequence of bytes to send /// \param size Number of bytes to send /// \param remoteAddress Address of the receiver /// \param remotePort Port of the receiver to send the data to /// /// \return Status code /// /// \see receive /// //////////////////////////////////////////////////////////// Status send(const void* data, std::size_t size, const IpAddress& remoteAddress, unsigned short remotePort); //////////////////////////////////////////////////////////// /// \brief Receive raw data from a remote peer /// /// In blocking mode, this function will wait until some /// bytes are actually received. /// Be careful to use a buffer which is large enough for /// the data that you intend to receive, if it is too small /// then an error will be returned and *all* the data will /// be lost. /// /// \param data Pointer to the array to fill with the received bytes /// \param size Maximum number of bytes that can be received /// \param received This variable is filled with the actual number of bytes received /// \param remoteAddress Address of the peer that sent the data /// \param remotePort Port of the peer that sent the data /// /// \return Status code /// /// \see send /// //////////////////////////////////////////////////////////// Status receive(void* data, std::size_t size, std::size_t& received, IpAddress& remoteAddress, unsigned short& remotePort); //////////////////////////////////////////////////////////// /// \brief Send a formatted packet of data to a remote peer /// /// Make sure that the packet size is not greater than /// UdpSocket::MaxDatagramSize, otherwise this function will /// fail and no data will be sent. /// /// \param packet Packet to send /// \param remoteAddress Address of the receiver /// \param remotePort Port of the receiver to send the data to /// /// \return Status code /// /// \see receive /// //////////////////////////////////////////////////////////// Status send(Packet& packet, const IpAddress& remoteAddress, unsigned short remotePort); //////////////////////////////////////////////////////////// /// \brief Receive a formatted packet of data from a remote peer /// /// In blocking mode, this function will wait until the whole packet /// has been received. /// /// \param packet Packet to fill with the received data /// \param remoteAddress Address of the peer that sent the data /// \param remotePort Port of the peer that sent the data /// /// \return Status code /// /// \see send /// //////////////////////////////////////////////////////////// Status receive(Packet& packet, IpAddress& remoteAddress, unsigned short& remotePort); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// std::vector m_buffer; ///< Temporary buffer holding the received data in Receive(Packet) }; } // namespace sf #endif // SFML_UDPSOCKET_HPP //////////////////////////////////////////////////////////// /// \class sf::UdpSocket /// \ingroup network /// /// A UDP socket is a connectionless socket. Instead of /// connecting once to a remote host, like TCP sockets, /// it can send to and receive from any host at any time. /// /// It is a datagram protocol: bounded blocks of data (datagrams) /// are transfered over the network rather than a continuous /// stream of data (TCP). Therefore, one call to send will always /// match one call to receive (if the datagram is not lost), /// with the same data that was sent. /// /// The UDP protocol is lightweight but unreliable. Unreliable /// means that datagrams may be duplicated, be lost or /// arrive reordered. However, if a datagram arrives, its /// data is guaranteed to be valid. /// /// UDP is generally used for real-time communication /// (audio or video streaming, real-time games, etc.) where /// speed is crucial and lost data doesn't matter much. /// /// Sending and receiving data can use either the low-level /// or the high-level functions. The low-level functions /// process a raw sequence of bytes, whereas the high-level /// interface uses packets (see sf::Packet), which are easier /// to use and provide more safety regarding the data that is /// exchanged. You can look at the sf::Packet class to get /// more details about how they work. /// /// It is important to note that UdpSocket is unable to send /// datagrams bigger than MaxDatagramSize. In this case, it /// returns an error and doesn't send anything. This applies /// to both raw data and packets. Indeed, even packets are /// unable to split and recompose data, due to the unreliability /// of the protocol (dropped, mixed or duplicated datagrams may /// lead to a big mess when trying to recompose a packet). /// /// If the socket is bound to a port, it is automatically /// unbound from it when the socket is destroyed. However, /// you can unbind the socket explicitly with the Unbind /// function if necessary, to stop receiving messages or /// make the port available for other sockets. /// /// Usage example: /// \code /// // ----- The client ----- /// /// // Create a socket and bind it to the port 55001 /// sf::UdpSocket socket; /// socket.bind(55001); /// /// // Send a message to 192.168.1.50 on port 55002 /// std::string message = "Hi, I am " + sf::IpAddress::getLocalAddress().toString(); /// socket.send(message.c_str(), message.size() + 1, "192.168.1.50", 55002); /// /// // Receive an answer (most likely from 192.168.1.50, but could be anyone else) /// char buffer[1024]; /// std::size_t received = 0; /// sf::IpAddress sender; /// unsigned short port; /// socket.receive(buffer, sizeof(buffer), received, sender, port); /// std::cout << sender.ToString() << " said: " << buffer << std::endl; /// /// // ----- The server ----- /// /// // Create a socket and bind it to the port 55002 /// sf::UdpSocket socket; /// socket.bind(55002); /// /// // Receive a message from anyone /// char buffer[1024]; /// std::size_t received = 0; /// sf::IpAddress sender; /// unsigned short port; /// socket.receive(buffer, sizeof(buffer), received, sender, port); /// std::cout << sender.ToString() << " said: " << buffer << std::endl; /// /// // Send an answer /// std::string message = "Welcome " + sender.toString(); /// socket.send(message.c_str(), message.size() + 1, sender, port); /// \endcode /// /// \see sf::Socket, sf::TcpSocket, sf::Packet /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Network.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_NETWORK_HPP #define SFML_NETWORK_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #endif // SFML_NETWORK_HPP //////////////////////////////////////////////////////////// /// \defgroup network Network module /// /// Socket-based communication, utilities and higher-level /// network protocols (HTTP, FTP). /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/OpenGL.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_OPENGL_HPP #define SFML_OPENGL_HPP //////////////////////////////////////////////////////////// /// Headers //////////////////////////////////////////////////////////// #include //////////////////////////////////////////////////////////// /// This file just includes the OpenGL headers, /// which have actually different paths on each system //////////////////////////////////////////////////////////// #if defined(SFML_SYSTEM_WINDOWS) // The Visual C++ version of gl.h uses WINGDIAPI and APIENTRY but doesn't define them #ifdef _MSC_VER #include #endif #include #elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD) #if defined(SFML_OPENGL_ES) #include #include #else #include #endif #elif defined(SFML_SYSTEM_MACOS) #include #elif defined (SFML_SYSTEM_IOS) #include #include #elif defined (SFML_SYSTEM_ANDROID) #include #include // We're not using OpenGL ES 2+ yet, but we can use the sRGB extension #include #endif #endif // SFML_OPENGL_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Clock.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_CLOCK_HPP #define SFML_CLOCK_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Utility class that measures the elapsed time /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API Clock { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// The clock starts automatically after being constructed. /// //////////////////////////////////////////////////////////// Clock(); //////////////////////////////////////////////////////////// /// \brief Get the elapsed time /// /// This function returns the time elapsed since the last call /// to restart() (or the construction of the instance if restart() /// has not been called). /// /// \return Time elapsed /// //////////////////////////////////////////////////////////// Time getElapsedTime() const; //////////////////////////////////////////////////////////// /// \brief Restart the clock /// /// This function puts the time counter back to zero. /// It also returns the time elapsed since the clock was started. /// /// \return Time elapsed /// //////////////////////////////////////////////////////////// Time restart(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Time m_startTime; ///< Time of last reset, in microseconds }; } // namespace sf #endif // SFML_CLOCK_HPP //////////////////////////////////////////////////////////// /// \class sf::Clock /// \ingroup system /// /// sf::Clock is a lightweight class for measuring time. /// /// Its provides the most precise time that the underlying /// OS can achieve (generally microseconds or nanoseconds). /// It also ensures monotonicity, which means that the returned /// time can never go backward, even if the system time is /// changed. /// /// Usage example: /// \code /// sf::Clock clock; /// ... /// Time time1 = clock.getElapsedTime(); /// ... /// Time time2 = clock.restart(); /// \endcode /// /// The sf::Time value returned by the clock can then be /// converted to a number of seconds, milliseconds or even /// microseconds. /// /// \see sf::Time /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Err.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_ERR_HPP #define SFML_ERR_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Standard stream used by SFML to output warnings and errors /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API std::ostream& err(); } // namespace sf #endif // SFML_ERR_HPP //////////////////////////////////////////////////////////// /// \fn sf::err /// \ingroup system /// /// By default, sf::err() outputs to the same location as std::cerr, /// (-> the stderr descriptor) which is the console if there's /// one available. /// /// It is a standard std::ostream instance, so it supports all the /// insertion operations defined by the STL /// (operator <<, manipulators, etc.). /// /// sf::err() can be redirected to write to another output, independently /// of std::cerr, by using the rdbuf() function provided by the /// std::ostream class. /// /// Example: /// \code /// // Redirect to a file /// std::ofstream file("sfml-log.txt"); /// std::streambuf* previous = sf::err().rdbuf(file.rdbuf()); /// /// // Redirect to nothing /// sf::err().rdbuf(NULL); /// /// // Restore the original output /// sf::err().rdbuf(previous); /// \endcode /// /// \return Reference to std::ostream representing the SFML error stream /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Export.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SYSTEM_EXPORT_HPP #define SFML_SYSTEM_EXPORT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include //////////////////////////////////////////////////////////// // Define portable import / export macros //////////////////////////////////////////////////////////// #if defined(SFML_SYSTEM_EXPORTS) #define SFML_SYSTEM_API SFML_API_EXPORT #else #define SFML_SYSTEM_API SFML_API_IMPORT #endif #endif // SFML_SYSTEM_EXPORT_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/FileInputStream.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_FILEINPUTSTREAM_HPP #define SFML_FILEINPUTSTREAM_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #ifdef ANDROID namespace sf { namespace priv { class SFML_SYSTEM_API ResourceStream; } } #endif namespace sf { //////////////////////////////////////////////////////////// /// \brief Implementation of input stream based on a file /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API FileInputStream : public InputStream, NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// FileInputStream(); //////////////////////////////////////////////////////////// /// \brief Default destructor /// //////////////////////////////////////////////////////////// virtual ~FileInputStream(); //////////////////////////////////////////////////////////// /// \brief Open the stream from a file path /// /// \param filename Name of the file to open /// /// \return True on success, false on error /// //////////////////////////////////////////////////////////// bool open(const std::string& filename); //////////////////////////////////////////////////////////// /// \brief Read data from the stream /// /// After reading, the stream's reading position must be /// advanced by the amount of bytes read. /// /// \param data Buffer where to copy the read data /// \param size Desired number of bytes to read /// /// \return The number of bytes actually read, or -1 on error /// //////////////////////////////////////////////////////////// virtual Int64 read(void* data, Int64 size); //////////////////////////////////////////////////////////// /// \brief Change the current reading position /// /// \param position The position to seek to, from the beginning /// /// \return The position actually sought to, or -1 on error /// //////////////////////////////////////////////////////////// virtual Int64 seek(Int64 position); //////////////////////////////////////////////////////////// /// \brief Get the current reading position in the stream /// /// \return The current position, or -1 on error. /// //////////////////////////////////////////////////////////// virtual Int64 tell(); //////////////////////////////////////////////////////////// /// \brief Return the size of the stream /// /// \return The total number of bytes available in the stream, or -1 on error /// //////////////////////////////////////////////////////////// virtual Int64 getSize(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// #ifdef ANDROID priv::ResourceStream* m_file; #else std::FILE* m_file; ///< stdio file stream #endif }; } // namespace sf #endif // SFML_FILEINPUTSTREAM_HPP //////////////////////////////////////////////////////////// /// \class sf::FileInputStream /// \ingroup system /// /// This class is a specialization of InputStream that /// reads from a file on disk. /// /// It wraps a file in the common InputStream interface /// and therefore allows to use generic classes or functions /// that accept such a stream, with a file on disk as the data /// source. /// /// In addition to the virtual functions inherited from /// InputStream, FileInputStream adds a function to /// specify the file to open. /// /// SFML resource classes can usually be loaded directly from /// a filename, so this class shouldn't be useful to you unless /// you create your own algorithms that operate on an InputStream. /// /// Usage example: /// \code /// void process(InputStream& stream); /// /// FileInputStream stream; /// if (stream.open("some_file.dat")) /// process(stream); /// \endcode /// /// InputStream, MemoryInputStream /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/InputStream.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_INPUTSTREAM_HPP #define SFML_INPUTSTREAM_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Abstract class for custom file input streams /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API InputStream { public: //////////////////////////////////////////////////////////// /// \brief Virtual destructor /// //////////////////////////////////////////////////////////// virtual ~InputStream() {} //////////////////////////////////////////////////////////// /// \brief Read data from the stream /// /// After reading, the stream's reading position must be /// advanced by the amount of bytes read. /// /// \param data Buffer where to copy the read data /// \param size Desired number of bytes to read /// /// \return The number of bytes actually read, or -1 on error /// //////////////////////////////////////////////////////////// virtual Int64 read(void* data, Int64 size) = 0; //////////////////////////////////////////////////////////// /// \brief Change the current reading position /// /// \param position The position to seek to, from the beginning /// /// \return The position actually sought to, or -1 on error /// //////////////////////////////////////////////////////////// virtual Int64 seek(Int64 position) = 0; //////////////////////////////////////////////////////////// /// \brief Get the current reading position in the stream /// /// \return The current position, or -1 on error. /// //////////////////////////////////////////////////////////// virtual Int64 tell() = 0; //////////////////////////////////////////////////////////// /// \brief Return the size of the stream /// /// \return The total number of bytes available in the stream, or -1 on error /// //////////////////////////////////////////////////////////// virtual Int64 getSize() = 0; }; } // namespace sf #endif // SFML_INPUTSTREAM_HPP //////////////////////////////////////////////////////////// /// \class sf::InputStream /// \ingroup system /// /// This class allows users to define their own file input sources /// from which SFML can load resources. /// /// SFML resource classes like sf::Texture and /// sf::SoundBuffer provide loadFromFile and loadFromMemory functions, /// which read data from conventional sources. However, if you /// have data coming from a different source (over a network, /// embedded, encrypted, compressed, etc) you can derive your /// own class from sf::InputStream and load SFML resources with /// their loadFromStream function. /// /// Usage example: /// \code /// // custom stream class that reads from inside a zip file /// class ZipStream : public sf::InputStream /// { /// public: /// /// ZipStream(std::string archive); /// /// bool open(std::string filename); /// /// Int64 read(void* data, Int64 size); /// /// Int64 seek(Int64 position); /// /// Int64 tell(); /// /// Int64 getSize(); /// /// private: /// /// ... /// }; /// /// // now you can load textures... /// sf::Texture texture; /// ZipStream stream("resources.zip"); /// stream.open("images/img.png"); /// texture.loadFromStream(stream); /// /// // musics... /// sf::Music music; /// ZipStream stream("resources.zip"); /// stream.open("musics/msc.ogg"); /// music.openFromStream(stream); /// /// // etc. /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Lock.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_LOCK_HPP #define SFML_LOCK_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { class Mutex; //////////////////////////////////////////////////////////// /// \brief Automatic wrapper for locking and unlocking mutexes /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API Lock : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Construct the lock with a target mutex /// /// The mutex passed to sf::Lock is automatically locked. /// /// \param mutex Mutex to lock /// //////////////////////////////////////////////////////////// explicit Lock(Mutex& mutex); //////////////////////////////////////////////////////////// /// \brief Destructor /// /// The destructor of sf::Lock automatically unlocks its mutex. /// //////////////////////////////////////////////////////////// ~Lock(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Mutex& m_mutex; ///< Mutex to lock / unlock }; } // namespace sf #endif // SFML_LOCK_HPP //////////////////////////////////////////////////////////// /// \class sf::Lock /// \ingroup system /// /// sf::Lock is a RAII wrapper for sf::Mutex. By unlocking /// it in its destructor, it ensures that the mutex will /// always be released when the current scope (most likely /// a function) ends. /// This is even more important when an exception or an early /// return statement can interrupt the execution flow of the /// function. /// /// For maximum robustness, sf::Lock should always be used /// to lock/unlock a mutex. /// /// Usage example: /// \code /// sf::Mutex mutex; /// /// void function() /// { /// sf::Lock lock(mutex); // mutex is now locked /// /// functionThatMayThrowAnException(); // mutex is unlocked if this function throws /// /// if (someCondition) /// return; // mutex is unlocked /// /// } // mutex is unlocked /// \endcode /// /// Because the mutex is not explicitly unlocked in the code, /// it may remain locked longer than needed. If the region /// of the code that needs to be protected by the mutex is /// not the entire function, a good practice is to create a /// smaller, inner scope so that the lock is limited to this /// part of the code. /// /// \code /// sf::Mutex mutex; /// /// void function() /// { /// { /// sf::Lock lock(mutex); /// codeThatRequiresProtection(); /// /// } // mutex is unlocked here /// /// codeThatDoesntCareAboutTheMutex(); /// } /// \endcode /// /// Having a mutex locked longer than required is a bad practice /// which can lead to bad performances. Don't forget that when /// a mutex is locked, other threads may be waiting doing nothing /// until it is released. /// /// \see sf::Mutex /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/MemoryInputStream.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_MEMORYINPUTSTREAM_HPP #define SFML_MEMORYINPUTSTREAM_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Implementation of input stream based on a memory chunk /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API MemoryInputStream : public InputStream { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// MemoryInputStream(); //////////////////////////////////////////////////////////// /// \brief Open the stream from its data /// /// \param data Pointer to the data in memory /// \param sizeInBytes Size of the data, in bytes /// //////////////////////////////////////////////////////////// void open(const void* data, std::size_t sizeInBytes); //////////////////////////////////////////////////////////// /// \brief Read data from the stream /// /// After reading, the stream's reading position must be /// advanced by the amount of bytes read. /// /// \param data Buffer where to copy the read data /// \param size Desired number of bytes to read /// /// \return The number of bytes actually read, or -1 on error /// //////////////////////////////////////////////////////////// virtual Int64 read(void* data, Int64 size); //////////////////////////////////////////////////////////// /// \brief Change the current reading position /// /// \param position The position to seek to, from the beginning /// /// \return The position actually sought to, or -1 on error /// //////////////////////////////////////////////////////////// virtual Int64 seek(Int64 position); //////////////////////////////////////////////////////////// /// \brief Get the current reading position in the stream /// /// \return The current position, or -1 on error. /// //////////////////////////////////////////////////////////// virtual Int64 tell(); //////////////////////////////////////////////////////////// /// \brief Return the size of the stream /// /// \return The total number of bytes available in the stream, or -1 on error /// //////////////////////////////////////////////////////////// virtual Int64 getSize(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// const char* m_data; ///< Pointer to the data in memory Int64 m_size; ///< Total size of the data Int64 m_offset; ///< Current reading position }; } // namespace sf #endif // SFML_MEMORYINPUTSTREAM_HPP //////////////////////////////////////////////////////////// /// \class sf::MemoryInputStream /// \ingroup system /// /// This class is a specialization of InputStream that /// reads from data in memory. /// /// It wraps a memory chunk in the common InputStream interface /// and therefore allows to use generic classes or functions /// that accept such a stream, with content already loaded in memory. /// /// In addition to the virtual functions inherited from /// InputStream, MemoryInputStream adds a function to /// specify the pointer and size of the data in memory. /// /// SFML resource classes can usually be loaded directly from /// memory, so this class shouldn't be useful to you unless /// you create your own algorithms that operate on an InputStream. /// /// Usage example: /// \code /// void process(InputStream& stream); /// /// MemoryInputStream stream; /// stream.open(thePtr, theSize); /// process(stream); /// \endcode /// /// InputStream, FileInputStream /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Mutex.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_MUTEX_HPP #define SFML_MUTEX_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { namespace priv { class MutexImpl; } //////////////////////////////////////////////////////////// /// \brief Blocks concurrent access to shared resources /// from multiple threads /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API Mutex : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// Mutex(); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~Mutex(); //////////////////////////////////////////////////////////// /// \brief Lock the mutex /// /// If the mutex is already locked in another thread, /// this call will block the execution until the mutex /// is released. /// /// \see unlock /// //////////////////////////////////////////////////////////// void lock(); //////////////////////////////////////////////////////////// /// \brief Unlock the mutex /// /// \see lock /// //////////////////////////////////////////////////////////// void unlock(); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// priv::MutexImpl* m_mutexImpl; ///< OS-specific implementation }; } // namespace sf #endif // SFML_MUTEX_HPP //////////////////////////////////////////////////////////// /// \class sf::Mutex /// \ingroup system /// /// Mutex stands for "MUTual EXclusion". A mutex is a /// synchronization object, used when multiple threads are involved. /// /// When you want to protect a part of the code from being accessed /// simultaneously by multiple threads, you typically use a /// mutex. When a thread is locked by a mutex, any other thread /// trying to lock it will be blocked until the mutex is released /// by the thread that locked it. This way, you can allow only /// one thread at a time to access a critical region of your code. /// /// Usage example: /// \code /// Database database; // this is a critical resource that needs some protection /// sf::Mutex mutex; /// /// void thread1() /// { /// mutex.lock(); // this call will block the thread if the mutex is already locked by thread2 /// database.write(...); /// mutex.unlock(); // if thread2 was waiting, it will now be unblocked /// } /// /// void thread2() /// { /// mutex.lock(); // this call will block the thread if the mutex is already locked by thread1 /// database.write(...); /// mutex.unlock(); // if thread1 was waiting, it will now be unblocked /// } /// \endcode /// /// Be very careful with mutexes. A bad usage can lead to bad problems, /// like deadlocks (two threads are waiting for each other and the /// application is globally stuck). /// /// To make the usage of mutexes more robust, particularly in /// environments where exceptions can be thrown, you should /// use the helper class sf::Lock to lock/unlock mutexes. /// /// SFML mutexes are recursive, which means that you can lock /// a mutex multiple times in the same thread without creating /// a deadlock. In this case, the first call to lock() behaves /// as usual, and the following ones have no effect. /// However, you must call unlock() exactly as many times as you /// called lock(). If you don't, the mutex won't be released. /// /// \see sf::Lock /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/NativeActivity.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_NATIVEACTIVITY_HPP #define SFML_NATIVEACTIVITY_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #if !defined(SFML_SYSTEM_ANDROID) #error NativeActivity.hpp: This header is Android only. #endif struct ANativeActivity; namespace sf { //////////////////////////////////////////////////////////// /// \ingroup system /// \brief Return a pointer to the Android native activity /// /// You shouldn't have to use this function, unless you want /// to implement very specific details, that SFML doesn't /// support, or to use a workaround for a known issue. /// /// \return Pointer to Android native activity structure /// /// \sfplatform{Android,SFML/System/NativeActivity.hpp} /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API ANativeActivity* getNativeActivity(); } // namespace sf #endif // SFML_NATIVEACTIVITY_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/NonCopyable.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_NONCOPYABLE_HPP #define SFML_NONCOPYABLE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Utility class that makes any derived /// class non-copyable /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API NonCopyable { protected: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Because this class has a copy constructor, the compiler /// will not automatically generate the default constructor. /// That's why we must define it explicitly. /// //////////////////////////////////////////////////////////// NonCopyable() {} private: //////////////////////////////////////////////////////////// /// \brief Disabled copy constructor /// /// By making the copy constructor private, the compiler will /// trigger an error if anyone outside tries to use it. /// To prevent NonCopyable or friend classes from using it, /// we also give no definition, so that the linker will /// produce an error if the first protection was inefficient. /// //////////////////////////////////////////////////////////// NonCopyable(const NonCopyable&); //////////////////////////////////////////////////////////// /// \brief Disabled assignment operator /// /// By making the assignment operator private, the compiler will /// trigger an error if anyone outside tries to use it. /// To prevent NonCopyable or friend classes from using it, /// we also give no definition, so that the linker will /// produce an error if the first protection was inefficient. /// //////////////////////////////////////////////////////////// NonCopyable& operator =(const NonCopyable&); }; } // namespace sf #endif // SFML_NONCOPYABLE_HPP //////////////////////////////////////////////////////////// /// \class sf::NonCopyable /// \ingroup system /// /// This class makes its instances non-copyable, by explicitly /// disabling its copy constructor and its assignment operator. /// /// To create a non-copyable class, simply inherit from /// sf::NonCopyable. /// /// The type of inheritance (public or private) doesn't matter, /// the copy constructor and assignment operator are declared private /// in sf::NonCopyable so they will end up being inaccessible in both /// cases. Thus you can use a shorter syntax for inheriting from it /// (see below). /// /// Usage example: /// \code /// class MyNonCopyableClass : sf::NonCopyable /// { /// ... /// }; /// \endcode /// /// Deciding whether the instances of a class can be copied /// or not is a very important design choice. You are strongly /// encouraged to think about it before writing a class, /// and to use sf::NonCopyable when necessary to prevent /// many potential future errors when using it. This is also /// a very important indication to users of your class. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Sleep.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SLEEP_HPP #define SFML_SLEEP_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \ingroup system /// \brief Make the current thread sleep for a given duration /// /// sf::sleep is the best way to block a program or one of its /// threads, as it doesn't consume any CPU power. /// /// \param duration Time to sleep /// //////////////////////////////////////////////////////////// void SFML_SYSTEM_API sleep(Time duration); } // namespace sf #endif // SFML_SLEEP_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/String.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_STRING_HPP #define SFML_STRING_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Utility string class that automatically handles /// conversions between types and encodings /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API String { public: //////////////////////////////////////////////////////////// // Types //////////////////////////////////////////////////////////// typedef std::basic_string::iterator Iterator; ///< Iterator type typedef std::basic_string::const_iterator ConstIterator; ///< Read-only iterator type //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// static const std::size_t InvalidPos; ///< Represents an invalid position in the string //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor creates an empty string. /// //////////////////////////////////////////////////////////// String(); //////////////////////////////////////////////////////////// /// \brief Construct from a single ANSI character and a locale /// /// The source character is converted to UTF-32 according /// to the given locale. /// /// \param ansiChar ANSI character to convert /// \param locale Locale to use for conversion /// //////////////////////////////////////////////////////////// String(char ansiChar, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Construct from single wide character /// /// \param wideChar Wide character to convert /// //////////////////////////////////////////////////////////// String(wchar_t wideChar); //////////////////////////////////////////////////////////// /// \brief Construct from single UTF-32 character /// /// \param utf32Char UTF-32 character to convert /// //////////////////////////////////////////////////////////// String(Uint32 utf32Char); //////////////////////////////////////////////////////////// /// \brief Construct from a null-terminated C-style ANSI string and a locale /// /// The source string is converted to UTF-32 according /// to the given locale. /// /// \param ansiString ANSI string to convert /// \param locale Locale to use for conversion /// //////////////////////////////////////////////////////////// String(const char* ansiString, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Construct from an ANSI string and a locale /// /// The source string is converted to UTF-32 according /// to the given locale. /// /// \param ansiString ANSI string to convert /// \param locale Locale to use for conversion /// //////////////////////////////////////////////////////////// String(const std::string& ansiString, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Construct from null-terminated C-style wide string /// /// \param wideString Wide string to convert /// //////////////////////////////////////////////////////////// String(const wchar_t* wideString); //////////////////////////////////////////////////////////// /// \brief Construct from a wide string /// /// \param wideString Wide string to convert /// //////////////////////////////////////////////////////////// String(const std::wstring& wideString); //////////////////////////////////////////////////////////// /// \brief Construct from a null-terminated C-style UTF-32 string /// /// \param utf32String UTF-32 string to assign /// //////////////////////////////////////////////////////////// String(const Uint32* utf32String); //////////////////////////////////////////////////////////// /// \brief Construct from an UTF-32 string /// /// \param utf32String UTF-32 string to assign /// //////////////////////////////////////////////////////////// String(const std::basic_string& utf32String); //////////////////////////////////////////////////////////// /// \brief Copy constructor /// /// \param copy Instance to copy /// //////////////////////////////////////////////////////////// String(const String& copy); //////////////////////////////////////////////////////////// /// \brief Create a new sf::String from a UTF-8 encoded string /// /// \param begin Forward iterator to the beginning of the UTF-8 sequence /// \param end Forward iterator to the end of the UTF-8 sequence /// /// \return A sf::String containing the source string /// /// \see fromUtf16, fromUtf32 /// //////////////////////////////////////////////////////////// template static String fromUtf8(T begin, T end); //////////////////////////////////////////////////////////// /// \brief Create a new sf::String from a UTF-16 encoded string /// /// \param begin Forward iterator to the beginning of the UTF-16 sequence /// \param end Forward iterator to the end of the UTF-16 sequence /// /// \return A sf::String containing the source string /// /// \see fromUtf8, fromUtf32 /// //////////////////////////////////////////////////////////// template static String fromUtf16(T begin, T end); //////////////////////////////////////////////////////////// /// \brief Create a new sf::String from a UTF-32 encoded string /// /// This function is provided for consistency, it is equivalent to /// using the constructors that takes a const sf::Uint32* or /// a std::basic_string. /// /// \param begin Forward iterator to the beginning of the UTF-32 sequence /// \param end Forward iterator to the end of the UTF-32 sequence /// /// \return A sf::String containing the source string /// /// \see fromUtf8, fromUtf16 /// //////////////////////////////////////////////////////////// template static String fromUtf32(T begin, T end); //////////////////////////////////////////////////////////// /// \brief Implicit conversion operator to std::string (ANSI string) /// /// The current global locale is used for conversion. If you /// want to explicitly specify a locale, see toAnsiString. /// Characters that do not fit in the target encoding are /// discarded from the returned string. /// This operator is defined for convenience, and is equivalent /// to calling toAnsiString(). /// /// \return Converted ANSI string /// /// \see toAnsiString, operator std::wstring /// //////////////////////////////////////////////////////////// operator std::string() const; //////////////////////////////////////////////////////////// /// \brief Implicit conversion operator to std::wstring (wide string) /// /// Characters that do not fit in the target encoding are /// discarded from the returned string. /// This operator is defined for convenience, and is equivalent /// to calling toWideString(). /// /// \return Converted wide string /// /// \see toWideString, operator std::string /// //////////////////////////////////////////////////////////// operator std::wstring() const; //////////////////////////////////////////////////////////// /// \brief Convert the Unicode string to an ANSI string /// /// The UTF-32 string is converted to an ANSI string in /// the encoding defined by \a locale. /// Characters that do not fit in the target encoding are /// discarded from the returned string. /// /// \param locale Locale to use for conversion /// /// \return Converted ANSI string /// /// \see toWideString, operator std::string /// //////////////////////////////////////////////////////////// std::string toAnsiString(const std::locale& locale = std::locale()) const; //////////////////////////////////////////////////////////// /// \brief Convert the Unicode string to a wide string /// /// Characters that do not fit in the target encoding are /// discarded from the returned string. /// /// \return Converted wide string /// /// \see toAnsiString, operator std::wstring /// //////////////////////////////////////////////////////////// std::wstring toWideString() const; //////////////////////////////////////////////////////////// /// \brief Convert the Unicode string to a UTF-8 string /// /// \return Converted UTF-8 string /// /// \see toUtf16, toUtf32 /// //////////////////////////////////////////////////////////// std::basic_string toUtf8() const; //////////////////////////////////////////////////////////// /// \brief Convert the Unicode string to a UTF-16 string /// /// \return Converted UTF-16 string /// /// \see toUtf8, toUtf32 /// //////////////////////////////////////////////////////////// std::basic_string toUtf16() const; //////////////////////////////////////////////////////////// /// \brief Convert the Unicode string to a UTF-32 string /// /// This function doesn't perform any conversion, since the /// string is already stored as UTF-32 internally. /// /// \return Converted UTF-32 string /// /// \see toUtf8, toUtf16 /// //////////////////////////////////////////////////////////// std::basic_string toUtf32() const; //////////////////////////////////////////////////////////// /// \brief Overload of assignment operator /// /// \param right Instance to assign /// /// \return Reference to self /// //////////////////////////////////////////////////////////// String& operator =(const String& right); //////////////////////////////////////////////////////////// /// \brief Overload of += operator to append an UTF-32 string /// /// \param right String to append /// /// \return Reference to self /// //////////////////////////////////////////////////////////// String& operator +=(const String& right); //////////////////////////////////////////////////////////// /// \brief Overload of [] operator to access a character by its position /// /// This function provides read-only access to characters. /// Note: the behavior is undefined if \a index is out of range. /// /// \param index Index of the character to get /// /// \return Character at position \a index /// //////////////////////////////////////////////////////////// Uint32 operator [](std::size_t index) const; //////////////////////////////////////////////////////////// /// \brief Overload of [] operator to access a character by its position /// /// This function provides read and write access to characters. /// Note: the behavior is undefined if \a index is out of range. /// /// \param index Index of the character to get /// /// \return Reference to the character at position \a index /// //////////////////////////////////////////////////////////// Uint32& operator [](std::size_t index); //////////////////////////////////////////////////////////// /// \brief Clear the string /// /// This function removes all the characters from the string. /// /// \see isEmpty, erase /// //////////////////////////////////////////////////////////// void clear(); //////////////////////////////////////////////////////////// /// \brief Get the size of the string /// /// \return Number of characters in the string /// /// \see isEmpty /// //////////////////////////////////////////////////////////// std::size_t getSize() const; //////////////////////////////////////////////////////////// /// \brief Check whether the string is empty or not /// /// \return True if the string is empty (i.e. contains no character) /// /// \see clear, getSize /// //////////////////////////////////////////////////////////// bool isEmpty() const; //////////////////////////////////////////////////////////// /// \brief Erase one or more characters from the string /// /// This function removes a sequence of \a count characters /// starting from \a position. /// /// \param position Position of the first character to erase /// \param count Number of characters to erase /// //////////////////////////////////////////////////////////// void erase(std::size_t position, std::size_t count = 1); //////////////////////////////////////////////////////////// /// \brief Insert one or more characters into the string /// /// This function inserts the characters of \a str /// into the string, starting from \a position. /// /// \param position Position of insertion /// \param str Characters to insert /// //////////////////////////////////////////////////////////// void insert(std::size_t position, const String& str); //////////////////////////////////////////////////////////// /// \brief Find a sequence of one or more characters in the string /// /// This function searches for the characters of \a str /// in the string, starting from \a start. /// /// \param str Characters to find /// \param start Where to begin searching /// /// \return Position of \a str in the string, or String::InvalidPos if not found /// //////////////////////////////////////////////////////////// std::size_t find(const String& str, std::size_t start = 0) const; //////////////////////////////////////////////////////////// /// \brief Replace a substring with another string /// /// This function replaces the substring that starts at index \a position /// and spans \a length characters with the string \a replaceWith. /// /// \param position Index of the first character to be replaced /// \param length Number of characters to replace. You can pass InvalidPos to /// replace all characters until the end of the string. /// \param replaceWith String that replaces the given substring. /// //////////////////////////////////////////////////////////// void replace(std::size_t position, std::size_t length, const String& replaceWith); //////////////////////////////////////////////////////////// /// \brief Replace all occurrences of a substring with a replacement string /// /// This function replaces all occurrences of \a searchFor in this string /// with the string \a replaceWith. /// /// \param searchFor The value being searched for /// \param replaceWith The value that replaces found \a searchFor values /// //////////////////////////////////////////////////////////// void replace(const String& searchFor, const String& replaceWith); //////////////////////////////////////////////////////////// /// \brief Return a part of the string /// /// This function returns the substring that starts at index \a position /// and spans \a length characters. /// /// \param position Index of the first character /// \param length Number of characters to include in the substring (if /// the string is shorter, as many characters as possible /// are included). \ref InvalidPos can be used to include all /// characters until the end of the string. /// /// \return String object containing a substring of this object /// //////////////////////////////////////////////////////////// String substring(std::size_t position, std::size_t length = InvalidPos) const; //////////////////////////////////////////////////////////// /// \brief Get a pointer to the C-style array of characters /// /// This functions provides a read-only access to a /// null-terminated C-style representation of the string. /// The returned pointer is temporary and is meant only for /// immediate use, thus it is not recommended to store it. /// /// \return Read-only pointer to the array of characters /// //////////////////////////////////////////////////////////// const Uint32* getData() const; //////////////////////////////////////////////////////////// /// \brief Return an iterator to the beginning of the string /// /// \return Read-write iterator to the beginning of the string characters /// /// \see end /// //////////////////////////////////////////////////////////// Iterator begin(); //////////////////////////////////////////////////////////// /// \brief Return an iterator to the beginning of the string /// /// \return Read-only iterator to the beginning of the string characters /// /// \see end /// //////////////////////////////////////////////////////////// ConstIterator begin() const; //////////////////////////////////////////////////////////// /// \brief Return an iterator to the end of the string /// /// The end iterator refers to 1 position past the last character; /// thus it represents an invalid character and should never be /// accessed. /// /// \return Read-write iterator to the end of the string characters /// /// \see begin /// //////////////////////////////////////////////////////////// Iterator end(); //////////////////////////////////////////////////////////// /// \brief Return an iterator to the end of the string /// /// The end iterator refers to 1 position past the last character; /// thus it represents an invalid character and should never be /// accessed. /// /// \return Read-only iterator to the end of the string characters /// /// \see begin /// //////////////////////////////////////////////////////////// ConstIterator end() const; private: friend SFML_SYSTEM_API bool operator ==(const String& left, const String& right); friend SFML_SYSTEM_API bool operator <(const String& left, const String& right); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// std::basic_string m_string; ///< Internal string of UTF-32 characters }; //////////////////////////////////////////////////////////// /// \relates String /// \brief Overload of == operator to compare two UTF-32 strings /// /// \param left Left operand (a string) /// \param right Right operand (a string) /// /// \return True if both strings are equal /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator ==(const String& left, const String& right); //////////////////////////////////////////////////////////// /// \relates String /// \brief Overload of != operator to compare two UTF-32 strings /// /// \param left Left operand (a string) /// \param right Right operand (a string) /// /// \return True if both strings are different /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator !=(const String& left, const String& right); //////////////////////////////////////////////////////////// /// \relates String /// \brief Overload of < operator to compare two UTF-32 strings /// /// \param left Left operand (a string) /// \param right Right operand (a string) /// /// \return True if \a left is lexicographically before \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator <(const String& left, const String& right); //////////////////////////////////////////////////////////// /// \relates String /// \brief Overload of > operator to compare two UTF-32 strings /// /// \param left Left operand (a string) /// \param right Right operand (a string) /// /// \return True if \a left is lexicographically after \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator >(const String& left, const String& right); //////////////////////////////////////////////////////////// /// \relates String /// \brief Overload of <= operator to compare two UTF-32 strings /// /// \param left Left operand (a string) /// \param right Right operand (a string) /// /// \return True if \a left is lexicographically before or equivalent to \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator <=(const String& left, const String& right); //////////////////////////////////////////////////////////// /// \relates String /// \brief Overload of >= operator to compare two UTF-32 strings /// /// \param left Left operand (a string) /// \param right Right operand (a string) /// /// \return True if \a left is lexicographically after or equivalent to \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator >=(const String& left, const String& right); //////////////////////////////////////////////////////////// /// \relates String /// \brief Overload of binary + operator to concatenate two strings /// /// \param left Left operand (a string) /// \param right Right operand (a string) /// /// \return Concatenated string /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API String operator +(const String& left, const String& right); #include } // namespace sf #endif // SFML_STRING_HPP //////////////////////////////////////////////////////////// /// \class sf::String /// \ingroup system /// /// sf::String is a utility string class defined mainly for /// convenience. It is a Unicode string (implemented using /// UTF-32), thus it can store any character in the world /// (European, Chinese, Arabic, Hebrew, etc.). /// /// It automatically handles conversions from/to ANSI and /// wide strings, so that you can work with standard string /// classes and still be compatible with functions taking a /// sf::String. /// /// \code /// sf::String s; /// /// std::string s1 = s; // automatically converted to ANSI string /// std::wstring s2 = s; // automatically converted to wide string /// s = "hello"; // automatically converted from ANSI string /// s = L"hello"; // automatically converted from wide string /// s += 'a'; // automatically converted from ANSI string /// s += L'a'; // automatically converted from wide string /// \endcode /// /// Conversions involving ANSI strings use the default user locale. However /// it is possible to use a custom locale if necessary: /// \code /// std::locale locale; /// sf::String s; /// ... /// std::string s1 = s.toAnsiString(locale); /// s = sf::String("hello", locale); /// \endcode /// /// sf::String defines the most important functions of the /// standard std::string class: removing, random access, iterating, /// appending, comparing, etc. However it is a simple class /// provided for convenience, and you may have to consider using /// a more optimized class if your program requires complex string /// handling. The automatic conversion functions will then take /// care of converting your string to sf::String whenever SFML /// requires it. /// /// Please note that SFML also defines a low-level, generic /// interface for Unicode handling, see the sf::Utf classes. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/String.inl ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// template String String::fromUtf8(T begin, T end) { String string; Utf8::toUtf32(begin, end, std::back_inserter(string.m_string)); return string; } //////////////////////////////////////////////////////////// template String String::fromUtf16(T begin, T end) { String string; Utf16::toUtf32(begin, end, std::back_inserter(string.m_string)); return string; } //////////////////////////////////////////////////////////// template String String::fromUtf32(T begin, T end) { String string; string.m_string.assign(begin, end); return string; } ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Thread.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_THREAD_HPP #define SFML_THREAD_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { namespace priv { class ThreadImpl; struct ThreadFunc; } //////////////////////////////////////////////////////////// /// \brief Utility class to manipulate threads /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API Thread : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Construct the thread from a functor with no argument /// /// This constructor works for function objects, as well /// as free functions. /// /// Use this constructor for this kind of function: /// \code /// void function(); /// /// // --- or ---- /// /// struct Functor /// { /// void operator()(); /// }; /// \endcode /// Note: this does *not* run the thread, use launch(). /// /// \param function Functor or free function to use as the entry point of the thread /// //////////////////////////////////////////////////////////// template Thread(F function); //////////////////////////////////////////////////////////// /// \brief Construct the thread from a functor with an argument /// /// This constructor works for function objects, as well /// as free functions. /// It is a template, which means that the argument can /// have any type (int, std::string, void*, Toto, ...). /// /// Use this constructor for this kind of function: /// \code /// void function(int arg); /// /// // --- or ---- /// /// struct Functor /// { /// void operator()(std::string arg); /// }; /// \endcode /// Note: this does *not* run the thread, use launch(). /// /// \param function Functor or free function to use as the entry point of the thread /// \param argument argument to forward to the function /// //////////////////////////////////////////////////////////// template Thread(F function, A argument); //////////////////////////////////////////////////////////// /// \brief Construct the thread from a member function and an object /// /// This constructor is a template, which means that you can /// use it with any class. /// Use this constructor for this kind of function: /// \code /// class MyClass /// { /// public: /// /// void function(); /// }; /// \endcode /// Note: this does *not* run the thread, use launch(). /// /// \param function Entry point of the thread /// \param object Pointer to the object to use /// //////////////////////////////////////////////////////////// template Thread(void(C::*function)(), C* object); //////////////////////////////////////////////////////////// /// \brief Destructor /// /// This destructor calls wait(), so that the internal thread /// cannot survive after its sf::Thread instance is destroyed. /// //////////////////////////////////////////////////////////// ~Thread(); //////////////////////////////////////////////////////////// /// \brief Run the thread /// /// This function starts the entry point passed to the /// thread's constructor, and returns immediately. /// After this function returns, the thread's function is /// running in parallel to the calling code. /// //////////////////////////////////////////////////////////// void launch(); //////////////////////////////////////////////////////////// /// \brief Wait until the thread finishes /// /// This function will block the execution until the /// thread's function ends. /// Warning: if the thread function never ends, the calling /// thread will block forever. /// If this function is called from its owner thread, it /// returns without doing anything. /// //////////////////////////////////////////////////////////// void wait(); //////////////////////////////////////////////////////////// /// \brief Terminate the thread /// /// This function immediately stops the thread, without waiting /// for its function to finish. /// Terminating a thread with this function is not safe, /// and can lead to local variables not being destroyed /// on some operating systems. You should rather try to make /// the thread function terminate by itself. /// //////////////////////////////////////////////////////////// void terminate(); private: friend class priv::ThreadImpl; //////////////////////////////////////////////////////////// /// \brief Internal entry point of the thread /// /// This function is called by the thread implementation. /// //////////////////////////////////////////////////////////// void run(); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// priv::ThreadImpl* m_impl; ///< OS-specific implementation of the thread priv::ThreadFunc* m_entryPoint; ///< Abstraction of the function to run }; #include } // namespace sf #endif // SFML_THREAD_HPP //////////////////////////////////////////////////////////// /// \class sf::Thread /// \ingroup system /// /// Threads provide a way to run multiple parts of the code /// in parallel. When you launch a new thread, the execution /// is split and both the new thread and the caller run /// in parallel. /// /// To use a sf::Thread, you construct it directly with the /// function to execute as the entry point of the thread. /// sf::Thread has multiple template constructors, which means /// that you can use several types of entry points: /// \li non-member functions with no argument /// \li non-member functions with one argument of any type /// \li functors with no argument (this one is particularly useful for compatibility with boost/std::%bind) /// \li functors with one argument of any type /// \li member functions from any class with no argument /// /// The function argument, if any, is copied in the sf::Thread /// instance, as well as the functor (if the corresponding /// constructor is used). Class instances, however, are passed /// by pointer so you must make sure that the object won't be /// destroyed while the thread is still using it. /// /// The thread ends when its function is terminated. If the /// owner sf::Thread instance is destroyed before the /// thread is finished, the destructor will wait (see wait()) /// /// Usage examples: /// \code /// // example 1: non member function with one argument /// /// void threadFunc(int argument) /// { /// ... /// } /// /// sf::Thread thread(&threadFunc, 5); /// thread.launch(); // start the thread (internally calls threadFunc(5)) /// \endcode /// /// \code /// // example 2: member function /// /// class Task /// { /// public: /// void run() /// { /// ... /// } /// }; /// /// Task task; /// sf::Thread thread(&Task::run, &task); /// thread.launch(); // start the thread (internally calls task.run()) /// \endcode /// /// \code /// // example 3: functor /// /// struct Task /// { /// void operator()() /// { /// ... /// } /// }; /// /// sf::Thread thread(Task()); /// thread.launch(); // start the thread (internally calls operator() on the Task instance) /// \endcode /// /// Creating parallel threads of execution can be dangerous: /// all threads inside the same process share the same memory space, /// which means that you may end up accessing the same variable /// from multiple threads at the same time. To prevent this /// kind of situations, you can use mutexes (see sf::Mutex). /// /// \see sf::Mutex /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Thread.inl ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// namespace priv { // Base class for abstract thread functions struct ThreadFunc { virtual ~ThreadFunc() {} virtual void run() = 0; }; // Specialization using a functor (including free functions) with no argument template struct ThreadFunctor : ThreadFunc { ThreadFunctor(T functor) : m_functor(functor) {} virtual void run() {m_functor();} T m_functor; }; // Specialization using a functor (including free functions) with one argument template struct ThreadFunctorWithArg : ThreadFunc { ThreadFunctorWithArg(F function, A arg) : m_function(function), m_arg(arg) {} virtual void run() {m_function(m_arg);} F m_function; A m_arg; }; // Specialization using a member function template struct ThreadMemberFunc : ThreadFunc { ThreadMemberFunc(void(C::*function)(), C* object) : m_function(function), m_object(object) {} virtual void run() {(m_object->*m_function)();} void(C::*m_function)(); C* m_object; }; } // namespace priv //////////////////////////////////////////////////////////// template Thread::Thread(F functor) : m_impl (NULL), m_entryPoint(new priv::ThreadFunctor(functor)) { } //////////////////////////////////////////////////////////// template Thread::Thread(F function, A argument) : m_impl (NULL), m_entryPoint(new priv::ThreadFunctorWithArg(function, argument)) { } //////////////////////////////////////////////////////////// template Thread::Thread(void(C::*function)(), C* object) : m_impl (NULL), m_entryPoint(new priv::ThreadMemberFunc(function, object)) { } ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/ThreadLocal.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_THREADLOCAL_HPP #define SFML_THREADLOCAL_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { namespace priv { class ThreadLocalImpl; } //////////////////////////////////////////////////////////// /// \brief Defines variables with thread-local storage /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API ThreadLocal : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// \param value Optional value to initialize the variable /// //////////////////////////////////////////////////////////// ThreadLocal(void* value = NULL); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~ThreadLocal(); //////////////////////////////////////////////////////////// /// \brief Set the thread-specific value of the variable /// /// \param value Value of the variable for the current thread /// //////////////////////////////////////////////////////////// void setValue(void* value); //////////////////////////////////////////////////////////// /// \brief Retrieve the thread-specific value of the variable /// /// \return Value of the variable for the current thread /// //////////////////////////////////////////////////////////// void* getValue() const; private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// priv::ThreadLocalImpl* m_impl; ///< Pointer to the OS specific implementation }; } // namespace sf #endif // SFML_THREADLOCAL_HPP //////////////////////////////////////////////////////////// /// \class sf::ThreadLocal /// \ingroup system /// /// This class manipulates void* parameters and thus is not /// appropriate for strongly-typed variables. You should rather /// use the sf::ThreadLocalPtr template class. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/ThreadLocalPtr.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_THREADLOCALPTR_HPP #define SFML_THREADLOCALPTR_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Pointer to a thread-local variable /// //////////////////////////////////////////////////////////// template class ThreadLocalPtr : private ThreadLocal { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// \param value Optional value to initialize the variable /// //////////////////////////////////////////////////////////// ThreadLocalPtr(T* value = NULL); //////////////////////////////////////////////////////////// /// \brief Overload of unary operator * /// /// Like raw pointers, applying the * operator returns a /// reference to the pointed-to object. /// /// \return Reference to the thread-local variable /// //////////////////////////////////////////////////////////// T& operator *() const; //////////////////////////////////////////////////////////// /// \brief Overload of operator -> /// /// Similarly to raw pointers, applying the -> operator /// returns the pointed-to object. /// /// \return Pointer to the thread-local variable /// //////////////////////////////////////////////////////////// T* operator ->() const; //////////////////////////////////////////////////////////// /// \brief Conversion operator to implicitly convert the /// pointer to its raw pointer type (T*) /// /// \return Pointer to the actual object /// //////////////////////////////////////////////////////////// operator T*() const; //////////////////////////////////////////////////////////// /// \brief Assignment operator for a raw pointer parameter /// /// \param value Pointer to assign /// /// \return Reference to self /// //////////////////////////////////////////////////////////// ThreadLocalPtr& operator =(T* value); //////////////////////////////////////////////////////////// /// \brief Assignment operator for a ThreadLocalPtr parameter /// /// \param right ThreadLocalPtr to assign /// /// \return Reference to self /// //////////////////////////////////////////////////////////// ThreadLocalPtr& operator =(const ThreadLocalPtr& right); }; } // namespace sf #include #endif // SFML_THREADLOCALPTR_HPP //////////////////////////////////////////////////////////// /// \class sf::ThreadLocalPtr /// \ingroup system /// /// sf::ThreadLocalPtr is a type-safe wrapper for storing /// pointers to thread-local variables. A thread-local /// variable holds a different value for each different /// thread, unlike normal variables that are shared. /// /// Its usage is completely transparent, so that it is similar /// to manipulating the raw pointer directly (like any smart pointer). /// /// Usage example: /// \code /// MyClass object1; /// MyClass object2; /// sf::ThreadLocalPtr objectPtr; /// /// void thread1() /// { /// objectPtr = &object1; // doesn't impact thread2 /// ... /// } /// /// void thread2() /// { /// objectPtr = &object2; // doesn't impact thread1 /// ... /// } /// /// int main() /// { /// // Create and launch the two threads /// sf::Thread t1(&thread1); /// sf::Thread t2(&thread2); /// t1.launch(); /// t2.launch(); /// /// return 0; /// } /// \endcode /// /// ThreadLocalPtr is designed for internal use; however you /// can use it if you feel like it fits well your implementation. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/ThreadLocalPtr.inl ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// namespace sf { //////////////////////////////////////////////////////////// template ThreadLocalPtr::ThreadLocalPtr(T* value) : ThreadLocal(value) { } //////////////////////////////////////////////////////////// template T& ThreadLocalPtr::operator *() const { return *static_cast(getValue()); } //////////////////////////////////////////////////////////// template T* ThreadLocalPtr::operator ->() const { return static_cast(getValue()); } //////////////////////////////////////////////////////////// template ThreadLocalPtr::operator T*() const { return static_cast(getValue()); } //////////////////////////////////////////////////////////// template ThreadLocalPtr& ThreadLocalPtr::operator =(T* value) { setValue(value); return *this; } //////////////////////////////////////////////////////////// template ThreadLocalPtr& ThreadLocalPtr::operator =(const ThreadLocalPtr& right) { setValue(right.getValue()); return *this; } } // namespace sf ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Time.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_TIME_HPP #define SFML_TIME_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Represents a time value /// //////////////////////////////////////////////////////////// class SFML_SYSTEM_API Time { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Sets the time value to zero. /// //////////////////////////////////////////////////////////// Time(); //////////////////////////////////////////////////////////// /// \brief Return the time value as a number of seconds /// /// \return Time in seconds /// /// \see asMilliseconds, asMicroseconds /// //////////////////////////////////////////////////////////// float asSeconds() const; //////////////////////////////////////////////////////////// /// \brief Return the time value as a number of milliseconds /// /// \return Time in milliseconds /// /// \see asSeconds, asMicroseconds /// //////////////////////////////////////////////////////////// Int32 asMilliseconds() const; //////////////////////////////////////////////////////////// /// \brief Return the time value as a number of microseconds /// /// \return Time in microseconds /// /// \see asSeconds, asMilliseconds /// //////////////////////////////////////////////////////////// Int64 asMicroseconds() const; //////////////////////////////////////////////////////////// // Static member data //////////////////////////////////////////////////////////// static const Time Zero; ///< Predefined "zero" time value private: friend SFML_SYSTEM_API Time seconds(float); friend SFML_SYSTEM_API Time milliseconds(Int32); friend SFML_SYSTEM_API Time microseconds(Int64); //////////////////////////////////////////////////////////// /// \brief Construct from a number of microseconds /// /// This function is internal. To construct time values, /// use sf::seconds, sf::milliseconds or sf::microseconds instead. /// /// \param microseconds Number of microseconds /// //////////////////////////////////////////////////////////// explicit Time(Int64 microseconds); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// Int64 m_microseconds; ///< Time value stored as microseconds }; //////////////////////////////////////////////////////////// /// \relates Time /// \brief Construct a time value from a number of seconds /// /// \param amount Number of seconds /// /// \return Time value constructed from the amount of seconds /// /// \see milliseconds, microseconds /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time seconds(float amount); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Construct a time value from a number of milliseconds /// /// \param amount Number of milliseconds /// /// \return Time value constructed from the amount of milliseconds /// /// \see seconds, microseconds /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time milliseconds(Int32 amount); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Construct a time value from a number of microseconds /// /// \param amount Number of microseconds /// /// \return Time value constructed from the amount of microseconds /// /// \see seconds, milliseconds /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time microseconds(Int64 amount); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of == operator to compare two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return True if both time values are equal /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator ==(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of != operator to compare two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return True if both time values are different /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator !=(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of < operator to compare two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return True if \a left is lesser than \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator <(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of > operator to compare two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return True if \a left is greater than \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator >(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of <= operator to compare two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return True if \a left is lesser or equal than \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator <=(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of >= operator to compare two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return True if \a left is greater or equal than \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API bool operator >=(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of unary - operator to negate a time value /// /// \param right Right operand (a time) /// /// \return Opposite of the time value /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator -(Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary + operator to add two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return Sum of the two times values /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator +(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary += operator to add/assign two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return Sum of the two times values /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time& operator +=(Time& left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary - operator to subtract two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return Difference of the two times values /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator -(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary -= operator to subtract/assign two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return Difference of the two times values /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time& operator -=(Time& left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary * operator to scale a time value /// /// \param left Left operand (a time) /// \param right Right operand (a number) /// /// \return \a left multiplied by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator *(Time left, float right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary * operator to scale a time value /// /// \param left Left operand (a time) /// \param right Right operand (a number) /// /// \return \a left multiplied by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator *(Time left, Int64 right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary * operator to scale a time value /// /// \param left Left operand (a number) /// \param right Right operand (a time) /// /// \return \a left multiplied by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator *(float left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary * operator to scale a time value /// /// \param left Left operand (a number) /// \param right Right operand (a time) /// /// \return \a left multiplied by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator *(Int64 left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary *= operator to scale/assign a time value /// /// \param left Left operand (a time) /// \param right Right operand (a number) /// /// \return \a left multiplied by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time& operator *=(Time& left, float right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary *= operator to scale/assign a time value /// /// \param left Left operand (a time) /// \param right Right operand (a number) /// /// \return \a left multiplied by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time& operator *=(Time& left, Int64 right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary / operator to scale a time value /// /// \param left Left operand (a time) /// \param right Right operand (a number) /// /// \return \a left divided by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator /(Time left, float right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary / operator to scale a time value /// /// \param left Left operand (a time) /// \param right Right operand (a number) /// /// \return \a left divided by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator /(Time left, Int64 right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary /= operator to scale/assign a time value /// /// \param left Left operand (a time) /// \param right Right operand (a number) /// /// \return \a left divided by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time& operator /=(Time& left, float right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary /= operator to scale/assign a time value /// /// \param left Left operand (a time) /// \param right Right operand (a number) /// /// \return \a left divided by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time& operator /=(Time& left, Int64 right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary / operator to compute the ratio of two time values /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return \a left divided by \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API float operator /(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary % operator to compute remainder of a time value /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return \a left modulo \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time operator %(Time left, Time right); //////////////////////////////////////////////////////////// /// \relates Time /// \brief Overload of binary %= operator to compute/assign remainder of a time value /// /// \param left Left operand (a time) /// \param right Right operand (a time) /// /// \return \a left modulo \a right /// //////////////////////////////////////////////////////////// SFML_SYSTEM_API Time& operator %=(Time& left, Time right); } // namespace sf #endif // SFML_TIME_HPP //////////////////////////////////////////////////////////// /// \class sf::Time /// \ingroup system /// /// sf::Time encapsulates a time value in a flexible way. /// It allows to define a time value either as a number of /// seconds, milliseconds or microseconds. It also works the /// other way round: you can read a time value as either /// a number of seconds, milliseconds or microseconds. /// /// By using such a flexible interface, the API doesn't /// impose any fixed type or resolution for time values, /// and let the user choose its own favorite representation. /// /// Time values support the usual mathematical operations: /// you can add or subtract two times, multiply or divide /// a time by a number, compare two times, etc. /// /// Since they represent a time span and not an absolute time /// value, times can also be negative. /// /// Usage example: /// \code /// sf::Time t1 = sf::seconds(0.1f); /// Int32 milli = t1.asMilliseconds(); // 100 /// /// sf::Time t2 = sf::milliseconds(30); /// Int64 micro = t2.asMicroseconds(); // 30000 /// /// sf::Time t3 = sf::microseconds(-800000); /// float sec = t3.asSeconds(); // -0.8 /// \endcode /// /// \code /// void update(sf::Time elapsed) /// { /// position += speed * elapsed.asSeconds(); /// } /// /// update(sf::milliseconds(100)); /// \endcode /// /// \see sf::Clock /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Utf.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_UTF_HPP #define SFML_UTF_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include namespace sf { template class Utf; //////////////////////////////////////////////////////////// /// \brief Specialization of the Utf template for UTF-8 /// //////////////////////////////////////////////////////////// template <> class Utf<8> { public: //////////////////////////////////////////////////////////// /// \brief Decode a single UTF-8 character /// /// Decoding a character means finding its unique 32-bits /// code (called the codepoint) in the Unicode standard. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Codepoint of the decoded UTF-8 character /// \param replacement Replacement character to use in case the UTF-8 sequence is invalid /// /// \return Iterator pointing to one past the last read element of the input sequence /// //////////////////////////////////////////////////////////// template static In decode(In begin, In end, Uint32& output, Uint32 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Encode a single UTF-8 character /// /// Encoding a character means converting a unique 32-bits /// code (called the codepoint) in the target encoding, UTF-8. /// /// \param input Codepoint to encode as UTF-8 /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to UTF-8 (use 0 to skip them) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out encode(Uint32 input, Out output, Uint8 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Advance to the next UTF-8 character /// /// This function is necessary for multi-elements encodings, as /// a single character may use more than 1 storage element. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// /// \return Iterator pointing to one past the last read element of the input sequence /// //////////////////////////////////////////////////////////// template static In next(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Count the number of characters of a UTF-8 sequence /// /// This function is necessary for multi-elements encodings, as /// a single character may use more than 1 storage element, thus the /// total size can be different from (begin - end). /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// /// \return Iterator pointing to one past the last read element of the input sequence /// //////////////////////////////////////////////////////////// template static std::size_t count(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Convert an ANSI characters range to UTF-8 /// /// The current global locale will be used by default, unless you /// pass a custom one in the \a locale parameter. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param locale Locale to use for conversion /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out fromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Convert a wide characters range to UTF-8 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out fromWide(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a latin-1 (ISO-5589-1) characters range to UTF-8 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out fromLatin1(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-8 characters range to ANSI characters /// /// The current global locale will be used by default, unless you /// pass a custom one in the \a locale parameter. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to ANSI (use 0 to skip them) /// \param locale Locale to use for conversion /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-8 characters range to wide characters /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toWide(In begin, In end, Out output, wchar_t replacement = 0); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-8 characters range to latin-1 (ISO-5589-1) characters /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toLatin1(In begin, In end, Out output, char replacement = 0); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-8 characters range to UTF-8 /// /// This functions does nothing more than a direct copy; /// it is defined only to provide the same interface as other /// specializations of the sf::Utf<> template, and allow /// generic code to be written on top of it. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toUtf8(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-8 characters range to UTF-16 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toUtf16(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-8 characters range to UTF-32 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toUtf32(In begin, In end, Out output); }; //////////////////////////////////////////////////////////// /// \brief Specialization of the Utf template for UTF-16 /// //////////////////////////////////////////////////////////// template <> class Utf<16> { public: //////////////////////////////////////////////////////////// /// \brief Decode a single UTF-16 character /// /// Decoding a character means finding its unique 32-bits /// code (called the codepoint) in the Unicode standard. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Codepoint of the decoded UTF-16 character /// \param replacement Replacement character to use in case the UTF-8 sequence is invalid /// /// \return Iterator pointing to one past the last read element of the input sequence /// //////////////////////////////////////////////////////////// template static In decode(In begin, In end, Uint32& output, Uint32 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Encode a single UTF-16 character /// /// Encoding a character means converting a unique 32-bits /// code (called the codepoint) in the target encoding, UTF-16. /// /// \param input Codepoint to encode as UTF-16 /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to UTF-16 (use 0 to skip them) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out encode(Uint32 input, Out output, Uint16 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Advance to the next UTF-16 character /// /// This function is necessary for multi-elements encodings, as /// a single character may use more than 1 storage element. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// /// \return Iterator pointing to one past the last read element of the input sequence /// //////////////////////////////////////////////////////////// template static In next(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Count the number of characters of a UTF-16 sequence /// /// This function is necessary for multi-elements encodings, as /// a single character may use more than 1 storage element, thus the /// total size can be different from (begin - end). /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// /// \return Iterator pointing to one past the last read element of the input sequence /// //////////////////////////////////////////////////////////// template static std::size_t count(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Convert an ANSI characters range to UTF-16 /// /// The current global locale will be used by default, unless you /// pass a custom one in the \a locale parameter. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param locale Locale to use for conversion /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out fromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Convert a wide characters range to UTF-16 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out fromWide(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a latin-1 (ISO-5589-1) characters range to UTF-16 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out fromLatin1(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-16 characters range to ANSI characters /// /// The current global locale will be used by default, unless you /// pass a custom one in the \a locale parameter. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to ANSI (use 0 to skip them) /// \param locale Locale to use for conversion /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-16 characters range to wide characters /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toWide(In begin, In end, Out output, wchar_t replacement = 0); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-16 characters range to latin-1 (ISO-5589-1) characters /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toLatin1(In begin, In end, Out output, char replacement = 0); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-16 characters range to UTF-8 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toUtf8(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-16 characters range to UTF-16 /// /// This functions does nothing more than a direct copy; /// it is defined only to provide the same interface as other /// specializations of the sf::Utf<> template, and allow /// generic code to be written on top of it. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toUtf16(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-16 characters range to UTF-32 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toUtf32(In begin, In end, Out output); }; //////////////////////////////////////////////////////////// /// \brief Specialization of the Utf template for UTF-32 /// //////////////////////////////////////////////////////////// template <> class Utf<32> { public: //////////////////////////////////////////////////////////// /// \brief Decode a single UTF-32 character /// /// Decoding a character means finding its unique 32-bits /// code (called the codepoint) in the Unicode standard. /// For UTF-32, the character value is the same as the codepoint. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Codepoint of the decoded UTF-32 character /// \param replacement Replacement character to use in case the UTF-8 sequence is invalid /// /// \return Iterator pointing to one past the last read element of the input sequence /// //////////////////////////////////////////////////////////// template static In decode(In begin, In end, Uint32& output, Uint32 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Encode a single UTF-32 character /// /// Encoding a character means converting a unique 32-bits /// code (called the codepoint) in the target encoding, UTF-32. /// For UTF-32, the codepoint is the same as the character value. /// /// \param input Codepoint to encode as UTF-32 /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to UTF-32 (use 0 to skip them) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out encode(Uint32 input, Out output, Uint32 replacement = 0); //////////////////////////////////////////////////////////// /// \brief Advance to the next UTF-32 character /// /// This function is trivial for UTF-32, which can store /// every character in a single storage element. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// /// \return Iterator pointing to one past the last read element of the input sequence /// //////////////////////////////////////////////////////////// template static In next(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Count the number of characters of a UTF-32 sequence /// /// This function is trivial for UTF-32, which can store /// every character in a single storage element. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// /// \return Iterator pointing to one past the last read element of the input sequence /// //////////////////////////////////////////////////////////// template static std::size_t count(In begin, In end); //////////////////////////////////////////////////////////// /// \brief Convert an ANSI characters range to UTF-32 /// /// The current global locale will be used by default, unless you /// pass a custom one in the \a locale parameter. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param locale Locale to use for conversion /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out fromAnsi(In begin, In end, Out output, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Convert a wide characters range to UTF-32 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out fromWide(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a latin-1 (ISO-5589-1) characters range to UTF-32 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out fromLatin1(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-32 characters range to ANSI characters /// /// The current global locale will be used by default, unless you /// pass a custom one in the \a locale parameter. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to ANSI (use 0 to skip them) /// \param locale Locale to use for conversion /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toAnsi(In begin, In end, Out output, char replacement = 0, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-32 characters range to wide characters /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toWide(In begin, In end, Out output, wchar_t replacement = 0); //////////////////////////////////////////////////////////// /// \brief Convert an UTF-16 characters range to latin-1 (ISO-5589-1) characters /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement for characters not convertible to wide (use 0 to skip them) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toLatin1(In begin, In end, Out output, char replacement = 0); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-32 characters range to UTF-8 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toUtf8(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-32 characters range to UTF-16 /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toUtf16(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Convert a UTF-32 characters range to UTF-32 /// /// This functions does nothing more than a direct copy; /// it is defined only to provide the same interface as other /// specializations of the sf::Utf<> template, and allow /// generic code to be written on top of it. /// /// \param begin Iterator pointing to the beginning of the input sequence /// \param end Iterator pointing to the end of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out toUtf32(In begin, In end, Out output); //////////////////////////////////////////////////////////// /// \brief Decode a single ANSI character to UTF-32 /// /// This function does not exist in other specializations /// of sf::Utf<>, it is defined for convenience (it is used by /// several other conversion functions). /// /// \param input Input ANSI character /// \param locale Locale to use for conversion /// /// \return Converted character /// //////////////////////////////////////////////////////////// template static Uint32 decodeAnsi(In input, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Decode a single wide character to UTF-32 /// /// This function does not exist in other specializations /// of sf::Utf<>, it is defined for convenience (it is used by /// several other conversion functions). /// /// \param input Input wide character /// /// \return Converted character /// //////////////////////////////////////////////////////////// template static Uint32 decodeWide(In input); //////////////////////////////////////////////////////////// /// \brief Encode a single UTF-32 character to ANSI /// /// This function does not exist in other specializations /// of sf::Utf<>, it is defined for convenience (it is used by /// several other conversion functions). /// /// \param codepoint Iterator pointing to the beginning of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement if the input character is not convertible to ANSI (use 0 to skip it) /// \param locale Locale to use for conversion /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out encodeAnsi(Uint32 codepoint, Out output, char replacement = 0, const std::locale& locale = std::locale()); //////////////////////////////////////////////////////////// /// \brief Encode a single UTF-32 character to wide /// /// This function does not exist in other specializations /// of sf::Utf<>, it is defined for convenience (it is used by /// several other conversion functions). /// /// \param codepoint Iterator pointing to the beginning of the input sequence /// \param output Iterator pointing to the beginning of the output sequence /// \param replacement Replacement if the input character is not convertible to wide (use 0 to skip it) /// /// \return Iterator to the end of the output sequence which has been written /// //////////////////////////////////////////////////////////// template static Out encodeWide(Uint32 codepoint, Out output, wchar_t replacement = 0); }; #include // Make typedefs to get rid of the template syntax typedef Utf<8> Utf8; typedef Utf<16> Utf16; typedef Utf<32> Utf32; } // namespace sf #endif // SFML_UTF_HPP //////////////////////////////////////////////////////////// /// \class sf::Utf /// \ingroup system /// /// Utility class providing generic functions for UTF conversions. /// /// sf::Utf is a low-level, generic interface for counting, iterating, /// encoding and decoding Unicode characters and strings. It is able /// to handle ANSI, wide, latin-1, UTF-8, UTF-16 and UTF-32 encodings. /// /// sf::Utf functions are all static, these classes are not meant to /// be instantiated. All the functions are template, so that you /// can use any character / string type for a given encoding. /// /// It has 3 specializations: /// \li sf::Utf<8> (typedef'd to sf::Utf8) /// \li sf::Utf<16> (typedef'd to sf::Utf16) /// \li sf::Utf<32> (typedef'd to sf::Utf32) /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Utf.inl ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// // References: // // http://www.unicode.org/ // http://www.unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.c // http://www.unicode.org/Public/PROGRAMS/CVTUTF/ConvertUTF.h // http://people.w3.org/rishida/scripts/uniview/conversion // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// template In Utf<8>::decode(In begin, In end, Uint32& output, Uint32 replacement) { // Some useful precomputed data static const int trailing[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5 }; static const Uint32 offsets[6] = { 0x00000000, 0x00003080, 0x000E2080, 0x03C82080, 0xFA082080, 0x82082080 }; // decode the character int trailingBytes = trailing[static_cast(*begin)]; if (begin + trailingBytes < end) { output = 0; switch (trailingBytes) { case 5: output += static_cast(*begin++); output <<= 6; case 4: output += static_cast(*begin++); output <<= 6; case 3: output += static_cast(*begin++); output <<= 6; case 2: output += static_cast(*begin++); output <<= 6; case 1: output += static_cast(*begin++); output <<= 6; case 0: output += static_cast(*begin++); } output -= offsets[trailingBytes]; } else { // Incomplete character begin = end; output = replacement; } return begin; } //////////////////////////////////////////////////////////// template Out Utf<8>::encode(Uint32 input, Out output, Uint8 replacement) { // Some useful precomputed data static const Uint8 firstBytes[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; // encode the character if ((input > 0x0010FFFF) || ((input >= 0xD800) && (input <= 0xDBFF))) { // Invalid character if (replacement) *output++ = replacement; } else { // Valid character // Get the number of bytes to write std::size_t bytestoWrite = 1; if (input < 0x80) bytestoWrite = 1; else if (input < 0x800) bytestoWrite = 2; else if (input < 0x10000) bytestoWrite = 3; else if (input <= 0x0010FFFF) bytestoWrite = 4; // Extract the bytes to write Uint8 bytes[4]; switch (bytestoWrite) { case 4: bytes[3] = static_cast((input | 0x80) & 0xBF); input >>= 6; case 3: bytes[2] = static_cast((input | 0x80) & 0xBF); input >>= 6; case 2: bytes[1] = static_cast((input | 0x80) & 0xBF); input >>= 6; case 1: bytes[0] = static_cast (input | firstBytes[bytestoWrite]); } // Add them to the output output = std::copy(bytes, bytes + bytestoWrite, output); } return output; } //////////////////////////////////////////////////////////// template In Utf<8>::next(In begin, In end) { Uint32 codepoint; return decode(begin, end, codepoint); } //////////////////////////////////////////////////////////// template std::size_t Utf<8>::count(In begin, In end) { std::size_t length = 0; while (begin < end) { begin = next(begin, end); ++length; } return length; } //////////////////////////////////////////////////////////// template Out Utf<8>::fromAnsi(In begin, In end, Out output, const std::locale& locale) { while (begin < end) { Uint32 codepoint = Utf<32>::decodeAnsi(*begin++, locale); output = encode(codepoint, output); } return output; } //////////////////////////////////////////////////////////// template Out Utf<8>::fromWide(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint = Utf<32>::decodeWide(*begin++); output = encode(codepoint, output); } return output; } //////////////////////////////////////////////////////////// template Out Utf<8>::fromLatin1(In begin, In end, Out output) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 while (begin < end) output = encode(*begin++, output); return output; } //////////////////////////////////////////////////////////// template Out Utf<8>::toAnsi(In begin, In end, Out output, char replacement, const std::locale& locale) { while (begin < end) { Uint32 codepoint; begin = decode(begin, end, codepoint); output = Utf<32>::encodeAnsi(codepoint, output, replacement, locale); } return output; } //////////////////////////////////////////////////////////// template Out Utf<8>::toWide(In begin, In end, Out output, wchar_t replacement) { while (begin < end) { Uint32 codepoint; begin = decode(begin, end, codepoint); output = Utf<32>::encodeWide(codepoint, output, replacement); } return output; } //////////////////////////////////////////////////////////// template Out Utf<8>::toLatin1(In begin, In end, Out output, char replacement) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 while (begin < end) { Uint32 codepoint; begin = decode(begin, end, codepoint); *output++ = codepoint < 256 ? static_cast(codepoint) : replacement; } return output; } //////////////////////////////////////////////////////////// template Out Utf<8>::toUtf8(In begin, In end, Out output) { return std::copy(begin, end, output); } //////////////////////////////////////////////////////////// template Out Utf<8>::toUtf16(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint; begin = decode(begin, end, codepoint); output = Utf<16>::encode(codepoint, output); } return output; } //////////////////////////////////////////////////////////// template Out Utf<8>::toUtf32(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint; begin = decode(begin, end, codepoint); *output++ = codepoint; } return output; } //////////////////////////////////////////////////////////// template In Utf<16>::decode(In begin, In end, Uint32& output, Uint32 replacement) { Uint16 first = *begin++; // If it's a surrogate pair, first convert to a single UTF-32 character if ((first >= 0xD800) && (first <= 0xDBFF)) { if (begin < end) { Uint32 second = *begin++; if ((second >= 0xDC00) && (second <= 0xDFFF)) { // The second element is valid: convert the two elements to a UTF-32 character output = static_cast(((first - 0xD800) << 10) + (second - 0xDC00) + 0x0010000); } else { // Invalid character output = replacement; } } else { // Invalid character begin = end; output = replacement; } } else { // We can make a direct copy output = first; } return begin; } //////////////////////////////////////////////////////////// template Out Utf<16>::encode(Uint32 input, Out output, Uint16 replacement) { if (input <= 0xFFFF) { // The character can be copied directly, we just need to check if it's in the valid range if ((input >= 0xD800) && (input <= 0xDFFF)) { // Invalid character (this range is reserved) if (replacement) *output++ = replacement; } else { // Valid character directly convertible to a single UTF-16 character *output++ = static_cast(input); } } else if (input > 0x0010FFFF) { // Invalid character (greater than the maximum Unicode value) if (replacement) *output++ = replacement; } else { // The input character will be converted to two UTF-16 elements input -= 0x0010000; *output++ = static_cast((input >> 10) + 0xD800); *output++ = static_cast((input & 0x3FFUL) + 0xDC00); } return output; } //////////////////////////////////////////////////////////// template In Utf<16>::next(In begin, In end) { Uint32 codepoint; return decode(begin, end, codepoint); } //////////////////////////////////////////////////////////// template std::size_t Utf<16>::count(In begin, In end) { std::size_t length = 0; while (begin < end) { begin = next(begin, end); ++length; } return length; } //////////////////////////////////////////////////////////// template Out Utf<16>::fromAnsi(In begin, In end, Out output, const std::locale& locale) { while (begin < end) { Uint32 codepoint = Utf<32>::decodeAnsi(*begin++, locale); output = encode(codepoint, output); } return output; } //////////////////////////////////////////////////////////// template Out Utf<16>::fromWide(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint = Utf<32>::decodeWide(*begin++); output = encode(codepoint, output); } return output; } //////////////////////////////////////////////////////////// template Out Utf<16>::fromLatin1(In begin, In end, Out output) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 return std::copy(begin, end, output); } //////////////////////////////////////////////////////////// template Out Utf<16>::toAnsi(In begin, In end, Out output, char replacement, const std::locale& locale) { while (begin < end) { Uint32 codepoint; begin = decode(begin, end, codepoint); output = Utf<32>::encodeAnsi(codepoint, output, replacement, locale); } return output; } //////////////////////////////////////////////////////////// template Out Utf<16>::toWide(In begin, In end, Out output, wchar_t replacement) { while (begin < end) { Uint32 codepoint; begin = decode(begin, end, codepoint); output = Utf<32>::encodeWide(codepoint, output, replacement); } return output; } //////////////////////////////////////////////////////////// template Out Utf<16>::toLatin1(In begin, In end, Out output, char replacement) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 while (begin < end) { *output++ = *begin < 256 ? static_cast(*begin) : replacement; begin++; } return output; } //////////////////////////////////////////////////////////// template Out Utf<16>::toUtf8(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint; begin = decode(begin, end, codepoint); output = Utf<8>::encode(codepoint, output); } return output; } //////////////////////////////////////////////////////////// template Out Utf<16>::toUtf16(In begin, In end, Out output) { return std::copy(begin, end, output); } //////////////////////////////////////////////////////////// template Out Utf<16>::toUtf32(In begin, In end, Out output) { while (begin < end) { Uint32 codepoint; begin = decode(begin, end, codepoint); *output++ = codepoint; } return output; } //////////////////////////////////////////////////////////// template In Utf<32>::decode(In begin, In /*end*/, Uint32& output, Uint32 /*replacement*/) { output = *begin++; return begin; } //////////////////////////////////////////////////////////// template Out Utf<32>::encode(Uint32 input, Out output, Uint32 /*replacement*/) { *output++ = input; return output; } //////////////////////////////////////////////////////////// template In Utf<32>::next(In begin, In /*end*/) { return ++begin; } //////////////////////////////////////////////////////////// template std::size_t Utf<32>::count(In begin, In end) { return begin - end; } //////////////////////////////////////////////////////////// template Out Utf<32>::fromAnsi(In begin, In end, Out output, const std::locale& locale) { while (begin < end) *output++ = decodeAnsi(*begin++, locale); return output; } //////////////////////////////////////////////////////////// template Out Utf<32>::fromWide(In begin, In end, Out output) { while (begin < end) *output++ = decodeWide(*begin++); return output; } //////////////////////////////////////////////////////////// template Out Utf<32>::fromLatin1(In begin, In end, Out output) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 return std::copy(begin, end, output); } //////////////////////////////////////////////////////////// template Out Utf<32>::toAnsi(In begin, In end, Out output, char replacement, const std::locale& locale) { while (begin < end) output = encodeAnsi(*begin++, output, replacement, locale); return output; } //////////////////////////////////////////////////////////// template Out Utf<32>::toWide(In begin, In end, Out output, wchar_t replacement) { while (begin < end) output = encodeWide(*begin++, output, replacement); return output; } //////////////////////////////////////////////////////////// template Out Utf<32>::toLatin1(In begin, In end, Out output, char replacement) { // Latin-1 is directly compatible with Unicode encodings, // and can thus be treated as (a sub-range of) UTF-32 while (begin < end) { *output++ = *begin < 256 ? static_cast(*begin) : replacement; begin++; } return output; } //////////////////////////////////////////////////////////// template Out Utf<32>::toUtf8(In begin, In end, Out output) { while (begin < end) output = Utf<8>::encode(*begin++, output); return output; } //////////////////////////////////////////////////////////// template Out Utf<32>::toUtf16(In begin, In end, Out output) { while (begin < end) output = Utf<16>::encode(*begin++, output); return output; } //////////////////////////////////////////////////////////// template Out Utf<32>::toUtf32(In begin, In end, Out output) { return std::copy(begin, end, output); } //////////////////////////////////////////////////////////// template Uint32 Utf<32>::decodeAnsi(In input, const std::locale& locale) { // On Windows, GCC's standard library (glibc++) has almost // no support for Unicode stuff. As a consequence, in this // context we can only use the default locale and ignore // the one passed as parameter. #if defined(SFML_SYSTEM_WINDOWS) && /* if Windows ... */ \ (defined(__GLIBCPP__) || defined (__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \ !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */ (void)locale; // to avoid warnings wchar_t character = 0; mbtowc(&character, &input, 1); return static_cast(character); #else // Get the facet of the locale which deals with character conversion const std::ctype& facet = std::use_facet< std::ctype >(locale); // Use the facet to convert each character of the input string return static_cast(facet.widen(input)); #endif } //////////////////////////////////////////////////////////// template Uint32 Utf<32>::decodeWide(In input) { // The encoding of wide characters is not well defined and is left to the system; // however we can safely assume that it is UCS-2 on Windows and // UCS-4 on Unix systems. // In both cases, a simple copy is enough (UCS-2 is a subset of UCS-4, // and UCS-4 *is* UTF-32). return input; } //////////////////////////////////////////////////////////// template Out Utf<32>::encodeAnsi(Uint32 codepoint, Out output, char replacement, const std::locale& locale) { // On Windows, gcc's standard library (glibc++) has almost // no support for Unicode stuff. As a consequence, in this // context we can only use the default locale and ignore // the one passed as parameter. #if defined(SFML_SYSTEM_WINDOWS) && /* if Windows ... */ \ (defined(__GLIBCPP__) || defined (__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \ !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */ (void)locale; // to avoid warnings char character = 0; if (wctomb(&character, static_cast(codepoint)) >= 0) *output++ = character; else if (replacement) *output++ = replacement; return output; #else // Get the facet of the locale which deals with character conversion const std::ctype& facet = std::use_facet< std::ctype >(locale); // Use the facet to convert each character of the input string *output++ = facet.narrow(static_cast(codepoint), replacement); return output; #endif } //////////////////////////////////////////////////////////// template Out Utf<32>::encodeWide(Uint32 codepoint, Out output, wchar_t replacement) { // The encoding of wide characters is not well defined and is left to the system; // however we can safely assume that it is UCS-2 on Windows and // UCS-4 on Unix systems. // For UCS-2 we need to check if the source characters fits in (UCS-2 is a subset of UCS-4). // For UCS-4 we can do a direct copy (UCS-4 *is* UTF-32). switch (sizeof(wchar_t)) { case 4: { *output++ = static_cast(codepoint); break; } default: { if ((codepoint <= 0xFFFF) && ((codepoint < 0xD800) || (codepoint > 0xDFFF))) { *output++ = static_cast(codepoint); } else if (replacement) { *output++ = replacement; } break; } } return output; } ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Vector2.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_VECTOR2_HPP #define SFML_VECTOR2_HPP namespace sf { //////////////////////////////////////////////////////////// /// \brief Utility template class for manipulating /// 2-dimensional vectors /// //////////////////////////////////////////////////////////// template class Vector2 { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates a Vector2(0, 0). /// //////////////////////////////////////////////////////////// Vector2(); //////////////////////////////////////////////////////////// /// \brief Construct the vector from its coordinates /// /// \param X X coordinate /// \param Y Y coordinate /// //////////////////////////////////////////////////////////// Vector2(T X, T Y); //////////////////////////////////////////////////////////// /// \brief Construct the vector from another type of vector /// /// This constructor doesn't replace the copy constructor, /// it's called only when U != T. /// A call to this constructor will fail to compile if U /// is not convertible to T. /// /// \param vector Vector to convert /// //////////////////////////////////////////////////////////// template explicit Vector2(const Vector2& vector); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// T x; ///< X coordinate of the vector T y; ///< Y coordinate of the vector }; //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of unary operator - /// /// \param right Vector to negate /// /// \return Memberwise opposite of the vector /// //////////////////////////////////////////////////////////// template Vector2 operator -(const Vector2& right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator += /// /// This operator performs a memberwise addition of both vectors, /// and assigns the result to \a left. /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// template Vector2& operator +=(Vector2& left, const Vector2& right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator -= /// /// This operator performs a memberwise subtraction of both vectors, /// and assigns the result to \a left. /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// template Vector2& operator -=(Vector2& left, const Vector2& right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator + /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return Memberwise addition of both vectors /// //////////////////////////////////////////////////////////// template Vector2 operator +(const Vector2& left, const Vector2& right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator - /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return Memberwise subtraction of both vectors /// //////////////////////////////////////////////////////////// template Vector2 operator -(const Vector2& left, const Vector2& right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator * /// /// \param left Left operand (a vector) /// \param right Right operand (a scalar value) /// /// \return Memberwise multiplication by \a right /// //////////////////////////////////////////////////////////// template Vector2 operator *(const Vector2& left, T right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator * /// /// \param left Left operand (a scalar value) /// \param right Right operand (a vector) /// /// \return Memberwise multiplication by \a left /// //////////////////////////////////////////////////////////// template Vector2 operator *(T left, const Vector2& right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator *= /// /// This operator performs a memberwise multiplication by \a right, /// and assigns the result to \a left. /// /// \param left Left operand (a vector) /// \param right Right operand (a scalar value) /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// template Vector2& operator *=(Vector2& left, T right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator / /// /// \param left Left operand (a vector) /// \param right Right operand (a scalar value) /// /// \return Memberwise division by \a right /// //////////////////////////////////////////////////////////// template Vector2 operator /(const Vector2& left, T right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator /= /// /// This operator performs a memberwise division by \a right, /// and assigns the result to \a left. /// /// \param left Left operand (a vector) /// \param right Right operand (a scalar value) /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// template Vector2& operator /=(Vector2& left, T right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator == /// /// This operator compares strict equality between two vectors. /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return True if \a left is equal to \a right /// //////////////////////////////////////////////////////////// template bool operator ==(const Vector2& left, const Vector2& right); //////////////////////////////////////////////////////////// /// \relates Vector2 /// \brief Overload of binary operator != /// /// This operator compares strict difference between two vectors. /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return True if \a left is not equal to \a right /// //////////////////////////////////////////////////////////// template bool operator !=(const Vector2& left, const Vector2& right); #include // Define the most common types typedef Vector2 Vector2i; typedef Vector2 Vector2u; typedef Vector2 Vector2f; } // namespace sf #endif // SFML_VECTOR2_HPP //////////////////////////////////////////////////////////// /// \class sf::Vector2 /// \ingroup system /// /// sf::Vector2 is a simple class that defines a mathematical /// vector with two coordinates (x and y). It can be used to /// represent anything that has two dimensions: a size, a point, /// a velocity, etc. /// /// The template parameter T is the type of the coordinates. It /// can be any type that supports arithmetic operations (+, -, /, *) /// and comparisons (==, !=), for example int or float. /// /// You generally don't have to care about the templated form (sf::Vector2), /// the most common specializations have special typedefs: /// \li sf::Vector2 is sf::Vector2f /// \li sf::Vector2 is sf::Vector2i /// \li sf::Vector2 is sf::Vector2u /// /// The sf::Vector2 class has a small and simple interface, its x and y members /// can be accessed directly (there are no accessors like setX(), getX()) and it /// contains no mathematical function like dot product, cross product, length, etc. /// /// Usage example: /// \code /// sf::Vector2f v1(16.5f, 24.f); /// v1.x = 18.2f; /// float y = v1.y; /// /// sf::Vector2f v2 = v1 * 5.f; /// sf::Vector2f v3; /// v3 = v1 + v2; /// /// bool different = (v2 != v3); /// \endcode /// /// Note: for 3-dimensional vectors, see sf::Vector3. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Vector2.inl ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// template inline Vector2::Vector2() : x(0), y(0) { } //////////////////////////////////////////////////////////// template inline Vector2::Vector2(T X, T Y) : x(X), y(Y) { } //////////////////////////////////////////////////////////// template template inline Vector2::Vector2(const Vector2& vector) : x(static_cast(vector.x)), y(static_cast(vector.y)) { } //////////////////////////////////////////////////////////// template inline Vector2 operator -(const Vector2& right) { return Vector2(-right.x, -right.y); } //////////////////////////////////////////////////////////// template inline Vector2& operator +=(Vector2& left, const Vector2& right) { left.x += right.x; left.y += right.y; return left; } //////////////////////////////////////////////////////////// template inline Vector2& operator -=(Vector2& left, const Vector2& right) { left.x -= right.x; left.y -= right.y; return left; } //////////////////////////////////////////////////////////// template inline Vector2 operator +(const Vector2& left, const Vector2& right) { return Vector2(left.x + right.x, left.y + right.y); } //////////////////////////////////////////////////////////// template inline Vector2 operator -(const Vector2& left, const Vector2& right) { return Vector2(left.x - right.x, left.y - right.y); } //////////////////////////////////////////////////////////// template inline Vector2 operator *(const Vector2& left, T right) { return Vector2(left.x * right, left.y * right); } //////////////////////////////////////////////////////////// template inline Vector2 operator *(T left, const Vector2& right) { return Vector2(right.x * left, right.y * left); } //////////////////////////////////////////////////////////// template inline Vector2& operator *=(Vector2& left, T right) { left.x *= right; left.y *= right; return left; } //////////////////////////////////////////////////////////// template inline Vector2 operator /(const Vector2& left, T right) { return Vector2(left.x / right, left.y / right); } //////////////////////////////////////////////////////////// template inline Vector2& operator /=(Vector2& left, T right) { left.x /= right; left.y /= right; return left; } //////////////////////////////////////////////////////////// template inline bool operator ==(const Vector2& left, const Vector2& right) { return (left.x == right.x) && (left.y == right.y); } //////////////////////////////////////////////////////////// template inline bool operator !=(const Vector2& left, const Vector2& right) { return (left.x != right.x) || (left.y != right.y); } ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Vector3.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_VECTOR3_HPP #define SFML_VECTOR3_HPP namespace sf { //////////////////////////////////////////////////////////// /// \brief Utility template class for manipulating /// 3-dimensional vectors /// //////////////////////////////////////////////////////////// template class Vector3 { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// Creates a Vector3(0, 0, 0). /// //////////////////////////////////////////////////////////// Vector3(); //////////////////////////////////////////////////////////// /// \brief Construct the vector from its coordinates /// /// \param X X coordinate /// \param Y Y coordinate /// \param Z Z coordinate /// //////////////////////////////////////////////////////////// Vector3(T X, T Y, T Z); //////////////////////////////////////////////////////////// /// \brief Construct the vector from another type of vector /// /// This constructor doesn't replace the copy constructor, /// it's called only when U != T. /// A call to this constructor will fail to compile if U /// is not convertible to T. /// /// \param vector Vector to convert /// //////////////////////////////////////////////////////////// template explicit Vector3(const Vector3& vector); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// T x; ///< X coordinate of the vector T y; ///< Y coordinate of the vector T z; ///< Z coordinate of the vector }; //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of unary operator - /// /// \param left Vector to negate /// /// \return Memberwise opposite of the vector /// //////////////////////////////////////////////////////////// template Vector3 operator -(const Vector3& left); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator += /// /// This operator performs a memberwise addition of both vectors, /// and assigns the result to \a left. /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// template Vector3& operator +=(Vector3& left, const Vector3& right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator -= /// /// This operator performs a memberwise subtraction of both vectors, /// and assigns the result to \a left. /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// template Vector3& operator -=(Vector3& left, const Vector3& right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator + /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return Memberwise addition of both vectors /// //////////////////////////////////////////////////////////// template Vector3 operator +(const Vector3& left, const Vector3& right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator - /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return Memberwise subtraction of both vectors /// //////////////////////////////////////////////////////////// template Vector3 operator -(const Vector3& left, const Vector3& right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator * /// /// \param left Left operand (a vector) /// \param right Right operand (a scalar value) /// /// \return Memberwise multiplication by \a right /// //////////////////////////////////////////////////////////// template Vector3 operator *(const Vector3& left, T right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator * /// /// \param left Left operand (a scalar value) /// \param right Right operand (a vector) /// /// \return Memberwise multiplication by \a left /// //////////////////////////////////////////////////////////// template Vector3 operator *(T left, const Vector3& right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator *= /// /// This operator performs a memberwise multiplication by \a right, /// and assigns the result to \a left. /// /// \param left Left operand (a vector) /// \param right Right operand (a scalar value) /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// template Vector3& operator *=(Vector3& left, T right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator / /// /// \param left Left operand (a vector) /// \param right Right operand (a scalar value) /// /// \return Memberwise division by \a right /// //////////////////////////////////////////////////////////// template Vector3 operator /(const Vector3& left, T right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator /= /// /// This operator performs a memberwise division by \a right, /// and assigns the result to \a left. /// /// \param left Left operand (a vector) /// \param right Right operand (a scalar value) /// /// \return Reference to \a left /// //////////////////////////////////////////////////////////// template Vector3& operator /=(Vector3& left, T right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator == /// /// This operator compares strict equality between two vectors. /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return True if \a left is equal to \a right /// //////////////////////////////////////////////////////////// template bool operator ==(const Vector3& left, const Vector3& right); //////////////////////////////////////////////////////////// /// \relates Vector3 /// \brief Overload of binary operator != /// /// This operator compares strict difference between two vectors. /// /// \param left Left operand (a vector) /// \param right Right operand (a vector) /// /// \return True if \a left is not equal to \a right /// //////////////////////////////////////////////////////////// template bool operator !=(const Vector3& left, const Vector3& right); #include // Define the most common types typedef Vector3 Vector3i; typedef Vector3 Vector3f; } // namespace sf #endif // SFML_VECTOR3_HPP //////////////////////////////////////////////////////////// /// \class sf::Vector3 /// \ingroup system /// /// sf::Vector3 is a simple class that defines a mathematical /// vector with three coordinates (x, y and z). It can be used to /// represent anything that has three dimensions: a size, a point, /// a velocity, etc. /// /// The template parameter T is the type of the coordinates. It /// can be any type that supports arithmetic operations (+, -, /, *) /// and comparisons (==, !=), for example int or float. /// /// You generally don't have to care about the templated form (sf::Vector3), /// the most common specializations have special typedefs: /// \li sf::Vector3 is sf::Vector3f /// \li sf::Vector3 is sf::Vector3i /// /// The sf::Vector3 class has a small and simple interface, its x and y members /// can be accessed directly (there are no accessors like setX(), getX()) and it /// contains no mathematical function like dot product, cross product, length, etc. /// /// Usage example: /// \code /// sf::Vector3f v1(16.5f, 24.f, -8.2f); /// v1.x = 18.2f; /// float y = v1.y; /// float z = v1.z; /// /// sf::Vector3f v2 = v1 * 5.f; /// sf::Vector3f v3; /// v3 = v1 + v2; /// /// bool different = (v2 != v3); /// \endcode /// /// Note: for 2-dimensional vectors, see sf::Vector2. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System/Vector3.inl ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// template inline Vector3::Vector3() : x(0), y(0), z(0) { } //////////////////////////////////////////////////////////// template inline Vector3::Vector3(T X, T Y, T Z) : x(X), y(Y), z(Z) { } //////////////////////////////////////////////////////////// template template inline Vector3::Vector3(const Vector3& vector) : x(static_cast(vector.x)), y(static_cast(vector.y)), z(static_cast(vector.z)) { } //////////////////////////////////////////////////////////// template inline Vector3 operator -(const Vector3& left) { return Vector3(-left.x, -left.y, -left.z); } //////////////////////////////////////////////////////////// template inline Vector3& operator +=(Vector3& left, const Vector3& right) { left.x += right.x; left.y += right.y; left.z += right.z; return left; } //////////////////////////////////////////////////////////// template inline Vector3& operator -=(Vector3& left, const Vector3& right) { left.x -= right.x; left.y -= right.y; left.z -= right.z; return left; } //////////////////////////////////////////////////////////// template inline Vector3 operator +(const Vector3& left, const Vector3& right) { return Vector3(left.x + right.x, left.y + right.y, left.z + right.z); } //////////////////////////////////////////////////////////// template inline Vector3 operator -(const Vector3& left, const Vector3& right) { return Vector3(left.x - right.x, left.y - right.y, left.z - right.z); } //////////////////////////////////////////////////////////// template inline Vector3 operator *(const Vector3& left, T right) { return Vector3(left.x * right, left.y * right, left.z * right); } //////////////////////////////////////////////////////////// template inline Vector3 operator *(T left, const Vector3& right) { return Vector3(right.x * left, right.y * left, right.z * left); } //////////////////////////////////////////////////////////// template inline Vector3& operator *=(Vector3& left, T right) { left.x *= right; left.y *= right; left.z *= right; return left; } //////////////////////////////////////////////////////////// template inline Vector3 operator /(const Vector3& left, T right) { return Vector3(left.x / right, left.y / right, left.z / right); } //////////////////////////////////////////////////////////// template inline Vector3& operator /=(Vector3& left, T right) { left.x /= right; left.y /= right; left.z /= right; return left; } //////////////////////////////////////////////////////////// template inline bool operator ==(const Vector3& left, const Vector3& right) { return (left.x == right.x) && (left.y == right.y) && (left.z == right.z); } //////////////////////////////////////////////////////////// template inline bool operator !=(const Vector3& left, const Vector3& right) { return (left.x != right.x) || (left.y != right.y) || (left.z != right.z); } ================================================ FILE: Libraries/Core/Windows/Headers/SFML/System.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SYSTEM_HPP #define SFML_SYSTEM_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif // SFML_SYSTEM_HPP //////////////////////////////////////////////////////////// /// \defgroup system System module /// /// Base module of SFML, defining various utilities. It provides /// vector classes, Unicode strings and conversion functions, /// threads and mutexes, timing classes. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/Context.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_CONTEXT_HPP #define SFML_CONTEXT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include namespace sf { namespace priv { class GlContext; } typedef void (*GlFunctionPointer)(); //////////////////////////////////////////////////////////// /// \brief Class holding a valid drawing context /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API Context : GlResource, NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// The constructor creates and activates the context /// //////////////////////////////////////////////////////////// Context(); //////////////////////////////////////////////////////////// /// \brief Destructor /// /// The destructor deactivates and destroys the context /// //////////////////////////////////////////////////////////// ~Context(); //////////////////////////////////////////////////////////// /// \brief Activate or deactivate explicitly the context /// /// \param active True to activate, false to deactivate /// /// \return True on success, false on failure /// //////////////////////////////////////////////////////////// bool setActive(bool active); //////////////////////////////////////////////////////////// /// \brief Get the settings of the context /// /// Note that these settings may be different than the ones /// passed to the constructor; they are indeed adjusted if the /// original settings are not directly supported by the system. /// /// \return Structure containing the settings /// //////////////////////////////////////////////////////////// const ContextSettings& getSettings() const; //////////////////////////////////////////////////////////// /// \brief Check whether a given OpenGL extension is available /// /// \param name Name of the extension to check for /// /// \return True if available, false if unavailable /// //////////////////////////////////////////////////////////// static bool isExtensionAvailable(const char* name); //////////////////////////////////////////////////////////// /// \brief Get the address of an OpenGL function /// /// \param name Name of the function to get the address of /// /// \return Address of the OpenGL function, 0 on failure /// //////////////////////////////////////////////////////////// static GlFunctionPointer getFunction(const char* name); //////////////////////////////////////////////////////////// /// \brief Get the currently active context /// /// \return The currently active context or NULL if none is active /// //////////////////////////////////////////////////////////// static const Context* getActiveContext(); //////////////////////////////////////////////////////////// /// \brief Construct a in-memory context /// /// This constructor is for internal use, you don't need /// to bother with it. /// /// \param settings Creation parameters /// \param width Back buffer width /// \param height Back buffer height /// //////////////////////////////////////////////////////////// Context(const ContextSettings& settings, unsigned int width, unsigned int height); private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// priv::GlContext* m_context; ///< Internal OpenGL context }; } // namespace sf #endif // SFML_CONTEXT_HPP //////////////////////////////////////////////////////////// /// \class sf::Context /// \ingroup window /// /// If you need to make OpenGL calls without having an /// active window (like in a thread), you can use an /// instance of this class to get a valid context. /// /// Having a valid context is necessary for *every* OpenGL call. /// /// Note that a context is only active in its current thread, /// if you create a new thread it will have no valid context /// by default. /// /// To use a sf::Context instance, just construct it and let it /// live as long as you need a valid context. No explicit activation /// is needed, all it has to do is to exist. Its destructor /// will take care of deactivating and freeing all the attached /// resources. /// /// Usage example: /// \code /// void threadFunction(void*) /// { /// sf::Context context; /// // from now on, you have a valid context /// /// // you can make OpenGL calls /// glClear(GL_DEPTH_BUFFER_BIT); /// } /// // the context is automatically deactivated and destroyed /// // by the sf::Context destructor /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/ContextSettings.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_CONTEXTSETTINGS_HPP #define SFML_CONTEXTSETTINGS_HPP namespace sf { //////////////////////////////////////////////////////////// /// \brief Structure defining the settings of the OpenGL /// context attached to a window /// //////////////////////////////////////////////////////////// struct ContextSettings { //////////////////////////////////////////////////////////// /// \brief Enumeration of the context attribute flags /// //////////////////////////////////////////////////////////// enum Attribute { Default = 0, ///< Non-debug, compatibility context (this and the core attribute are mutually exclusive) Core = 1 << 0, ///< Core attribute Debug = 1 << 2 ///< Debug attribute }; //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// \param depth Depth buffer bits /// \param stencil Stencil buffer bits /// \param antialiasing Antialiasing level /// \param major Major number of the context version /// \param minor Minor number of the context version /// \param attributes Attribute flags of the context /// \param sRgb sRGB capable framebuffer /// //////////////////////////////////////////////////////////// explicit ContextSettings(unsigned int depth = 0, unsigned int stencil = 0, unsigned int antialiasing = 0, unsigned int major = 1, unsigned int minor = 1, unsigned int attributes = Default, bool sRgb = false) : depthBits (depth), stencilBits (stencil), antialiasingLevel(antialiasing), majorVersion (major), minorVersion (minor), attributeFlags (attributes), sRgbCapable (sRgb) { } //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// unsigned int depthBits; ///< Bits of the depth buffer unsigned int stencilBits; ///< Bits of the stencil buffer unsigned int antialiasingLevel; ///< Level of antialiasing unsigned int majorVersion; ///< Major number of the context version to create unsigned int minorVersion; ///< Minor number of the context version to create Uint32 attributeFlags; ///< The attribute flags to create the context with bool sRgbCapable; ///< Whether the context framebuffer is sRGB capable }; } // namespace sf #endif // SFML_CONTEXTSETTINGS_HPP //////////////////////////////////////////////////////////// /// \class sf::ContextSettings /// \ingroup window /// /// ContextSettings allows to define several advanced settings /// of the OpenGL context attached to a window. All these /// settings with the exception of the compatibility flag /// and anti-aliasing level have no impact on the regular /// SFML rendering (graphics module), so you may need to use /// this structure only if you're using SFML as a windowing /// system for custom OpenGL rendering. /// /// The depthBits and stencilBits members define the number /// of bits per pixel requested for the (respectively) depth /// and stencil buffers. /// /// antialiasingLevel represents the requested number of /// multisampling levels for anti-aliasing. /// /// majorVersion and minorVersion define the version of the /// OpenGL context that you want. Only versions greater or /// equal to 3.0 are relevant; versions lesser than 3.0 are /// all handled the same way (i.e. you can use any version /// < 3.0 if you don't want an OpenGL 3 context). /// /// When requesting a context with a version greater or equal /// to 3.2, you have the option of specifying whether the /// context should follow the core or compatibility profile /// of all newer (>= 3.2) OpenGL specifications. For versions /// 3.0 and 3.1 there is only the core profile. By default /// a compatibility context is created. You only need to specify /// the core flag if you want a core profile context to use with /// your own OpenGL rendering. /// Warning: The graphics module will not function if you /// request a core profile context. Make sure the attributes are /// set to Default if you want to use the graphics module. /// /// Setting the debug attribute flag will request a context with /// additional debugging features enabled. Depending on the /// system, this might be required for advanced OpenGL debugging. /// OpenGL debugging is disabled by default. /// /// Special Note for OS X: /// Apple only supports choosing between either a legacy context /// (OpenGL 2.1) or a core context (OpenGL version depends on the /// operating system version but is at least 3.2). Compatibility /// contexts are not supported. Further information is available on the /// /// OpenGL Capabilities Tables page. OS X also currently does /// not support debug contexts. /// /// Please note that these values are only a hint. /// No failure will be reported if one or more of these values /// are not supported by the system; instead, SFML will try to /// find the closest valid match. You can then retrieve the /// settings that the window actually used to create its context, /// with Window::getSettings(). /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/Event.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_EVENT_HPP #define SFML_EVENT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Defines a system event and its parameters /// //////////////////////////////////////////////////////////// class Event { public: //////////////////////////////////////////////////////////// /// \brief Size events parameters (Resized) /// //////////////////////////////////////////////////////////// struct SizeEvent { unsigned int width; ///< New width, in pixels unsigned int height; ///< New height, in pixels }; //////////////////////////////////////////////////////////// /// \brief Keyboard event parameters (KeyPressed, KeyReleased) /// //////////////////////////////////////////////////////////// struct KeyEvent { Keyboard::Key code; ///< Code of the key that has been pressed bool alt; ///< Is the Alt key pressed? bool control; ///< Is the Control key pressed? bool shift; ///< Is the Shift key pressed? bool system; ///< Is the System key pressed? }; //////////////////////////////////////////////////////////// /// \brief Text event parameters (TextEntered) /// //////////////////////////////////////////////////////////// struct TextEvent { Uint32 unicode; ///< UTF-32 Unicode value of the character }; //////////////////////////////////////////////////////////// /// \brief Mouse move event parameters (MouseMoved) /// //////////////////////////////////////////////////////////// struct MouseMoveEvent { int x; ///< X position of the mouse pointer, relative to the left of the owner window int y; ///< Y position of the mouse pointer, relative to the top of the owner window }; //////////////////////////////////////////////////////////// /// \brief Mouse buttons events parameters /// (MouseButtonPressed, MouseButtonReleased) /// //////////////////////////////////////////////////////////// struct MouseButtonEvent { Mouse::Button button; ///< Code of the button that has been pressed int x; ///< X position of the mouse pointer, relative to the left of the owner window int y; ///< Y position of the mouse pointer, relative to the top of the owner window }; //////////////////////////////////////////////////////////// /// \brief Mouse wheel events parameters (MouseWheelMoved) /// /// \deprecated This event is deprecated and potentially inaccurate. /// Use MouseWheelScrollEvent instead. /// //////////////////////////////////////////////////////////// struct MouseWheelEvent { int delta; ///< Number of ticks the wheel has moved (positive is up, negative is down) int x; ///< X position of the mouse pointer, relative to the left of the owner window int y; ///< Y position of the mouse pointer, relative to the top of the owner window }; //////////////////////////////////////////////////////////// /// \brief Mouse wheel events parameters (MouseWheelScrolled) /// //////////////////////////////////////////////////////////// struct MouseWheelScrollEvent { Mouse::Wheel wheel; ///< Which wheel (for mice with multiple ones) float delta; ///< Wheel offset (positive is up/left, negative is down/right). High-precision mice may use non-integral offsets. int x; ///< X position of the mouse pointer, relative to the left of the owner window int y; ///< Y position of the mouse pointer, relative to the top of the owner window }; //////////////////////////////////////////////////////////// /// \brief Joystick connection events parameters /// (JoystickConnected, JoystickDisconnected) /// //////////////////////////////////////////////////////////// struct JoystickConnectEvent { unsigned int joystickId; ///< Index of the joystick (in range [0 .. Joystick::Count - 1]) }; //////////////////////////////////////////////////////////// /// \brief Joystick axis move event parameters (JoystickMoved) /// //////////////////////////////////////////////////////////// struct JoystickMoveEvent { unsigned int joystickId; ///< Index of the joystick (in range [0 .. Joystick::Count - 1]) Joystick::Axis axis; ///< Axis on which the joystick moved float position; ///< New position on the axis (in range [-100 .. 100]) }; //////////////////////////////////////////////////////////// /// \brief Joystick buttons events parameters /// (JoystickButtonPressed, JoystickButtonReleased) /// //////////////////////////////////////////////////////////// struct JoystickButtonEvent { unsigned int joystickId; ///< Index of the joystick (in range [0 .. Joystick::Count - 1]) unsigned int button; ///< Index of the button that has been pressed (in range [0 .. Joystick::ButtonCount - 1]) }; //////////////////////////////////////////////////////////// /// \brief Touch events parameters (TouchBegan, TouchMoved, TouchEnded) /// //////////////////////////////////////////////////////////// struct TouchEvent { unsigned int finger; ///< Index of the finger in case of multi-touch events int x; ///< X position of the touch, relative to the left of the owner window int y; ///< Y position of the touch, relative to the top of the owner window }; //////////////////////////////////////////////////////////// /// \brief Sensor event parameters (SensorChanged) /// //////////////////////////////////////////////////////////// struct SensorEvent { Sensor::Type type; ///< Type of the sensor float x; ///< Current value of the sensor on X axis float y; ///< Current value of the sensor on Y axis float z; ///< Current value of the sensor on Z axis }; //////////////////////////////////////////////////////////// /// \brief Enumeration of the different types of events /// //////////////////////////////////////////////////////////// enum EventType { Closed, ///< The window requested to be closed (no data) Resized, ///< The window was resized (data in event.size) LostFocus, ///< The window lost the focus (no data) GainedFocus, ///< The window gained the focus (no data) TextEntered, ///< A character was entered (data in event.text) KeyPressed, ///< A key was pressed (data in event.key) KeyReleased, ///< A key was released (data in event.key) MouseWheelMoved, ///< The mouse wheel was scrolled (data in event.mouseWheel) (deprecated) MouseWheelScrolled, ///< The mouse wheel was scrolled (data in event.mouseWheelScroll) MouseButtonPressed, ///< A mouse button was pressed (data in event.mouseButton) MouseButtonReleased, ///< A mouse button was released (data in event.mouseButton) MouseMoved, ///< The mouse cursor moved (data in event.mouseMove) MouseEntered, ///< The mouse cursor entered the area of the window (no data) MouseLeft, ///< The mouse cursor left the area of the window (no data) JoystickButtonPressed, ///< A joystick button was pressed (data in event.joystickButton) JoystickButtonReleased, ///< A joystick button was released (data in event.joystickButton) JoystickMoved, ///< The joystick moved along an axis (data in event.joystickMove) JoystickConnected, ///< A joystick was connected (data in event.joystickConnect) JoystickDisconnected, ///< A joystick was disconnected (data in event.joystickConnect) TouchBegan, ///< A touch event began (data in event.touch) TouchMoved, ///< A touch moved (data in event.touch) TouchEnded, ///< A touch event ended (data in event.touch) SensorChanged, ///< A sensor value changed (data in event.sensor) Count ///< Keep last -- the total number of event types }; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// EventType type; ///< Type of the event union { SizeEvent size; ///< Size event parameters (Event::Resized) KeyEvent key; ///< Key event parameters (Event::KeyPressed, Event::KeyReleased) TextEvent text; ///< Text event parameters (Event::TextEntered) MouseMoveEvent mouseMove; ///< Mouse move event parameters (Event::MouseMoved) MouseButtonEvent mouseButton; ///< Mouse button event parameters (Event::MouseButtonPressed, Event::MouseButtonReleased) MouseWheelEvent mouseWheel; ///< Mouse wheel event parameters (Event::MouseWheelMoved) (deprecated) MouseWheelScrollEvent mouseWheelScroll; ///< Mouse wheel event parameters (Event::MouseWheelScrolled) JoystickMoveEvent joystickMove; ///< Joystick move event parameters (Event::JoystickMoved) JoystickButtonEvent joystickButton; ///< Joystick button event parameters (Event::JoystickButtonPressed, Event::JoystickButtonReleased) JoystickConnectEvent joystickConnect; ///< Joystick (dis)connect event parameters (Event::JoystickConnected, Event::JoystickDisconnected) TouchEvent touch; ///< Touch events parameters (Event::TouchBegan, Event::TouchMoved, Event::TouchEnded) SensorEvent sensor; ///< Sensor event parameters (Event::SensorChanged) }; }; } // namespace sf #endif // SFML_EVENT_HPP //////////////////////////////////////////////////////////// /// \class sf::Event /// \ingroup window /// /// sf::Event holds all the informations about a system event /// that just happened. Events are retrieved using the /// sf::Window::pollEvent and sf::Window::waitEvent functions. /// /// A sf::Event instance contains the type of the event /// (mouse moved, key pressed, window closed, ...) as well /// as the details about this particular event. Please note that /// the event parameters are defined in a union, which means that /// only the member matching the type of the event will be properly /// filled; all other members will have undefined values and must not /// be read if the type of the event doesn't match. For example, /// if you received a KeyPressed event, then you must read the /// event.key member, all other members such as event.MouseMove /// or event.text will have undefined values. /// /// Usage example: /// \code /// sf::Event event; /// while (window.pollEvent(event)) /// { /// // Request for closing the window /// if (event.type == sf::Event::Closed) /// window.close(); /// /// // The escape key was pressed /// if ((event.type == sf::Event::KeyPressed) && (event.key.code == sf::Keyboard::Escape)) /// window.close(); /// /// // The window was resized /// if (event.type == sf::Event::Resized) /// doSomethingWithTheNewSize(event.size.width, event.size.height); /// /// // etc ... /// } /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/Export.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_WINDOW_EXPORT_HPP #define SFML_WINDOW_EXPORT_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include //////////////////////////////////////////////////////////// // Define portable import / export macros //////////////////////////////////////////////////////////// #if defined(SFML_WINDOW_EXPORTS) #define SFML_WINDOW_API SFML_API_EXPORT #else #define SFML_WINDOW_API SFML_API_IMPORT #endif #endif // SFML_WINDOW_EXPORT_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/GlResource.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_GLRESOURCE_HPP #define SFML_GLRESOURCE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { class Context; //////////////////////////////////////////////////////////// /// \brief Base class for classes that require an OpenGL context /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API GlResource { protected: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// GlResource(); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~GlResource(); //////////////////////////////////////////////////////////// /// \brief Empty function for ABI compatibility, use acquireTransientContext instead /// //////////////////////////////////////////////////////////// static void ensureGlContext(); //////////////////////////////////////////////////////////// /// \brief RAII helper class to temporarily lock an available context for use /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API TransientContextLock : NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// //////////////////////////////////////////////////////////// TransientContextLock(); //////////////////////////////////////////////////////////// /// \brief Destructor /// //////////////////////////////////////////////////////////// ~TransientContextLock(); private: Context* m_context; ///< Temporary context, in case we needed to create one }; }; } // namespace sf #endif // SFML_GLRESOURCE_HPP //////////////////////////////////////////////////////////// /// \class sf::GlResource /// \ingroup window /// /// This class is for internal use only, it must be the base /// of every class that requires a valid OpenGL context in /// order to work. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/Joystick.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_JOYSTICK_HPP #define SFML_JOYSTICK_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Give access to the real-time state of the joysticks /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API Joystick { public: //////////////////////////////////////////////////////////// /// \brief Constants related to joysticks capabilities /// //////////////////////////////////////////////////////////// enum { Count = 8, ///< Maximum number of supported joysticks ButtonCount = 32, ///< Maximum number of supported buttons AxisCount = 8 ///< Maximum number of supported axes }; //////////////////////////////////////////////////////////// /// \brief Axes supported by SFML joysticks /// //////////////////////////////////////////////////////////// enum Axis { X, ///< The X axis Y, ///< The Y axis Z, ///< The Z axis R, ///< The R axis U, ///< The U axis V, ///< The V axis PovX, ///< The X axis of the point-of-view hat PovY ///< The Y axis of the point-of-view hat }; //////////////////////////////////////////////////////////// /// \brief Structure holding a joystick's identification /// //////////////////////////////////////////////////////////// struct SFML_WINDOW_API Identification { Identification(); String name; ///< Name of the joystick unsigned int vendorId; ///< Manufacturer identifier unsigned int productId; ///< Product identifier }; //////////////////////////////////////////////////////////// /// \brief Check if a joystick is connected /// /// \param joystick Index of the joystick to check /// /// \return True if the joystick is connected, false otherwise /// //////////////////////////////////////////////////////////// static bool isConnected(unsigned int joystick); //////////////////////////////////////////////////////////// /// \brief Return the number of buttons supported by a joystick /// /// If the joystick is not connected, this function returns 0. /// /// \param joystick Index of the joystick /// /// \return Number of buttons supported by the joystick /// //////////////////////////////////////////////////////////// static unsigned int getButtonCount(unsigned int joystick); //////////////////////////////////////////////////////////// /// \brief Check if a joystick supports a given axis /// /// If the joystick is not connected, this function returns false. /// /// \param joystick Index of the joystick /// \param axis Axis to check /// /// \return True if the joystick supports the axis, false otherwise /// //////////////////////////////////////////////////////////// static bool hasAxis(unsigned int joystick, Axis axis); //////////////////////////////////////////////////////////// /// \brief Check if a joystick button is pressed /// /// If the joystick is not connected, this function returns false. /// /// \param joystick Index of the joystick /// \param button Button to check /// /// \return True if the button is pressed, false otherwise /// //////////////////////////////////////////////////////////// static bool isButtonPressed(unsigned int joystick, unsigned int button); //////////////////////////////////////////////////////////// /// \brief Get the current position of a joystick axis /// /// If the joystick is not connected, this function returns 0. /// /// \param joystick Index of the joystick /// \param axis Axis to check /// /// \return Current position of the axis, in range [-100 .. 100] /// //////////////////////////////////////////////////////////// static float getAxisPosition(unsigned int joystick, Axis axis); //////////////////////////////////////////////////////////// /// \brief Get the joystick information /// /// \param joystick Index of the joystick /// /// \return Structure containing joystick information. /// //////////////////////////////////////////////////////////// static Identification getIdentification(unsigned int joystick); //////////////////////////////////////////////////////////// /// \brief Update the states of all joysticks /// /// This function is used internally by SFML, so you normally /// don't have to call it explicitly. However, you may need to /// call it if you have no window yet (or no window at all): /// in this case the joystick states are not updated automatically. /// //////////////////////////////////////////////////////////// static void update(); }; } // namespace sf #endif // SFML_JOYSTICK_HPP //////////////////////////////////////////////////////////// /// \class sf::Joystick /// \ingroup window /// /// sf::Joystick provides an interface to the state of the /// joysticks. It only contains static functions, so it's not /// meant to be instantiated. Instead, each joystick is identified /// by an index that is passed to the functions of this class. /// /// This class allows users to query the state of joysticks at any /// time and directly, without having to deal with a window and /// its events. Compared to the JoystickMoved, JoystickButtonPressed /// and JoystickButtonReleased events, sf::Joystick can retrieve the /// state of axes and buttons of joysticks at any time /// (you don't need to store and update a boolean on your side /// in order to know if a button is pressed or released), and you /// always get the real state of joysticks, even if they are /// moved, pressed or released when your window is out of focus /// and no event is triggered. /// /// SFML supports: /// \li 8 joysticks (sf::Joystick::Count) /// \li 32 buttons per joystick (sf::Joystick::ButtonCount) /// \li 8 axes per joystick (sf::Joystick::AxisCount) /// /// Unlike the keyboard or mouse, the state of joysticks is sometimes /// not directly available (depending on the OS), therefore an update() /// function must be called in order to update the current state of /// joysticks. When you have a window with event handling, this is done /// automatically, you don't need to call anything. But if you have no /// window, or if you want to check joysticks state before creating one, /// you must call sf::Joystick::update explicitly. /// /// Usage example: /// \code /// // Is joystick #0 connected? /// bool connected = sf::Joystick::isConnected(0); /// /// // How many buttons does joystick #0 support? /// unsigned int buttons = sf::Joystick::getButtonCount(0); /// /// // Does joystick #0 define a X axis? /// bool hasX = sf::Joystick::hasAxis(0, sf::Joystick::X); /// /// // Is button #2 pressed on joystick #0? /// bool pressed = sf::Joystick::isButtonPressed(0, 2); /// /// // What's the current position of the Y axis on joystick #0? /// float position = sf::Joystick::getAxisPosition(0, sf::Joystick::Y); /// \endcode /// /// \see sf::Keyboard, sf::Mouse /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/Keyboard.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_KEYBOARD_HPP #define SFML_KEYBOARD_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Give access to the real-time state of the keyboard /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API Keyboard { public: //////////////////////////////////////////////////////////// /// \brief Key codes /// //////////////////////////////////////////////////////////// enum Key { Unknown = -1, ///< Unhandled key A = 0, ///< The A key B, ///< The B key C, ///< The C key D, ///< The D key E, ///< The E key F, ///< The F key G, ///< The G key H, ///< The H key I, ///< The I key J, ///< The J key K, ///< The K key L, ///< The L key M, ///< The M key N, ///< The N key O, ///< The O key P, ///< The P key Q, ///< The Q key R, ///< The R key S, ///< The S key T, ///< The T key U, ///< The U key V, ///< The V key W, ///< The W key X, ///< The X key Y, ///< The Y key Z, ///< The Z key Num0, ///< The 0 key Num1, ///< The 1 key Num2, ///< The 2 key Num3, ///< The 3 key Num4, ///< The 4 key Num5, ///< The 5 key Num6, ///< The 6 key Num7, ///< The 7 key Num8, ///< The 8 key Num9, ///< The 9 key Escape, ///< The Escape key LControl, ///< The left Control key LShift, ///< The left Shift key LAlt, ///< The left Alt key LSystem, ///< The left OS specific key: window (Windows and Linux), apple (MacOS X), ... RControl, ///< The right Control key RShift, ///< The right Shift key RAlt, ///< The right Alt key RSystem, ///< The right OS specific key: window (Windows and Linux), apple (MacOS X), ... Menu, ///< The Menu key LBracket, ///< The [ key RBracket, ///< The ] key SemiColon, ///< The ; key Comma, ///< The , key Period, ///< The . key Quote, ///< The ' key Slash, ///< The / key BackSlash, ///< The \ key Tilde, ///< The ~ key Equal, ///< The = key Dash, ///< The - key Space, ///< The Space key Return, ///< The Return key BackSpace, ///< The Backspace key Tab, ///< The Tabulation key PageUp, ///< The Page up key PageDown, ///< The Page down key End, ///< The End key Home, ///< The Home key Insert, ///< The Insert key Delete, ///< The Delete key Add, ///< The + key Subtract, ///< The - key Multiply, ///< The * key Divide, ///< The / key Left, ///< Left arrow Right, ///< Right arrow Up, ///< Up arrow Down, ///< Down arrow Numpad0, ///< The numpad 0 key Numpad1, ///< The numpad 1 key Numpad2, ///< The numpad 2 key Numpad3, ///< The numpad 3 key Numpad4, ///< The numpad 4 key Numpad5, ///< The numpad 5 key Numpad6, ///< The numpad 6 key Numpad7, ///< The numpad 7 key Numpad8, ///< The numpad 8 key Numpad9, ///< The numpad 9 key F1, ///< The F1 key F2, ///< The F2 key F3, ///< The F3 key F4, ///< The F4 key F5, ///< The F5 key F6, ///< The F6 key F7, ///< The F7 key F8, ///< The F8 key F9, ///< The F9 key F10, ///< The F10 key F11, ///< The F11 key F12, ///< The F12 key F13, ///< The F13 key F14, ///< The F14 key F15, ///< The F15 key Pause, ///< The Pause key KeyCount ///< Keep last -- the total number of keyboard keys }; //////////////////////////////////////////////////////////// /// \brief Check if a key is pressed /// /// \param key Key to check /// /// \return True if the key is pressed, false otherwise /// //////////////////////////////////////////////////////////// static bool isKeyPressed(Key key); //////////////////////////////////////////////////////////// /// \brief Show or hide the virtual keyboard /// /// Warning: the virtual keyboard is not supported on all /// systems. It will typically be implemented on mobile OSes /// (Android, iOS) but not on desktop OSes (Windows, Linux, ...). /// /// If the virtual keyboard is not available, this function does /// nothing. /// /// \param visible True to show, false to hide /// //////////////////////////////////////////////////////////// static void setVirtualKeyboardVisible(bool visible); }; } // namespace sf #endif // SFML_KEYBOARD_HPP //////////////////////////////////////////////////////////// /// \class sf::Keyboard /// \ingroup window /// /// sf::Keyboard provides an interface to the state of the /// keyboard. It only contains static functions (a single /// keyboard is assumed), so it's not meant to be instantiated. /// /// This class allows users to query the keyboard state at any /// time and directly, without having to deal with a window and /// its events. Compared to the KeyPressed and KeyReleased events, /// sf::Keyboard can retrieve the state of a key at any time /// (you don't need to store and update a boolean on your side /// in order to know if a key is pressed or released), and you /// always get the real state of the keyboard, even if keys are /// pressed or released when your window is out of focus and no /// event is triggered. /// /// Usage example: /// \code /// if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) /// { /// // move left... /// } /// else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) /// { /// // move right... /// } /// else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) /// { /// // quit... /// } /// \endcode /// /// \see sf::Joystick, sf::Mouse, sf::Touch /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/Mouse.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_MOUSE_HPP #define SFML_MOUSE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { class Window; //////////////////////////////////////////////////////////// /// \brief Give access to the real-time state of the mouse /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API Mouse { public: //////////////////////////////////////////////////////////// /// \brief Mouse buttons /// //////////////////////////////////////////////////////////// enum Button { Left, ///< The left mouse button Right, ///< The right mouse button Middle, ///< The middle (wheel) mouse button XButton1, ///< The first extra mouse button XButton2, ///< The second extra mouse button ButtonCount ///< Keep last -- the total number of mouse buttons }; //////////////////////////////////////////////////////////// /// \brief Mouse wheels /// //////////////////////////////////////////////////////////// enum Wheel { VerticalWheel, ///< The vertical mouse wheel HorizontalWheel ///< The horizontal mouse wheel }; //////////////////////////////////////////////////////////// /// \brief Check if a mouse button is pressed /// /// \param button Button to check /// /// \return True if the button is pressed, false otherwise /// //////////////////////////////////////////////////////////// static bool isButtonPressed(Button button); //////////////////////////////////////////////////////////// /// \brief Get the current position of the mouse in desktop coordinates /// /// This function returns the global position of the mouse /// cursor on the desktop. /// /// \return Current position of the mouse /// //////////////////////////////////////////////////////////// static Vector2i getPosition(); //////////////////////////////////////////////////////////// /// \brief Get the current position of the mouse in window coordinates /// /// This function returns the current position of the mouse /// cursor, relative to the given window. /// /// \param relativeTo Reference window /// /// \return Current position of the mouse /// //////////////////////////////////////////////////////////// static Vector2i getPosition(const Window& relativeTo); //////////////////////////////////////////////////////////// /// \brief Set the current position of the mouse in desktop coordinates /// /// This function sets the global position of the mouse /// cursor on the desktop. /// /// \param position New position of the mouse /// //////////////////////////////////////////////////////////// static void setPosition(const Vector2i& position); //////////////////////////////////////////////////////////// /// \brief Set the current position of the mouse in window coordinates /// /// This function sets the current position of the mouse /// cursor, relative to the given window. /// /// \param position New position of the mouse /// \param relativeTo Reference window /// //////////////////////////////////////////////////////////// static void setPosition(const Vector2i& position, const Window& relativeTo); }; } // namespace sf #endif // SFML_MOUSE_HPP //////////////////////////////////////////////////////////// /// \class sf::Mouse /// \ingroup window /// /// sf::Mouse provides an interface to the state of the /// mouse. It only contains static functions (a single /// mouse is assumed), so it's not meant to be instantiated. /// /// This class allows users to query the mouse state at any /// time and directly, without having to deal with a window and /// its events. Compared to the MouseMoved, MouseButtonPressed /// and MouseButtonReleased events, sf::Mouse can retrieve the /// state of the cursor and the buttons at any time /// (you don't need to store and update a boolean on your side /// in order to know if a button is pressed or released), and you /// always get the real state of the mouse, even if it is /// moved, pressed or released when your window is out of focus /// and no event is triggered. /// /// The setPosition and getPosition functions can be used to change /// or retrieve the current position of the mouse pointer. There are /// two versions: one that operates in global coordinates (relative /// to the desktop) and one that operates in window coordinates /// (relative to a specific window). /// /// Usage example: /// \code /// if (sf::Mouse::isButtonPressed(sf::Mouse::Left)) /// { /// // left click... /// } /// /// // get global mouse position /// sf::Vector2i position = sf::Mouse::getPosition(); /// /// // set mouse position relative to a window /// sf::Mouse::setPosition(sf::Vector2i(100, 200), window); /// \endcode /// /// \see sf::Joystick, sf::Keyboard, sf::Touch /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/Sensor.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SENSOR_HPP #define SFML_SENSOR_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief Give access to the real-time state of the sensors /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API Sensor { public: //////////////////////////////////////////////////////////// /// \brief Sensor type /// //////////////////////////////////////////////////////////// enum Type { Accelerometer, ///< Measures the raw acceleration (m/s^2) Gyroscope, ///< Measures the raw rotation rates (degrees/s) Magnetometer, ///< Measures the ambient magnetic field (micro-teslas) Gravity, ///< Measures the direction and intensity of gravity, independent of device acceleration (m/s^2) UserAcceleration, ///< Measures the direction and intensity of device acceleration, independent of the gravity (m/s^2) Orientation, ///< Measures the absolute 3D orientation (degrees) Count ///< Keep last -- the total number of sensor types }; //////////////////////////////////////////////////////////// /// \brief Check if a sensor is available on the underlying platform /// /// \param sensor Sensor to check /// /// \return True if the sensor is available, false otherwise /// //////////////////////////////////////////////////////////// static bool isAvailable(Type sensor); //////////////////////////////////////////////////////////// /// \brief Enable or disable a sensor /// /// All sensors are disabled by default, to avoid consuming too /// much battery power. Once a sensor is enabled, it starts /// sending events of the corresponding type. /// /// This function does nothing if the sensor is unavailable. /// /// \param sensor Sensor to enable /// \param enabled True to enable, false to disable /// //////////////////////////////////////////////////////////// static void setEnabled(Type sensor, bool enabled); //////////////////////////////////////////////////////////// /// \brief Get the current sensor value /// /// \param sensor Sensor to read /// /// \return The current sensor value /// //////////////////////////////////////////////////////////// static Vector3f getValue(Type sensor); }; } // namespace sf #endif // SFML_SENSOR_HPP //////////////////////////////////////////////////////////// /// \class sf::Sensor /// \ingroup window /// /// sf::Sensor provides an interface to the state of the /// various sensors that a device provides. It only contains static /// functions, so it's not meant to be instantiated. /// /// This class allows users to query the sensors values at any /// time and directly, without having to deal with a window and /// its events. Compared to the SensorChanged event, sf::Sensor /// can retrieve the state of a sensor at any time (you don't need to /// store and update its current value on your side). /// /// Depending on the OS and hardware of the device (phone, tablet, ...), /// some sensor types may not be available. You should always check /// the availability of a sensor before trying to read it, with the /// sf::Sensor::isAvailable function. /// /// You may wonder why some sensor types look so similar, for example /// Accelerometer and Gravity / UserAcceleration. The first one /// is the raw measurement of the acceleration, and takes into account /// both the earth gravity and the user movement. The others are /// more precise: they provide these components separately, which is /// usually more useful. In fact they are not direct sensors, they /// are computed internally based on the raw acceleration and other sensors. /// This is exactly the same for Gyroscope vs Orientation. /// /// Because sensors consume a non-negligible amount of current, they are /// all disabled by default. You must call sf::Sensor::setEnabled for each /// sensor in which you are interested. /// /// Usage example: /// \code /// if (sf::Sensor::isAvailable(sf::Sensor::Gravity)) /// { /// // gravity sensor is available /// } /// /// // enable the gravity sensor /// sf::Sensor::setEnabled(sf::Sensor::Gravity, true); /// /// // get the current value of gravity /// sf::Vector3f gravity = sf::Sensor::getValue(sf::Sensor::Gravity); /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/Touch.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_TOUCH_HPP #define SFML_TOUCH_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { class Window; //////////////////////////////////////////////////////////// /// \brief Give access to the real-time state of the touches /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API Touch { public: //////////////////////////////////////////////////////////// /// \brief Check if a touch event is currently down /// /// \param finger Finger index /// /// \return True if \a finger is currently touching the screen, false otherwise /// //////////////////////////////////////////////////////////// static bool isDown(unsigned int finger); //////////////////////////////////////////////////////////// /// \brief Get the current position of a touch in desktop coordinates /// /// This function returns the current touch position /// in global (desktop) coordinates. /// /// \param finger Finger index /// /// \return Current position of \a finger, or undefined if it's not down /// //////////////////////////////////////////////////////////// static Vector2i getPosition(unsigned int finger); //////////////////////////////////////////////////////////// /// \brief Get the current position of a touch in window coordinates /// /// This function returns the current touch position /// relative to the given window. /// /// \param finger Finger index /// \param relativeTo Reference window /// /// \return Current position of \a finger, or undefined if it's not down /// //////////////////////////////////////////////////////////// static Vector2i getPosition(unsigned int finger, const Window& relativeTo); }; } // namespace sf #endif // SFML_TOUCH_HPP //////////////////////////////////////////////////////////// /// \class sf::Touch /// \ingroup window /// /// sf::Touch provides an interface to the state of the /// touches. It only contains static functions, so it's not /// meant to be instantiated. /// /// This class allows users to query the touches state at any /// time and directly, without having to deal with a window and /// its events. Compared to the TouchBegan, TouchMoved /// and TouchEnded events, sf::Touch can retrieve the /// state of the touches at any time (you don't need to store and /// update a boolean on your side in order to know if a touch is down), /// and you always get the real state of the touches, even if they /// happen when your window is out of focus and no event is triggered. /// /// The getPosition function can be used to retrieve the current /// position of a touch. There are two versions: one that operates /// in global coordinates (relative to the desktop) and one that /// operates in window coordinates (relative to a specific window). /// /// Touches are identified by an index (the "finger"), so that in /// multi-touch events, individual touches can be tracked correctly. /// As long as a finger touches the screen, it will keep the same index /// even if other fingers start or stop touching the screen in the /// meantime. As a consequence, active touch indices may not always be /// sequential (i.e. touch number 0 may be released while touch number 1 /// is still down). /// /// Usage example: /// \code /// if (sf::Touch::isDown(0)) /// { /// // touch 0 is down /// } /// /// // get global position of touch 1 /// sf::Vector2i globalPos = sf::Touch::getPosition(1); /// /// // get position of touch 1 relative to a window /// sf::Vector2i relativePos = sf::Touch::getPosition(1, window); /// \endcode /// /// \see sf::Joystick, sf::Keyboard, sf::Mouse /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/VideoMode.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_VIDEOMODE_HPP #define SFML_VIDEOMODE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include namespace sf { //////////////////////////////////////////////////////////// /// \brief VideoMode defines a video mode (width, height, bpp) /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API VideoMode { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructors initializes all members to 0. /// //////////////////////////////////////////////////////////// VideoMode(); //////////////////////////////////////////////////////////// /// \brief Construct the video mode with its attributes /// /// \param modeWidth Width in pixels /// \param modeHeight Height in pixels /// \param modeBitsPerPixel Pixel depths in bits per pixel /// //////////////////////////////////////////////////////////// VideoMode(unsigned int modeWidth, unsigned int modeHeight, unsigned int modeBitsPerPixel = 32); //////////////////////////////////////////////////////////// /// \brief Get the current desktop video mode /// /// \return Current desktop video mode /// //////////////////////////////////////////////////////////// static VideoMode getDesktopMode(); //////////////////////////////////////////////////////////// /// \brief Retrieve all the video modes supported in fullscreen mode /// /// When creating a fullscreen window, the video mode is restricted /// to be compatible with what the graphics driver and monitor /// support. This function returns the complete list of all video /// modes that can be used in fullscreen mode. /// The returned array is sorted from best to worst, so that /// the first element will always give the best mode (higher /// width, height and bits-per-pixel). /// /// \return Array containing all the supported fullscreen modes /// //////////////////////////////////////////////////////////// static const std::vector& getFullscreenModes(); //////////////////////////////////////////////////////////// /// \brief Tell whether or not the video mode is valid /// /// The validity of video modes is only relevant when using /// fullscreen windows; otherwise any video mode can be used /// with no restriction. /// /// \return True if the video mode is valid for fullscreen mode /// //////////////////////////////////////////////////////////// bool isValid() const; //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// unsigned int width; ///< Video mode width, in pixels unsigned int height; ///< Video mode height, in pixels unsigned int bitsPerPixel; ///< Video mode pixel depth, in bits per pixels }; //////////////////////////////////////////////////////////// /// \relates VideoMode /// \brief Overload of == operator to compare two video modes /// /// \param left Left operand (a video mode) /// \param right Right operand (a video mode) /// /// \return True if modes are equal /// //////////////////////////////////////////////////////////// SFML_WINDOW_API bool operator ==(const VideoMode& left, const VideoMode& right); //////////////////////////////////////////////////////////// /// \relates VideoMode /// \brief Overload of != operator to compare two video modes /// /// \param left Left operand (a video mode) /// \param right Right operand (a video mode) /// /// \return True if modes are different /// //////////////////////////////////////////////////////////// SFML_WINDOW_API bool operator !=(const VideoMode& left, const VideoMode& right); //////////////////////////////////////////////////////////// /// \relates VideoMode /// \brief Overload of < operator to compare video modes /// /// \param left Left operand (a video mode) /// \param right Right operand (a video mode) /// /// \return True if \a left is lesser than \a right /// //////////////////////////////////////////////////////////// SFML_WINDOW_API bool operator <(const VideoMode& left, const VideoMode& right); //////////////////////////////////////////////////////////// /// \relates VideoMode /// \brief Overload of > operator to compare video modes /// /// \param left Left operand (a video mode) /// \param right Right operand (a video mode) /// /// \return True if \a left is greater than \a right /// //////////////////////////////////////////////////////////// SFML_WINDOW_API bool operator >(const VideoMode& left, const VideoMode& right); //////////////////////////////////////////////////////////// /// \relates VideoMode /// \brief Overload of <= operator to compare video modes /// /// \param left Left operand (a video mode) /// \param right Right operand (a video mode) /// /// \return True if \a left is lesser or equal than \a right /// //////////////////////////////////////////////////////////// SFML_WINDOW_API bool operator <=(const VideoMode& left, const VideoMode& right); //////////////////////////////////////////////////////////// /// \relates VideoMode /// \brief Overload of >= operator to compare video modes /// /// \param left Left operand (a video mode) /// \param right Right operand (a video mode) /// /// \return True if \a left is greater or equal than \a right /// //////////////////////////////////////////////////////////// SFML_WINDOW_API bool operator >=(const VideoMode& left, const VideoMode& right); } // namespace sf #endif // SFML_VIDEOMODE_HPP //////////////////////////////////////////////////////////// /// \class sf::VideoMode /// \ingroup window /// /// A video mode is defined by a width and a height (in pixels) /// and a depth (in bits per pixel). Video modes are used to /// setup windows (sf::Window) at creation time. /// /// The main usage of video modes is for fullscreen mode: /// indeed you must use one of the valid video modes /// allowed by the OS (which are defined by what the monitor /// and the graphics card support), otherwise your window /// creation will just fail. /// /// sf::VideoMode provides a static function for retrieving /// the list of all the video modes supported by the system: /// getFullscreenModes(). /// /// A custom video mode can also be checked directly for /// fullscreen compatibility with its isValid() function. /// /// Additionally, sf::VideoMode provides a static function /// to get the mode currently used by the desktop: getDesktopMode(). /// This allows to build windows with the same size or pixel /// depth as the current resolution. /// /// Usage example: /// \code /// // Display the list of all the video modes available for fullscreen /// std::vector modes = sf::VideoMode::getFullscreenModes(); /// for (std::size_t i = 0; i < modes.size(); ++i) /// { /// sf::VideoMode mode = modes[i]; /// std::cout << "Mode #" << i << ": " /// << mode.width << "x" << mode.height << " - " /// << mode.bitsPerPixel << " bpp" << std::endl; /// } /// /// // Create a window with the same pixel depth as the desktop /// sf::VideoMode desktop = sf::VideoMode::getDesktopMode(); /// window.create(sf::VideoMode(1024, 768, desktop.bitsPerPixel), "SFML window"); /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/Window.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_WINDOW_HPP #define SFML_WINDOW_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include namespace sf { namespace priv { class GlContext; class WindowImpl; } class Event; //////////////////////////////////////////////////////////// /// \brief Window that serves as a target for OpenGL rendering /// //////////////////////////////////////////////////////////// class SFML_WINDOW_API Window : GlResource, NonCopyable { public: //////////////////////////////////////////////////////////// /// \brief Default constructor /// /// This constructor doesn't actually create the window, /// use the other constructors or call create() to do so. /// //////////////////////////////////////////////////////////// Window(); //////////////////////////////////////////////////////////// /// \brief Construct a new window /// /// This constructor creates the window with the size and pixel /// depth defined in \a mode. An optional style can be passed to /// customize the look and behavior of the window (borders, /// title bar, resizable, closable, ...). If \a style contains /// Style::Fullscreen, then \a mode must be a valid video mode. /// /// The fourth parameter is an optional structure specifying /// advanced OpenGL context settings such as antialiasing, /// depth-buffer bits, etc. /// /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param title Title of the window /// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// \param settings Additional settings for the underlying OpenGL context /// //////////////////////////////////////////////////////////// Window(VideoMode mode, const String& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings()); //////////////////////////////////////////////////////////// /// \brief Construct the window from an existing control /// /// Use this constructor if you want to create an OpenGL /// rendering area into an already existing control. /// /// The second parameter is an optional structure specifying /// advanced OpenGL context settings such as antialiasing, /// depth-buffer bits, etc. /// /// \param handle Platform-specific handle of the control /// \param settings Additional settings for the underlying OpenGL context /// //////////////////////////////////////////////////////////// explicit Window(WindowHandle handle, const ContextSettings& settings = ContextSettings()); //////////////////////////////////////////////////////////// /// \brief Destructor /// /// Closes the window and frees all the resources attached to it. /// //////////////////////////////////////////////////////////// virtual ~Window(); //////////////////////////////////////////////////////////// /// \brief Create (or recreate) the window /// /// If the window was already created, it closes it first. /// If \a style contains Style::Fullscreen, then \a mode /// must be a valid video mode. /// /// The fourth parameter is an optional structure specifying /// advanced OpenGL context settings such as antialiasing, /// depth-buffer bits, etc. /// /// \param mode Video mode to use (defines the width, height and depth of the rendering area of the window) /// \param title Title of the window /// \param style %Window style, a bitwise OR combination of sf::Style enumerators /// \param settings Additional settings for the underlying OpenGL context /// //////////////////////////////////////////////////////////// void create(VideoMode mode, const String& title, Uint32 style = Style::Default, const ContextSettings& settings = ContextSettings()); //////////////////////////////////////////////////////////// /// \brief Create (or recreate) the window from an existing control /// /// Use this function if you want to create an OpenGL /// rendering area into an already existing control. /// If the window was already created, it closes it first. /// /// The second parameter is an optional structure specifying /// advanced OpenGL context settings such as antialiasing, /// depth-buffer bits, etc. /// /// \param handle Platform-specific handle of the control /// \param settings Additional settings for the underlying OpenGL context /// //////////////////////////////////////////////////////////// void create(WindowHandle handle, const ContextSettings& settings = ContextSettings()); //////////////////////////////////////////////////////////// /// \brief Close the window and destroy all the attached resources /// /// After calling this function, the sf::Window instance remains /// valid and you can call create() to recreate the window. /// All other functions such as pollEvent() or display() will /// still work (i.e. you don't have to test isOpen() every time), /// and will have no effect on closed windows. /// //////////////////////////////////////////////////////////// void close(); //////////////////////////////////////////////////////////// /// \brief Tell whether or not the window is open /// /// This function returns whether or not the window exists. /// Note that a hidden window (setVisible(false)) is open /// (therefore this function would return true). /// /// \return True if the window is open, false if it has been closed /// //////////////////////////////////////////////////////////// bool isOpen() const; //////////////////////////////////////////////////////////// /// \brief Get the settings of the OpenGL context of the window /// /// Note that these settings may be different from what was /// passed to the constructor or the create() function, /// if one or more settings were not supported. In this case, /// SFML chose the closest match. /// /// \return Structure containing the OpenGL context settings /// //////////////////////////////////////////////////////////// const ContextSettings& getSettings() const; //////////////////////////////////////////////////////////// /// \brief Pop the event on top of the event queue, if any, and return it /// /// This function is not blocking: if there's no pending event then /// it will return false and leave \a event unmodified. /// Note that more than one event may be present in the event queue, /// thus you should always call this function in a loop /// to make sure that you process every pending event. /// \code /// sf::Event event; /// while (window.pollEvent(event)) /// { /// // process event... /// } /// \endcode /// /// \param event Event to be returned /// /// \return True if an event was returned, or false if the event queue was empty /// /// \see waitEvent /// //////////////////////////////////////////////////////////// bool pollEvent(Event& event); //////////////////////////////////////////////////////////// /// \brief Wait for an event and return it /// /// This function is blocking: if there's no pending event then /// it will wait until an event is received. /// After this function returns (and no error occurred), /// the \a event object is always valid and filled properly. /// This function is typically used when you have a thread that /// is dedicated to events handling: you want to make this thread /// sleep as long as no new event is received. /// \code /// sf::Event event; /// if (window.waitEvent(event)) /// { /// // process event... /// } /// \endcode /// /// \param event Event to be returned /// /// \return False if any error occurred /// /// \see pollEvent /// //////////////////////////////////////////////////////////// bool waitEvent(Event& event); //////////////////////////////////////////////////////////// /// \brief Get the position of the window /// /// \return Position of the window, in pixels /// /// \see setPosition /// //////////////////////////////////////////////////////////// Vector2i getPosition() const; //////////////////////////////////////////////////////////// /// \brief Change the position of the window on screen /// /// This function only works for top-level windows /// (i.e. it will be ignored for windows created from /// the handle of a child window/control). /// /// \param position New position, in pixels /// /// \see getPosition /// //////////////////////////////////////////////////////////// void setPosition(const Vector2i& position); //////////////////////////////////////////////////////////// /// \brief Get the size of the rendering region of the window /// /// The size doesn't include the titlebar and borders /// of the window. /// /// \return Size in pixels /// /// \see setSize /// //////////////////////////////////////////////////////////// Vector2u getSize() const; //////////////////////////////////////////////////////////// /// \brief Change the size of the rendering region of the window /// /// \param size New size, in pixels /// /// \see getSize /// //////////////////////////////////////////////////////////// void setSize(const Vector2u& size); //////////////////////////////////////////////////////////// /// \brief Change the title of the window /// /// \param title New title /// /// \see setIcon /// //////////////////////////////////////////////////////////// void setTitle(const String& title); //////////////////////////////////////////////////////////// /// \brief Change the window's icon /// /// \a pixels must be an array of \a width x \a height pixels /// in 32-bits RGBA format. /// /// The OS default icon is used by default. /// /// \param width Icon's width, in pixels /// \param height Icon's height, in pixels /// \param pixels Pointer to the array of pixels in memory. The /// pixels are copied, so you need not keep the /// source alive after calling this function. /// /// \see setTitle /// //////////////////////////////////////////////////////////// void setIcon(unsigned int width, unsigned int height, const Uint8* pixels); //////////////////////////////////////////////////////////// /// \brief Show or hide the window /// /// The window is shown by default. /// /// \param visible True to show the window, false to hide it /// //////////////////////////////////////////////////////////// void setVisible(bool visible); //////////////////////////////////////////////////////////// /// \brief Enable or disable vertical synchronization /// /// Activating vertical synchronization will limit the number /// of frames displayed to the refresh rate of the monitor. /// This can avoid some visual artifacts, and limit the framerate /// to a good value (but not constant across different computers). /// /// Vertical synchronization is disabled by default. /// /// \param enabled True to enable v-sync, false to deactivate it /// //////////////////////////////////////////////////////////// void setVerticalSyncEnabled(bool enabled); //////////////////////////////////////////////////////////// /// \brief Show or hide the mouse cursor /// /// The mouse cursor is visible by default. /// /// \param visible True to show the mouse cursor, false to hide it /// //////////////////////////////////////////////////////////// void setMouseCursorVisible(bool visible); //////////////////////////////////////////////////////////// /// \brief Grab or release the mouse cursor /// /// If set, grabs the mouse cursor inside this window's client /// area so it may no longer be moved outside its bounds. /// Note that grabbing is only active while the window has /// focus. /// /// \param grabbed True to enable, false to disable /// //////////////////////////////////////////////////////////// void setMouseCursorGrabbed(bool grabbed); //////////////////////////////////////////////////////////// /// \brief Enable or disable automatic key-repeat /// /// If key repeat is enabled, you will receive repeated /// KeyPressed events while keeping a key pressed. If it is disabled, /// you will only get a single event when the key is pressed. /// /// Key repeat is enabled by default. /// /// \param enabled True to enable, false to disable /// //////////////////////////////////////////////////////////// void setKeyRepeatEnabled(bool enabled); //////////////////////////////////////////////////////////// /// \brief Limit the framerate to a maximum fixed frequency /// /// If a limit is set, the window will use a small delay after /// each call to display() to ensure that the current frame /// lasted long enough to match the framerate limit. /// SFML will try to match the given limit as much as it can, /// but since it internally uses sf::sleep, whose precision /// depends on the underlying OS, the results may be a little /// unprecise as well (for example, you can get 65 FPS when /// requesting 60). /// /// \param limit Framerate limit, in frames per seconds (use 0 to disable limit) /// //////////////////////////////////////////////////////////// void setFramerateLimit(unsigned int limit); //////////////////////////////////////////////////////////// /// \brief Change the joystick threshold /// /// The joystick threshold is the value below which /// no JoystickMoved event will be generated. /// /// The threshold value is 0.1 by default. /// /// \param threshold New threshold, in the range [0, 100] /// //////////////////////////////////////////////////////////// void setJoystickThreshold(float threshold); //////////////////////////////////////////////////////////// /// \brief Activate or deactivate the window as the current target /// for OpenGL rendering /// /// A window is active only on the current thread, if you want to /// make it active on another thread you have to deactivate it /// on the previous thread first if it was active. /// Only one window can be active on a thread at a time, thus /// the window previously active (if any) automatically gets deactivated. /// This is not to be confused with requestFocus(). /// /// \param active True to activate, false to deactivate /// /// \return True if operation was successful, false otherwise /// //////////////////////////////////////////////////////////// bool setActive(bool active = true) const; //////////////////////////////////////////////////////////// /// \brief Request the current window to be made the active /// foreground window /// /// At any given time, only one window may have the input focus /// to receive input events such as keystrokes or mouse events. /// If a window requests focus, it only hints to the operating /// system, that it would like to be focused. The operating system /// is free to deny the request. /// This is not to be confused with setActive(). /// /// \see hasFocus /// //////////////////////////////////////////////////////////// void requestFocus(); //////////////////////////////////////////////////////////// /// \brief Check whether the window has the input focus /// /// At any given time, only one window may have the input focus /// to receive input events such as keystrokes or most mouse /// events. /// /// \return True if window has focus, false otherwise /// \see requestFocus /// //////////////////////////////////////////////////////////// bool hasFocus() const; //////////////////////////////////////////////////////////// /// \brief Display on screen what has been rendered to the window so far /// /// This function is typically called after all OpenGL rendering /// has been done for the current frame, in order to show /// it on screen. /// //////////////////////////////////////////////////////////// void display(); //////////////////////////////////////////////////////////// /// \brief Get the OS-specific handle of the window /// /// The type of the returned handle is sf::WindowHandle, /// which is a typedef to the handle type defined by the OS. /// You shouldn't need to use this function, unless you have /// very specific stuff to implement that SFML doesn't support, /// or implement a temporary workaround until a bug is fixed. /// /// \return System handle of the window /// //////////////////////////////////////////////////////////// WindowHandle getSystemHandle() const; protected: //////////////////////////////////////////////////////////// /// \brief Function called after the window has been created /// /// This function is called so that derived classes can /// perform their own specific initialization as soon as /// the window is created. /// //////////////////////////////////////////////////////////// virtual void onCreate(); //////////////////////////////////////////////////////////// /// \brief Function called after the window has been resized /// /// This function is called so that derived classes can /// perform custom actions when the size of the window changes. /// //////////////////////////////////////////////////////////// virtual void onResize(); private: //////////////////////////////////////////////////////////// /// \brief Processes an event before it is sent to the user /// /// This function is called every time an event is received /// from the internal window (through pollEvent or waitEvent). /// It filters out unwanted events, and performs whatever internal /// stuff the window needs before the event is returned to the /// user. /// /// \param event Event to filter /// //////////////////////////////////////////////////////////// bool filterEvent(const Event& event); //////////////////////////////////////////////////////////// /// \brief Perform some common internal initializations /// //////////////////////////////////////////////////////////// void initialize(); //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// priv::WindowImpl* m_impl; ///< Platform-specific implementation of the window priv::GlContext* m_context; ///< Platform-specific implementation of the OpenGL context Clock m_clock; ///< Clock for measuring the elapsed time between frames Time m_frameTimeLimit; ///< Current framerate limit Vector2u m_size; ///< Current size of the window }; } // namespace sf #endif // SFML_WINDOW_HPP //////////////////////////////////////////////////////////// /// \class sf::Window /// \ingroup window /// /// sf::Window is the main class of the Window module. It defines /// an OS window that is able to receive an OpenGL rendering. /// /// A sf::Window can create its own new window, or be embedded into /// an already existing control using the create(handle) function. /// This can be useful for embedding an OpenGL rendering area into /// a view which is part of a bigger GUI with existing windows, /// controls, etc. It can also serve as embedding an OpenGL rendering /// area into a window created by another (probably richer) GUI library /// like Qt or wxWidgets. /// /// The sf::Window class provides a simple interface for manipulating /// the window: move, resize, show/hide, control mouse cursor, etc. /// It also provides event handling through its pollEvent() and waitEvent() /// functions. /// /// Note that OpenGL experts can pass their own parameters (antialiasing /// level, bits for the depth and stencil buffers, etc.) to the /// OpenGL context attached to the window, with the sf::ContextSettings /// structure which is passed as an optional argument when creating the /// window. /// /// Usage example: /// \code /// // Declare and create a new window /// sf::Window window(sf::VideoMode(800, 600), "SFML window"); /// /// // Limit the framerate to 60 frames per second (this step is optional) /// window.setFramerateLimit(60); /// /// // The main loop - ends as soon as the window is closed /// while (window.isOpen()) /// { /// // Event processing /// sf::Event event; /// while (window.pollEvent(event)) /// { /// // Request for closing the window /// if (event.type == sf::Event::Closed) /// window.close(); /// } /// /// // Activate the window for OpenGL rendering /// window.setActive(); /// /// // OpenGL drawing commands go here... /// /// // End the current frame and display its contents on screen /// window.display(); /// } /// \endcode /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/WindowHandle.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_WINDOWHANDLE_HPP #define SFML_WINDOWHANDLE_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include // Windows' HWND is a typedef on struct HWND__* #if defined(SFML_SYSTEM_WINDOWS) struct HWND__; #endif namespace sf { #if defined(SFML_SYSTEM_WINDOWS) // Window handle is HWND (HWND__*) on Windows typedef HWND__* WindowHandle; #elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD) // Window handle is Window (unsigned long) on Unix - X11 typedef unsigned long WindowHandle; #elif defined(SFML_SYSTEM_MACOS) // Window handle is NSWindow or NSView (void*) on Mac OS X - Cocoa typedef void* WindowHandle; #elif defined(SFML_SYSTEM_IOS) // Window handle is UIWindow (void*) on iOS - UIKit typedef void* WindowHandle; #elif defined(SFML_SYSTEM_ANDROID) // Window handle is ANativeWindow* (void*) on Android typedef void* WindowHandle; #elif defined(SFML_DOXYGEN) // Define typedef symbol so that Doxygen can attach some documentation to it typedef "platform–specific" WindowHandle; #endif } // namespace sf #endif // SFML_WINDOWHANDLE_HPP //////////////////////////////////////////////////////////// /// \typedef sf::WindowHandle /// \ingroup window /// /// Define a low-level window handle type, specific to /// each platform. /// /// Platform | Type /// ----------------|------------------------------------------------------------ /// Windows | \p HWND /// Linux/FreeBSD | \p %Window /// Mac OS X | either \p NSWindow* or \p NSView*, disguised as \p void* /// iOS | \p UIWindow* /// Android | \p ANativeWindow* /// /// \par Mac OS X Specification /// /// On Mac OS X, a sf::Window can be created either from an /// existing \p NSWindow* or an \p NSView*. When the window /// is created from a window, SFML will use its content view /// as the OpenGL area. sf::Window::getSystemHandle() will /// return the handle that was used to create the window, /// which is a \p NSWindow* by default. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window/WindowStyle.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_WINDOWSTYLE_HPP #define SFML_WINDOWSTYLE_HPP namespace sf { namespace Style { //////////////////////////////////////////////////////////// /// \ingroup window /// \brief Enumeration of the window styles /// //////////////////////////////////////////////////////////// enum { None = 0, ///< No border / title bar (this flag and all others are mutually exclusive) Titlebar = 1 << 0, ///< Title bar + fixed border Resize = 1 << 1, ///< Title bar + resizable border + maximize button Close = 1 << 2, ///< Title bar + close button Fullscreen = 1 << 3, ///< Fullscreen mode (this flag and all others are mutually exclusive) Default = Titlebar | Resize | Close ///< Default window style }; } } // namespace sf #endif // SFML_WINDOWSTYLE_HPP ================================================ FILE: Libraries/Core/Windows/Headers/SFML/Window.hpp ================================================ //////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2017 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// #ifndef SFML_SFML_WINDOW_HPP #define SFML_SFML_WINDOW_HPP //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include #include #include #endif // SFML_SFML_WINDOW_HPP //////////////////////////////////////////////////////////// /// \defgroup window Window module /// /// Provides OpenGL-based windows, and abstractions for /// events and input handling. /// //////////////////////////////////////////////////////////// ================================================ FILE: Libraries/Core/Windows/Headers/SHA1/HMAC_SHA1.h ================================================ /* 100% free public domain implementation of the HMAC-SHA1 algorithm by Chien-Chung, Chung (Jim Chung) */ #ifndef __HMAC_SHA1_H__ #define __HMAC_SHA1_H__ #include "SHA1.h" typedef unsigned char BYTE ; class CHMAC_SHA1 : public CSHA1 { private: BYTE m_ipad[64]; BYTE m_opad[64]; char * szReport ; char * SHA1_Key ; char * AppendBuf1 ; char * AppendBuf2 ; public: enum { SHA1_DIGEST_LENGTH = 20, SHA1_BLOCK_SIZE = 64, HMAC_BUF_LEN = 4096 } ; CHMAC_SHA1() :szReport(new char[HMAC_BUF_LEN]), AppendBuf1(new char[HMAC_BUF_LEN]), AppendBuf2(new char[HMAC_BUF_LEN]), SHA1_Key(new char[HMAC_BUF_LEN]) {} ~CHMAC_SHA1() { delete[] szReport ; delete[] AppendBuf1 ; delete[] AppendBuf2 ; delete[] SHA1_Key ; } void HMAC_SHA1(BYTE *text, int text_len, BYTE *key, int key_len, BYTE *digest); }; #endif /* __HMAC_SHA1_H__ */ ================================================ FILE: Libraries/Core/Windows/Headers/SHA1/SHA1.h ================================================ /* 100% free public domain implementation of the SHA-1 algorithm by Dominik Reichl Web: http://www.dominik-reichl.de/ Version 2.1 - 2012-06-19 - Deconstructor (resetting internal variables) is now only implemented if SHA1_WIPE_VARIABLES is defined (which is the default). - Renamed inclusion guard to contain a GUID. - Demo application is now using C++/STL objects and functions. - Unicode build of the demo application now outputs the hashes of both the ANSI and Unicode representations of strings. - Various other demo application improvements. Version 2.0 - 2012-06-14 - Added 'limits.h' include. - Renamed inclusion guard and macros for compliancy (names beginning with an underscore are reserved). Version 1.9 - 2011-11-10 - Added Unicode test vectors. - Improved support for hashing files using the HashFile method that are larger than 4 GB. - Improved file hashing performance (by using a larger buffer). - Disabled unnecessary compiler warnings. - Internal variables are now private. Version 1.8 - 2009-03-16 - Converted project files to Visual Studio 2008 format. - Added Unicode support for HashFile utility method. - Added support for hashing files using the HashFile method that are larger than 2 GB. - HashFile now returns an error code instead of copying an error message into the output buffer. - GetHash now returns an error code and validates the input parameter. - Added ReportHashStl STL utility method. - Added REPORT_HEX_SHORT reporting mode. - Improved Linux compatibility of test program. Version 1.7 - 2006-12-21 - Fixed buffer underrun warning that appeared when compiling with Borland C Builder (thanks to Rex Bloom and Tim Gallagher for the patch). - Breaking change: ReportHash writes the final hash to the start of the buffer, i.e. it's not appending it to the string anymore. - Made some function parameters const. - Added Visual Studio 2005 project files to demo project. Version 1.6 - 2005-02-07 (thanks to Howard Kapustein for patches) - You can set the endianness in your files, no need to modify the header file of the CSHA1 class anymore. - Aligned data support. - Made support/compilation of the utility functions (ReportHash and HashFile) optional (useful when bytes count, for example in embedded environments). Version 1.5 - 2005-01-01 - 64-bit compiler compatibility added. - Made variable wiping optional (define SHA1_WIPE_VARIABLES). - Removed unnecessary variable initializations. - ROL32 improvement for the Microsoft compiler (using _rotl). Version 1.4 - 2004-07-22 - CSHA1 now compiles fine with GCC 3.3 under Mac OS X (thanks to Larry Hastings). Version 1.3 - 2003-08-17 - Fixed a small memory bug and made a buffer array a class member to ensure correct working when using multiple CSHA1 class instances at one time. Version 1.2 - 2002-11-16 - Borlands C++ compiler seems to have problems with string addition using sprintf. Fixed the bug which caused the digest report function not to work properly. CSHA1 is now Borland compatible. Version 1.1 - 2002-10-11 - Removed two unnecessary header file includes and changed BOOL to bool. Fixed some minor bugs in the web page contents. Version 1.0 - 2002-06-20 - First official release. ================ Test Vectors ================ SHA1("abc" in ANSI) = A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D SHA1("abc" in Unicode LE) = 9F04F41A 84851416 2050E3D6 8C1A7ABB 441DC2B5 SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" in ANSI) = 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" in Unicode LE) = 51D7D876 9AC72C40 9C5B0E3F 69C60ADC 9A039014 SHA1(A million repetitions of "a" in ANSI) = 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F SHA1(A million repetitions of "a" in Unicode LE) = C4609560 A108A0C6 26AA7F2B 38A65566 739353C5 */ #ifndef SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 #define SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 #if !defined(SHA1_UTILITY_FUNCTIONS) && !defined(SHA1_NO_UTILITY_FUNCTIONS) #define SHA1_UTILITY_FUNCTIONS #endif #if !defined(SHA1_STL_FUNCTIONS) && !defined(SHA1_NO_STL_FUNCTIONS) #define SHA1_STL_FUNCTIONS #if !defined(SHA1_UTILITY_FUNCTIONS) #error STL functions require SHA1_UTILITY_FUNCTIONS. #endif #endif #include #include #ifdef SHA1_UTILITY_FUNCTIONS #include #include #endif #ifdef SHA1_STL_FUNCTIONS #include #endif #ifdef _MSC_VER #include #endif // You can define the endian mode in your files without modifying the SHA-1 // source files. Just #define SHA1_LITTLE_ENDIAN or #define SHA1_BIG_ENDIAN // in your files, before including the SHA1.h header file. If you don't // define anything, the class defaults to little endian. #if !defined(SHA1_LITTLE_ENDIAN) && !defined(SHA1_BIG_ENDIAN) #define SHA1_LITTLE_ENDIAN #endif // If you want variable wiping, #define SHA1_WIPE_VARIABLES, if not, // #define SHA1_NO_WIPE_VARIABLES. If you don't define anything, it // defaults to wiping. #if !defined(SHA1_WIPE_VARIABLES) && !defined(SHA1_NO_WIPE_VARIABLES) #define SHA1_WIPE_VARIABLES #endif #if defined(SHA1_HAS_TCHAR) #include #else #ifdef _MSC_VER #include #else #ifndef TCHAR #define TCHAR char #endif #ifndef _T #define _T(__x) (__x) #define _tmain main #define _tprintf printf #define _getts gets #define _tcslen strlen #define _tfopen fopen #define _tcscpy strcpy #define _tcscat strcat #define _sntprintf snprintf #endif #endif #endif /////////////////////////////////////////////////////////////////////////// // Define variable types #ifndef UINT_8 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_8 unsigned __int8 #else // !_MSC_VER #define UINT_8 unsigned char #endif // _MSC_VER #endif #ifndef UINT_32 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_32 unsigned __int32 #else // !_MSC_VER #if (ULONG_MAX == 0xFFFFFFFFUL) #define UINT_32 unsigned long #else #define UINT_32 unsigned int #endif #endif // _MSC_VER #endif // UINT_32 #ifndef INT_64 #ifdef _MSC_VER // Compiling with Microsoft compiler #define INT_64 __int64 #else // !_MSC_VER #define INT_64 long long #endif // _MSC_VER #endif // INT_64 #ifndef UINT_64 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_64 unsigned __int64 #else // !_MSC_VER #define UINT_64 unsigned long long #endif // _MSC_VER #endif // UINT_64 /////////////////////////////////////////////////////////////////////////// // Declare SHA-1 workspace typedef union { UINT_8 c[64]; UINT_32 l[16]; } SHA1_WORKSPACE_BLOCK; class CSHA1 { public: #ifdef SHA1_UTILITY_FUNCTIONS // Different formats for ReportHash(Stl) enum REPORT_TYPE { REPORT_HEX = 0, REPORT_DIGIT = 1, REPORT_HEX_SHORT = 2 }; #endif // Constructor and destructor CSHA1(); #ifdef SHA1_WIPE_VARIABLES ~CSHA1(); #endif void Reset(); // Hash in binary data and strings void Update(const UINT_8* pbData, UINT_32 uLen); #ifdef SHA1_UTILITY_FUNCTIONS // Hash in file contents bool HashFile(const TCHAR* tszFileName); #endif // Finalize hash; call it before using ReportHash(Stl) void Final(); #ifdef SHA1_UTILITY_FUNCTIONS bool ReportHash(TCHAR* tszReport, REPORT_TYPE rtReportType = REPORT_HEX) const; #endif #ifdef SHA1_STL_FUNCTIONS bool ReportHashStl(std::basic_string& strOut, REPORT_TYPE rtReportType = REPORT_HEX) const; #endif // Get the raw message digest (20 bytes) bool GetHash(UINT_8* pbDest20) const; private: // Private SHA-1 transformation void Transform(UINT_32* pState, const UINT_8* pBuffer); // Member variables UINT_32 m_state[5]; UINT_32 m_count[2]; UINT_32 m_reserved0[1]; // Memory alignment padding UINT_8 m_buffer[64]; UINT_8 m_digest[20]; UINT_32 m_reserved1[3]; // Memory alignment padding UINT_8 m_workspace[64]; SHA1_WORKSPACE_BLOCK* m_block; // SHA1 pointer to the byte array above }; #endif // SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 ================================================ FILE: Libraries/Core/Windows/Headers/SHA256/sha256.h ================================================ // ////////////////////////////////////////////////////////// // sha256.h // Copyright (c) 2014,2015 Stephan Brumme. All rights reserved. // see http://create.stephan-brumme.com/disclaimer.html // #pragma once //#include "hash.h" #include // define fixed size integer types #ifdef _MSC_VER // Windows typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; #else // GCC #include #endif /// compute SHA256 hash /** Usage: SHA256 sha256; std::string myHash = sha256("Hello World"); // std::string std::string myHash2 = sha256("How are you", 11); // arbitrary data, 11 bytes // or in a streaming fashion: SHA256 sha256; while (more data available) sha256.add(pointer to fresh data, number of new bytes); std::string myHash3 = sha256.getHash(); */ class SHA256 //: public Hash { public: /// split into 64 byte blocks (=> 512 bits), hash is 32 bytes long enum { BlockSize = 512 / 8, HashBytes = 32 }; /// same as reset() SHA256(); /// compute SHA256 of a memory block std::string operator()(const void* data, size_t numBytes); /// compute SHA256 of a string, excluding final zero std::string operator()(const std::string& text); /// add arbitrary number of bytes void add(const void* data, size_t numBytes); /// return latest hash as 64 hex characters std::string getHash(); /// return latest hash as bytes void getHash(unsigned char buffer[HashBytes]); /// restart void reset(); private: /// process 64 bytes void processBlock(const void* data); /// process everything left in the internal buffer void processBuffer(); /// size of processed data in bytes uint64_t m_numBytes; /// valid bytes in m_buffer size_t m_bufferSize; /// bytes not processed yet uint8_t m_buffer[BlockSize]; enum { HashValues = HashBytes / 4 }; /// hash, stored as integers uint32_t m_hash[HashValues]; }; ================================================ FILE: Libraries/Core/Windows/Headers/aes/aes.h ================================================ /* The MIT License Copyright (C) 2011 Zilong Tan (labytan@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* * aes.h * * @version 3.0 (December 2000) * * Optimised ANSI C code for the Rijndael cipher (now AES) * * @author Vincent Rijmen * @author Antoon Bosselaers * @author Paulo Barreto * * This code is hereby placed in the public domain. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __ULIB_AES_H #define __ULIB_AES_H #include #define AES_MAXNR 14 #define AES_BLOCK_SIZE 16 struct aes_key_st { uint32_t rd_key[4 *(AES_MAXNR + 1)]; int rounds; }; typedef struct aes_key_st AES_KEY; #ifdef __cplusplus extern "C" { #endif /* bits can be 128, 192 or 256 */ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); /* in/out can be the same for ECB encryption/decryption */ void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); void AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); /* in/out can be the same */ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, unsigned long nblock, const AES_KEY *key); /* in/out MUST be DIFFERENT */ void AES_cbc_decrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, unsigned long nblock, const AES_KEY *key); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/Windows/Headers/base64/base64.h ================================================ #include std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_decode(std::string const& s); ================================================ FILE: Libraries/Core/Windows/Headers/json/assertions.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED #define CPPTL_JSON_ASSERTIONS_H_INCLUDED #include #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) #if JSON_USE_EXCEPTION #include #define JSON_ASSERT(condition) \ assert(condition); // @todo <= change this into an exception throw #define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message); #else // JSON_USE_EXCEPTION #define JSON_ASSERT(condition) assert(condition); // The call to assert() will show the failure message in debug builds. In // release bugs we write to invalid memory in order to crash hard, so that a // debugger or crash reporter gets the chance to take over. We still call exit() // afterward in order to tell the compiler that this macro doesn't return. #define JSON_FAIL_MESSAGE(message) \ { \ assert(false &&message); \ strcpy(reinterpret_cast(666), message); \ exit(123); \ } #endif #define JSON_ASSERT_MESSAGE(condition, message) \ if (!(condition)) { \ JSON_FAIL_MESSAGE(message) \ } #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED ================================================ FILE: Libraries/Core/Windows/Headers/json/autolink.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_AUTOLINK_H_INCLUDED #define JSON_AUTOLINK_H_INCLUDED #include "config.h" #ifdef JSON_IN_CPPTL #include #endif #if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \ !defined(JSON_IN_CPPTL) #define CPPTL_AUTOLINK_NAME "json" #undef CPPTL_AUTOLINK_DLL #ifdef JSON_DLL #define CPPTL_AUTOLINK_DLL #endif #include "autolink.h" #endif #endif // JSON_AUTOLINK_H_INCLUDED ================================================ FILE: Libraries/Core/Windows/Headers/json/config.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_CONFIG_H_INCLUDED #define JSON_CONFIG_H_INCLUDED /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 /// If defined, indicates that json may leverage CppTL library //# define JSON_USE_CPPTL 1 /// If defined, indicates that cpptl vector based map should be used instead of /// std::map /// as Value container. //# define JSON_USE_CPPTL_SMALLMAP 1 /// If defined, indicates that Json specific container should be used /// (hash table & simple deque container with customizable allocator). /// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 //# define JSON_VALUE_USE_INTERNAL_MAP 1 /// Force usage of standard new/malloc based allocator instead of memory pool /// based allocator. /// The memory pools allocator used optimization (initializing Value and /// ValueInternalLink /// as if it was a POD) that may cause some validation tool to report errors. /// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. //# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 // If non-zero, the library uses exceptions to report bad input instead of C // assertion macros. The default is to use exceptions. #ifndef JSON_USE_EXCEPTION #define JSON_USE_EXCEPTION 1 #endif /// If defined, indicates that the source file is amalgated /// to prevent private header inclusion. /// Remarks: it is automatically defined in the generated amalgated header. // #define JSON_IS_AMALGAMATION #ifdef JSON_IN_CPPTL #include #ifndef JSON_USE_CPPTL #define JSON_USE_CPPTL 1 #endif #endif #ifdef JSON_IN_CPPTL #define JSON_API CPPTL_API #elif defined(JSON_DLL_BUILD) #if defined(_MSC_VER) #define JSON_API __declspec(dllexport) #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING #endif // if defined(_MSC_VER) #elif defined(JSON_DLL) #if defined(_MSC_VER) #define JSON_API __declspec(dllimport) #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING #endif // if defined(_MSC_VER) #endif // ifdef JSON_IN_CPPTL #if !defined(JSON_API) #define JSON_API #endif // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for // integer // Storages, and 64 bits integer support is disabled. // #define JSON_NO_INT64 1 #if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 // Microsoft Visual Studio 6 only support conversion from __int64 to double // (no conversion from unsigned __int64). #define JSON_USE_INT64_DOUBLE_CONVERSION 1 // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' // characters in the debug information) // All projects I've ever seen with VS6 were using this globally (not bothering // with pragma push/pop). #pragma warning(disable : 4786) #endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 #if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 /// Indicates that the following function is deprecated. #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) #endif #if !defined(JSONCPP_DEPRECATED) #define JSONCPP_DEPRECATED(message) #endif // if !defined(JSONCPP_DEPRECATED) namespace Json { typedef int Int; typedef unsigned int UInt; #if defined(JSON_NO_INT64) typedef int LargestInt; typedef unsigned int LargestUInt; #undef JSON_HAS_INT64 #else // if defined(JSON_NO_INT64) // For Microsoft Visual use specific types as long long is not supported #if defined(_MSC_VER) // Microsoft Visual Studio typedef __int64 Int64; typedef unsigned __int64 UInt64; #else // if defined(_MSC_VER) // Other platforms, use long long typedef long long int Int64; typedef unsigned long long int UInt64; #endif // if defined(_MSC_VER) typedef Int64 LargestInt; typedef UInt64 LargestUInt; #define JSON_HAS_INT64 #endif // if defined(JSON_NO_INT64) } // end namespace Json #endif // JSON_CONFIG_H_INCLUDED ================================================ FILE: Libraries/Core/Windows/Headers/json/features.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_FEATURES_H_INCLUDED #define CPPTL_JSON_FEATURES_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { /** \brief Configuration passed to reader and writer. * This configuration object can be used to force the Reader or Writer * to behave in a standard conforming way. */ class JSON_API Features { public: /** \brief A configuration that allows all features and assumes all strings * are UTF-8. * - C & C++ comments are allowed * - Root object can be any JSON value * - Assumes Value strings are encoded in UTF-8 */ static Features all(); /** \brief A configuration that is strictly compatible with the JSON * specification. * - Comments are forbidden. * - Root object must be either an array or an object value. * - Assumes Value strings are encoded in UTF-8 */ static Features strictMode(); /** \brief Initialize the configuration like JsonConfig::allFeatures; */ Features(); /// \c true if comments are allowed. Default: \c true. bool allowComments_; /// \c true if root must be either an array or an object value. Default: \c /// false. bool strictRoot_; /// \c true if dropped null placeholders are allowed. Default: \c false. bool allowDroppedNullPlaceholders_; /// \c true if numeric object key are allowed. Default: \c false. bool allowNumericKeys_; }; } // namespace Json #endif // CPPTL_JSON_FEATURES_H_INCLUDED ================================================ FILE: Libraries/Core/Windows/Headers/json/forwards.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_FORWARDS_H_INCLUDED #define JSON_FORWARDS_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { // writer.h class FastWriter; class StyledWriter; // reader.h class Reader; // features.h class Features; // value.h typedef unsigned int ArrayIndex; class StaticString; class Path; class PathArgument; class Value; class ValueIteratorBase; class ValueIterator; class ValueConstIterator; #ifdef JSON_VALUE_USE_INTERNAL_MAP class ValueMapAllocator; class ValueInternalLink; class ValueInternalArray; class ValueInternalMap; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP } // namespace Json #endif // JSON_FORWARDS_H_INCLUDED ================================================ FILE: Libraries/Core/Windows/Headers/json/json.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_JSON_H_INCLUDED #define JSON_JSON_H_INCLUDED #include "autolink.h" #include "value.h" #include "reader.h" #include "writer.h" #include "features.h" #endif // JSON_JSON_H_INCLUDED ================================================ FILE: Libraries/Core/Windows/Headers/json/json_batchallocator.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED #define JSONCPP_BATCHALLOCATOR_H_INCLUDED #include #include #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION namespace Json { /* Fast memory allocator. * * This memory allocator allocates memory for a batch of object (specified by * the page size, the number of object in each page). * * It does not allow the destruction of a single object. All the allocated * objects can be destroyed at once. The memory can be either released or reused * for future allocation. * * The in-place new operator must be used to construct the object using the * pointer returned by allocate. */ template class BatchAllocator { public: BatchAllocator(unsigned int objectsPerPage = 255) : freeHead_(0), objectsPerPage_(objectsPerPage) { // printf( "Size: %d => %s\n", sizeof(AllocatedType), // typeid(AllocatedType).name() ); assert(sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *)); // We must be able to store a slist in the // object free space. assert(objectsPerPage >= 16); batches_ = allocateBatch(0); // allocated a dummy page currentBatch_ = batches_; } ~BatchAllocator() { for (BatchInfo *batch = batches_; batch;) { BatchInfo *nextBatch = batch->next_; free(batch); batch = nextBatch; } } /// allocate space for an array of objectPerAllocation object. /// @warning it is the responsability of the caller to call objects /// constructors. AllocatedType *allocate() { if (freeHead_) // returns node from free list. { AllocatedType *object = freeHead_; freeHead_ = *(AllocatedType **)object; return object; } if (currentBatch_->used_ == currentBatch_->end_) { currentBatch_ = currentBatch_->next_; while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_) currentBatch_ = currentBatch_->next_; if (!currentBatch_) // no free batch found, allocate a new one { currentBatch_ = allocateBatch(objectsPerPage_); currentBatch_->next_ = batches_; // insert at the head of the list batches_ = currentBatch_; } } AllocatedType *allocated = currentBatch_->used_; currentBatch_->used_ += objectPerAllocation; return allocated; } /// Release the object. /// @warning it is the responsability of the caller to actually destruct the /// object. void release(AllocatedType *object) { assert(object != 0); *(AllocatedType **)object = freeHead_; freeHead_ = object; } private: struct BatchInfo { BatchInfo *next_; AllocatedType *used_; AllocatedType *end_; AllocatedType buffer_[objectPerAllocation]; }; // disabled copy constructor and assignement operator. BatchAllocator(const BatchAllocator &); void operator=(const BatchAllocator &); static BatchInfo *allocateBatch(unsigned int objectsPerPage) { const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; BatchInfo *batch = static_cast(malloc(mallocSize)); batch->next_ = 0; batch->used_ = batch->buffer_; batch->end_ = batch->buffer_ + objectsPerPage; return batch; } BatchInfo *batches_; BatchInfo *currentBatch_; /// Head of a single linked list within the allocated space of freeed object AllocatedType *freeHead_; unsigned int objectsPerPage_; }; } // namespace Json #endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION #endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED // vim: et ts=2 sts=2 sw=2 tw=0 ================================================ FILE: Libraries/Core/Windows/Headers/json/json_internalarray.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueArrayAllocator::~ValueArrayAllocator() { } // ////////////////////////////////////////////////////////////////// // class DefaultValueArrayAllocator // ////////////////////////////////////////////////////////////////// #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destructArray( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; #else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray(); // placement new return array; } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray( other ); // placement new return array; } virtual void destructArray( ValueInternalArray *array ) { if ( array ) { array->~ValueInternalArray(); arraysAllocator_.release( array ); } } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( pagesAllocator_.allocate() ); } virtual void releaseArrayPage( Value *value ) { if ( value ) pagesAllocator_.release( value ); } private: BatchAllocator arraysAllocator_; BatchAllocator pagesAllocator_; }; #endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR static ValueArrayAllocator *&arrayAllocator() { static DefaultValueArrayAllocator defaultAllocator; static ValueArrayAllocator *arrayAllocator = &defaultAllocator; return arrayAllocator; } static struct DummyArrayAllocatorInitializer { DummyArrayAllocatorInitializer() { arrayAllocator(); // ensure arrayAllocator() statics are initialized before main(). } } dummyArrayAllocatorInitializer; // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// bool ValueInternalArray::equals( const IteratorState &x, const IteratorState &other ) { return x.array_ == other.array_ && x.currentItemIndex_ == other.currentItemIndex_ && x.currentPageIndex_ == other.currentPageIndex_; } void ValueInternalArray::increment( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ != it.array_->size_, "ValueInternalArray::increment(): moving iterator beyond end" ); ++(it.currentItemIndex_); if ( it.currentItemIndex_ == itemsPerPage ) { it.currentItemIndex_ = 0; ++(it.currentPageIndex_); } } void ValueInternalArray::decrement( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && it.currentPageIndex_ == it.array_->pages_ && it.currentItemIndex_ == 0, "ValueInternalArray::decrement(): moving iterator beyond end" ); if ( it.currentItemIndex_ == 0 ) { it.currentItemIndex_ = itemsPerPage-1; --(it.currentPageIndex_); } else { --(it.currentItemIndex_); } } Value & ValueInternalArray::unsafeDereference( const IteratorState &it ) { return (*(it.currentPageIndex_))[it.currentItemIndex_]; } Value & ValueInternalArray::dereference( const IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ < it.array_->size_, "ValueInternalArray::dereference(): dereferencing invalid iterator" ); return unsafeDereference( it ); } void ValueInternalArray::makeBeginIterator( IteratorState &it ) const { it.array_ = const_cast( this ); it.currentItemIndex_ = 0; it.currentPageIndex_ = pages_; } void ValueInternalArray::makeIterator( IteratorState &it, ArrayIndex index ) const { it.array_ = const_cast( this ); it.currentItemIndex_ = index % itemsPerPage; it.currentPageIndex_ = pages_ + index / itemsPerPage; } void ValueInternalArray::makeEndIterator( IteratorState &it ) const { makeIterator( it, size_ ); } ValueInternalArray::ValueInternalArray() : pages_( 0 ) , size_( 0 ) , pageCount_( 0 ) { } ValueInternalArray::ValueInternalArray( const ValueInternalArray &other ) : pages_( 0 ) , size_( other.size_ ) , pageCount_( 0 ) { PageIndex minNewPages = other.size_ / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); IteratorState itOther; other.makeBeginIterator( itOther ); Value *value; for ( ArrayIndex index = 0; index < size_; ++index, increment(itOther) ) { if ( index % itemsPerPage == 0 ) { PageIndex pageIndex = index / itemsPerPage; value = arrayAllocator()->allocateArrayPage(); pages_[pageIndex] = value; } new (value) Value( dereference( itOther ) ); } } ValueInternalArray & ValueInternalArray::operator=(ValueInternalArray other) { swap(other); return *this; } ValueInternalArray::~ValueInternalArray() { // destroy all constructed items IteratorState it; IteratorState itEnd; makeBeginIterator( it); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } // release all pages PageIndex lastPageIndex = size_ / itemsPerPage; for ( PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); // release pages index arrayAllocator()->releaseArrayPageIndex( pages_, pageCount_ ); } void ValueInternalArray::swap( ValueInternalArray &other ) { Value **tempPages = pages_; pages_ = other.pages_; other.pages_ = tempPages; ArrayIndex tempSize = size_; size_ = other.size_; other.size_ = tempSize; PageIndex tempPageCount = pageCount_; pageCount_ = other.pageCount_; other.pageCount_ = tempPageCount; } void ValueInternalArray::clear() { ValueInternalArray dummy; swap( dummy ); } void ValueInternalArray::resize( ArrayIndex newSize ) { if ( newSize == 0 ) clear(); else if ( newSize < size_ ) { IteratorState it; IteratorState itEnd; makeIterator( it, newSize ); makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage; PageIndex lastPageIndex = size_ / itemsPerPage; for ( ; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); size_ = newSize; } else if ( newSize > size_ ) resolveReference( newSize ); } void ValueInternalArray::makeIndexValid( ArrayIndex index ) { // Need to enlarge page index ? if ( index >= pageCount_ * itemsPerPage ) { PageIndex minNewPages = (index + 1) / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); } // Need to allocate new pages ? ArrayIndex nextPageIndex = (size_ % itemsPerPage) != 0 ? size_ - (size_%itemsPerPage) + itemsPerPage : size_; if ( nextPageIndex <= index ) { PageIndex pageIndex = nextPageIndex / itemsPerPage; PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1; for ( ; pageToAllocate-- > 0; ++pageIndex ) pages_[pageIndex] = arrayAllocator()->allocateArrayPage(); } // Initialize all new entries IteratorState it; IteratorState itEnd; makeIterator( it, size_ ); size_ = index + 1; makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); new (value) Value(); // Construct a default value using placement new } } Value & ValueInternalArray::resolveReference( ArrayIndex index ) { if ( index >= size_ ) makeIndexValid( index ); return pages_[index/itemsPerPage][index%itemsPerPage]; } Value * ValueInternalArray::find( ArrayIndex index ) const { if ( index >= size_ ) return 0; return &(pages_[index/itemsPerPage][index%itemsPerPage]); } ValueInternalArray::ArrayIndex ValueInternalArray::size() const { return size_; } int ValueInternalArray::distance( const IteratorState &x, const IteratorState &y ) { return indexOf(y) - indexOf(x); } ValueInternalArray::ArrayIndex ValueInternalArray::indexOf( const IteratorState &iterator ) { if ( !iterator.array_ ) return ArrayIndex(-1); return ArrayIndex( (iterator.currentPageIndex_ - iterator.array_->pages_) * itemsPerPage + iterator.currentItemIndex_ ); } int ValueInternalArray::compare( const ValueInternalArray &other ) const { int sizeDiff( size_ - other.size_ ); if ( sizeDiff != 0 ) return sizeDiff; for ( ArrayIndex index =0; index < size_; ++index ) { int diff = pages_[index/itemsPerPage][index%itemsPerPage].compare( other.pages_[index/itemsPerPage][index%itemsPerPage] ); if ( diff != 0 ) return diff; } return 0; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/Windows/Headers/json/json_internalmap.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalMap // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// /** \internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) ); * This optimization is used by the fast allocator. */ ValueInternalLink::ValueInternalLink() : previous_( 0 ) , next_( 0 ) { } ValueInternalLink::~ValueInternalLink() { for ( int index =0; index < itemPerLink; ++index ) { if ( !items_[index].isItemAvailable() ) { if ( !items_[index].isMemberNameStatic() ) free( keys_[index] ); } else break; } } ValueMapAllocator::~ValueMapAllocator() { } #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; #else /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap(); // placement new return map; } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap( other ); // placement new return map; } virtual void destructMap( ValueInternalMap *map ) { if ( map ) { map->~ValueInternalMap(); mapsAllocator_.release( map ); } } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { ValueInternalLink *link = linksAllocator_.allocate(); memset( link, 0, sizeof(ValueInternalLink) ); return link; } virtual void releaseMapLink( ValueInternalLink *link ) { link->~ValueInternalLink(); linksAllocator_.release( link ); } private: BatchAllocator mapsAllocator_; BatchAllocator linksAllocator_; }; #endif static ValueMapAllocator *&mapAllocator() { static DefaultValueMapAllocator defaultAllocator; static ValueMapAllocator *mapAllocator = &defaultAllocator; return mapAllocator; } static struct DummyMapAllocatorInitializer { DummyMapAllocatorInitializer() { mapAllocator(); // ensure mapAllocator() statics are initialized before main(). } } dummyMapAllocatorInitializer; // h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32. /* use linked list hash map. buckets array is a container. linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124) value have extra state: valid, available, deleted */ ValueInternalMap::ValueInternalMap() : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { } ValueInternalMap::ValueInternalMap( const ValueInternalMap &other ) : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { reserve( other.itemCount_ ); IteratorState it; IteratorState itEnd; other.makeBeginIterator( it ); other.makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { bool isStatic; const char *memberName = key( it, isStatic ); const Value &aValue = value( it ); resolveReference(memberName, isStatic) = aValue; } } ValueInternalMap & ValueInternalMap::operator=(ValueInternalMap other) { swap(other); return *this; } ValueInternalMap::~ValueInternalMap() { if ( buckets_ ) { for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex ) { ValueInternalLink *link = buckets_[bucketIndex].next_; while ( link ) { ValueInternalLink *linkToRelease = link; link = link->next_; mapAllocator()->releaseMapLink( linkToRelease ); } } mapAllocator()->releaseMapBuckets( buckets_ ); } } void ValueInternalMap::swap( ValueInternalMap &other ) { ValueInternalLink *tempBuckets = buckets_; buckets_ = other.buckets_; other.buckets_ = tempBuckets; ValueInternalLink *tempTailLink = tailLink_; tailLink_ = other.tailLink_; other.tailLink_ = tempTailLink; BucketIndex tempBucketsSize = bucketsSize_; bucketsSize_ = other.bucketsSize_; other.bucketsSize_ = tempBucketsSize; BucketIndex tempItemCount = itemCount_; itemCount_ = other.itemCount_; other.itemCount_ = tempItemCount; } void ValueInternalMap::clear() { ValueInternalMap dummy; swap( dummy ); } ValueInternalMap::BucketIndex ValueInternalMap::size() const { return itemCount_; } bool ValueInternalMap::reserveDelta( BucketIndex growth ) { return reserve( itemCount_ + growth ); } bool ValueInternalMap::reserve( BucketIndex newItemCount ) { if ( !buckets_ && newItemCount > 0 ) { buckets_ = mapAllocator()->allocateMapBuckets( 1 ); bucketsSize_ = 1; tailLink_ = &buckets_[0]; } // BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink; return true; } const Value * ValueInternalMap::find( const char *key ) const { if ( !bucketsSize_ ) return 0; HashKey hashedKey = hash( key ); BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( const ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; current = current->next_ ) { for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return 0; if ( strcmp( key, current->keys_[index] ) == 0 ) return ¤t->items_[index]; } } return 0; } Value * ValueInternalMap::find( const char *key ) { const ValueInternalMap *constThis = this; return const_cast( constThis->find( key ) ); } Value & ValueInternalMap::resolveReference( const char *key, bool isStatic ) { HashKey hashedKey = hash( key ); if ( bucketsSize_ ) { BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink **previous = 0; BucketIndex index; for ( ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; previous = ¤t->next_, current = current->next_ ) { for ( index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return setNewItem( key, isStatic, current, index ); if ( strcmp( key, current->keys_[index] ) == 0 ) return current->items_[index]; } } } reserveDelta( 1 ); return unsafeAdd( key, isStatic, hashedKey ); } void ValueInternalMap::remove( const char *key ) { HashKey hashedKey = hash( key ); if ( !bucketsSize_ ) return; BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( ValueInternalLink *link = &buckets_[bucketIndex]; link != 0; link = link->next_ ) { BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) return; if ( strcmp( key, link->keys_[index] ) == 0 ) { doActualRemove( link, index, bucketIndex ); return; } } } } void ValueInternalMap::doActualRemove( ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex ) { // find last item of the bucket and swap it with the 'removed' one. // set removed items flags to 'available'. // if last page only contains 'available' items, then desallocate it (it's empty) ValueInternalLink *&lastLink = getLastLinkInBucket( index ); BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1 for ( ; lastItemIndex < ValueInternalLink::itemPerLink; ++lastItemIndex ) // may be optimized with dicotomic search { if ( lastLink->items_[lastItemIndex].isItemAvailable() ) break; } BucketIndex lastUsedIndex = lastItemIndex - 1; Value *valueToDelete = &link->items_[index]; Value *valueToPreserve = &lastLink->items_[lastUsedIndex]; if ( valueToDelete != valueToPreserve ) valueToDelete->swap( *valueToPreserve ); if ( lastUsedIndex == 0 ) // page is now empty { // remove it from bucket linked list and delete it. ValueInternalLink *linkPreviousToLast = lastLink->previous_; if ( linkPreviousToLast != 0 ) // can not deleted bucket link. { mapAllocator()->releaseMapLink( lastLink ); linkPreviousToLast->next_ = 0; lastLink = linkPreviousToLast; } } else { Value dummy; valueToPreserve->swap( dummy ); // restore deleted to default Value. valueToPreserve->setItemUsed( false ); } --itemCount_; } ValueInternalLink *& ValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex ) { if ( bucketIndex == bucketsSize_ - 1 ) return tailLink_; ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_; if ( !previous ) previous = &buckets_[bucketIndex]; return previous; } Value & ValueInternalMap::setNewItem( const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index ) { char *duplicatedKey = makeMemberName( key ); ++itemCount_; link->keys_[index] = duplicatedKey; link->items_[index].setItemUsed(); link->items_[index].setMemberNameIsStatic( isStatic ); return link->items_[index]; // items already default constructed. } Value & ValueInternalMap::unsafeAdd( const char *key, bool isStatic, HashKey hashedKey ) { JSON_ASSERT_MESSAGE( bucketsSize_ > 0, "ValueInternalMap::unsafeAdd(): internal logic error." ); BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex ); ValueInternalLink *link = previousLink; BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) break; } if ( index == ValueInternalLink::itemPerLink ) // need to add a new page { ValueInternalLink *newLink = mapAllocator()->allocateMapLink(); index = 0; link->next_ = newLink; previousLink = newLink; link = newLink; } return setNewItem( key, isStatic, link, index ); } ValueInternalMap::HashKey ValueInternalMap::hash( const char *key ) const { HashKey hash = 0; while ( *key ) hash += *key++ * 37; return hash; } int ValueInternalMap::compare( const ValueInternalMap &other ) const { int sizeDiff( itemCount_ - other.itemCount_ ); if ( sizeDiff != 0 ) return sizeDiff; // Strict order guaranty is required. Compare all keys FIRST, then compare values. IteratorState it; IteratorState itEnd; makeBeginIterator( it ); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { if ( !other.find( key( it ) ) ) return 1; } // All keys are equals, let's compare values makeBeginIterator( it ); for ( ; !equals(it,itEnd); increment(it) ) { const Value *otherValue = other.find( key( it ) ); int valueDiff = value(it).compare( *otherValue ); if ( valueDiff != 0 ) return valueDiff; } return 0; } void ValueInternalMap::makeBeginIterator( IteratorState &it ) const { it.map_ = const_cast( this ); it.bucketIndex_ = 0; it.itemIndex_ = 0; it.link_ = buckets_; } void ValueInternalMap::makeEndIterator( IteratorState &it ) const { it.map_ = const_cast( this ); it.bucketIndex_ = bucketsSize_; it.itemIndex_ = 0; it.link_ = 0; } bool ValueInternalMap::equals( const IteratorState &x, const IteratorState &other ) { return x.map_ == other.map_ && x.bucketIndex_ == other.bucketIndex_ && x.link_ == other.link_ && x.itemIndex_ == other.itemIndex_; } void ValueInternalMap::incrementBucket( IteratorState &iterator ) { ++iterator.bucketIndex_; JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_, "ValueInternalMap::increment(): attempting to iterate beyond end." ); if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ ) iterator.link_ = 0; else iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]); iterator.itemIndex_ = 0; } void ValueInternalMap::increment( IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterator using invalid iterator." ); ++iterator.itemIndex_; if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink ) { JSON_ASSERT_MESSAGE( iterator.link_ != 0, "ValueInternalMap::increment(): attempting to iterate beyond end." ); iterator.link_ = iterator.link_->next_; if ( iterator.link_ == 0 ) incrementBucket( iterator ); } else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() ) { incrementBucket( iterator ); } } void ValueInternalMap::decrement( IteratorState &iterator ) { if ( iterator.itemIndex_ == 0 ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterate using invalid iterator." ); if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] ) { JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, "Attempting to iterate beyond beginning." ); --(iterator.bucketIndex_); } iterator.link_ = iterator.link_->previous_; iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1; } } const char * ValueInternalMap::key( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->keys_[iterator.itemIndex_]; } const char * ValueInternalMap::key( const IteratorState &iterator, bool &isStatic ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic(); return iterator.link_->keys_[iterator.itemIndex_]; } Value & ValueInternalMap::value( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->items_[iterator.itemIndex_]; } int ValueInternalMap::distance( const IteratorState &x, const IteratorState &y ) { int offset = 0; IteratorState it = x; while ( !equals( it, y ) ) increment( it ); return offset; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/Windows/Headers/json/json_tool.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED /* This header provides common string manipulation support, such as UTF-8, * portable conversion from/to string... * * It is an internal header that must not be exposed. */ namespace Json { /// Converts a unicode code-point to UTF-8. static inline std::string codePointToUTF8(unsigned int cp) { std::string result; // based on description from http://en.wikipedia.org/wiki/UTF-8 if (cp <= 0x7f) { result.resize(1); result[0] = static_cast(cp); } else if (cp <= 0x7FF) { result.resize(2); result[1] = static_cast(0x80 | (0x3f & cp)); result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); } else if (cp <= 0xFFFF) { result.resize(3); result[2] = static_cast(0x80 | (0x3f & cp)); result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); } else if (cp <= 0x10FFFF) { result.resize(4); result[3] = static_cast(0x80 | (0x3f & cp)); result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); } return result; } /// Returns true if ch is a control character (in range [0,32[). static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } enum { /// Constant that specify the size of the buffer that must be passed to /// uintToString. uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 }; // Defines a char buffer for use with uintToString(). typedef char UIntToStringBuffer[uintToStringBufferSize]; /** Converts an unsigned integer to string. * @param value Unsigned interger to convert to string * @param current Input/Output string buffer. * Must have at least uintToStringBufferSize chars free. */ static inline void uintToString(LargestUInt value, char *¤t) { *--current = 0; do { *--current = char(value % 10) + '0'; value /= 10; } while (value != 0); } /** Change ',' to '.' everywhere in buffer. * * We had a sophisticated way, but it did not work in WinCE. * @see https://github.com/open-source-parsers/jsoncpp/pull/9 */ static inline void fixNumericLocale(char* begin, char* end) { while (begin < end) { if (*begin == ',') { *begin = '.'; } ++begin; } } } // namespace Json { #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED // vim: et ts=2 sts=2 sw=2 tw=0 ================================================ FILE: Libraries/Core/Windows/Headers/json/json_valueiterator.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIteratorBase // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIteratorBase::ValueIteratorBase() #ifndef JSON_VALUE_USE_INTERNAL_MAP : current_() , isNull_( true ) { } #else : isArray_( true ) , isNull_( true ) { iterator_.array_ = ValueInternalArray::IteratorState(); } #endif #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator ¤t ) : current_( current ) , isNull_( false ) { } #else ValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state ) : isArray_( true ) { iterator_.array_ = state; } ValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state ) : isArray_( false ) { iterator_.map_ = state; } #endif Value & ValueIteratorBase::deref() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP return current_->second; #else if ( isArray_ ) return ValueInternalArray::dereference( iterator_.array_ ); return ValueInternalMap::value( iterator_.map_ ); #endif } void ValueIteratorBase::increment() { #ifndef JSON_VALUE_USE_INTERNAL_MAP ++current_; #else if ( isArray_ ) ValueInternalArray::increment( iterator_.array_ ); ValueInternalMap::increment( iterator_.map_ ); #endif } void ValueIteratorBase::decrement() { #ifndef JSON_VALUE_USE_INTERNAL_MAP --current_; #else if ( isArray_ ) ValueInternalArray::decrement( iterator_.array_ ); ValueInternalMap::decrement( iterator_.map_ ); #endif } ValueIteratorBase::difference_type ValueIteratorBase::computeDistance( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP # ifdef JSON_USE_CPPTL_SMALLMAP return current_ - other.current_; # else // Iterator for null value are initialized using the default // constructor, which initialize current_ to the default // std::map::iterator. As begin() and end() are two instance // of the default std::map::iterator, they can not be compared. // To allow this, we handle this comparison specifically. if ( isNull_ && other.isNull_ ) { return 0; } // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL, // which is the one used by default). // Using a portable hand-made version for non random iterator instead: // return difference_type( std::distance( current_, other.current_ ) ); difference_type myDistance = 0; for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it ) { ++myDistance; } return myDistance; # endif #else if ( isArray_ ) return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ ); #endif } bool ValueIteratorBase::isEqual( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP if ( isNull_ ) { return other.isNull_; } return current_ == other.current_; #else if ( isArray_ ) return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ ); #endif } void ValueIteratorBase::copy( const SelfType &other ) { #ifndef JSON_VALUE_USE_INTERNAL_MAP current_ = other.current_; isNull_ = other.isNull_; #else if ( isArray_ ) iterator_.array_ = other.iterator_.array_; iterator_.map_ = other.iterator_.map_; #endif } Value ValueIteratorBase::key() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( czstring.c_str() ) { if ( czstring.isStaticString() ) return Value( StaticString( czstring.c_str() ) ); return Value( czstring.c_str() ); } return Value( czstring.index() ); #else if ( isArray_ ) return Value( ValueInternalArray::indexOf( iterator_.array_ ) ); bool isStatic; const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic ); if ( isStatic ) return Value( StaticString( memberName ) ); return Value( memberName ); #endif } UInt ValueIteratorBase::index() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( !czstring.c_str() ) return czstring.index(); return Value::UInt( -1 ); #else if ( isArray_ ) return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) ); return Value::UInt( -1 ); #endif } const char * ValueIteratorBase::memberName() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const char *name = (*current_).first.c_str(); return name ? name : ""; #else if ( !isArray_ ) return ValueInternalMap::key( iterator_.map_ ); return ""; #endif } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueConstIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueConstIterator::ValueConstIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueConstIterator & ValueConstIterator::operator =( const ValueIteratorBase &other ) { copy( other ); return *this; } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIterator::ValueIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIterator::ValueIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueIterator::ValueIterator( const ValueConstIterator &other ) : ValueIteratorBase( other ) { } ValueIterator::ValueIterator( const ValueIterator &other ) : ValueIteratorBase( other ) { } ValueIterator & ValueIterator::operator =( const SelfType &other ) { copy( other ); return *this; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/Windows/Headers/json/reader.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_READER_H_INCLUDED #define CPPTL_JSON_READER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "features.h" #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include #include #include // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) namespace Json { /** \brief Unserialize a JSON document into a *Value. * */ class JSON_API Reader { public: typedef char Char; typedef const Char *Location; /** \brief An error tagged with where in the JSON text it was encountered. * * The offsets give the [start, limit) range of bytes within the text. Note * that this is bytes, not codepoints. * */ struct StructuredError { size_t offset_start; size_t offset_limit; std::string message; }; /** \brief Constructs a Reader allowing all features * for parsing. */ Reader(); /** \brief Constructs a Reader allowing the specified feature set * for parsing. */ Reader(const Features &features); /** \brief Read a Value from a JSON * document. * \param document UTF-8 encoded string containing the document to read. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them * back during * serialization, \c false to discard comments. * This parameter is ignored if * Features::allowComments_ * is \c false. * \return \c true if the document was successfully parsed, \c false if an * error occurred. */ bool parse(const std::string &document, Value &root, bool collectComments = true); /** \brief Read a Value from a JSON document. * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the document to read. * \param endDoc Pointer on the end of the UTF-8 encoded string of the document to read. \ Must be >= beginDoc. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them back during * serialization, \c false to discard comments. * This parameter is ignored if Features::allowComments_ * is \c false. * \return \c true if the document was successfully parsed, \c false if an error occurred. */ bool parse(const char *beginDoc, const char *endDoc, Value &root, bool collectComments = true); /// \brief Parse from input stream. /// \see Json::operator>>(std::istream&, Json::Value&). bool parse(std::istream &is, Value &root, bool collectComments = true); /** \brief Returns a user friendly string that list errors in the parsed * document. * \return Formatted error message with the list of errors with their location * in * the parsed document. An empty string is returned if no error * occurred * during parsing. * \deprecated Use getFormattedErrorMessages() instead (typo fix). */ JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead") std::string getFormatedErrorMessages() const; /** \brief Returns a user friendly string that list errors in the parsed * document. * \return Formatted error message with the list of errors with their location * in * the parsed document. An empty string is returned if no error * occurred * during parsing. */ std::string getFormattedErrorMessages() const; /** \brief Returns a vector of structured erros encounted while parsing. * \return A (possibly empty) vector of StructuredError objects. Currently * only one error can be returned, but the caller should tolerate * multiple * errors. This can occur if the parser recovers from a non-fatal * parse error and then encounters additional errors. */ std::vector getStructuredErrors() const; private: enum TokenType { tokenEndOfStream = 0, tokenObjectBegin, tokenObjectEnd, tokenArrayBegin, tokenArrayEnd, tokenString, tokenNumber, tokenTrue, tokenFalse, tokenNull, tokenArraySeparator, tokenMemberSeparator, tokenComment, tokenError }; class Token { public: TokenType type_; Location start_; Location end_; }; class ErrorInfo { public: Token token_; std::string message_; Location extra_; }; typedef std::deque Errors; bool expectToken(TokenType type, Token &token, const char *message); bool readToken(Token &token); void skipSpaces(); bool match(Location pattern, int patternLength); bool readComment(); bool readCStyleComment(); bool readCppStyleComment(); bool readString(); void readNumber(); bool readValue(); bool readObject(Token &token); bool readArray(Token &token); bool decodeNumber(Token &token); bool decodeNumber(Token &token, Value &decoded); bool decodeString(Token &token); bool decodeString(Token &token, std::string &decoded); bool decodeDouble(Token &token); bool decodeDouble(Token &token, Value &decoded); bool decodeUnicodeCodePoint(Token &token, Location ¤t, Location end, unsigned int &unicode); bool decodeUnicodeEscapeSequence(Token &token, Location ¤t, Location end, unsigned int &unicode); bool addError(const std::string &message, Token &token, Location extra = 0); bool recoverFromError(TokenType skipUntilToken); bool addErrorAndRecover(const std::string &message, Token &token, TokenType skipUntilToken); void skipUntilSpace(); Value ¤tValue(); Char getNextChar(); void getLocationLineAndColumn(Location location, int &line, int &column) const; std::string getLocationLineAndColumn(Location location) const; void addComment(Location begin, Location end, CommentPlacement placement); void skipCommentTokens(Token &token); typedef std::stack Nodes; Nodes nodes_; Errors errors_; std::string document_; Location begin_; Location end_; Location current_; Location lastValueEnd_; Value *lastValue_; std::string commentsBefore_; Features features_; bool collectComments_; }; /** \brief Read from 'sin' into 'root'. Always keep comments from the input JSON. This can be used to read a file into a particular sub-object. For example: \code Json::Value root; cin >> root["dir"]["file"]; cout << root; \endcode Result: \verbatim { "dir": { "file": { // The input stream JSON would be nested here. } } } \endverbatim \throw std::exception on parse error. \see Json::operator<<() */ JSON_API std::istream &operator>>(std::istream &, Value &); } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // CPPTL_JSON_READER_H_INCLUDED ================================================ FILE: Libraries/Core/Windows/Headers/json/value.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_H_INCLUDED #define CPPTL_JSON_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include #ifndef JSON_USE_CPPTL_SMALLMAP #include #else #include #endif #ifdef JSON_USE_CPPTL #include #endif // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) /** \brief JSON (JavaScript Object Notation). */ namespace Json { /** \brief Type of the value held by a Value object. */ enum ValueType { nullValue = 0, ///< 'null' value intValue, ///< signed integer value uintValue, ///< unsigned integer value realValue, ///< double value stringValue, ///< UTF-8 string value booleanValue, ///< bool value arrayValue, ///< array value (ordered list) objectValue ///< object value (collection of name/value pairs). }; enum CommentPlacement { commentBefore = 0, ///< a comment placed on the line before a value commentAfterOnSameLine, ///< a comment just after a value on the same line commentAfter, ///< a comment on the line after a value (only make sense for /// root value) numberOfCommentPlacement }; //# ifdef JSON_USE_CPPTL // typedef CppTL::AnyEnumerator EnumMemberNames; // typedef CppTL::AnyEnumerator EnumValues; //# endif /** \brief Lightweight wrapper to tag static string. * * Value constructor and objectValue member assignement takes advantage of the * StaticString and avoid the cost of string duplication when storing the * string or the member name. * * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ class JSON_API StaticString { public: explicit StaticString(const char *czstring) : str_(czstring) {} operator const char *() const { return str_; } const char *c_str() const { return str_; } private: const char *str_; }; /** \brief Represents a JSON value. * * This class is a discriminated union wrapper that can represents a: * - signed integer [range: Value::minInt - Value::maxInt] * - unsigned integer (range: 0 - Value::maxUInt) * - double * - UTF-8 string * - boolean * - 'null' * - an ordered list of Value * - collection of name/value pairs (javascript object) * * The type of the held value is represented by a #ValueType and * can be obtained using type(). * * values of an #objectValue or #arrayValue can be accessed using operator[]() *methods. * Non const methods will automatically create the a #nullValue element * if it does not exist. * The sequence of an #arrayValue will be automatically resize and initialized * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. * * The get() methods can be used to obtanis default value in the case the *required element * does not exist. * * It is possible to iterate over the list of a #objectValue values using * the getMemberNames() method. */ class JSON_API Value { friend class ValueIteratorBase; #ifdef JSON_VALUE_USE_INTERNAL_MAP friend class ValueInternalLink; friend class ValueInternalMap; #endif public: typedef std::vector Members; typedef ValueIterator iterator; typedef ValueConstIterator const_iterator; typedef Json::UInt UInt; typedef Json::Int Int; #if defined(JSON_HAS_INT64) typedef Json::UInt64 UInt64; typedef Json::Int64 Int64; #endif // defined(JSON_HAS_INT64) typedef Json::LargestInt LargestInt; typedef Json::LargestUInt LargestUInt; typedef Json::ArrayIndex ArrayIndex; static const Value& null; /// Minimum signed integer value that can be stored in a Json::Value. static const LargestInt minLargestInt; /// Maximum signed integer value that can be stored in a Json::Value. static const LargestInt maxLargestInt; /// Maximum unsigned integer value that can be stored in a Json::Value. static const LargestUInt maxLargestUInt; /// Minimum signed int value that can be stored in a Json::Value. static const Int minInt; /// Maximum signed int value that can be stored in a Json::Value. static const Int maxInt; /// Maximum unsigned int value that can be stored in a Json::Value. static const UInt maxUInt; #if defined(JSON_HAS_INT64) /// Minimum signed 64 bits int value that can be stored in a Json::Value. static const Int64 minInt64; /// Maximum signed 64 bits int value that can be stored in a Json::Value. static const Int64 maxInt64; /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. static const UInt64 maxUInt64; #endif // defined(JSON_HAS_INT64) private: #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION #ifndef JSON_VALUE_USE_INTERNAL_MAP class CZString { public: enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy }; CZString(ArrayIndex index); CZString(const char *cstr, DuplicationPolicy allocate); CZString(const CZString &other); ~CZString(); CZString &operator=(CZString other); bool operator<(const CZString &other) const; bool operator==(const CZString &other) const; ArrayIndex index() const; const char *c_str() const; bool isStaticString() const; private: void swap(CZString &other); const char *cstr_; ArrayIndex index_; }; public: #ifndef JSON_USE_CPPTL_SMALLMAP typedef std::map ObjectValues; #else typedef CppTL::SmallMap ObjectValues; #endif // ifndef JSON_USE_CPPTL_SMALLMAP #endif // ifndef JSON_VALUE_USE_INTERNAL_MAP #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION public: /** \brief Create a default Value of the given type. This is a very useful constructor. To create an empty array, pass arrayValue. To create an empty object, pass objectValue. Another Value can then be set to this one by assignment. This is useful since clear() and resize() will not alter types. Examples: \code Json::Value null_value; // null Json::Value arr_value(Json::arrayValue); // [] Json::Value obj_value(Json::objectValue); // {} \endcode */ Value(ValueType type = nullValue); Value(Int value); Value(UInt value); #if defined(JSON_HAS_INT64) Value(Int64 value); Value(UInt64 value); #endif // if defined(JSON_HAS_INT64) Value(double value); Value(const char *value); Value(const char *beginValue, const char *endValue); /** \brief Constructs a value from a static string. * Like other value string constructor but do not duplicate the string for * internal storage. The given string must remain alive after the call to this * constructor. * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * \endcode */ Value(const StaticString &value); Value(const std::string &value); #ifdef JSON_USE_CPPTL Value(const CppTL::ConstString &value); #endif Value(bool value); Value(const Value &other); ~Value(); Value &operator=(Value other); /// Swap values. /// \note Currently, comments are intentionally not swapped, for /// both logic and efficiency. void swap(Value &other); ValueType type() const; bool operator<(const Value &other) const; bool operator<=(const Value &other) const; bool operator>=(const Value &other) const; bool operator>(const Value &other) const; bool operator==(const Value &other) const; bool operator!=(const Value &other) const; int compare(const Value &other) const; const char *asCString() const; std::string asString() const; #ifdef JSON_USE_CPPTL CppTL::ConstString asConstString() const; #endif Int asInt() const; UInt asUInt() const; #if defined(JSON_HAS_INT64) Int64 asInt64() const; UInt64 asUInt64() const; #endif // if defined(JSON_HAS_INT64) LargestInt asLargestInt() const; LargestUInt asLargestUInt() const; float asFloat() const; double asDouble() const; bool asBool() const; bool isNull() const; bool isBool() const; bool isInt() const; bool isInt64() const; bool isUInt() const; bool isUInt64() const; bool isIntegral() const; bool isDouble() const; bool isNumeric() const; bool isString() const; bool isArray() const; bool isObject() const; bool isConvertibleTo(ValueType other) const; /// Number of values in array or object ArrayIndex size() const; /// \brief Return true if empty array, empty object, or null; /// otherwise, false. bool empty() const; /// Return isNull() bool operator!() const; /// Remove all object members and array elements. /// \pre type() is arrayValue, objectValue, or nullValue /// \post type() is unchanged void clear(); /// Resize the array to size elements. /// New elements are initialized to null. /// May only be called on nullValue or arrayValue. /// \pre type() is arrayValue or nullValue /// \post type() is arrayValue void resize(ArrayIndex size); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are /// inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) Value &operator[](ArrayIndex index); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are /// inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) Value &operator[](int index); /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) const Value &operator[](ArrayIndex index) const; /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) const Value &operator[](int index) const; /// If the array contains at least index+1 elements, returns the element /// value, /// otherwise returns defaultValue. Value get(ArrayIndex index, const Value &defaultValue) const; /// Return true if index < size(). bool isValidIndex(ArrayIndex index) const; /// \brief Append value to array at the end. /// /// Equivalent to jsonvalue[jsonvalue.size()] = value; Value &append(const Value &value); /// Access an object value by name, create a null member if it does not exist. Value &operator[](const char *key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const char *key) const; /// Access an object value by name, create a null member if it does not exist. Value &operator[](const std::string &key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const std::string &key) const; /** \brief Access an object value by name, create a null member if it does not exist. * If the object as no entry for that name, then the member name used to store * the new entry is not duplicated. * Example of use: * \code * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ Value &operator[](const StaticString &key); #ifdef JSON_USE_CPPTL /// Access an object value by name, create a null member if it does not exist. Value &operator[](const CppTL::ConstString &key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const CppTL::ConstString &key) const; #endif /// Return the member named key if it exist, defaultValue otherwise. Value get(const char *key, const Value &defaultValue) const; /// Return the member named key if it exist, defaultValue otherwise. Value get(const std::string &key, const Value &defaultValue) const; #ifdef JSON_USE_CPPTL /// Return the member named key if it exist, defaultValue otherwise. Value get(const CppTL::ConstString &key, const Value &defaultValue) const; #endif /// \brief Remove and return the named member. /// /// Do nothing if it did not exist. /// \return the removed Value, or null. /// \pre type() is objectValue or nullValue /// \post type() is unchanged Value removeMember(const char *key); /// Same as removeMember(const char*) Value removeMember(const std::string &key); /// Return true if the object has a member named key. bool isMember(const char *key) const; /// Return true if the object has a member named key. bool isMember(const std::string &key) const; #ifdef JSON_USE_CPPTL /// Return true if the object has a member named key. bool isMember(const CppTL::ConstString &key) const; #endif /// \brief Return a list of the member names. /// /// If null, return an empty list. /// \pre type() is objectValue or nullValue /// \post if type() was nullValue, it remains nullValue Members getMemberNames() const; //# ifdef JSON_USE_CPPTL // EnumMemberNames enumMemberNames() const; // EnumValues enumValues() const; //# endif /// Comments must be //... or /* ... */ void setComment(const char *comment, CommentPlacement placement); /// Comments must be //... or /* ... */ void setComment(const std::string &comment, CommentPlacement placement); bool hasComment(CommentPlacement placement) const; /// Include delimiters and embedded newlines. std::string getComment(CommentPlacement placement) const; std::string toStyledString() const; const_iterator begin() const; const_iterator end() const; iterator begin(); iterator end(); // Accessors for the [start, limit) range of bytes within the JSON text from // which this value was parsed, if any. void setOffsetStart(size_t start); void setOffsetLimit(size_t limit); size_t getOffsetStart() const; size_t getOffsetLimit() const; private: Value &resolveReference(const char *key, bool isStatic); #ifdef JSON_VALUE_USE_INTERNAL_MAP inline bool isItemAvailable() const { return itemIsUsed_ == 0; } inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; } inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; } inline void setMemberNameIsStatic(bool isStatic) { memberNameIsStatic_ = isStatic ? 1 : 0; } #endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP private: struct CommentInfo { CommentInfo(); ~CommentInfo(); void setComment(const char *text); char *comment_; }; // struct MemberNamesTransform //{ // typedef const char *result_type; // const char *operator()( const CZString &name ) const // { // return name.c_str(); // } //}; union ValueHolder { LargestInt int_; LargestUInt uint_; double real_; bool bool_; char *string_; #ifdef JSON_VALUE_USE_INTERNAL_MAP ValueInternalArray *array_; ValueInternalMap *map_; #else ObjectValues *map_; #endif } value_; ValueType type_ : 8; int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. #ifdef JSON_VALUE_USE_INTERNAL_MAP unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. #endif CommentInfo *comments_; // [start, limit) byte offsets in the source JSON text from which this Value // was extracted. size_t start_; size_t limit_; }; /** \brief Experimental and untested: represents an element of the "path" to * access a node. */ class JSON_API PathArgument { public: friend class Path; PathArgument(); PathArgument(ArrayIndex index); PathArgument(const char *key); PathArgument(const std::string &key); private: enum Kind { kindNone = 0, kindIndex, kindKey }; std::string key_; ArrayIndex index_; Kind kind_; }; /** \brief Experimental and untested: represents a "path" to access a node. * * Syntax: * - "." => root node * - ".[n]" => elements at index 'n' of root node (an array value) * - ".name" => member named 'name' of root node (an object value) * - ".name1.name2.name3" * - ".[0][1][2].name1[3]" * - ".%" => member name is provided as parameter * - ".[%]" => index is provied as parameter */ class JSON_API Path { public: Path(const std::string &path, const PathArgument &a1 = PathArgument(), const PathArgument &a2 = PathArgument(), const PathArgument &a3 = PathArgument(), const PathArgument &a4 = PathArgument(), const PathArgument &a5 = PathArgument()); const Value &resolve(const Value &root) const; Value resolve(const Value &root, const Value &defaultValue) const; /// Creates the "path" to access the specified node and returns a reference on /// the node. Value &make(Value &root) const; private: typedef std::vector InArgs; typedef std::vector Args; void makePath(const std::string &path, const InArgs &in); void addPathInArg(const std::string &path, const InArgs &in, InArgs::const_iterator &itInArg, PathArgument::Kind kind); void invalidPath(const std::string &path, int location); Args args_; }; #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief Allocator to customize Value internal map. * Below is an example of a simple implementation (default implementation actually * use memory pool for speed). * \code class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; * \endcode */ class JSON_API ValueMapAllocator { public: virtual ~ValueMapAllocator(); virtual ValueInternalMap *newMap() = 0; virtual ValueInternalMap *newMapCopy(const ValueInternalMap &other) = 0; virtual void destructMap(ValueInternalMap *map) = 0; virtual ValueInternalLink *allocateMapBuckets(unsigned int size) = 0; virtual void releaseMapBuckets(ValueInternalLink *links) = 0; virtual ValueInternalLink *allocateMapLink() = 0; virtual void releaseMapLink(ValueInternalLink *link) = 0; }; /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). * \internal previous_ & next_ allows for bidirectional traversal. */ class JSON_API ValueInternalLink { public: enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. enum InternalFlags { flagAvailable = 0, flagUsed = 1 }; ValueInternalLink(); ~ValueInternalLink(); Value items_[itemPerLink]; char *keys_[itemPerLink]; ValueInternalLink *previous_; ValueInternalLink *next_; }; /** \brief A linked page based hash-table implementation used internally by *Value. * \internal ValueInternalMap is a tradional bucket based hash-table, with a *linked * list in each bucket to handle collision. There is an addional twist in that * each node of the collision linked list is a page containing a fixed amount of * value. This provides a better compromise between memory usage and speed. * * Each bucket is made up of a chained list of ValueInternalLink. The last * link of a given bucket can be found in the 'previous_' field of the following *bucket. * The last link of the last bucket is stored in tailLink_ as it has no *following bucket. * Only the last link of a bucket may contains 'available' item. The last link *always * contains at least one element unless is it the bucket one very first link. */ class JSON_API ValueInternalMap { friend class ValueIteratorBase; friend class Value; public: typedef unsigned int HashKey; typedef unsigned int BucketIndex; #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState { IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {} ValueInternalMap *map_; ValueInternalLink *link_; BucketIndex itemIndex_; BucketIndex bucketIndex_; }; #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalMap(); ValueInternalMap(const ValueInternalMap &other); ValueInternalMap &operator=(ValueInternalMap other); ~ValueInternalMap(); void swap(ValueInternalMap &other); BucketIndex size() const; void clear(); bool reserveDelta(BucketIndex growth); bool reserve(BucketIndex newItemCount); const Value *find(const char *key) const; Value *find(const char *key); Value &resolveReference(const char *key, bool isStatic); void remove(const char *key); void doActualRemove(ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex); ValueInternalLink *&getLastLinkInBucket(BucketIndex bucketIndex); Value &setNewItem(const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index); Value &unsafeAdd(const char *key, bool isStatic, HashKey hashedKey); HashKey hash(const char *key) const; int compare(const ValueInternalMap &other) const; private: void makeBeginIterator(IteratorState &it) const; void makeEndIterator(IteratorState &it) const; static bool equals(const IteratorState &x, const IteratorState &other); static void increment(IteratorState &iterator); static void incrementBucket(IteratorState &iterator); static void decrement(IteratorState &iterator); static const char *key(const IteratorState &iterator); static const char *key(const IteratorState &iterator, bool &isStatic); static Value &value(const IteratorState &iterator); static int distance(const IteratorState &x, const IteratorState &y); private: ValueInternalLink *buckets_; ValueInternalLink *tailLink_; BucketIndex bucketsSize_; BucketIndex itemCount_; }; /** \brief A simplified deque implementation used internally by Value. * \internal * It is based on a list of fixed "page", each page contains a fixed number of *items. * Instead of using a linked-list, a array of pointer is used for fast item *look-up. * Look-up for an element is as follow: * - compute page index: pageIndex = itemIndex / itemsPerPage * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] * * Insertion is amortized constant time (only the array containing the index of *pointers * need to be reallocated when items are appended). */ class JSON_API ValueInternalArray { friend class Value; friend class ValueIteratorBase; public: enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. typedef Value::ArrayIndex ArrayIndex; typedef unsigned int PageIndex; #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState // Must be a POD { IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {} ValueInternalArray *array_; Value **currentPageIndex_; unsigned int currentItemIndex_; }; #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalArray(); ValueInternalArray(const ValueInternalArray &other); ValueInternalArray &operator=(ValueInternalArray other); ~ValueInternalArray(); void swap(ValueInternalArray &other); void clear(); void resize(ArrayIndex newSize); Value &resolveReference(ArrayIndex index); Value *find(ArrayIndex index) const; ArrayIndex size() const; int compare(const ValueInternalArray &other) const; private: static bool equals(const IteratorState &x, const IteratorState &other); static void increment(IteratorState &iterator); static void decrement(IteratorState &iterator); static Value &dereference(const IteratorState &iterator); static Value &unsafeDereference(const IteratorState &iterator); static int distance(const IteratorState &x, const IteratorState &y); static ArrayIndex indexOf(const IteratorState &iterator); void makeBeginIterator(IteratorState &it) const; void makeEndIterator(IteratorState &it) const; void makeIterator(IteratorState &it, ArrayIndex index) const; void makeIndexValid(ArrayIndex index); Value **pages_; ArrayIndex size_; PageIndex pageCount_; }; /** \brief Experimental: do not use. Allocator to customize Value internal array. * Below is an example of a simple implementation (actual implementation use * memory pool). \code class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destruct( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); if ( !newIndexes ) throw std::bad_alloc(); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; \endcode */ class JSON_API ValueArrayAllocator { public: virtual ~ValueArrayAllocator(); virtual ValueInternalArray *newArray() = 0; virtual ValueInternalArray *newArrayCopy(const ValueInternalArray &other) = 0; virtual void destructArray(ValueInternalArray *array) = 0; /** \brief Reallocate array page index. * Reallocates an array of pointer on each page. * \param indexes [input] pointer on the current index. May be \c NULL. * [output] pointer on the new index of at least * \a minNewIndexCount pages. * \param indexCount [input] current number of pages in the index. * [output] number of page the reallocated index can handle. * \b MUST be >= \a minNewIndexCount. * \param minNewIndexCount Minimum number of page the new index must be able * to * handle. */ virtual void reallocateArrayPageIndex(Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount) = 0; virtual void releaseArrayPageIndex(Value **indexes, ValueInternalArray::PageIndex indexCount) = 0; virtual Value *allocateArrayPage() = 0; virtual void releaseArrayPage(Value *value) = 0; }; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief base class for Value iterators. * */ class JSON_API ValueIteratorBase { public: typedef std::bidirectional_iterator_tag iterator_category; typedef unsigned int size_t; typedef int difference_type; typedef ValueIteratorBase SelfType; ValueIteratorBase(); #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIteratorBase(const Value::ObjectValues::iterator ¤t); #else ValueIteratorBase(const ValueInternalArray::IteratorState &state); ValueIteratorBase(const ValueInternalMap::IteratorState &state); #endif bool operator==(const SelfType &other) const { return isEqual(other); } bool operator!=(const SelfType &other) const { return !isEqual(other); } difference_type operator-(const SelfType &other) const { return computeDistance(other); } /// Return either the index or the member name of the referenced value as a /// Value. Value key() const; /// Return the index of the referenced Value. -1 if it is not an arrayValue. UInt index() const; /// Return the member name of the referenced Value. "" if it is not an /// objectValue. const char *memberName() const; protected: Value &deref() const; void increment(); void decrement(); difference_type computeDistance(const SelfType &other) const; bool isEqual(const SelfType &other) const; void copy(const SelfType &other); private: #ifndef JSON_VALUE_USE_INTERNAL_MAP Value::ObjectValues::iterator current_; // Indicates that iterator is for a null value. bool isNull_; #else union { ValueInternalArray::IteratorState array_; ValueInternalMap::IteratorState map_; } iterator_; bool isArray_; #endif }; /** \brief const iterator for object and array value. * */ class JSON_API ValueConstIterator : public ValueIteratorBase { friend class Value; public: typedef const Value value_type; typedef unsigned int size_t; typedef int difference_type; typedef const Value &reference; typedef const Value *pointer; typedef ValueConstIterator SelfType; ValueConstIterator(); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueConstIterator(const Value::ObjectValues::iterator ¤t); #else ValueConstIterator(const ValueInternalArray::IteratorState &state); ValueConstIterator(const ValueInternalMap::IteratorState &state); #endif public: SelfType &operator=(const ValueIteratorBase &other); SelfType operator++(int) { SelfType temp(*this); ++*this; return temp; } SelfType operator--(int) { SelfType temp(*this); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator*() const { return deref(); } }; /** \brief Iterator for object and array value. */ class JSON_API ValueIterator : public ValueIteratorBase { friend class Value; public: typedef Value value_type; typedef unsigned int size_t; typedef int difference_type; typedef Value &reference; typedef Value *pointer; typedef ValueIterator SelfType; ValueIterator(); ValueIterator(const ValueConstIterator &other); ValueIterator(const ValueIterator &other); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIterator(const Value::ObjectValues::iterator ¤t); #else ValueIterator(const ValueInternalArray::IteratorState &state); ValueIterator(const ValueInternalMap::IteratorState &state); #endif public: SelfType &operator=(const SelfType &other); SelfType operator++(int) { SelfType temp(*this); ++*this; return temp; } SelfType operator--(int) { SelfType temp(*this); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator*() const { return deref(); } }; } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // CPPTL_JSON_H_INCLUDED ================================================ FILE: Libraries/Core/Windows/Headers/json/writer.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_WRITER_H_INCLUDED #define JSON_WRITER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) namespace Json { class Value; /** \brief Abstract class for writers. */ class JSON_API Writer { public: virtual ~Writer(); virtual std::string write(const Value &root) = 0; }; /** \brief Outputs a Value in JSON format *without formatting (not human friendly). * * The JSON document is written in a single line. It is not intended for 'human' *consumption, * but may be usefull to support feature such as RPC where bandwith is limited. * \sa Reader, Value */ class JSON_API FastWriter : public Writer { public: FastWriter(); virtual ~FastWriter() {} void enableYAMLCompatibility(); /** \brief Drop the "null" string from the writer's output for nullValues. * Strictly speaking, this is not valid JSON. But when the output is being * fed to a browser's Javascript, it makes for smaller output and the * browser can handle the output just fine. */ void dropNullPlaceholders(); void omitEndingLineFeed(); public: // overridden from Writer virtual std::string write(const Value &root); private: void writeValue(const Value &value); std::string document_; bool yamlCompatiblityEnabled_; bool dropNullPlaceholders_; bool omitEndingLineFeed_; }; /** \brief Writes a Value in JSON format in a *human friendly way. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per *line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value *types, * and all the values fit on one lines, then print the array on a single *line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their *#CommentPlacement. * * \sa Reader, Value, Value::setComment() */ class JSON_API StyledWriter : public Writer { public: StyledWriter(); virtual ~StyledWriter() {} public: // overridden from Writer /** \brief Serialize a Value in JSON format. * \param root Value to serialize. * \return String containing the JSON document that represents the root value. */ virtual std::string write(const Value &root); private: void writeValue(const Value &value); void writeArrayValue(const Value &value); bool isMultineArray(const Value &value); void pushValue(const std::string &value); void writeIndent(); void writeWithIndent(const std::string &value); void indent(); void unindent(); void writeCommentBeforeValue(const Value &root); void writeCommentAfterValueOnSameLine(const Value &root); bool hasCommentForValue(const Value &value); static std::string normalizeEOL(const std::string &text); typedef std::vector ChildValues; ChildValues childValues_; std::string document_; std::string indentString_; int rightMargin_; int indentSize_; bool addChildValues_; }; /** \brief Writes a Value in JSON format in a human friendly way, to a stream rather than to a string. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value types, * and all the values fit on one lines, then print the array on a single line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their #CommentPlacement. * * \param indentation Each level will be indented by this amount extra. * \sa Reader, Value, Value::setComment() */ class JSON_API StyledStreamWriter { public: StyledStreamWriter(std::string indentation = "\t"); ~StyledStreamWriter() {} public: /** \brief Serialize a Value in JSON format. * \param out Stream to write to. (Can be ostringstream, e.g.) * \param root Value to serialize. * \note There is no point in deriving from Writer, since write() should not * return a value. */ void write(std::ostream &out, const Value &root); private: void writeValue(const Value &value); void writeArrayValue(const Value &value); bool isMultineArray(const Value &value); void pushValue(const std::string &value); void writeIndent(); void writeWithIndent(const std::string &value); void indent(); void unindent(); void writeCommentBeforeValue(const Value &root); void writeCommentAfterValueOnSameLine(const Value &root); bool hasCommentForValue(const Value &value); static std::string normalizeEOL(const std::string &text); typedef std::vector ChildValues; ChildValues childValues_; std::ostream *document_; std::string indentString_; int rightMargin_; std::string indentation_; bool addChildValues_; }; #if defined(JSON_HAS_INT64) std::string JSON_API valueToString(Int value); std::string JSON_API valueToString(UInt value); #endif // if defined(JSON_HAS_INT64) std::string JSON_API valueToString(LargestInt value); std::string JSON_API valueToString(LargestUInt value); std::string JSON_API valueToString(double value); std::string JSON_API valueToString(bool value); std::string JSON_API valueToQuotedString(const char *value); /// \brief Output using the StyledStreamWriter. /// \see Json::operator>>() JSON_API std::ostream &operator<<(std::ostream &, const Value &root); } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // JSON_WRITER_H_INCLUDED ================================================ FILE: Libraries/Core/Windows/Headers/md5/md5.h ================================================ /* MD5 converted to C++ class by Frank Thilo (thilo@unix-ag.org) for bzflag (http://www.bzflag.org) based on: md5.h and md5.c reference implementation of RFC 1321 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #ifndef BZF_MD5_H #define BZF_MD5_H #include #include // a small class for calculating MD5 hashes of strings or byte arrays // it is not meant to be fast or secure // // usage: 1) feed it blocks of uchars with update() // 2) finalize() // 3) get hexdigest() string // or // MD5(std::string).hexdigest() // // assumes that char is 8 bit and int is 32 bit class MD5 { public: typedef unsigned int size_type; // must be 32bit MD5(); MD5(const std::string& text); void update(const unsigned char *buf, size_type length); void update(const char *buf, size_type length); MD5& finalize(); std::string hexdigest() const; friend std::ostream& operator<<(std::ostream&, MD5 md5); std::string binarydigest() const {return std::string(reinterpret_cast(digest), 16);} //Ian Copland, 09/06/2014: added accessor for the raw digest. private: void init(); typedef unsigned char uint1; // 8bit typedef unsigned int uint4; // 32bit enum {blocksize = 64}; // VC6 won't eat a const static int here void transform(const uint1 block[blocksize]); static void decode(uint4 output[], const uint1 input[], size_type len); static void encode(uint1 output[], const uint4 input[], size_type len); bool finalized; uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk uint4 count[2]; // 64bit counter for number of bits (lo, hi) uint4 state[4]; // digest so far uint1 digest[16]; // the result // low level logic operations static inline uint4 F(uint4 x, uint4 y, uint4 z); static inline uint4 G(uint4 x, uint4 y, uint4 z); static inline uint4 H(uint4 x, uint4 y, uint4 z); static inline uint4 I(uint4 x, uint4 y, uint4 z); static inline uint4 rotate_left(uint4 x, int n); static inline void FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); }; std::string md5(const std::string str); #endif ================================================ FILE: Libraries/Core/Windows/Headers/minizip/crypt.h ================================================ /* crypt.h -- base code for crypt/uncrypt ZIPfile Version 1.01e, February 12th, 2005 Copyright (C) 1998-2005 Gilles Vollant This code is a modified version of crypting code in Infozip distribution The encryption/decryption parts of this source code (as opposed to the non-echoing password parts) were originally written in Europe. The whole source package can be freely distributed, including from the USA. (Prior to January 2000, re-export from the US was a violation of US law.) This encryption code is a direct transcription of the algorithm from Roger Schlafly, described by Phil Katz in the file appnote.txt. This file (appnote.txt) is distributed with the PKZIP program (even in the version without encryption capabilities). If you don't need crypting in your application, just define symbols NOCRYPT and NOUNCRYPT. This code support the "Traditional PKWARE Encryption". The new AES encryption added on Zip format by Winzip (see the page http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong Encryption is not supported. */ #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) /*********************************************************************** * Return the next byte in the pseudo-random sequence */ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) { unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); } /*********************************************************************** * Update the encryption keys with the next byte of plain text */ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) { (*(pkeys+0)) = CRC32((*(pkeys+0)), c); (*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; { register int keyshift = (int)((*(pkeys+1)) >> 24); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); } return c; } /*********************************************************************** * Initialize the encryption keys and the random header according to * the given password. */ static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) { *(pkeys+0) = 305419896L; *(pkeys+1) = 591751049L; *(pkeys+2) = 878082192L; while (*passwd != '\0') { update_keys(pkeys,pcrc_32_tab,(int)*passwd); passwd++; } } #define zdecode(pkeys,pcrc_32_tab,c) \ (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) #define zencode(pkeys,pcrc_32_tab,c,t) \ (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED #define RAND_HEAD_LEN 12 /* "last resort" source for second part of crypt seed pattern */ # ifndef ZCR_SEED2 # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ # endif static int crypthead(const char* passwd, /* password string */ unsigned char* buf, /* where to write header */ int bufSize, unsigned long* pkeys, const unsigned long* pcrc_32_tab, unsigned long crcForCrypting) { int n; /* index in random header */ int t; /* temporary */ int c; /* random byte */ unsigned char header[RAND_HEAD_LEN-2]; /* random header */ static unsigned calls = 0; /* ensure different random header each time */ if (bufSize> 7) & 0xff; header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); } /* Encrypt random header (last two bytes is high word of crc) */ init_keys(passwd, pkeys, pcrc_32_tab); for (n = 0; n < RAND_HEAD_LEN-2; n++) { buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); } buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); return n; } #endif ================================================ FILE: Libraries/Core/Windows/Headers/minizip/ioapi.h ================================================ /* ioapi.h -- IO base function header for compress/uncompress .zip part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt Changes Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. More if/def section may be needed to support other platforms Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. (but you should use iowin32.c for windows instead) */ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H #if (!defined(_WIN32)) && (!defined(WIN32)) // Linux needs this to support file operation on files larger then 4+GB // But might need better if/def to select just the platforms that needs them. #ifndef __USE_FILE_OFFSET64 #define __USE_FILE_OFFSET64 #endif #ifndef __USE_LARGEFILE64 #define __USE_LARGEFILE64 #endif #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif #ifndef _FILE_OFFSET_BIT #define _FILE_OFFSET_BIT 64 #endif #endif #include #include #include "zlib.h" #if defined(USE_FILE32API) #define fopen64 fopen #define ftello64 ftell #define fseeko64 fseek #else #ifdef _MSC_VER #define fopen64 fopen #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) #define ftello64 _ftelli64 #define fseeko64 _fseeki64 #else // old MSC #define ftello64 ftell #define fseeko64 fseek #endif #endif #endif /* #ifndef ZPOS64_T #ifdef _WIN32 #define ZPOS64_T fpos_t #else #include #define ZPOS64_T uint64_t #endif #endif */ #ifdef HAVE_MINIZIP64_CONF_H #include "mz64conf.h" #endif /* a type choosen by DEFINE */ #ifdef HAVE_64BIT_INT_CUSTOM typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; #else #ifdef HAS_STDINT_H #include "stdint.h" typedef uint64_t ZPOS64_T; #else #if defined(_MSC_VER) || defined(__BORLANDC__) typedef unsigned __int64 ZPOS64_T; #else typedef unsigned long long int ZPOS64_T; #endif #endif #endif #ifdef __cplusplus extern "C" { #endif #define ZLIB_FILEFUNC_SEEK_CUR (1) #define ZLIB_FILEFUNC_SEEK_END (2) #define ZLIB_FILEFUNC_SEEK_SET (0) #define ZLIB_FILEFUNC_MODE_READ (1) #define ZLIB_FILEFUNC_MODE_WRITE (2) #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) #define ZLIB_FILEFUNC_MODE_EXISTING (4) #define ZLIB_FILEFUNC_MODE_CREATE (8) #ifndef ZCALLBACK #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) #define ZCALLBACK CALLBACK #else #define ZCALLBACK #endif #endif typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); /* here is the "old" 32 bits structure structure */ typedef struct zlib_filefunc_def_s { open_file_func zopen_file; read_file_func zread_file; write_file_func zwrite_file; tell_file_func ztell_file; seek_file_func zseek_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; } zlib_filefunc_def; typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); typedef struct zlib_filefunc64_def_s { open64_file_func zopen64_file; read_file_func zread_file; write_file_func zwrite_file; tell64_file_func ztell64_file; seek64_file_func zseek64_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; } zlib_filefunc64_def; void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); /* now internal definition, only for zip.c and unzip.h */ typedef struct zlib_filefunc64_32_def_s { zlib_filefunc64_def zfile_func64; open_file_func zopen32_file; tell_file_func ztell32_file; seek_file_func zseek32_file; } zlib_filefunc64_32_def; #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) //#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) //#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/Windows/Headers/minizip/mztools.h ================================================ /* Additional tools for Minizip Code: Xavier Roche '2004 License: Same as ZLIB (www.gzip.org) */ #ifndef _zip_tools_H #define _zip_tools_H #ifdef __cplusplus extern "C" { #endif #ifndef _ZLIB_H #include "zlib.h" #endif #include "unzip.h" /* Repair a ZIP file (missing central directory) file: file to recover fileOut: output file after recovery fileOutTmp: temporary file name used for recovery */ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char* fileOutTmp, uLong* nRecovered, uLong* bytesRecovered); #endif ================================================ FILE: Libraries/Core/Windows/Headers/minizip/unzip.h ================================================ /* unzip.h -- IO for uncompress .zip files using zlib Version 1.1, February 14h, 2010 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications of Unzip for Zip64 Copyright (C) 2007-2008 Even Rouault Modifications for Zip64 support on both zip and unzip Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt --------------------------------------------------------------------------------- Condition of use and distribution are the same than zlib : This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- Changes See header of unzip64.c */ #ifndef _unz64_H #define _unz64_H #ifdef __cplusplus extern "C" { #endif #ifndef _ZLIB_H #include "zlib.h" #endif #ifndef _ZLIBIOAPI_H #include "ioapi.h" #endif #ifdef HAVE_BZIP2 #include "bzlib.h" #endif #define Z_BZIP2ED 12 #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ typedef struct TagunzFile__ { int unused; } unzFile__; typedef unzFile__ *unzFile; #else typedef voidp unzFile; #endif #define UNZ_OK (0) #define UNZ_END_OF_LIST_OF_FILE (-100) #define UNZ_ERRNO (Z_ERRNO) #define UNZ_EOF (0) #define UNZ_PARAMERROR (-102) #define UNZ_BADZIPFILE (-103) #define UNZ_INTERNALERROR (-104) #define UNZ_CRCERROR (-105) /* tm_unz contain date/time info */ typedef struct tm_unz_s { uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mon; /* months since January - [0,11] */ uInt tm_year; /* years - [1980..2044] */ } tm_unz; /* unz_global_info structure contain global data about the ZIPfile These data comes from the end of central dir */ typedef struct unz_global_info64_s { ZPOS64_T number_entry; /* total number of entries in the central dir on this disk */ uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info64; typedef struct unz_global_info_s { uLong number_entry; /* total number of entries in the central dir on this disk */ uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info; /* unz_file_info contain information about a file in the zipfile */ typedef struct unz_file_info64_s { uLong version; /* version made by 2 bytes */ uLong version_needed; /* version needed to extract 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */ uLong compression_method; /* compression method 2 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong crc; /* crc-32 4 bytes */ ZPOS64_T compressed_size; /* compressed size 8 bytes */ ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ uLong size_filename; /* filename length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */ uLong disk_num_start; /* disk number start 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info64; typedef struct unz_file_info_s { uLong version; /* version made by 2 bytes */ uLong version_needed; /* version needed to extract 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */ uLong compression_method; /* compression method 2 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong crc; /* crc-32 4 bytes */ uLong compressed_size; /* compressed size 4 bytes */ uLong uncompressed_size; /* uncompressed size 4 bytes */ uLong size_filename; /* filename length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */ uLong disk_num_start; /* disk number start 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info; extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, const char* fileName2, int iCaseSensitivity)); /* Compare two filename (fileName1,fileName2). If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi or strcasecmp) If iCaseSenisivity = 0, case sensitivity is defaut of your operating system (like 1 on Unix, 2 on Windows) */ extern unzFile ZEXPORT unzOpen OF((const char *path)); extern unzFile ZEXPORT unzOpen64 OF((const void *path)); /* Open a Zip file. path contain the full pathname (by example, on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip". If the zipfile cannot be opened (file don't exist or in not valid), the return value is NULL. Else, the return value is a unzFile Handle, usable with other function of this unzip package. the "64" function take a const void* pointer, because the path is just the value passed to the open64_file_func callback. Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* does not describe the reality */ extern unzFile ZEXPORT unzOpen2 OF((const char *path, zlib_filefunc_def* pzlib_filefunc_def)); /* Open a Zip file, like unzOpen, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, zlib_filefunc64_def* pzlib_filefunc_def)); /* Open a Zip file, like unz64Open, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ extern int ZEXPORT unzClose OF((unzFile file)); /* Close a ZipFile opened with unzipOpen. If there is files inside the .Zip opened with unzOpenCurrentFile (see later), these files MUST be closed with unzipCloseCurrentFile before call unzipClose. return UNZ_OK if there is no problem. */ extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, unz_global_info *pglobal_info)); extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, unz_global_info64 *pglobal_info)); /* Write info about the ZipFile in the *pglobal_info structure. No preparation of the structure is needed return UNZ_OK if there is no problem. */ extern int ZEXPORT unzGetGlobalComment OF((unzFile file, char *szComment, uLong uSizeBuf)); /* Get the global comment string of the ZipFile, in the szComment buffer. uSizeBuf is the size of the szComment buffer. return the number of byte copied or an error code <0 */ /***************************************************************************/ /* Unzip package allow you browse the directory of the zipfile */ extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); /* Set the current file of the zipfile to the first file. return UNZ_OK if there is no problem */ extern int ZEXPORT unzGoToNextFile OF((unzFile file)); /* Set the current file of the zipfile to the next file. return UNZ_OK if there is no problem return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. */ extern int ZEXPORT unzLocateFile OF((unzFile file, const char *szFileName, int iCaseSensitivity)); /* Try locate the file szFileName in the zipfile. For the iCaseSensitivity signification, see unzStringFileNameCompare return value : UNZ_OK if the file is found. It becomes the current file. UNZ_END_OF_LIST_OF_FILE if the file is not found */ /* ****************************************** */ /* Ryan supplied functions */ /* unz_file_info contain information about a file in the zipfile */ typedef struct unz_file_pos_s { uLong pos_in_zip_directory; /* offset in zip file directory */ uLong num_of_file; /* # of file */ } unz_file_pos; extern int ZEXPORT unzGetFilePos( unzFile file, unz_file_pos* file_pos); extern int ZEXPORT unzGoToFilePos( unzFile file, unz_file_pos* file_pos); typedef struct unz64_file_pos_s { ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ ZPOS64_T num_of_file; /* # of file */ } unz64_file_pos; extern int ZEXPORT unzGetFilePos64( unzFile file, unz64_file_pos* file_pos); extern int ZEXPORT unzGoToFilePos64( unzFile file, const unz64_file_pos* file_pos); /* ****************************************** */ extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, unz_file_info64 *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)); extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, unz_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)); /* Get Info about the current file if pfile_info!=NULL, the *pfile_info structure will contain somes info about the current file if szFileName!=NULL, the filemane string will be copied in szFileName (fileNameBufferSize is the size of the buffer) if extraField!=NULL, the extra field information will be copied in extraField (extraFieldBufferSize is the size of the buffer). This is the Central-header version of the extra field if szComment!=NULL, the comment string of the file will be copied in szComment (commentBufferSize is the size of the buffer) */ /** Addition for GDAL : START */ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); /** Addition for GDAL : END */ /***************************************************************************/ /* for reading the content of the current zipfile, you can open it, read data from it, and close it (you can close it before reading all the file) */ extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); /* Open for reading data the current file in the zipfile. If there is no error, the return value is UNZ_OK. */ extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, const char* password)); /* Open for reading data the current file in the zipfile. password is a crypting password If there is no error, the return value is UNZ_OK. */ extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, int* method, int* level, int raw)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 *method will receive method of compression, *level will receive level of compression note : you can set level parameter as NULL (if you did not want known level, but you CANNOT set method parameter as NULL */ extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, int* method, int* level, int raw, const char* password)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 *method will receive method of compression, *level will receive level of compression note : you can set level parameter as NULL (if you did not want known level, but you CANNOT set method parameter as NULL */ extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); /* Close the file in zip opened with unzOpenCurrentFile Return UNZ_CRCERROR if all the file was read but the CRC is not good */ extern int ZEXPORT unzReadCurrentFile OF((unzFile file, voidp buf, unsigned len)); /* Read bytes from the current file (opened by unzOpenCurrentFile) buf contain buffer where data must be copied len the size of buf. return the number of byte copied if somes bytes are copied return 0 if the end of file was reached return <0 with error code if there is an error (UNZ_ERRNO for IO error, or zLib error for uncompress error) */ extern z_off_t ZEXPORT unztell OF((unzFile file)); extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); /* Give the current position in uncompressed data */ extern int ZEXPORT unzeof OF((unzFile file)); /* return 1 if the end of file was reached, 0 elsewhere */ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, voidp buf, unsigned len)); /* Read extra field from the current file (opened by unzOpenCurrentFile) This is the local-header version of the extra field (sometimes, there is more info in the local-header version than in the central-header) if buf==NULL, it return the size of the local extra field if buf!=NULL, len is the size of the buffer, the extra header is copied in buf. the return value is the number of bytes copied in buf, or (if <0) the error code */ /***************************************************************************/ /* Get the current file offset */ extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); extern uLong ZEXPORT unzGetOffset (unzFile file); /* Set the current file offset */ extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); #ifdef __cplusplus } #endif #endif /* _unz64_H */ ================================================ FILE: Libraries/Core/Windows/Headers/minizip/zip.h ================================================ /* zip.h -- IO on .zip files using zlib Version 1.1, February 14h, 2010 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt --------------------------------------------------------------------------- Condition of use and distribution are the same than zlib : This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------- Changes See header of zip.h */ #ifndef _zip12_H #define _zip12_H #ifdef __cplusplus extern "C" { #endif //#define HAVE_BZIP2 #ifndef _ZLIB_H #include "zlib.h" #endif #ifndef _ZLIBIOAPI_H #include "ioapi.h" #endif #ifdef HAVE_BZIP2 #include "bzlib.h" #endif #define Z_BZIP2ED 12 #if defined(STRICTZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ typedef struct TagzipFile__ { int unused; } zipFile__; typedef zipFile__ *zipFile; #else typedef voidp zipFile; #endif #define ZIP_OK (0) #define ZIP_EOF (0) #define ZIP_ERRNO (Z_ERRNO) #define ZIP_PARAMERROR (-102) #define ZIP_BADZIPFILE (-103) #define ZIP_INTERNALERROR (-104) #ifndef DEF_MEM_LEVEL # if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 # else # define DEF_MEM_LEVEL MAX_MEM_LEVEL # endif #endif /* default memLevel */ /* tm_zip contain date/time info */ typedef struct tm_zip_s { uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mon; /* months since January - [0,11] */ uInt tm_year; /* years - [1980..2044] */ } tm_zip; typedef struct { tm_zip tmz_date; /* date in understandable format */ uLong dosDate; /* if dos_date == 0, tmu_date is used */ /* uLong flag; */ /* general purpose bit flag 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ } zip_fileinfo; typedef const char* zipcharpc; #define APPEND_STATUS_CREATE (0) #define APPEND_STATUS_CREATEAFTER (1) #define APPEND_STATUS_ADDINZIP (2) extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); /* Create a zipfile. pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip". if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip will be created at the end of the file. (useful if the file contain a self extractor code) if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will add files in existing zip (be sure you don't add file that doesn't exist) If the zipfile cannot be opened, the return value is NULL. Else, the return value is a zipFile Handle, usable with other function of this zip package. */ /* Note : there is no delete function into a zipfile. If you want delete file into a zipfile, you must open a zipfile, and create another Of couse, you can use RAW reading and writing to copy the file you did not want delte */ extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc_def)); extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def)); extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level)); extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int zip64)); /* Open a file in the ZIP for writing. filename : the filename in zip (if NULL, '-' without quote will be used *zipfi contain supplemental information if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local contains the extrafield data the the local header if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global contains the extrafield data the the local header if comment != NULL, comment contain the comment string method contain the compression method (0 for store, Z_DEFLATED for deflate) level contain the level of compression (can be Z_DEFAULT_COMPRESSION) zip64 is set to 1 if a zip64 extended information block should be added to the local file header. this MUST be '1' if the uncompressed size is >= 0xffffffff. */ extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw)); extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int zip64)); /* Same than zipOpenNewFileInZip, except if raw=1, we write raw file */ extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting)); extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, int zip64 )); /* Same than zipOpenNewFileInZip2, except windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 password : crypting password (NULL for no crypting) crcForCrypting : crc of file to compress (needed for crypting) */ extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase )); extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64 )); /* Same than zipOpenNewFileInZip4, except versionMadeBy : value for Version made by field flag : value for flag field (compression level info will be added) */ extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, const void* buf, unsigned len)); /* Write data in the zipfile */ extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); /* Close the current file in the zipfile */ extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, uLong uncompressed_size, uLong crc32)); extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, ZPOS64_T uncompressed_size, uLong crc32)); /* Close the current file in the zipfile, for file opened with parameter raw=1 in zipOpenNewFileInZip2 uncompressed_size and crc32 are value for the uncompressed size */ extern int ZEXPORT zipClose OF((zipFile file, const char* global_comment)); /* Close the zipfile */ extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); /* zipRemoveExtraInfoBlock - Added by Mathias Svensson Remove extra information block from a extra information data for the local file header or central directory header It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode. 0x0001 is the signature header for the ZIP64 extra information blocks usage. Remove ZIP64 Extra information from a central director extra field data zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001); Remove ZIP64 Extra information from a Local File Header extra field data zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001); */ #ifdef __cplusplus } #endif #endif /* _zip64_H */ ================================================ FILE: Libraries/Core/Windows/Headers/png/png.h ================================================ /* png.h - header file for PNG reference library * * libpng version 1.6.10 - March 6, 2014 * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license (See LICENSE, below) * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.97, January 1998, through 1.6.10 - March 6, 2014: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: * * Due to various miscommunications, unforeseen code incompatibilities * and occasional factors outside the authors' control, version numbering * on the library has not always been consistent and straightforward. * The following table summarizes matters since version 0.89c, which was * the first widely used release: * * source png.h png.h shared-lib * version string int version * ------- ------ ----- ---------- * 0.89c "1.0 beta 3" 0.89 89 1.0.89 * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] * 0.97c 0.97 97 2.0.97 * 0.98 0.98 98 2.0.98 * 0.99 0.99 98 2.0.99 * 0.99a-m 0.99 99 2.0.99 * 1.00 1.00 100 2.1.0 [100 should be 10000] * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] * 1.0.1 png.h string is 10001 2.1.0 * 1.0.1a-e identical to the 10002 from here on, the shared library * 1.0.2 source version) 10002 is 2.V where V is the source code * 1.0.2a-b 10003 version, except as noted. * 1.0.3 10003 * 1.0.3a-d 10004 * 1.0.4 10004 * 1.0.4a-f 10005 * 1.0.5 (+ 2 patches) 10005 * 1.0.5a-d 10006 * 1.0.5e-r 10100 (not source compatible) * 1.0.5s-v 10006 (not binary compatible) * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) * 1.0.6d-f 10007 (still binary incompatible) * 1.0.6g 10007 * 1.0.6h 10007 10.6h (testing xy.z so-numbering) * 1.0.6i 10007 10.6i * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) * 1.0.7 1 10007 (still compatible) * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 * 1.0.8rc1 1 10008 2.1.0.8rc1 * 1.0.8 1 10008 2.1.0.8 * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 * 1.0.9rc1 1 10009 2.1.0.9rc1 * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 * 1.0.9rc2 1 10009 2.1.0.9rc2 * 1.0.9 1 10009 2.1.0.9 * 1.0.10beta1 1 10010 2.1.0.10beta1 * 1.0.10rc1 1 10010 2.1.0.10rc1 * 1.0.10 1 10010 2.1.0.10 * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 * 1.0.11rc1 1 10011 2.1.0.11rc1 * 1.0.11 1 10011 2.1.0.11 * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 * 1.0.12rc1 2 10012 2.1.0.12rc1 * 1.0.12 2 10012 2.1.0.12 * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 * 1.2.0rc1 3 10200 3.1.2.0rc1 * 1.2.0 3 10200 3.1.2.0 * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 * 1.2.1 3 10201 3.1.2.1 * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 * 1.0.13 10 10013 10.so.0.1.0.13 * 1.2.2 12 10202 12.so.0.1.2.2 * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 * 1.2.3 12 10203 12.so.0.1.2.3 * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 * 1.0.14 10 10014 10.so.0.1.0.14 * 1.2.4 13 10204 12.so.0.1.2.4 * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 * 1.0.15 10 10015 10.so.0.1.0.15 * 1.2.5 13 10205 12.so.0.1.2.5 * 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 * 1.0.16 10 10016 10.so.0.1.0.16 * 1.2.6 13 10206 12.so.0.1.2.6 * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 * 1.0.17rc1 10 10017 12.so.0.1.0.17rc1 * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 * 1.0.17 10 10017 12.so.0.1.0.17 * 1.2.7 13 10207 12.so.0.1.2.7 * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 * 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5 * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 * 1.0.18 10 10018 12.so.0.1.0.18 * 1.2.8 13 10208 12.so.0.1.2.8 * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 * 1.2.9beta4-11 13 10209 12.so.0.9[.0] * 1.2.9rc1 13 10209 12.so.0.9[.0] * 1.2.9 13 10209 12.so.0.9[.0] * 1.2.10beta1-7 13 10210 12.so.0.10[.0] * 1.2.10rc1-2 13 10210 12.so.0.10[.0] * 1.2.10 13 10210 12.so.0.10[.0] * 1.4.0beta1-5 14 10400 14.so.0.0[.0] * 1.2.11beta1-4 13 10211 12.so.0.11[.0] * 1.4.0beta7-8 14 10400 14.so.0.0[.0] * 1.2.11 13 10211 12.so.0.11[.0] * 1.2.12 13 10212 12.so.0.12[.0] * 1.4.0beta9-14 14 10400 14.so.0.0[.0] * 1.2.13 13 10213 12.so.0.13[.0] * 1.4.0beta15-36 14 10400 14.so.0.0[.0] * 1.4.0beta37-87 14 10400 14.so.14.0[.0] * 1.4.0rc01 14 10400 14.so.14.0[.0] * 1.4.0beta88-109 14 10400 14.so.14.0[.0] * 1.4.0rc02-08 14 10400 14.so.14.0[.0] * 1.4.0 14 10400 14.so.14.0[.0] * 1.4.1beta01-03 14 10401 14.so.14.1[.0] * 1.4.1rc01 14 10401 14.so.14.1[.0] * 1.4.1beta04-12 14 10401 14.so.14.1[.0] * 1.4.1 14 10401 14.so.14.1[.0] * 1.4.2 14 10402 14.so.14.2[.0] * 1.4.3 14 10403 14.so.14.3[.0] * 1.4.4 14 10404 14.so.14.4[.0] * 1.5.0beta01-58 15 10500 15.so.15.0[.0] * 1.5.0rc01-07 15 10500 15.so.15.0[.0] * 1.5.0 15 10500 15.so.15.0[.0] * 1.5.1beta01-11 15 10501 15.so.15.1[.0] * 1.5.1rc01-02 15 10501 15.so.15.1[.0] * 1.5.1 15 10501 15.so.15.1[.0] * 1.5.2beta01-03 15 10502 15.so.15.2[.0] * 1.5.2rc01-03 15 10502 15.so.15.2[.0] * 1.5.2 15 10502 15.so.15.2[.0] * 1.5.3beta01-10 15 10503 15.so.15.3[.0] * 1.5.3rc01-02 15 10503 15.so.15.3[.0] * 1.5.3beta11 15 10503 15.so.15.3[.0] * 1.5.3 [omitted] * 1.5.4beta01-08 15 10504 15.so.15.4[.0] * 1.5.4rc01 15 10504 15.so.15.4[.0] * 1.5.4 15 10504 15.so.15.4[.0] * 1.5.5beta01-08 15 10505 15.so.15.5[.0] * 1.5.5rc01 15 10505 15.so.15.5[.0] * 1.5.5 15 10505 15.so.15.5[.0] * 1.5.6beta01-07 15 10506 15.so.15.6[.0] * 1.5.6rc01-03 15 10506 15.so.15.6[.0] * 1.5.6 15 10506 15.so.15.6[.0] * 1.5.7beta01-05 15 10507 15.so.15.7[.0] * 1.5.7rc01-03 15 10507 15.so.15.7[.0] * 1.5.7 15 10507 15.so.15.7[.0] * 1.6.0beta01-40 16 10600 16.so.16.0[.0] * 1.6.0rc01-08 16 10600 16.so.16.0[.0] * 1.6.0 16 10600 16.so.16.0[.0] * 1.6.1beta01-09 16 10601 16.so.16.1[.0] * 1.6.1rc01 16 10601 16.so.16.1[.0] * 1.6.1 16 10601 16.so.16.1[.0] * 1.6.2beta01 16 10602 16.so.16.2[.0] * 1.6.2rc01-06 16 10602 16.so.16.2[.0] * 1.6.2 16 10602 16.so.16.2[.0] * 1.6.3beta01-11 16 10603 16.so.16.3[.0] * 1.6.3rc01 16 10603 16.so.16.3[.0] * 1.6.3 16 10603 16.so.16.3[.0] * 1.6.4beta01-02 16 10604 16.so.16.4[.0] * 1.6.4rc01 16 10604 16.so.16.4[.0] * 1.6.4 16 10604 16.so.16.4[.0] * 1.6.5 16 10605 16.so.16.5[.0] * 1.6.6 16 10606 16.so.16.6[.0] * 1.6.7beta01-04 16 10607 16.so.16.7[.0] * 1.6.7rc01-03 16 10607 16.so.16.7[.0] * 1.6.7 16 10607 16.so.16.7[.0] * 1.6.8beta01-02 16 10608 16.so.16.8[.0] * 1.6.8rc01-02 16 10608 16.so.16.8[.0] * 1.6.8 16 10608 16.so.16.8[.0] * 1.6.9beta01-04 16 10609 16.so.16.9[.0] * 1.6.9rc01-02 16 10609 16.so.16.9[.0] * 1.6.9 16 10609 16.so.16.9[.0] * 1.6.10beta01-03 16 10610 16.so.16.10[.0] * 1.6.10betarc01-04 16 10610 16.so.16.10[.0] * 1.6.10beta 16 10610 16.so.16.10[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The * PNG_LIBPNG_VER macro, which is not used within libpng but is available * for applications, is an unsigned integer of the form xyyzz corresponding * to the source version x.y.z (leading zeros in y and z). Beta versions * were given the previous public release number plus a letter, until * version 1.0.6j; from then on they were given the upcoming public * release number plus "betaNN" or "rcNN". * * Binary incompatibility exists only when applications make direct access * to the info_ptr or png_ptr members through png.h, and the compiled * application is loaded with a different version of the library. * * DLLNUM will change each time there are forward or backward changes * in binary compatibility (e.g., when a new feature is added). * * See libpng-manual.txt or libpng.3 for more information. The PNG * specification is available as a W3C Recommendation and as an ISO * Specification, defines should NOT be changed. */ #define PNG_INFO_gAMA 0x0001 #define PNG_INFO_sBIT 0x0002 #define PNG_INFO_cHRM 0x0004 #define PNG_INFO_PLTE 0x0008 #define PNG_INFO_tRNS 0x0010 #define PNG_INFO_bKGD 0x0020 #define PNG_INFO_hIST 0x0040 #define PNG_INFO_pHYs 0x0080 #define PNG_INFO_oFFs 0x0100 #define PNG_INFO_tIME 0x0200 #define PNG_INFO_pCAL 0x0400 #define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ #define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ #define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using * the routines for other purposes. */ typedef struct png_row_info_struct { png_uint_32 width; /* width of row */ png_size_t rowbytes; /* number of bytes in row */ png_byte color_type; /* color type of row */ png_byte bit_depth; /* bit depth of row */ png_byte channels; /* number of channels (1, 2, 3, or 4) */ png_byte pixel_depth; /* bits per pixel (depth * channels) */ } png_row_info; typedef png_row_info * png_row_infop; typedef png_row_info * * png_row_infopp; /* These are the function types for the I/O functions and for the functions * that allow the user to override the default I/O functions with his or her * own. The png_error_ptr type should match that of user-supplied warning * and error functions, while the png_rw_ptr type should match that of the * user read/write data functions. Note that the 'write' function must not * modify the buffer it is passed. The 'read' function, on the other hand, is * expected to return the read data in the buffer. */ typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp)); typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t)); typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp)); typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32, int)); typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32, int)); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); /* The following callback receives png_uint_32 row_number, int pass for the * png_bytep data of the row. When transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ typedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep, png_uint_32, int)); #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) typedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop, png_bytep)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp, png_unknown_chunkp)); #endif #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED /* not used anywhere */ /* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */ #endif #ifdef PNG_SETJMP_SUPPORTED /* This must match the function definition in , and the application * must include this before png.h to obtain the definition of jmp_buf. The * function is required to be PNG_NORETURN, but this is not checked. If the * function does return the application will crash via an abort() or similar * system level call. * * If you get a warning here while building the library you may need to make * changes to ensure that pnglibconf.h records the calling convention used by * your compiler. This may be very difficult - try using a different compiler * to build the library! */ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef); #endif /* Transform masks for the high-level interface */ #define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ #define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ #define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ #define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ #define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ #define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ #define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ #define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ #define PNG_TRANSFORM_BGR 0x0080 /* read and write */ #define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ #define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ #define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only */ /* Added to libpng-1.2.34 */ #define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER #define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ /* Added to libpng-1.4.0 */ #define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ /* Added to libpng-1.5.4 */ #define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ #define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ /* Flags for MNG supported features */ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 #define PNG_FLAG_MNG_FILTER_64 0x04 #define PNG_ALL_MNG_FEATURES 0x05 /* NOTE: prior to 1.5 these functions had no 'API' style declaration, * this allowed the zlib default functions to be used on Windows * platforms. In 1.5 the zlib default malloc (which just calls malloc and * ignores the first argument) should be completely compatible with the * following. */ typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp, png_alloc_size_t)); typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp)); /* Section 3: exported functions * Here are the function definitions most commonly used. This is not * the place to find out how to use libpng. See libpng-manual.txt for the * full explanation, see example.c for the summary. This just provides * a simple one line description of the use of each function. * * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in * pngconf.h and in the *.dfn files in the scripts directory. * * PNG_EXPORT(ordinal, type, name, (args)); * * ordinal: ordinal that is used while building * *.def files. The ordinal value is only * relevant when preprocessing png.h with * the *.dfn files for building symbol table * entries, and are removed by pngconf.h. * type: return type of the function * name: function name * args: function arguments, with types * * When we wish to append attributes to a function prototype we use * the PNG_EXPORTA() macro instead. * * PNG_EXPORTA(ordinal, type, name, (args), attributes); * * ordinal, type, name, and args: same as in PNG_EXPORT(). * attributes: function attributes */ /* Returns the version number of the library */ PNG_EXPORT(1, png_uint_32, png_access_version_number, (void)); /* Tell lib we have already handled the first magic bytes. * Handling more than 8 bytes from the beginning of the file is an error. */ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes)); /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a * PNG file. Returns zero if the supplied bytes match the 8-byte PNG * signature, and non-zero otherwise. Having num_to_check == 0 or * start > 7 will always fail (ie return non-zero). */ PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start, png_size_t num_to_check)); /* Simple signature checking function. This is the same as calling * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). */ #define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n)) /* Allocate and initialize png_ptr struct for reading, and any other memory. */ PNG_EXPORTA(4, png_structp, png_create_read_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); /* Allocate and initialize png_ptr struct for writing, and any other memory */ PNG_EXPORTA(5, png_structp, png_create_write_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size, (png_const_structrp png_ptr)); PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr, png_size_t size)); /* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp * match up. */ #ifdef PNG_SETJMP_SUPPORTED /* This function returns the jmp_buf built in to *png_ptr. It must be * supplied with an appropriate 'longjmp' function to use on that jmp_buf * unless the default error function is overridden in which case NULL is * acceptable. The size of the jmp_buf is checked against the actual size * allocated by the library - the call will return NULL on a mismatch * indicating an ABI mismatch. */ PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr, png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)); # define png_jmpbuf(png_ptr) \ (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf)))) #else # define png_jmpbuf(png_ptr) \ (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) #endif /* This function should be used by libpng applications in place of * longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it * will use it; otherwise it will call PNG_ABORT(). This function was * added in libpng-1.5.0. */ PNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val), PNG_NORETURN); #ifdef PNG_READ_SUPPORTED /* Reset the compression stream */ PNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED); #endif /* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(11, png_structp, png_create_read_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); PNG_EXPORTA(12, png_structp, png_create_write_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); #endif /* Write the PNG file signature. */ PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr)); /* Write a PNG chunk - size, type, (optional) data, CRC. */ PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep chunk_name, png_const_bytep data, png_size_t length)); /* Write the start of a PNG chunk - length and chunk name. */ PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr, png_const_bytep chunk_name, png_uint_32 length)); /* Write the data of a PNG chunk started with png_write_chunk_start(). */ PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr, png_const_bytep data, png_size_t length)); /* Finish a chunk started with png_write_chunk_start() (includes CRC). */ PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr)); /* Allocate and initialize the info structure */ PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr), PNG_ALLOCATED); /* DEPRECATED: this function allowed init structures to be created using the * default allocation method (typically malloc). Use is deprecated in 1.6.0 and * the API will be removed in the future. */ PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr, png_size_t png_info_struct_size), PNG_DEPRECATED); /* Writes all the PNG information before the image. */ PNG_EXPORT(20, void, png_write_info_before_PLTE, (png_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(21, void, png_write_info, (png_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the information before the actual image data. */ PNG_EXPORT(22, void, png_read_info, (png_structrp png_ptr, png_inforp info_ptr)); #endif #ifdef PNG_TIME_RFC1123_SUPPORTED /* Convert to a US string format: there is no localization support in this * routine. The original implementation used a 29 character buffer in * png_struct, this will be removed in future versions. */ #if PNG_LIBPNG_VER < 10700 /* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */ PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr, png_const_timep ptime),PNG_DEPRECATED); #endif PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29], png_const_timep ptime)); #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Convert from a struct tm to png_time */ PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime, const struct tm * ttime)); /* Convert from time_t to png_time. Uses gmtime() */ PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime)); #endif /* PNG_CONVERT_tIME_SUPPORTED */ #ifdef PNG_READ_EXPAND_SUPPORTED /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ PNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr)); PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr)); PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr)); PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr)); #endif #ifdef PNG_READ_EXPAND_16_SUPPORTED /* Expand to 16-bit channels, forces conversion of palette to RGB and expansion * of a tRNS chunk if present. */ PNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr)); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) /* Use blue, green, red order for pixels. */ PNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr)); #endif #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED /* Expand the grayscale to 24-bit RGB if necessary. */ PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr)); #endif #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED /* Reduce RGB to grayscale. */ #define PNG_ERROR_ACTION_NONE 1 #define PNG_ERROR_ACTION_WARN 2 #define PNG_ERROR_ACTION_ERROR 3 #define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr, int error_action, double red, double green)) PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr, int error_action, png_fixed_point red, png_fixed_point green)) PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp png_ptr)); #endif #ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth, png_colorp palette)); #endif #ifdef PNG_READ_ALPHA_MODE_SUPPORTED /* How the alpha channel is interpreted - this affects how the color channels * of a PNG file are returned to the calling application when an alpha channel, * or a tRNS chunk in a palette file, is present. * * This has no effect on the way pixels are written into a PNG output * datastream. The color samples in a PNG datastream are never premultiplied * with the alpha samples. * * The default is to return data according to the PNG specification: the alpha * channel is a linear measure of the contribution of the pixel to the * corresponding composited pixel, and the color channels are unassociated * (not premultiplied). The gamma encoded color channels must be scaled * according to the contribution and to do this it is necessary to undo * the encoding, scale the color values, perform the composition and reencode * the values. This is the 'PNG' mode. * * The alternative is to 'associate' the alpha with the color information by * storing color channel values that have been scaled by the alpha. * image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes * (the latter being the two common names for associated alpha color channels). * * For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha * value is equal to the maximum value. * * The final choice is to gamma encode the alpha channel as well. This is * broken because, in practice, no implementation that uses this choice * correctly undoes the encoding before handling alpha composition. Use this * choice only if other serious errors in the software or hardware you use * mandate it; the typical serious error is for dark halos to appear around * opaque areas of the composited PNG image because of arithmetic overflow. * * The API function png_set_alpha_mode specifies which of these choices to use * with an enumerated 'mode' value and the gamma of the required output: */ #define PNG_ALPHA_PNG 0 /* according to the PNG standard */ #define PNG_ALPHA_STANDARD 1 /* according to Porter/Duff */ #define PNG_ALPHA_ASSOCIATED 1 /* as above; this is the normal practice */ #define PNG_ALPHA_PREMULTIPLIED 1 /* as above */ #define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ #define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode, double output_gamma)) PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr, int mode, png_fixed_point output_gamma)) #endif #if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) /* The output_gamma value is a screen gamma in libpng terminology: it expresses * how to decode the output values, not how they are encoded. */ #define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */ #define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */ #define PNG_GAMMA_sRGB 220000 /* Television standards--matches sRGB gamma */ #define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */ #endif /* The following are examples of calls to png_set_alpha_mode to achieve the * required overall gamma correction and, where necessary, alpha * premultiplication. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * This is the default libpng handling of the alpha channel - it is not * pre-multiplied into the color components. In addition the call states * that the output is for a sRGB system and causes all PNG files without gAMA * chunks to be assumed to be encoded using sRGB. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * In this case the output is assumed to be something like an sRGB conformant * display preceeded by a power-law lookup table of power 1.45. This is how * early Mac systems behaved. * * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); * This is the classic Jim Blinn approach and will work in academic * environments where everything is done by the book. It has the shortcoming * of assuming that input PNG data with no gamma information is linear - this * is unlikely to be correct unless the PNG files where generated locally. * Most of the time the output precision will be so low as to show * significant banding in dark areas of the image. * * png_set_expand_16(pp); * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB); * This is a somewhat more realistic Jim Blinn inspired approach. PNG files * are assumed to have the sRGB encoding if not marked with a gamma value and * the output is always 16 bits per component. This permits accurate scaling * and processing of the data. If you know that your input PNG files were * generated locally you might need to replace PNG_DEFAULT_sRGB with the * correct value for your system. * * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB); * If you just need to composite the PNG image onto an existing background * and if you control the code that does this you can use the optimization * setting. In this case you just copy completely opaque pixels to the * output. For pixels that are not completely transparent (you just skip * those) you do the composition math using png_composite or png_composite_16 * below then encode the resultant 8-bit or 16-bit values to match the output * encoding. * * Other cases * If neither the PNG nor the standard linear encoding work for you because * of the software or hardware you use then you have a big problem. The PNG * case will probably result in halos around the image. The linear encoding * will probably result in a washed out, too bright, image (it's actually too * contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably * substantially reduce the halos. Alternatively try: * * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB); * This option will also reduce the halos, but there will be slight dark * halos round the opaque parts of the image where the background is light. * In the OPTIMIZED mode the halos will be light halos where the background * is dark. Take your pick - the halos are unavoidable unless you can get * your hardware/software fixed! (The OPTIMIZED approach is slightly * faster.) * * When the default gamma of PNG files doesn't match the output gamma. * If you have PNG files with no gamma information png_set_alpha_mode allows * you to provide a default gamma, but it also sets the ouput gamma to the * matching value. If you know your PNG files have a gamma that doesn't * match the output you can take advantage of the fact that * png_set_alpha_mode always sets the output gamma but only sets the PNG * default if it is not already set: * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * The first call sets both the default and the output gamma values, the * second call overrides the output gamma without changing the default. This * is easier than achieving the same effect with png_set_gamma. You must use * PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will * fire if more than one call to png_set_alpha_mode and png_set_background is * made in the same read operation, however multiple calls with PNG_ALPHA_PNG * are ignored. */ #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED PNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) PNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) /* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler, int flags)); /* The values of the PNG_FILLER_ defines should NOT be changed */ # define PNG_FILLER_BEFORE 0 # define PNG_FILLER_AFTER 1 /* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, png_uint_32 filler, int flags)); #endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) /* Swap bytes in 16-bit depth files. */ PNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ PNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) /* Swap packing order of pixels in bytes. */ PNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) /* Converts files to legal bit depths. */ PNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p true_bits)); #endif #if defined(PNG_READ_INTERLACING_SUPPORTED) || \ defined(PNG_WRITE_INTERLACING_SUPPORTED) /* Have the code handle the interlacing. Returns the number of passes. * MUST be called before png_read_update_info or png_start_read_image, * otherwise it will not have the desired effect. Note that it is still * necessary to call png_read_row or png_read_rows png_get_image_height * times for each pass. */ PNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) /* Invert monochrome files */ PNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr)); #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED /* Handle alpha and tRNS by replacing with a background color. Prior to * libpng-1.5.4 this API must not be called before the PNG file header has been * read. Doing so will result in unexpected behavior and possible warnings or * errors if the PNG file contains a bKGD chunk. */ PNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma)) PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, png_fixed_point background_gamma)) #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED # define PNG_BACKGROUND_GAMMA_UNKNOWN 0 # define PNG_BACKGROUND_GAMMA_SCREEN 1 # define PNG_BACKGROUND_GAMMA_FILE 2 # define PNG_BACKGROUND_GAMMA_UNIQUE 3 #endif #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED /* Scale a 16-bit depth file down to 8-bit, accurately. */ PNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED #define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */ /* Strip the second byte of information from a 16-bit depth file. */ PNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED /* Turn on quantizing, and reduce the palette to the number of colors * available. */ PNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr, png_colorp palette, int num_palette, int maximum_colors, png_const_uint_16p histogram, int full_quantize)); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* The threshold on gamma processing is configurable but hard-wired into the * library. The following is the floating point variant. */ #define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001) /* Handle gamma correction. Screen_gamma=(display_exponent). * NOTE: this API simply sets the screen and file gamma values. It will * therefore override the value for gamma in a PNG file if it is called after * the file header has been read - use with care - call before reading the PNG * file for best results! * * These routines accept the same gamma values as png_set_alpha_mode (described * above). The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either * API (floating point or fixed.) Notice, however, that the 'file_gamma' value * is the inverse of a 'screen gamma' value. */ PNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr, double screen_gamma, double override_file_gamma)) PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr, png_fixed_point screen_gamma, png_fixed_point override_file_gamma)) #endif #ifdef PNG_WRITE_FLUSH_SUPPORTED /* Set how many lines between output flushes - 0 for no flushing */ PNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows)); /* Flush the current PNG output buffer */ PNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr)); #endif /* Optional update palette with requested transformations */ PNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr)); /* Optional call to update the users info structure */ PNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read one or more rows of image data. */ PNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read a row of data. */ PNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row, png_bytep display_row)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the whole image into memory at once. */ PNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image)); #endif /* Write a row of image data */ PNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr, png_const_bytep row)); /* Write a few rows of image data: (*row) is not written; however, the type * is declared as writeable to maintain compatibility with previous versions * of libpng and to allow the 'display_row' array from read_rows to be passed * unchanged to write_rows. */ PNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows)); /* Write the image data */ PNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image)); /* Write the end of the PNG file. */ PNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the end of the PNG file. */ PNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr)); #endif /* Free any memory associated with the png_info_struct */ PNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr, png_infopp info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); /* Set the libpng method of handling chunk CRC errors */ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, int ancil_action)); /* Values for png_set_crc_action() say how to handle CRC errors in * ancillary and critical chunks, and whether to use the data contained * therein. Note that it is impossible to "discard" data in a critical * chunk. For versions prior to 0.90, the action was always error/quit, * whereas in version 0.90 and later, the action for CRC errors in ancillary * chunks is warn/discard. These values should NOT be changed. * * value action:critical action:ancillary */ #define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ #define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ #define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ #define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ #define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ #define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ /* These functions give the user control over the scan-line filtering in * libpng and the compression methods used by zlib. These functions are * mainly useful for testing, as the defaults should work with most users. * Those users who are tight on memory or want faster performance at the * expense of compression can modify them. See the compression library * header file (zlib.h) for an explination of the compression functions. */ /* Set the filtering method(s) used by libpng. Currently, the only valid * value for "method" is 0. */ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, int filters)); /* Flags for png_set_filter() to say which filters to use. The flags * are chosen so that they don't conflict with real filter types * below, in case they are supplied instead of the #defined constants. * These values should NOT be changed. */ #define PNG_NO_FILTERS 0x00 #define PNG_FILTER_NONE 0x08 #define PNG_FILTER_SUB 0x10 #define PNG_FILTER_UP 0x20 #define PNG_FILTER_AVG 0x40 #define PNG_FILTER_PAETH 0x80 #define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ PNG_FILTER_AVG | PNG_FILTER_PAETH) /* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. * These defines should NOT be changed. */ #define PNG_FILTER_VALUE_NONE 0 #define PNG_FILTER_VALUE_SUB 1 #define PNG_FILTER_VALUE_UP 2 #define PNG_FILTER_VALUE_AVG 3 #define PNG_FILTER_VALUE_PAETH 4 #define PNG_FILTER_VALUE_LAST 5 #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */ /* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ * defines, either the default (minimum-sum-of-absolute-differences), or * the experimental method (weighted-minimum-sum-of-absolute-differences). * * Weights are factors >= 1.0, indicating how important it is to keep the * filter type consistent between rows. Larger numbers mean the current * filter is that many times as likely to be the same as the "num_weights" * previous filters. This is cumulative for each previous row with a weight. * There needs to be "num_weights" values in "filter_weights", or it can be * NULL if the weights aren't being specified. Weights have no influence on * the selection of the first row filter. Well chosen weights can (in theory) * improve the compression for a given image. * * Costs are factors >= 1.0 indicating the relative decoding costs of a * filter type. Higher costs indicate more decoding expense, and are * therefore less likely to be selected over a filter with lower computational * costs. There needs to be a value in "filter_costs" for each valid filter * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't * setting the costs. Costs try to improve the speed of decompression without * unduly increasing the compressed image size. * * A negative weight or cost indicates the default value is to be used, and * values in the range [0.0, 1.0) indicate the value is to remain unchanged. * The default values for both weights and costs are currently 1.0, but may * change if good general weighting/cost heuristics can be found. If both * the weights and costs are set to 1.0, this degenerates the WEIGHTED method * to the UNWEIGHTED method, but with added encoding time/computation. */ PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_doublep filter_weights, png_const_doublep filter_costs)) PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_fixed_point_p filter_weights, png_const_fixed_point_p filter_costs)) #endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ /* Heuristic used for row filter selection. These defines should NOT be * changed. */ #define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ #define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ #define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ #define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ #ifdef PNG_WRITE_SUPPORTED /* Set the library compression level. Currently, valid values range from * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 * (0 - no compression, 9 - "maximal" compression). Note that tests have * shown that zlib compression levels 3-6 usually perform as well as level 9 * for PNG images, and do considerably fewer caclulations. In the future, * these values may not correspond directly to the zlib compression levels. */ PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr, int method)); #endif #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED /* Also set zlib parameters for compressing non-IDAT chunks */ PNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr, int method)); #endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */ /* These next functions are called for input/output, memory, and error * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, * and call standard C I/O routines such as fread(), fwrite(), and * fprintf(). These functions can be made to use other I/O routines * at run time for those applications that need to handle I/O in a * different manner by calling png_set_???_fn(). See libpng-manual.txt for * more information. */ #ifdef PNG_STDIO_SUPPORTED /* Initialize the input/output for the PNG file to the default functions. */ PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp)); #endif /* Replace the (error and abort), and warning functions with user * supplied functions. If no messages are to be printed you must still * write and use replacement functions. The replacement error_fn should * still do a longjmp to the last setjmp location if you are using this * method of error handling. If error_fn or warning_fn is NULL, the * default function will be used. */ PNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); /* Return the user pointer associated with the error functions */ PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr)); /* Replace the default data output functions with a user supplied one(s). * If buffered output is not used, then output_flush_fn can be set to NULL. * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time * output_flush_fn will be ignored (and thus can be NULL). * It is probably a mistake to use NULL for output_flush_fn if * write_data_fn is not also NULL unless you have built libpng with * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's * default flush function, which uses the standard *FILE structure, will * be used. */ PNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); /* Replace the default data input function with a user supplied one. */ PNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)); /* Return the user pointer associated with the I/O functions */ PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr)); PNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr, png_read_status_ptr read_row_fn)); PNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr, png_write_status_ptr write_row_fn)); #ifdef PNG_USER_MEM_SUPPORTED /* Replace the default memory allocation functions with user supplied one(s). */ PNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); /* Return the user pointer associated with the memory functions */ PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn)); #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn)); #endif #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED PNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels)); /* Return the user pointer associated with the user transform functions */ PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED /* Return information about the row currently being processed. Note that these * APIs do not fail but will return unexpected results if called outside a user * transform callback. Also note that when transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp)); PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp)); #endif #ifdef PNG_READ_USER_CHUNKS_SUPPORTED /* This callback is called only for *unknown* chunks. If * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known * chunks to be treated as unknown, however in this case the callback must do * any processing required by the chunk (e.g. by calling the appropriate * png_set_ APIs.) * * There is no write support - on write, by default, all the chunks in the * 'unknown' list are written in the specified position. * * The integer return from the callback function is interpreted thus: * * negative: An error occured, png_chunk_error will be called. * zero: The chunk was not handled, the chunk will be saved. A critical * chunk will cause an error at this point unless it is to be saved. * positive: The chunk was handled, libpng will ignore/discard it. * * See "INTERACTION WTIH USER CHUNK CALLBACKS" below for important notes about * how this behavior will change in libpng 1.7 */ PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED /* Sets the function callbacks for the push reader, and a pointer to a * user-defined structure available to the callback functions. */ PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr, png_voidp progressive_ptr, png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn)); /* Returns the user pointer associated with the push read functions */ PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, (png_const_structrp png_ptr)); /* Function to be called when data becomes available */ PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr, png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size)); /* A function which may be called *only* within png_process_data to stop the * processing of any more data. The function returns the number of bytes * remaining, excluding any that libpng has cached internally. A subsequent * call to png_process_data must supply these bytes again. If the argument * 'save' is set to true the routine will first save all the pending data and * will always return 0. */ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save)); /* A function which may be called *only* outside (after) a call to * png_process_data. It returns the number of bytes of data to skip in the * input. Normally it will return 0, but if it returns a non-zero value the * application must skip than number of bytes of input data and pass the * following data to the next call to png_process_data. */ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp)); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Function that combines rows. 'new_row' is a flag that should come from * the callback and be non-NULL if anything needs to be done; the library * stores its own version of the new data internally and ignores the passed * in value. */ PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr, png_bytep old_row, png_const_bytep new_row)); #endif /* PNG_READ_INTERLACING_SUPPORTED */ #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.4.0 */ PNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.2.4 */ PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Frees a pointer allocated by png_malloc() */ PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr)); /* Free data that was allocated internally */ PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 free_me, int num)); /* Reassign responsibility for freeing existing data, whether allocated * by libpng or by the application; this works on the png_info structure passed * in, it does not change the state for other png_info structures. * * It is unlikely that this function works correctly as of 1.6.0 and using it * may result either in memory leaks or double free of allocated data. */ PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr, png_inforp info_ptr, int freer, png_uint_32 mask)); /* Assignments for png_data_freer */ #define PNG_DESTROY_WILL_FREE_DATA 1 #define PNG_SET_WILL_FREE_DATA 1 #define PNG_USER_WILL_FREE_DATA 2 /* Flags for png_ptr->free_me and info_ptr->free_me */ #define PNG_FREE_HIST 0x0008 #define PNG_FREE_ICCP 0x0010 #define PNG_FREE_SPLT 0x0020 #define PNG_FREE_ROWS 0x0040 #define PNG_FREE_PCAL 0x0080 #define PNG_FREE_SCAL 0x0100 #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED # define PNG_FREE_UNKN 0x0200 #endif /* PNG_FREE_LIST 0x0400 removed in 1.6.0 because it is ignored */ #define PNG_FREE_PLTE 0x1000 #define PNG_FREE_TRNS 0x2000 #define PNG_FREE_TEXT 0x4000 #define PNG_FREE_ALL 0x7fff #define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED); PNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr, png_voidp ptr), PNG_DEPRECATED); #endif #ifdef PNG_ERROR_TEXT_SUPPORTED /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); /* The same, but the chunk name is prepended to the error string. */ PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); #else /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN); # define png_error(s1,s2) png_err(s1) # define png_chunk_error(s1,s2) png_err(s1) #endif #ifdef PNG_WARNINGS_SUPPORTED /* Non-fatal error in libpng. Can continue, but may have a problem. */ PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); /* Non-fatal error in libpng, chunk name is prepended to message. */ PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); #else # define png_warning(s1,s2) ((void)(s1)) # define png_chunk_warning(s1,s2) ((void)(s1)) #endif #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Benign error in libpng. Can continue, but may have a problem. * User can choose whether to handle as a fatal error or as a warning. */ PNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #ifdef PNG_READ_SUPPORTED /* Same, chunk name is prepended to message (only during read) */ PNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #endif PNG_EXPORT(109, void, png_set_benign_errors, (png_structrp png_ptr, int allowed)); #else # ifdef PNG_ALLOW_BENIGN_ERRORS # define png_benign_error png_warning # define png_chunk_benign_error png_chunk_warning # else # define png_benign_error png_error # define png_chunk_benign_error png_chunk_error # endif #endif /* The png_set_ functions are for storing values in the png_info_struct. * Similarly, the png_get_ calls are used to read values from the * png_info_struct, either storing the parameters in the passed variables, or * setting pointers into the png_info_struct where the data is stored. The * png_get_ functions return a non-zero value if the data was available * in info_ptr, or return zero and do not change any of the parameters if the * data was not available. * * These functions should be used instead of directly accessing png_info * to avoid problems with future changes in the size and internal layout of * png_info_struct. */ /* Returns "flag" if chunk data is valid in info_ptr. */ PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 flag)); /* Returns number of bytes needed to hold a transformed row. */ PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* Returns row_pointers, which is an array of pointers to scanlines that was * returned from png_read_png(). */ PNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Set row_pointers, which is an array of pointers to scanlines for use * by png_write_png(). */ PNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytepp row_pointers)); #endif /* Returns number of color channels in image. */ PNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_EASY_ACCESS_SUPPORTED /* Returns image width in pixels. */ PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image height in pixels. */ PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image bit_depth. */ PNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image color_type. */ PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image filter_type. */ PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image interlace_type. */ PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image compression_type. */ PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image resolution in pixels per meter, from pHYs chunk data. */ PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns pixel aspect ratio, computed from pHYs chunk data. */ PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio, (png_const_structrp png_ptr, png_const_inforp info_ptr)) PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(128, png_int_32, png_get_x_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(129, png_int_32, png_get_y_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif /* PNG_EASY_ACCESS_SUPPORTED */ #ifdef PNG_READ_SUPPORTED /* Returns pointer to signature string read from PNG header */ PNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_16p *background)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_16p background)); #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y)) PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z, double *green_X, double *green_Y, double *green_Z, double *blue_X, double *blue_Y, double *blue_Z)) PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_white_x, png_fixed_point *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)) PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_red_X, png_fixed_point *int_red_Y, png_fixed_point *int_red_Z, png_fixed_point *int_green_X, png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, png_fixed_point *int_blue_Z)) #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y)) PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr, png_inforp info_ptr, double red_X, double red_Y, double red_Z, double green_X, double green_Y, double green_Z, double blue_X, double blue_Y, double blue_Z)) PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, png_fixed_point int_blue_y)) PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y, png_fixed_point int_red_Z, png_fixed_point int_green_X, png_fixed_point int_green_Y, png_fixed_point int_green_Z, png_fixed_point int_blue_X, png_fixed_point int_blue_Y, png_fixed_point int_blue_Z)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *file_gamma)) PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_file_gamma)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr, png_inforp info_ptr, double file_gamma)) PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_file_gamma)) #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_16p *hist)); #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist)); #endif PNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method)); PNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_method, int compression_method, int filter_method)); #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)); #endif #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr, png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); #endif PNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr, png_inforp info_ptr, png_colorp *palette, int *num_palette)); PNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette)); #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_8p *sig_bit)); #endif #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_8p sig_bit)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *file_srgb_intent)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_charpp name, int *compression_type, png_bytepp profile, png_uint_32 *proflen)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp name, int compression_type, png_const_bytep profile, png_uint_32 proflen)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_sPLT_tpp entries)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_sPLT_tp entries, int nentries)); #endif #ifdef PNG_TEXT_SUPPORTED /* png_get_text also returns the number of text chunks in *num_text */ PNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_textp *text_ptr, int *num_text)); #endif /* Note while png_set_text() will accept a structure whose text, * language, and translated keywords are NULL pointers, the structure * returned by png_get_text will always contain regular * zero-terminated C strings. They might be empty strings but * they will never be NULL pointers. */ #ifdef PNG_TEXT_SUPPORTED PNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_timep *mod_time)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_timep mod_time)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr, png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans, png_const_color_16p trans_color)); #endif #ifdef PNG_sCAL_SUPPORTED PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, double *width, double *height)) #if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \ defined(PNG_FLOATING_POINT_SUPPORTED) /* NOTE: this API is currently implemented using floating point arithmetic, * consequently it can only be used on systems with floating point support. * In any case the range of values supported by png_fixed_point is small and it * is highly recommended that png_get_sCAL_s be used instead. */ PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_fixed_point *width, png_fixed_point *height)) #endif PNG_EXPORT(169, png_uint_32, png_get_sCAL_s, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); PNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, double width, double height)) PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_fixed_point width, png_fixed_point height)) PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_const_charp swidth, png_const_charp sheight)); #endif /* PNG_sCAL_SUPPORTED */ #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED /* Provide the default handling for all unknown chunks or, optionally, for * specific unknown chunks. * * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was * ignored and the default was used, the per-chunk setting only had an effect on * write. If you wish to have chunk-specific handling on read in code that must * work on earlier versions you must use a user chunk callback to specify the * desired handling (keep or discard.) * * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below. The * parameter is interpreted as follows: * * READ: * PNG_HANDLE_CHUNK_AS_DEFAULT: * Known chunks: do normal libpng processing, do not keep the chunk (but * see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED) * Unknown chunks: for a specific chunk use the global default, when used * as the default discard the chunk data. * PNG_HANDLE_CHUNK_NEVER: * Discard the chunk data. * PNG_HANDLE_CHUNK_IF_SAFE: * Keep the chunk data if the chunk is not critical else raise a chunk * error. * PNG_HANDLE_CHUNK_ALWAYS: * Keep the chunk data. * * If the chunk data is saved it can be retrieved using png_get_unknown_chunks, * below. Notice that specifying "AS_DEFAULT" as a global default is equivalent * to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks * it simply resets the behavior to the libpng default. * * INTERACTION WTIH USER CHUNK CALLBACKS: * The per-chunk handling is always used when there is a png_user_chunk_ptr * callback and the callback returns 0; the chunk is then always stored *unless* * it is critical and the per-chunk setting is other than ALWAYS. Notice that * the global default is *not* used in this case. (In effect the per-chunk * value is incremented to at least IF_SAFE.) * * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and * per-chunk defaults will be honored. If you want to preserve the current * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE * as the default - if you don't do this libpng 1.6 will issue a warning. * * If you want unhandled unknown chunks to be discarded in libpng 1.6 and * earlier simply return '1' (handled). * * PNG_HANDLE_AS_UNKNOWN_SUPPORTED: * If this is *not* set known chunks will always be handled by libpng and * will never be stored in the unknown chunk list. Known chunks listed to * png_set_keep_unknown_chunks will have no effect. If it is set then known * chunks listed with a keep other than AS_DEFAULT will *never* be processed * by libpng, in addition critical chunks must either be processed by the * callback or saved. * * The IHDR and IEND chunks must not be listed. Because this turns off the * default handling for chunks that would otherwise be recognized the * behavior of libpng transformations may well become incorrect! * * WRITE: * When writing chunks the options only apply to the chunks specified by * png_set_unknown_chunks (below), libpng will *always* write known chunks * required by png_set_ calls and will always write the core critical chunks * (as required for PLTE). * * Each chunk in the png_set_unknown_chunks list is looked up in the * png_set_keep_unknown_chunks list to find the keep setting, this is then * interpreted as follows: * * PNG_HANDLE_CHUNK_AS_DEFAULT: * Write safe-to-copy chunks and write other chunks if the global * default is set to _ALWAYS, otherwise don't write this chunk. * PNG_HANDLE_CHUNK_NEVER: * Do not write the chunk. * PNG_HANDLE_CHUNK_IF_SAFE: * Write the chunk if it is safe-to-copy, otherwise do not write it. * PNG_HANDLE_CHUNK_ALWAYS: * Write the chunk. * * Note that the default behavior is effectively the opposite of the read case - * in read unknown chunks are not stored by default, in write they are written * by default. Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different * - on write the safe-to-copy bit is checked, on read the critical bit is * checked and on read if the chunk is critical an error will be raised. * * num_chunks: * =========== * If num_chunks is positive, then the "keep" parameter specifies the manner * for handling only those chunks appearing in the chunk_list array, * otherwise the chunk list array is ignored. * * If num_chunks is 0 the "keep" parameter specifies the default behavior for * unknown chunks, as described above. * * If num_chunks is negative, then the "keep" parameter specifies the manner * for handling all unknown chunks plus all chunks recognized by libpng * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to * be processed by libpng. */ PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks)); /* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; * the result is therefore true (non-zero) if special handling is required, * false for the default handling. */ PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr, png_const_bytep chunk_name)); #endif #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)); /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added * unknowns to the location currently stored in the png_struct. This is * invariably the wrong value on write. To fix this call the following API * for each chunk in the list with the correct location. If you know your * code won't be compiled on earlier versions you can rely on * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing * the correct thing. */ PNG_EXPORT(175, void, png_set_unknown_chunk_location, (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location)); PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_unknown_chunkpp entries)); #endif /* Png_free_data() will turn off the "valid" flag for anything it frees. * If you need to turn it off for a chunk that your application has freed, * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr, png_inforp info_ptr, int mask)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* The "params" pointer is currently not used and is for future expansion. */ #ifdef PNG_SEQUENTIAL_READ_SUPPORTED PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #ifdef PNG_WRITE_SUPPORTED PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #endif PNG_EXPORT(180, png_const_charp, png_get_copyright, (png_const_structrp png_ptr)); PNG_EXPORT(181, png_const_charp, png_get_header_ver, (png_const_structrp png_ptr)); PNG_EXPORT(182, png_const_charp, png_get_header_version, (png_const_structrp png_ptr)); PNG_EXPORT(183, png_const_charp, png_get_libpng_ver, (png_const_structrp png_ptr)); #ifdef PNG_MNG_FEATURES_SUPPORTED PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr, png_uint_32 mng_features_permitted)); #endif /* For use in png_set_keep_unknown, added to version 1.2.6 */ #define PNG_HANDLE_CHUNK_AS_DEFAULT 0 #define PNG_HANDLE_CHUNK_NEVER 1 #define PNG_HANDLE_CHUNK_IF_SAFE 2 #define PNG_HANDLE_CHUNK_ALWAYS 3 #define PNG_HANDLE_CHUNK_LAST 4 /* Strip the prepended error numbers ("#nnn ") from error and warning * messages before passing them to the error or warning handler. */ #ifdef PNG_ERROR_NUMBERS_SUPPORTED PNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr, png_uint_32 strip_mode)); #endif /* Added in libpng-1.2.6 */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED PNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); PNG_EXPORT(187, png_uint_32, png_get_user_width_max, (png_const_structrp png_ptr)); PNG_EXPORT(188, png_uint_32, png_get_user_height_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.0 */ PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)); PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.1 */ PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr, png_alloc_size_t user_chunk_cache_max)); PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max, (png_const_structrp png_ptr)); #endif #if defined(PNG_INCH_CONVERSIONS_SUPPORTED) PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_FP_EXPORT(196, float, png_get_x_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif # ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); # endif /* PNG_pHYs_SUPPORTED */ #endif /* PNG_INCH_CONVERSIONS_SUPPORTED */ /* Added in libpng-1.4.0 */ #ifdef PNG_IO_STATE_SUPPORTED PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr)); /* Removed from libpng 1.6; use png_get_io_chunk_type. */ PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr), PNG_DEPRECATED) PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, (png_const_structrp png_ptr)); /* The flags returned by png_get_io_state() are the following: */ # define PNG_IO_NONE 0x0000 /* no I/O at this moment */ # define PNG_IO_READING 0x0001 /* currently reading */ # define PNG_IO_WRITING 0x0002 /* currently writing */ # define PNG_IO_SIGNATURE 0x0010 /* currently at the file signature */ # define PNG_IO_CHUNK_HDR 0x0020 /* currently at the chunk header */ # define PNG_IO_CHUNK_DATA 0x0040 /* currently at the chunk data */ # define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */ # define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */ # define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */ #endif /* ?PNG_IO_STATE_SUPPORTED */ /* Interlace support. The following macros are always defined so that if * libpng interlace handling is turned off the macros may be used to handle * interlaced images within the application. */ #define PNG_INTERLACE_ADAM7_PASSES 7 /* Two macros to return the first row and first column of the original, * full, image which appears in a given pass. 'pass' is in the range 0 * to 6 and the result is in the range 0 to 7. */ #define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7) #define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7) /* A macro to return the offset between pixels in the output row for a pair of * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that * follows. Note that ROW_OFFSET is the offset from one row to the next whereas * COL_OFFSET is from one column to the next, within a row. */ #define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8) #define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1)) /* Two macros to help evaluate the number of rows or columns in each * pass. This is expressed as a shift - effectively log2 of the number or * rows or columns in each 8x8 tile of the original image. */ #define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) #define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) /* Hence two macros to determine the number of rows or columns in a given * pass of an image given its height or width. In fact these macros may * return non-zero even though the sub-image is empty, because the other * dimension may be empty for a small image. */ #define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) #define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) /* For the reader row callbacks (both progressive and sequential) it is * necessary to find the row in the output image given a row in an interlaced * image, so two more macros: */ #define PNG_ROW_FROM_PASS_ROW(y_in, pass) \ (((y_in)<>(((7-(off))-(pass))<<2)) & 0xF) | \ ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0)) #define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) #define PNG_COL_IN_INTERLACE_PASS(x, pass) \ ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED /* With these routines we avoid an integer divide, which will be slower on * most machines. However, it does take more operations than the corresponding * divide method, so it may be slower on a few RISC systems. There are two * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. * * Note that the rounding factors are NOT supposed to be the same! 128 and * 32768 are correct for the NODIV code; 127 and 32767 are correct for the * standard method. * * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] */ /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ # define png_composite(composite, fg, alpha, bg) \ { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ * (png_uint_16)(alpha) \ + (png_uint_16)(bg)*(png_uint_16)(255 \ - (png_uint_16)(alpha)) + 128); \ (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } # define png_composite_16(composite, fg, alpha, bg) \ { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ * (png_uint_32)(alpha) \ + (png_uint_32)(bg)*(65535 \ - (png_uint_32)(alpha)) + 32768); \ (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } #else /* Standard method using integer division */ # define png_composite(composite, fg, alpha, bg) \ (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ 127) / 255) # define png_composite_16(composite, fg, alpha, bg) \ (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ 32767) / 65535) #endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ #ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf)); PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf)); PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf)); #endif PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr, png_const_bytep buf)); /* No png_get_int_16 -- may be added if there's a real need for it. */ /* Place a 32-bit number into a buffer in PNG byte order (big-endian). */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i)); #endif #ifdef PNG_SAVE_INT_32_SUPPORTED PNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i)); #endif /* Place a 16-bit number into a buffer in PNG byte order. * The parameter is declared unsigned int, not png_uint_16, * just to avoid potential problems on pre-ANSI C compilers. */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); /* No png_save_int_16 -- may be added if there's a real need for it. */ #endif #ifdef PNG_USE_READ_MACROS /* Inline macros to do direct reads of bytes from the input buffer. * The png_get_int_32() routine assumes we are using two's complement * format for negative values, which is almost certainly true. */ # define PNG_get_uint_32(buf) \ (((png_uint_32)(*(buf)) << 24) + \ ((png_uint_32)(*((buf) + 1)) << 16) + \ ((png_uint_32)(*((buf) + 2)) << 8) + \ ((png_uint_32)(*((buf) + 3)))) /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the * function) incorrectly returned a value of type png_uint_32. */ # define PNG_get_uint_16(buf) \ ((png_uint_16) \ (((unsigned int)(*(buf)) << 8) + \ ((unsigned int)(*((buf) + 1))))) # define PNG_get_int_32(buf) \ ((png_int_32)((*(buf) & 0x80) \ ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \ : (png_int_32)png_get_uint_32(buf))) /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, * but defining a macro name prefixed with PNG_PREFIX. */ # ifndef PNG_PREFIX # define png_get_uint_32(buf) PNG_get_uint_32(buf) # define png_get_uint_16(buf) PNG_get_uint_16(buf) # define png_get_int_32(buf) PNG_get_int_32(buf) # endif #else # ifdef PNG_PREFIX /* No macros; revert to the (redefined) function */ # define PNG_get_uint_32 (png_get_uint_32) # define PNG_get_uint_16 (png_get_uint_16) # define PNG_get_int_32 (png_get_int_32) # endif #endif /******************************************************************************* * SIMPLIFIED API ******************************************************************************* * * Please read the documentation in libpng-manual.txt (TODO: write said * documentation) if you don't understand what follows. * * The simplified API hides the details of both libpng and the PNG file format * itself. It allows PNG files to be read into a very limited number of * in-memory bitmap formats or to be written from the same formats. If these * formats do not accomodate your needs then you can, and should, use the more * sophisticated APIs above - these support a wide variety of in-memory formats * and a wide variety of sophisticated transformations to those formats as well * as a wide variety of APIs to manipulate ancillary information. * * To read a PNG file using the simplified API: * * 1) Declare a 'png_image' structure (see below) on the stack and set the * version field to PNG_IMAGE_VERSION. * 2) Call the appropriate png_image_begin_read... function. * 3) Set the png_image 'format' member to the required sample format. * 4) Allocate a buffer for the image and, if required, the color-map. * 5) Call png_image_finish_read to read the image and, if required, the * color-map into your buffers. * * There are no restrictions on the format of the PNG input itself; all valid * color types, bit depths, and interlace methods are acceptable, and the * input image is transformed as necessary to the requested in-memory format * during the png_image_finish_read() step. The only caveat is that if you * request a color-mapped image from a PNG that is full-color or makes * complex use of an alpha channel the transformation is extremely lossy and the * result may look terrible. * * To write a PNG file using the simplified API: * * 1) Declare a 'png_image' structure on the stack and memset() it to all zero. * 2) Initialize the members of the structure that describe the image, setting * the 'format' member to the format of the image samples. * 3) Call the appropriate png_image_write... function with a pointer to the * image and, if necessary, the color-map to write the PNG data. * * png_image is a structure that describes the in-memory format of an image * when it is being read or defines the in-memory format of an image that you * need to write: */ #define PNG_IMAGE_VERSION 1 typedef struct png_control *png_controlp; typedef struct { png_controlp opaque; /* Initialize to NULL, free with png_image_free */ png_uint_32 version; /* Set to PNG_IMAGE_VERSION */ png_uint_32 width; /* Image width in pixels (columns) */ png_uint_32 height; /* Image height in pixels (rows) */ png_uint_32 format; /* Image format as defined below */ png_uint_32 flags; /* A bit mask containing informational flags */ png_uint_32 colormap_entries; /* Number of entries in the color-map */ /* In the event of an error or warning the following field will be set to a * non-zero value and the 'message' field will contain a '\0' terminated * string with the libpng error or warning message. If both warnings and * an error were encountered, only the error is recorded. If there * are multiple warnings, only the first one is recorded. * * The upper 30 bits of this value are reserved, the low two bits contain * a value as follows: */ # define PNG_IMAGE_WARNING 1 # define PNG_IMAGE_ERROR 2 /* * The result is a two bit code such that a value more than 1 indicates * a failure in the API just called: * * 0 - no warning or error * 1 - warning * 2 - error * 3 - error preceded by warning */ # define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1) png_uint_32 warning_or_error; char message[64]; } png_image, *png_imagep; /* The samples of the image have one to four channels whose components have * original values in the range 0 to 1.0: * * 1: A single gray or luminance channel (G). * 2: A gray/luminance channel and an alpha channel (GA). * 3: Three red, green, blue color channels (RGB). * 4: Three color channels and an alpha channel (RGBA). * * The components are encoded in one of two ways: * * a) As a small integer, value 0..255, contained in a single byte. For the * alpha channel the original value is simply value/255. For the color or * luminance channels the value is encoded according to the sRGB specification * and matches the 8-bit format expected by typical display devices. * * The color/gray channels are not scaled (pre-multiplied) by the alpha * channel and are suitable for passing to color management software. * * b) As a value in the range 0..65535, contained in a 2-byte integer. All * channels can be converted to the original value by dividing by 65535; all * channels are linear. Color channels use the RGB encoding (RGB end-points) of * the sRGB specification. This encoding is identified by the * PNG_FORMAT_FLAG_LINEAR flag below. * * When the simplified API needs to convert between sRGB and linear colorspaces, * the actual sRGB transfer curve defined in the sRGB specification (see the * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 * approximation used elsewhere in libpng. * * When an alpha channel is present it is expected to denote pixel coverage * of the color or luminance channels and is returned as an associated alpha * channel: the color/gray channels are scaled (pre-multiplied) by the alpha * value. * * The samples are either contained directly in the image data, between 1 and 8 * bytes per pixel according to the encoding, or are held in a color-map indexed * by bytes in the image data. In the case of a color-map the color-map entries * are individual samples, encoded as above, and the image data has one byte per * pixel to select the relevant sample from the color-map. */ /* PNG_FORMAT_* * * #defines to be used in png_image::format. Each #define identifies a * particular layout of sample data and, if present, alpha values. There are * separate defines for each of the two component encodings. * * A format is built up using single bit flag values. All combinations are * valid. Formats can be built up from the flag values or you can use one of * the predefined values below. When testing formats always use the FORMAT_FLAG * macros to test for individual features - future versions of the library may * add new flags. * * When reading or writing color-mapped images the format should be set to the * format of the entries in the color-map then png_image_{read,write}_colormap * called to read or write the color-map and set the format correctly for the * image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! * * NOTE: libpng can be built with particular features disabled, if you see * compiler errors because the definition of one of the following flags has been * compiled out it is because libpng does not have the required support. It is * possible, however, for the libpng configuration to enable the format on just * read or just write; in that case you may see an error at run time. You can * guard against this by checking for the definition of the appropriate * "_SUPPORTED" macro, one of: * * PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED */ #define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ #define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ #define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2 byte channels else 1 byte */ #define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ #ifdef PNG_FORMAT_BGR_SUPPORTED # define PNG_FORMAT_FLAG_BGR 0x10U /* BGR colors, else order is RGB */ #endif #ifdef PNG_FORMAT_AFIRST_SUPPORTED # define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */ #endif /* Commonly used formats have predefined macros. * * First the single byte (sRGB) formats: */ #define PNG_FORMAT_GRAY 0 #define PNG_FORMAT_GA PNG_FORMAT_FLAG_ALPHA #define PNG_FORMAT_AG (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_RGB PNG_FORMAT_FLAG_COLOR #define PNG_FORMAT_BGR (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR) #define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST) /* Then the linear 2-byte formats. When naming these "Y" is used to * indicate a luminance (gray) channel. */ #define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR #define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR) #define PNG_FORMAT_LINEAR_RGB_ALPHA \ (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA) /* With color-mapped formats the image data is one byte for each pixel, the byte * is an index into the color-map which is formatted as above. To obtain a * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP * to one of the above definitions, or you can use one of the definitions below. */ #define PNG_FORMAT_RGB_COLORMAP (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGR_COLORMAP (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP) /* PNG_IMAGE macros * * These are convenience macros to derive information from a png_image * structure. The PNG_IMAGE_SAMPLE_ macros return values appropriate to the * actual image sample values - either the entries in the color-map or the * pixels in the image. The PNG_IMAGE_PIXEL_ macros return corresponding values * for the pixels and will always return 1 for color-mapped formats. The * remaining macros return information about the rows in the image and the * complete image. * * NOTE: All the macros that take a png_image::format parameter are compile time * constants if the format parameter is, itself, a constant. Therefore these * macros can be used in array declarations and case labels where required. * Similarly the macros are also pre-processor constants (sizeof is not used) so * they can be used in #if tests. * * First the information about the samples. */ #define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\ (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1) /* Return the total number of channels in a given format: 1..4 */ #define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\ ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1) /* Return the size in bytes of a single component of a pixel or color-map * entry (as appropriate) in the image: 1 or 2. */ #define PNG_IMAGE_SAMPLE_SIZE(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)) /* This is the size of the sample data for one sample. If the image is * color-mapped it is the size of one color-map entry (and image pixels are * one byte in size), otherwise it is the size of one image pixel. */ #define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256) /* The maximum size of the color-map required by the format expressed in a * count of components. This can be used to compile-time allocate a * color-map: * * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)]; * * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)]; * * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the * information from one of the png_image_begin_read_ APIs and dynamically * allocate the required memory. */ /* Corresponding information about the pixels */ #define PNG_IMAGE_PIXEL_(test,fmt)\ (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt)) #define PNG_IMAGE_PIXEL_CHANNELS(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt) /* The number of separate channels (components) in a pixel; 1 for a * color-mapped image. */ #define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt) /* The size, in bytes, of each component in a pixel; 1 for a color-mapped * image. */ #define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt) /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */ /* Information about the whole row, or whole image */ #define PNG_IMAGE_ROW_STRIDE(image)\ (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width) /* Return the total number of components in a single row of the image; this * is the minimum 'row stride', the minimum count of components between each * row. For a color-mapped image this is the minimum number of bytes in a * row. */ #define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\ (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride)) /* Return the size, in bytes, of an image buffer given a png_image and a row * stride - the number of components to leave space for in each row. */ #define PNG_IMAGE_SIZE(image)\ PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image)) /* Return the size, in bytes, of the image in memory given just a png_image; * the row stride is the minimum stride required for the image. */ #define PNG_IMAGE_COLORMAP_SIZE(image)\ (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries) /* Return the size, in bytes, of the color-map of this image. If the image * format is not a color-map format this will return a size sufficient for * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if * you don't want to allocate a color-map in this case. */ /* PNG_IMAGE_FLAG_* * * Flags containing additional information about the image are held in the * 'flags' field of png_image. */ #define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01 /* This indicates the the RGB values of the in-memory bitmap do not * correspond to the red, green and blue end-points defined by sRGB. */ #define PNG_IMAGE_FLAG_FAST 0x02 /* On write emphasise speed over compression; the resultant PNG file will be * larger but will be produced significantly faster, particular for large * images. Do not use this option for images which will be distributed, only * used it when producing intermediate files that will be read back in * repeatedly. For a typical 24-bit image the option will double the read * speed at the cost of increasing the image size by 25%, however for many * more compressible images the PNG file can be 10 times larger with only a * slight speed gain. */ #define PNG_IMAGE_FLAG_16BIT_sRGB 0x04 /* On read if the image is a 16-bit per component image and there is no gAMA * or sRGB chunk assume that the components are sRGB encoded. Notice that * images output by the simplified API always have gamma information; setting * this flag only affects the interpretation of 16-bit images from an * external source. It is recommended that the application expose this flag * to the user; the user can normally easily recognize the difference between * linear and sRGB encoding. This flag has no effect on write - the data * passed to the write APIs must have the correct encoding (as defined * above.) * * If the flag is not set (the default) input 16-bit per component data is * assumed to be linear. * * NOTE: the flag can only be set after the png_image_begin_read_ call, * because that call initializes the 'flags' field. */ #ifdef PNG_SIMPLIFIED_READ_SUPPORTED /* READ APIs * --------- * * The png_image passed to the read APIs must have been initialized by setting * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.) */ #ifdef PNG_STDIO_SUPPORTED PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image, const char *file_name)); /* The named file is opened for read and the image header is filled in * from the PNG header in the file. */ PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image, FILE* file)); /* The PNG header is read from the stdio FILE object. */ #endif /* PNG_STDIO_SUPPORTED */ PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image, png_const_voidp memory, png_size_t size)); /* The PNG header is read from the given memory buffer. */ PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image, png_const_colorp background, void *buffer, png_int_32 row_stride, void *colormap)); /* Finish reading the image into the supplied buffer and clean up the * png_image structure. * * row_stride is the step, in byte or 2-byte units as appropriate, * between adjacent rows. A positive stride indicates that the top-most row * is first in the buffer - the normal top-down arrangement. A negative * stride indicates that the bottom-most row is first in the buffer. * * background need only be supplied if an alpha channel must be removed from * a png_byte format and the removal is to be done by compositing on a solid * color; otherwise it may be NULL and any composition will be done directly * onto the buffer. The value is an sRGB color to use for the background, * for grayscale output the green channel is used. * * background must be supplied when an alpha channel must be removed from a * single byte color-mapped output format, in other words if: * * 1) The original format from png_image_begin_read_from_* had * PNG_FORMAT_FLAG_ALPHA set. * 2) The format set by the application does not. * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and * PNG_FORMAT_FLAG_LINEAR *not* set. * * For linear output removing the alpha channel is always done by compositing * on black and background is ignored. * * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set. It must * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE. * image->colormap_entries will be updated to the actual number of entries * written to the colormap; this may be less than the original value. */ PNG_EXPORT(238, void, png_image_free, (png_imagep image)); /* Free any data allocated by libpng in image->opaque, setting the pointer to * NULL. May be called at any time after the structure is initialized. */ #endif /* PNG_SIMPLIFIED_READ_SUPPORTED */ #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED #ifdef PNG_STDIO_SUPPORTED /* WRITE APIS * ---------- * For write you must initialize a png_image structure to describe the image to * be written. To do this use memset to set the whole structure to 0 then * initialize fields describing your image. * * version: must be set to PNG_IMAGE_VERSION * opaque: must be initialized to NULL * width: image width in pixels * height: image height in rows * format: the format of the data (image and color-map) you wish to write * flags: set to 0 unless one of the defined flags applies; set * PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB * values do not correspond to the colors in sRGB. * colormap_entries: set to the number of entries in the color-map (0 to 256) */ PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image, const char *file, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the named file. */ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, int convert_to_8_bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the given (FILE*). */ /* With both write APIs if image is in one of the linear formats with 16-bit * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG * gamma encoded according to the sRGB specification, otherwise a 16-bit linear * encoded PNG file is written. * * With color-mapped data formats the colormap parameter point to a color-map * with at least image->colormap_entries encoded in the specified format. If * the format is linear the written PNG color-map will be converted to sRGB * regardless of the convert_to_8_bit flag. * * With all APIs row_stride is handled as in the read APIs - it is the spacing * from one row to the next in component sized units (1 or 2 bytes) and if * negative indicates a bottom-up row layout in the buffer. * * Note that the write API does not support interlacing or sub-8-bit pixels. */ #endif /* PNG_STDIO_SUPPORTED */ #endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */ /******************************************************************************* * END OF SIMPLIFIED API ******************************************************************************/ #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED PNG_EXPORT(242, void, png_set_check_for_invalid_index, (png_structrp png_ptr, int allowed)); # ifdef PNG_GET_PALETTE_MAX_SUPPORTED PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, png_const_infop info_ptr)); # endif #endif /* CHECK_FOR_INVALID_INDEX */ /******************************************************************************* * IMPLEMENTATION OPTIONS ******************************************************************************* * * Support for arbitrary implementation-specific optimizations. The API allows * particular options to be turned on or off. 'Option' is the number of the * option and 'onoff' is 0 (off) or non-0 (on). The value returned is given * by the PNG_OPTION_ defines below. * * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions, * are detected at run time, however sometimes it may be impossible * to do this in user mode, in which case it is necessary to discover * the capabilities in an OS specific way. Such capabilities are * listed here when libpng has support for them and must be turned * ON by the application if present. * * SOFTWARE: sometimes software optimizations actually result in performance * decrease on some architectures or systems, or with some sets of * PNG images. 'Software' options allow such optimizations to be * selected at run time. */ #ifdef PNG_SET_OPTION_SUPPORTED #ifdef PNG_ARM_NEON_API_SUPPORTED # define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */ #endif #define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */ #define PNG_OPTION_NEXT 4 /* Next option - numbers must be even */ /* Return values: NOTE: there are four values and 'off' is *not* zero */ #define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ #define PNG_OPTION_INVALID 1 /* Option number out of range */ #define PNG_OPTION_OFF 2 #define PNG_OPTION_ON 3 PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, int onoff)); #endif /******************************************************************************* * END OF HARDWARE OPTIONS ******************************************************************************/ /* Maintainer: Put new public prototypes here ^, in libpng.3, and project * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt */ /* The last ordinal number (this is the *last* one already used; the next * one to use is one more than this.) Maintainer, remember to add an entry to * scripts/symbols.def as well. */ #ifdef PNG_EXPORT_LAST_ORDINAL PNG_EXPORT_LAST_ORDINAL(244); #endif #ifdef __cplusplus } #endif #endif /* PNG_VERSION_INFO_ONLY */ /* Do not put anything past this line */ #endif /* PNG_H */ ================================================ FILE: Libraries/Core/Windows/Headers/png/pngconf.h ================================================ /* pngconf.h - machine configurable file for libpng * * libpng version 1.6.10 - March 6, 2014 * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h * */ /* Any machine specific code is near the front of this file, so if you * are configuring libpng for a machine, you may want to read the section * starting here down to where it starts to typedef png_color, png_text, * and png_info. */ #ifndef PNGCONF_H #define PNGCONF_H /* To do: Do all of this in scripts/pnglibconf.dfa */ #ifdef PNG_SAFE_LIMITS_SUPPORTED # ifdef PNG_USER_WIDTH_MAX # undef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 1000000L # endif # ifdef PNG_USER_HEIGHT_MAX # undef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 1000000L # endif # ifdef PNG_USER_CHUNK_MALLOC_MAX # undef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 4000000L # endif # ifdef PNG_USER_CHUNK_CACHE_MAX # undef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 128 # endif #endif #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C * compiler for correct compilation. The following header files are required by * the standard. If your compiler doesn't provide these header files, or they * do not match the standard, you will need to provide/improve them. */ #include #include /* Library header files. These header files are all defined by ISOC90; libpng * expects conformant implementations, however, an ISOC90 conformant system need * not provide these header files if the functionality cannot be implemented. * In this case it will be necessary to disable the relevant parts of libpng in * the build of pnglibconf.h. * * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not * include this unnecessary header file. */ #ifdef PNG_STDIO_SUPPORTED /* Required for the definition of FILE: */ # include #endif #ifdef PNG_SETJMP_SUPPORTED /* Required for the definition of jmp_buf and the declaration of longjmp: */ # include #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Required for struct tm: */ # include #endif #endif /* PNG_BUILDING_SYMBOL_TABLE */ /* Prior to 1.6.0 it was possible to turn off 'const' in declarations using * PNG_NO_CONST; this is no longer supported except for data declarations which * apparently still cause problems in 2011 on some compilers. */ #define PNG_CONST const /* backward compatibility only */ /* This controls optimization of the reading of 16 and 32 bit values * from PNG files. It can be set on a per-app-file basis - it * just changes whether a macro is used when the function is called. * The library builder sets the default; if read functions are not * built into the library the macro implementation is forced on. */ #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED # define PNG_USE_READ_MACROS #endif #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) # if PNG_DEFAULT_READ_MACROS # define PNG_USE_READ_MACROS # endif #endif /* COMPILER SPECIFIC OPTIONS. * * These options are provided so that a variety of difficult compilers * can be used. Some are fixed at build time (e.g. PNG_API_RULE * below) but still have compiler specific implementations, others * may be changed on a per-file basis when compiling against libpng. */ /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect * against legacy (pre ISOC90) compilers that did not understand function * prototypes. It is not required for modern C compilers. */ #ifndef PNGARG # define PNGARG(arglist) arglist #endif /* Function calling conventions. * ============================= * Normally it is not necessary to specify to the compiler how to call * a function - it just does it - however on x86 systems derived from * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems * and some others) there are multiple ways to call a function and the * default can be changed on the compiler command line. For this reason * libpng specifies the calling convention of every exported function and * every function called via a user supplied function pointer. This is * done in this file by defining the following macros: * * PNGAPI Calling convention for exported functions. * PNGCBAPI Calling convention for user provided (callback) functions. * PNGCAPI Calling convention used by the ANSI-C library (required * for longjmp callbacks and sometimes used internally to * specify the calling convention for zlib). * * These macros should never be overridden. If it is necessary to * change calling convention in a private build this can be done * by setting PNG_API_RULE (which defaults to 0) to one of the values * below to select the correct 'API' variants. * * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. * This is correct in every known environment. * PNG_API_RULE=1 Use the operating system convention for PNGAPI and * the 'C' calling convention (from PNGCAPI) for * callbacks (PNGCBAPI). This is no longer required * in any known environment - if it has to be used * please post an explanation of the problem to the * libpng mailing list. * * These cases only differ if the operating system does not use the C * calling convention, at present this just means the above cases * (x86 DOS/Windows sytems) and, even then, this does not apply to * Cygwin running on those systems. * * Note that the value must be defined in pnglibconf.h so that what * the application uses to call the library matches the conventions * set when building the library. */ /* Symbol export * ============= * When building a shared library it is almost always necessary to tell * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' * is used to mark the symbols. On some systems these symbols can be * extracted at link time and need no special processing by the compiler, * on other systems the symbols are flagged by the compiler and just * the declaration requires a special tag applied (unfortunately) in a * compiler dependent way. Some systems can do either. * * A small number of older systems also require a symbol from a DLL to * be flagged to the program that calls it. This is a problem because * we do not know in the header file included by application code that * the symbol will come from a shared library, as opposed to a statically * linked one. For this reason the application must tell us by setting * the magic flag PNG_USE_DLL to turn on the special processing before * it includes png.h. * * Four additional macros are used to make this happen: * * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from * the build or imported if PNG_USE_DLL is set - compiler * and system specific. * * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to * 'type', compiler specific. * * PNG_DLL_EXPORT Set to the magic to use during a libpng build to * make a symbol exported from the DLL. Not used in the * public header files; see pngpriv.h for how it is used * in the libpng build. * * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come * from a DLL - used to define PNG_IMPEXP when * PNG_USE_DLL is set. */ /* System specific discovery. * ========================== * This code is used at build time to find PNG_IMPEXP, the API settings * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL * import processing is possible. On Windows systems it also sets * compiler-specific macros to the values required to change the calling * conventions of the various functions. */ #if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or * MinGW on any architecture currently supported by Windows. Also includes * Watcom builds but these need special treatment because they are not * compatible with GCC or Visual C because of different calling conventions. */ # if PNG_API_RULE == 2 /* If this line results in an error, either because __watcall is not * understood or because of a redefine just below you cannot use *this* * build of the library with the compiler you are using. *This* build was * build using Watcom and applications must also be built using Watcom! */ # define PNGCAPI __watcall # endif # if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) # define PNGCAPI __cdecl # if PNG_API_RULE == 1 /* If this line results in an error __stdcall is not understood and * PNG_API_RULE should not have been set to '1'. */ # define PNGAPI __stdcall # endif # else /* An older compiler, or one not detected (erroneously) above, * if necessary override on the command line to get the correct * variants for the compiler. */ # ifndef PNGCAPI # define PNGCAPI _cdecl # endif # if PNG_API_RULE == 1 && !defined(PNGAPI) # define PNGAPI _stdcall # endif # endif /* compiler/api */ /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) # error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed" # endif # if (defined(_MSC_VER) && _MSC_VER < 800) ||\ (defined(__BORLANDC__) && __BORLANDC__ < 0x500) /* older Borland and MSC * compilers used '__export' and required this to be after * the type. */ # ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP # endif # define PNG_DLL_EXPORT __export # else /* newer compiler */ # define PNG_DLL_EXPORT __declspec(dllexport) # ifndef PNG_DLL_IMPORT # define PNG_DLL_IMPORT __declspec(dllimport) # endif # endif /* compiler */ #else /* !Windows */ # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) # define PNGAPI _System # else /* !Windows/x86 && !OS/2 */ /* Use the defaults, or define PNG*API on the command line (but * this will have to be done for every compile!) */ # endif /* other system, !OS/2 */ #endif /* !Windows/x86 */ /* Now do all the defaulting . */ #ifndef PNGCAPI # define PNGCAPI #endif #ifndef PNGCBAPI # define PNGCBAPI PNGCAPI #endif #ifndef PNGAPI # define PNGAPI PNGCAPI #endif /* PNG_IMPEXP may be set on the compilation system command line or (if not set) * then in an internal header file when building the library, otherwise (when * using the library) it is set here. */ #ifndef PNG_IMPEXP # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) /* This forces use of a DLL, disallowing static linking */ # define PNG_IMPEXP PNG_DLL_IMPORT # endif # ifndef PNG_IMPEXP # define PNG_IMPEXP # endif #endif /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat * 'attributes' as a storage class - the attributes go at the start of the * function definition, and attributes are always appended regardless of the * compiler. This considerably simplifies these macros but may cause problems * if any compilers both need function attributes and fail to handle them as * a storage class (this is unlikely.) */ #ifndef PNG_FUNCTION # define PNG_FUNCTION(type, name, args, attributes) attributes type name args #endif #ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type #endif /* The ordinal value is only relevant when preprocessing png.h for symbol * table entries, so we discard it here. See the .dfn files in the * scripts directory. */ #ifndef PNG_EXPORTA # define PNG_EXPORTA(ordinal, type, name, args, attributes)\ PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \ extern attributes) #endif /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, * so make something non-empty to satisfy the requirement: */ #define PNG_EMPTY /*empty list*/ #define PNG_EXPORT(ordinal, type, name, args)\ PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) /* Use PNG_REMOVED to comment out a removed interface. */ #ifndef PNG_REMOVED # define PNG_REMOVED(ordinal, type, name, args, attributes) #endif #ifndef PNG_CALLBACK # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args) #endif /* Support for compiler specific function attributes. These are used * so that where compiler support is available incorrect use of API * functions in png.h will generate compiler warnings. * * Added at libpng-1.2.41. */ #ifndef PNG_NO_PEDANTIC_WARNINGS # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED # define PNG_PEDANTIC_WARNINGS_SUPPORTED # endif #endif #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED /* Support for compiler specific function attributes. These are used * so that where compiler support is available, incorrect use of API * functions in png.h will generate compiler warnings. Added at libpng * version 1.2.41. Disabling these removes the warnings but may also produce * less efficient code. */ # if defined(__clang__) /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ # if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # if !defined(PNG_NORETURN) && __has_attribute(__noreturn__) # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__) # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__) # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # if !defined(PNG_PRIVATE) # ifdef __has_extension # if __has_extension(attribute_unavailable_with_message) # define PNG_PRIVATE __attribute__((__unavailable__(\ "This function is not exported by libpng."))) # endif # endif # endif # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # elif defined(__GNUC__) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # ifndef PNG_NORETURN # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if __GNUC__ >= 3 # ifndef PNG_ALLOCATED # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # ifndef PNG_PRIVATE # if 0 /* Doesn't work so we use deprecated instead*/ # define PNG_PRIVATE \ __attribute__((warning("This function is not exported by libpng."))) # else # define PNG_PRIVATE \ __attribute__((__deprecated__)) # endif # endif # if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */ # endif /* __GNUC__ >= 3 */ # elif defined(_MSC_VER) && (_MSC_VER >= 1300) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* not supported */ # endif # ifndef PNG_NORETURN # define PNG_NORETURN __declspec(noreturn) # endif # ifndef PNG_ALLOCATED # if (_MSC_VER >= 1400) # define PNG_ALLOCATED __declspec(restrict) # endif # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __declspec(deprecated) # endif # ifndef PNG_PRIVATE # define PNG_PRIVATE __declspec(deprecated) # endif # ifndef PNG_RESTRICT # if (_MSC_VER >= 1400) # define PNG_RESTRICT __restrict # endif # endif # elif defined(__WATCOMC__) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif #endif /* PNG_PEDANTIC_WARNINGS */ #ifndef PNG_DEPRECATED # define PNG_DEPRECATED /* Use of this function is deprecated */ #endif #ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* The result of this function must be checked */ #endif #ifndef PNG_NORETURN # define PNG_NORETURN /* This function does not return */ #endif #ifndef PNG_ALLOCATED # define PNG_ALLOCATED /* The result of the function is new memory */ #endif #ifndef PNG_PRIVATE # define PNG_PRIVATE /* This is a private libpng function */ #endif #ifndef PNG_RESTRICT # define PNG_RESTRICT /* The C99 "restrict" feature */ #endif #ifndef PNG_FP_EXPORT /* A floating point API. */ # ifdef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No floating point APIs */ # define PNG_FP_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_FIXED_EXPORT /* A fixed point API. */ # ifdef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No fixed point APIs */ # define PNG_FIXED_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_BUILDING_SYMBOL_TABLE /* Some typedefs to get us started. These should be safe on most of the common * platforms. * * png_uint_32 and png_int_32 may, currently, be larger than required to hold a * 32-bit value however this is not normally advisable. * * png_uint_16 and png_int_16 should always be two bytes in size - this is * verified at library build time. * * png_byte must always be one byte in size. * * The checks below use constants from limits.h, as defined by the ISOC90 * standard. */ #if CHAR_BIT == 8 && UCHAR_MAX == 255 typedef unsigned char png_byte; #else # error "libpng requires 8 bit bytes" #endif #if INT_MIN == -32768 && INT_MAX == 32767 typedef int png_int_16; #elif SHRT_MIN == -32768 && SHRT_MAX == 32767 typedef short png_int_16; #else # error "libpng requires a signed 16 bit type" #endif #if UINT_MAX == 65535 typedef unsigned int png_uint_16; #elif USHRT_MAX == 65535 typedef unsigned short png_uint_16; #else # error "libpng requires an unsigned 16 bit type" #endif #if INT_MIN < -2147483646 && INT_MAX > 2147483646 typedef int png_int_32; #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 typedef long int png_int_32; #else # error "libpng requires a signed 32 bit (or more) type" #endif #if UINT_MAX > 4294967294 typedef unsigned int png_uint_32; #elif ULONG_MAX > 4294967294 typedef unsigned long int png_uint_32; #else # error "libpng requires an unsigned 32 bit (or more) type" #endif /* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however, * requires an ISOC90 compiler and relies on consistent behavior of sizeof. */ typedef size_t png_size_t; typedef ptrdiff_t png_ptrdiff_t; /* libpng needs to know the maximum value of 'size_t' and this controls the * definition of png_alloc_size_t, below. This maximum value of size_t limits * but does not control the maximum allocations the library makes - there is * direct application control of this through png_set_user_limits(). */ #ifndef PNG_SMALL_SIZE_T /* Compiler specific tests for systems where size_t is known to be less than * 32 bits (some of these systems may no longer work because of the lack of * 'far' support; see above.) */ # if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ (defined(_MSC_VER) && defined(MAXSEG_64K)) # define PNG_SMALL_SIZE_T # endif #endif /* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to * png_alloc_size_t are not necessary; in fact, it is recommended not to use * them at all so that the compiler can complain when something turns out to be * problematic. * * Casts in the other direction (from png_alloc_size_t to png_size_t or * png_uint_32) should be explicitly applied; however, we do not expect to * encounter practical situations that require such conversions. * * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than * 4294967295 - i.e. less than the maximum value of png_uint_32. */ #ifdef PNG_SMALL_SIZE_T typedef png_uint_32 png_alloc_size_t; #else typedef png_size_t png_alloc_size_t; #endif /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler * implementations of Intel CPU specific support of user-mode segmented address * spaces, where 16-bit pointers address more than 65536 bytes of memory using * separate 'segment' registers. The implementation requires two different * types of pointer (only one of which includes the segment value.) * * If required this support is available in version 1.2 of libpng and may be * available in versions through 1.5, although the correctness of the code has * not been verified recently. */ /* Typedef for floating-point numbers that are converted to fixed-point with a * multiple of 100,000, e.g., gamma */ typedef png_int_32 png_fixed_point; /* Add typedefs for pointers */ typedef void * png_voidp; typedef const void * png_const_voidp; typedef png_byte * png_bytep; typedef const png_byte * png_const_bytep; typedef png_uint_32 * png_uint_32p; typedef const png_uint_32 * png_const_uint_32p; typedef png_int_32 * png_int_32p; typedef const png_int_32 * png_const_int_32p; typedef png_uint_16 * png_uint_16p; typedef const png_uint_16 * png_const_uint_16p; typedef png_int_16 * png_int_16p; typedef const png_int_16 * png_const_int_16p; typedef char * png_charp; typedef const char * png_const_charp; typedef png_fixed_point * png_fixed_point_p; typedef const png_fixed_point * png_const_fixed_point_p; typedef png_size_t * png_size_tp; typedef const png_size_t * png_const_size_tp; #ifdef PNG_STDIO_SUPPORTED typedef FILE * png_FILE_p; #endif #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * png_doublep; typedef const double * png_const_doublep; #endif /* Pointers to pointers; i.e. arrays */ typedef png_byte * * png_bytepp; typedef png_uint_32 * * png_uint_32pp; typedef png_int_32 * * png_int_32pp; typedef png_uint_16 * * png_uint_16pp; typedef png_int_16 * * png_int_16pp; typedef const char * * png_const_charpp; typedef char * * png_charpp; typedef png_fixed_point * * png_fixed_point_pp; #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * * png_doublepp; #endif /* Pointers to pointers to pointers; i.e., pointer to array */ typedef char * * * png_charppp; #endif /* PNG_BUILDING_SYMBOL_TABLE */ #endif /* PNGCONF_H */ ================================================ FILE: Libraries/Core/Windows/Headers/png/pngdebug.h ================================================ /* pngdebug.h - Debugging macros for libpng, also used in pngtest.c * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.8 [December 19, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* Define PNG_DEBUG at compile time for debugging information. Higher * numbers for PNG_DEBUG mean more debugging information. This has * only been added since version 0.95 so it is not implemented throughout * libpng yet, but more support will be added as needed. * * png_debug[1-2]?(level, message ,arg{0-2}) * Expands to a statement (either a simple expression or a compound * do..while(0) statement) that outputs a message with parameter * substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG * is undefined, 0 or 1 every png_debug expands to a simple expression * (actually ((void)0)). * * level: level of detail of message, starting at 0. A level 'n' * message is preceded by 'n' 3-space indentations (not implemented * on Microsoft compilers unless PNG_DEBUG_FILE is also * defined, to allow debug DLL compilation with no standard IO). * message: a printf(3) style text string. A trailing '\n' is added * to the message. * arg: 0 to 2 arguments for printf(3) style substitution in message. */ #ifndef PNGDEBUG_H #define PNGDEBUG_H /* These settings control the formatting of messages in png.c and pngerror.c */ /* Moved to pngdebug.h at 1.5.0 */ # ifndef PNG_LITERAL_SHARP # define PNG_LITERAL_SHARP 0x23 # endif # ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET # define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b # endif # ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET # define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d # endif # ifndef PNG_STRING_NEWLINE # define PNG_STRING_NEWLINE "\n" # endif #ifdef PNG_DEBUG # if (PNG_DEBUG > 0) # if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) # include # if (PNG_DEBUG > 1) # ifndef _DEBUG # define _DEBUG # endif # ifndef png_debug # define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) # endif # endif # else /* PNG_DEBUG_FILE || !_MSC_VER */ # ifndef PNG_STDIO_SUPPORTED # include /* not included yet */ # endif # ifndef PNG_DEBUG_FILE # define PNG_DEBUG_FILE stderr # endif /* PNG_DEBUG_FILE */ # if (PNG_DEBUG > 1) # ifdef __STDC__ # ifndef png_debug # define png_debug(l,m) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \ } while (0) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \ } while (0) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\ } while (0) # endif # else /* __STDC __ */ # ifndef png_debug # define png_debug(l,m) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format); \ } while (0) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format,p1); \ } while (0) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format,p1,p2); \ } while (0) # endif # endif /* __STDC __ */ # endif /* (PNG_DEBUG > 1) */ # endif /* _MSC_VER */ # endif /* (PNG_DEBUG > 0) */ #endif /* PNG_DEBUG */ #ifndef png_debug # define png_debug(l, m) ((void)0) #endif #ifndef png_debug1 # define png_debug1(l, m, p1) ((void)0) #endif #ifndef png_debug2 # define png_debug2(l, m, p1, p2) ((void)0) #endif #endif /* PNGDEBUG_H */ ================================================ FILE: Libraries/Core/Windows/Headers/png/pnginfo.h ================================================ /* pnginfo.h - header file for PNG reference library * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.1 [March 28, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* png_info is a structure that holds the information in a PNG file so * that the application can find out the characteristics of the image. * If you are reading the file, this structure will tell you what is * in the PNG file. If you are writing the file, fill in the information * you want to put into the PNG file, using png_set_*() functions, then * call png_write_info(). * * The names chosen should be very close to the PNG specification, so * consult that document for information about the meaning of each field. * * With libpng < 0.95, it was only possible to directly set and read the * the values in the png_info_struct, which meant that the contents and * order of the values had to remain fixed. With libpng 0.95 and later, * however, there are now functions that abstract the contents of * png_info_struct from the application, so this makes it easier to use * libpng with dynamic libraries, and even makes it possible to use * libraries that don't have all of the libpng ancillary chunk-handing * functionality. In libpng-1.5.0 this was moved into a separate private * file that is not visible to applications. * * The following members may have allocated storage attached that should be * cleaned up before the structure is discarded: palette, trans, text, * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these * are automatically freed when the info structure is deallocated, if they were * allocated internally by libpng. This behavior can be changed by means * of the png_data_freer() function. * * More allocation details: all the chunk-reading functions that * change these members go through the corresponding png_set_* * functions. A function to clear these members is available: see * png_free_data(). The png_set_* functions do not depend on being * able to point info structure members to any of the storage they are * passed (they make their own copies), EXCEPT that the png_set_text * functions use the same storage passed to them in the text_ptr or * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns * functions do not make their own copies. */ #ifndef PNGINFO_H #define PNGINFO_H struct png_info_def { /* The following are necessary for every PNG file */ png_uint_32 width; /* width of image in pixels (from IHDR) */ png_uint_32 height; /* height of image in pixels (from IHDR) */ png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ png_size_t rowbytes; /* bytes needed to hold an untransformed row */ png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ /* The following three should have been named *_method not *_type */ png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ /* The following are set by png_set_IHDR, called from the application on * write, but the are never actually used by the write code. */ png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ png_byte pixel_depth; /* number of bits per pixel */ png_byte spare_byte; /* to align the data, and for future use */ #ifdef PNG_READ_SUPPORTED /* This is never set during write */ png_byte signature[8]; /* magic bytes read by libpng from start of file */ #endif /* The rest of the data is optional. If you are reading, check the * valid field to see if the information in these are valid. If you * are writing, set the valid field to those chunks you want written, * and initialize the appropriate fields below. */ #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) /* png_colorspace only contains 'flags' if neither GAMMA or COLORSPACE are * defined. When COLORSPACE is switched on all the colorspace-defining * chunks should be enabled, when GAMMA is switched on all the gamma-defining * chunks should be enabled. If this is not done it becomes possible to read * inconsistent PNG files and assign a probably incorrect interpretation to * the information. (In other words, by carefully choosing which chunks to * recognize the system configuration can select an interpretation for PNG * files containing ambiguous data and this will result in inconsistent * behavior between different libpng builds!) */ png_colorspace colorspace; #endif #ifdef PNG_iCCP_SUPPORTED /* iCCP chunk data. */ png_charp iccp_name; /* profile name */ png_bytep iccp_profile; /* International Color Consortium profile data */ png_uint_32 iccp_proflen; /* ICC profile data length */ #endif #ifdef PNG_TEXT_SUPPORTED /* The tEXt, and zTXt chunks contain human-readable textual data in * uncompressed, compressed, and optionally compressed forms, respectively. * The data in "text" is an array of pointers to uncompressed, * null-terminated C strings. Each chunk has a keyword that describes the * textual data contained in that chunk. Keywords are not required to be * unique, and the text string may be empty. Any number of text chunks may * be in an image. */ int num_text; /* number of comments read or comments to write */ int max_text; /* current size of text array */ png_textp text; /* array of comments read or comments to write */ #endif /* PNG_TEXT_SUPPORTED */ #ifdef PNG_tIME_SUPPORTED /* The tIME chunk holds the last time the displayed image data was * modified. See the png_time struct for the contents of this struct. */ png_time mod_time; #endif #ifdef PNG_sBIT_SUPPORTED /* The sBIT chunk specifies the number of significant high-order bits * in the pixel data. Values are in the range [1, bit_depth], and are * only specified for the channels in the pixel data. The contents of * the low-order bits is not specified. Data is valid if * (valid & PNG_INFO_sBIT) is non-zero. */ png_color_8 sig_bit; /* significant bits in color channels */ #endif #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ defined(PNG_READ_BACKGROUND_SUPPORTED) /* The tRNS chunk supplies transparency data for paletted images and * other image types that don't need a full alpha channel. There are * "num_trans" transparency values for a paletted image, stored in the * same order as the palette colors, starting from index 0. Values * for the data are in the range [0, 255], ranging from fully transparent * to fully opaque, respectively. For non-paletted images, there is a * single color specified that should be treated as fully transparent. * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. */ png_bytep trans_alpha; /* alpha values for paletted image */ png_color_16 trans_color; /* transparent color for non-palette image */ #endif #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) /* The bKGD chunk gives the suggested image background color if the * display program does not have its own background color and the image * is needs to composited onto a background before display. The colors * in "background" are normally in the same color space/depth as the * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. */ png_color_16 background; #endif #ifdef PNG_oFFs_SUPPORTED /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards * and downwards from the top-left corner of the display, page, or other * application-specific co-ordinate space. See the PNG_OFFSET_ defines * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. */ png_int_32 x_offset; /* x offset on page */ png_int_32 y_offset; /* y offset on page */ png_byte offset_unit_type; /* offset units type */ #endif #ifdef PNG_pHYs_SUPPORTED /* The pHYs chunk gives the physical pixel density of the image for * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. */ png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ png_uint_32 y_pixels_per_unit; /* vertical pixel density */ png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ #endif #ifdef PNG_hIST_SUPPORTED /* The hIST chunk contains the relative frequency or importance of the * various palette entries, so that a viewer can intelligently select a * reduced-color palette, if required. Data is an array of "num_palette" * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) * is non-zero. */ png_uint_16p hist; #endif #ifdef PNG_pCAL_SUPPORTED /* The pCAL chunk describes a transformation between the stored pixel * values and original physical data values used to create the image. * The integer range [0, 2^bit_depth - 1] maps to the floating-point * range given by [pcal_X0, pcal_X1], and are further transformed by a * (possibly non-linear) transformation function given by "pcal_type" * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ * defines below, and the PNG-Group's PNG extensions document for a * complete description of the transformations and how they should be * implemented, and for a description of the ASCII parameter strings. * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. */ png_charp pcal_purpose; /* pCAL chunk description string */ png_int_32 pcal_X0; /* minimum value */ png_int_32 pcal_X1; /* maximum value */ png_charp pcal_units; /* Latin-1 string giving physical units */ png_charpp pcal_params; /* ASCII strings containing parameter values */ png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ png_byte pcal_nparams; /* number of parameters given in pcal_params */ #endif /* New members added in libpng-1.0.6 */ png_uint_32 free_me; /* flags items libpng is responsible for freeing */ #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED /* Storage for unknown chunks that the library doesn't recognize. */ png_unknown_chunkp unknown_chunks; /* The type of this field is limited by the type of * png_struct::user_chunk_cache_max, else overflow can occur. */ int unknown_chunks_num; #endif #ifdef PNG_sPLT_SUPPORTED /* Data on sPLT chunks (there may be more than one). */ png_sPLT_tp splt_palettes; int splt_palettes_num; /* Match type returned by png_get API */ #endif #ifdef PNG_sCAL_SUPPORTED /* The sCAL chunk describes the actual physical dimensions of the * subject matter of the graphic. The chunk contains a unit specification * a byte value, and two ASCII strings representing floating-point * values. The values are width and height corresponsing to one pixel * in the image. Data values are valid if (valid & PNG_INFO_sCAL) is * non-zero. */ png_byte scal_unit; /* unit of physical scale */ png_charp scal_s_width; /* string containing height */ png_charp scal_s_height; /* string containing width */ #endif #ifdef PNG_INFO_IMAGE_SUPPORTED /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */ /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ png_bytepp row_pointers; /* the image bits */ #endif }; #endif /* PNGINFO_H */ ================================================ FILE: Libraries/Core/Windows/Headers/png/pnglibconf.h ================================================ /* libpng 1.6.10 STANDARD API DEFINITION */ /* pnglibconf.h - library build configuration */ /* Libpng version 1.6.10 - March 6, 2014 */ /* Copyright (c) 1998-2013 Glenn Randers-Pehrson */ /* This code is released under the libpng license. */ /* For conditions of distribution and use, see the disclaimer */ /* and license in png.h */ /* pnglibconf.h */ /* Machine generated file: DO NOT EDIT */ /* Derived from: scripts/pnglibconf.dfa */ #ifndef PNGLCONF_H #define PNGLCONF_H /* options */ #define PNG_16BIT_SUPPORTED #define PNG_ALIGNED_MEMORY_SUPPORTED /*#undef PNG_ARM_NEON_API_SUPPORTED*/ /*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/ #define PNG_BENIGN_ERRORS_SUPPORTED #define PNG_BENIGN_READ_ERRORS_SUPPORTED /*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/ #define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED #define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_COLORSPACE_SUPPORTED #define PNG_CONSOLE_IO_SUPPORTED #define PNG_CONVERT_tIME_SUPPORTED #define PNG_EASY_ACCESS_SUPPORTED /*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ #define PNG_ERROR_TEXT_SUPPORTED #define PNG_FIXED_POINT_SUPPORTED #define PNG_FLOATING_ARITHMETIC_SUPPORTED #define PNG_FLOATING_POINT_SUPPORTED #define PNG_FORMAT_AFIRST_SUPPORTED #define PNG_FORMAT_BGR_SUPPORTED #define PNG_GAMMA_SUPPORTED #define PNG_GET_PALETTE_MAX_SUPPORTED #define PNG_HANDLE_AS_UNKNOWN_SUPPORTED #define PNG_INCH_CONVERSIONS_SUPPORTED #define PNG_INFO_IMAGE_SUPPORTED #define PNG_IO_STATE_SUPPORTED #define PNG_MNG_FEATURES_SUPPORTED #define PNG_POINTER_INDEXING_SUPPORTED #define PNG_PROGRESSIVE_READ_SUPPORTED #define PNG_READ_16BIT_SUPPORTED #define PNG_READ_ALPHA_MODE_SUPPORTED #define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED #define PNG_READ_BACKGROUND_SUPPORTED #define PNG_READ_BGR_SUPPORTED #define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_READ_COMPOSITE_NODIV_SUPPORTED #define PNG_READ_COMPRESSED_TEXT_SUPPORTED #define PNG_READ_EXPAND_16_SUPPORTED #define PNG_READ_EXPAND_SUPPORTED #define PNG_READ_FILLER_SUPPORTED #define PNG_READ_GAMMA_SUPPORTED #define PNG_READ_GET_PALETTE_MAX_SUPPORTED #define PNG_READ_GRAY_TO_RGB_SUPPORTED #define PNG_READ_INTERLACING_SUPPORTED #define PNG_READ_INT_FUNCTIONS_SUPPORTED #define PNG_READ_INVERT_ALPHA_SUPPORTED #define PNG_READ_INVERT_SUPPORTED #define PNG_READ_OPT_PLTE_SUPPORTED #define PNG_READ_PACKSWAP_SUPPORTED #define PNG_READ_PACK_SUPPORTED #define PNG_READ_QUANTIZE_SUPPORTED #define PNG_READ_RGB_TO_GRAY_SUPPORTED #define PNG_READ_SCALE_16_TO_8_SUPPORTED #define PNG_READ_SHIFT_SUPPORTED #define PNG_READ_STRIP_16_TO_8_SUPPORTED #define PNG_READ_STRIP_ALPHA_SUPPORTED #define PNG_READ_SUPPORTED #define PNG_READ_SWAP_ALPHA_SUPPORTED #define PNG_READ_SWAP_SUPPORTED #define PNG_READ_TEXT_SUPPORTED #define PNG_READ_TRANSFORMS_SUPPORTED #define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED #define PNG_READ_USER_CHUNKS_SUPPORTED #define PNG_READ_USER_TRANSFORM_SUPPORTED #define PNG_READ_bKGD_SUPPORTED #define PNG_READ_cHRM_SUPPORTED #define PNG_READ_gAMA_SUPPORTED #define PNG_READ_hIST_SUPPORTED #define PNG_READ_iCCP_SUPPORTED #define PNG_READ_iTXt_SUPPORTED #define PNG_READ_oFFs_SUPPORTED #define PNG_READ_pCAL_SUPPORTED #define PNG_READ_pHYs_SUPPORTED #define PNG_READ_sBIT_SUPPORTED #define PNG_READ_sCAL_SUPPORTED #define PNG_READ_sPLT_SUPPORTED #define PNG_READ_sRGB_SUPPORTED #define PNG_READ_tEXt_SUPPORTED #define PNG_READ_tIME_SUPPORTED #define PNG_READ_tRNS_SUPPORTED #define PNG_READ_zTXt_SUPPORTED /*#undef PNG_SAFE_LIMITS_SUPPORTED*/ #define PNG_SAVE_INT_32_SUPPORTED #define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SEQUENTIAL_READ_SUPPORTED #define PNG_SETJMP_SUPPORTED #define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED #define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED #define PNG_SET_OPTION_SUPPORTED #define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SET_USER_LIMITS_SUPPORTED #define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED #define PNG_SIMPLIFIED_READ_BGR_SUPPORTED #define PNG_SIMPLIFIED_READ_SUPPORTED #define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED #define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED #define PNG_SIMPLIFIED_WRITE_SUPPORTED #define PNG_STDIO_SUPPORTED #define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_TEXT_SUPPORTED #define PNG_TIME_RFC1123_SUPPORTED #define PNG_UNKNOWN_CHUNKS_SUPPORTED #define PNG_USER_CHUNKS_SUPPORTED #define PNG_USER_LIMITS_SUPPORTED #define PNG_USER_MEM_SUPPORTED #define PNG_USER_TRANSFORM_INFO_SUPPORTED #define PNG_USER_TRANSFORM_PTR_SUPPORTED #define PNG_WARNINGS_SUPPORTED #define PNG_WRITE_16BIT_SUPPORTED #define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED #define PNG_WRITE_BGR_SUPPORTED #define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED #define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED #define PNG_WRITE_FILLER_SUPPORTED #define PNG_WRITE_FILTER_SUPPORTED #define PNG_WRITE_FLUSH_SUPPORTED #define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED #define PNG_WRITE_INTERLACING_SUPPORTED #define PNG_WRITE_INT_FUNCTIONS_SUPPORTED #define PNG_WRITE_INVERT_ALPHA_SUPPORTED #define PNG_WRITE_INVERT_SUPPORTED #define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED #define PNG_WRITE_PACKSWAP_SUPPORTED #define PNG_WRITE_PACK_SUPPORTED #define PNG_WRITE_SHIFT_SUPPORTED #define PNG_WRITE_SUPPORTED #define PNG_WRITE_SWAP_ALPHA_SUPPORTED #define PNG_WRITE_SWAP_SUPPORTED #define PNG_WRITE_TEXT_SUPPORTED #define PNG_WRITE_TRANSFORMS_SUPPORTED #define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_WRITE_USER_TRANSFORM_SUPPORTED #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED #define PNG_WRITE_bKGD_SUPPORTED #define PNG_WRITE_cHRM_SUPPORTED #define PNG_WRITE_gAMA_SUPPORTED #define PNG_WRITE_hIST_SUPPORTED #define PNG_WRITE_iCCP_SUPPORTED #define PNG_WRITE_iTXt_SUPPORTED #define PNG_WRITE_oFFs_SUPPORTED #define PNG_WRITE_pCAL_SUPPORTED #define PNG_WRITE_pHYs_SUPPORTED #define PNG_WRITE_sBIT_SUPPORTED #define PNG_WRITE_sCAL_SUPPORTED #define PNG_WRITE_sPLT_SUPPORTED #define PNG_WRITE_sRGB_SUPPORTED #define PNG_WRITE_tEXt_SUPPORTED #define PNG_WRITE_tIME_SUPPORTED #define PNG_WRITE_tRNS_SUPPORTED #define PNG_WRITE_zTXt_SUPPORTED #define PNG_bKGD_SUPPORTED #define PNG_cHRM_SUPPORTED #define PNG_gAMA_SUPPORTED #define PNG_hIST_SUPPORTED #define PNG_iCCP_SUPPORTED #define PNG_iTXt_SUPPORTED #define PNG_oFFs_SUPPORTED #define PNG_pCAL_SUPPORTED #define PNG_pHYs_SUPPORTED #define PNG_sBIT_SUPPORTED #define PNG_sCAL_SUPPORTED #define PNG_sPLT_SUPPORTED #define PNG_sRGB_SUPPORTED #define PNG_tEXt_SUPPORTED #define PNG_tIME_SUPPORTED #define PNG_tRNS_SUPPORTED #define PNG_zTXt_SUPPORTED /* end of options */ /* settings */ #define PNG_API_RULE 0 #define PNG_CALLOC_SUPPORTED #define PNG_COST_SHIFT 3 #define PNG_DEFAULT_READ_MACROS 1 #define PNG_GAMMA_THRESHOLD_FIXED 5000 #define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE #define PNG_INFLATE_BUF_SIZE 1024 #define PNG_MAX_GAMMA_8 11 #define PNG_QUANTIZE_BLUE_BITS 5 #define PNG_QUANTIZE_GREEN_BITS 5 #define PNG_QUANTIZE_RED_BITS 5 #define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1) #define PNG_TEXT_Z_DEFAULT_STRATEGY 0 #define PNG_WEIGHT_SHIFT 8 #define PNG_ZBUF_SIZE 8192 #define PNG_ZLIB_VERNUM 0 /* unknown */ #define PNG_Z_DEFAULT_COMPRESSION (-1) #define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0 #define PNG_Z_DEFAULT_STRATEGY 1 #define PNG_sCAL_PRECISION 5 #define PNG_sRGB_PROFILE_CHECKS 2 /* end of settings */ #endif /* PNGLCONF_H */ ================================================ FILE: Libraries/Core/Windows/Headers/png/pngpriv.h ================================================ /* pngpriv.h - private declarations for use inside libpng * * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.10 [March 6, 2014] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* The symbols declared in this file (including the functions declared * as extern) are PRIVATE. They are not part of the libpng public * interface, and are not recommended for use by regular applications. * Some of them may become public in the future; others may stay private, * change in an incompatible way, or even disappear. * Although the libpng users are not forbidden to include this header, * they should be well aware of the issues that may arise from doing so. */ #ifndef PNGPRIV_H #define PNGPRIV_H /* Feature Test Macros. The following are defined here to ensure that correctly * implemented libraries reveal the APIs libpng needs to build and hide those * that are not needed and potentially damaging to the compilation. * * Feature Test Macros must be defined before any system header is included (see * POSIX 1003.1 2.8.2 "POSIX Symbols." * * These macros only have an effect if the operating system supports either * POSIX 1003.1 or C99, or both. On other operating systems (particularly * Windows/Visual Studio) there is no effect; the OS specific tests below are * still required (as of 2011-05-02.) */ #define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */ #ifndef PNG_VERSION_INFO_ONLY /* Standard library headers not required by png.h: */ # include # include #endif #define PNGLIB_BUILD /*libpng is being built, not used*/ /* If HAVE_CONFIG_H is defined during the build then the build system must * provide an appropriate "config.h" file on the include path. The header file * must provide definitions as required below (search for "HAVE_CONFIG_H"); * see configure.ac for more details of the requirements. The macro * "PNG_NO_CONFIG_H" is provided for maintainers to test for dependencies on * 'configure'; define this macro to prevent the configure build including the * configure generated config.h. Libpng is expected to compile without *any* * special build system support on a reasonably ANSI-C compliant system. */ #if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) # include /* Pick up the definition of 'restrict' from config.h if it was read: */ # define PNG_RESTRICT restrict #endif /* To support symbol prefixing it is necessary to know *before* including png.h * whether the fixed point (and maybe other) APIs are exported, because if they * are not internal definitions may be required. This is handled below just * before png.h is included, but load the configuration now if it is available. */ #ifndef PNGLCONF_H # include "pnglibconf.h" #endif /* Local renames may change non-exported API functions from png.h */ #if defined(PNG_PREFIX) && !defined(PNGPREFIX_H) # include "pngprefix.h" #endif #ifdef PNG_USER_CONFIG # include "pngusr.h" /* These should have been defined in pngusr.h */ # ifndef PNG_USER_PRIVATEBUILD # define PNG_USER_PRIVATEBUILD "Custom libpng build" # endif # ifndef PNG_USER_DLLFNAME_POSTFIX # define PNG_USER_DLLFNAME_POSTFIX "Cb" # endif #endif /* Compile time options. * ===================== * In a multi-arch build the compiler may compile the code several times for the * same object module, producing different binaries for different architectures. * When this happens configure-time setting of the target host options cannot be * done and this interferes with the handling of the ARM NEON optimizations, and * possibly other similar optimizations. Put additional tests here; in general * this is needed when the same option can be changed at both compile time and * run time depending on the target OS (i.e. iOS vs Android.) * * NOTE: symbol prefixing does not pass $(CFLAGS) to the preprocessor, because * this is not possible with certain compilers (Oracle SUN OS CC), as a result * it is necessary to ensure that all extern functions that *might* be used * regardless of $(CFLAGS) get declared in this file. The test on __ARM_NEON__ * below is one example of this behavior because it is controlled by the * presence or not of -mfpu=neon on the GCC command line, it is possible to do * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely * do this. */ #ifndef PNG_ARM_NEON_OPT /* ARM NEON optimizations are being controlled by the compiler settings, * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon * with GCC) then the compiler will define __ARM_NEON__ and we can rely * unconditionally on NEON instructions not crashing, otherwise we must * disable use of NEON instructions. * * NOTE: at present these optimizations depend on 'ALIGNED_MEMORY', so they * can only be turned on automatically if that is supported too. If * PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail * to compile with an appropriate #error if ALIGNED_MEMORY has been turned * off. */ # if defined(__ARM_NEON__) && defined(PNG_ALIGNED_MEMORY_SUPPORTED) # define PNG_ARM_NEON_OPT 2 # else # define PNG_ARM_NEON_OPT 0 # endif #endif #if PNG_ARM_NEON_OPT > 0 /* NEON optimizations are to be at least considered by libpng, so enable the * callbacks to do this. */ # define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon /* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used * if possible - if __ARM_NEON__ is set and the compiler version is not known * to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can * be: * * 1 The intrinsics code (the default with __ARM_NEON__) * 2 The hand coded assembler (the default without __ARM_NEON__) * * It is possible to set PNG_ARM_NEON_IMPLEMENTATION in CPPFLAGS, however * this is *NOT* supported and may cease to work even after a minor revision * to libpng. It *is* valid to do this for testing purposes, e.g. speed * testing or a new compiler, but the results should be communicated to the * libpng implementation list for incorporation in the next minor release. */ # ifndef PNG_ARM_NEON_IMPLEMENTATION # ifdef __ARM_NEON__ # if defined(__clang__) /* At present it is unknown by the libpng developers which versions * of clang support the intrinsics, however some or perhaps all * versions do not work with the assembler so this may be * irrelevant, so just use the default (do nothing here.) */ # elif defined(__GNUC__) /* GCC 4.5.4 NEON support is known to be broken. 4.6.3 is known to * work, so if this *is* GCC, or G++, look for a version >4.5 */ # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) # define PNG_ARM_NEON_IMPLEMENTATION 2 # endif /* no GNUC support */ # endif /* __GNUC__ */ # else /* !defined __ARM_NEON__ */ /* The 'intrinsics' code simply won't compile without this -mfpu=neon: */ # define PNG_ARM_NEON_IMPLEMENTATION 2 # endif /* __ARM_NEON__ */ # endif /* !defined PNG_ARM_NEON_IMPLEMENTATION */ # ifndef PNG_ARM_NEON_IMPLEMENTATION /* Use the intrinsics code by default. */ # define PNG_ARM_NEON_IMPLEMENTATION 1 # endif #endif /* PNG_ARM_NEON_OPT > 0 */ /* Is this a build of a DLL where compilation of the object modules requires * different preprocessor settings to those required for a simple library? If * so PNG_BUILD_DLL must be set. * * If libpng is used inside a DLL but that DLL does not export the libpng APIs * PNG_BUILD_DLL must not be set. To avoid the code below kicking in build a * static library of libpng then link the DLL against that. */ #ifndef PNG_BUILD_DLL # ifdef DLL_EXPORT /* This is set by libtool when files are compiled for a DLL; libtool * always compiles twice, even on systems where it isn't necessary. Set * PNG_BUILD_DLL in case it is necessary: */ # define PNG_BUILD_DLL # else # ifdef _WINDLL /* This is set by the Microsoft Visual Studio IDE in projects that * build a DLL. It can't easily be removed from those projects (it * isn't visible in the Visual Studio UI) so it is a fairly reliable * indication that PNG_IMPEXP needs to be set to the DLL export * attributes. */ # define PNG_BUILD_DLL # else # ifdef __DLL__ /* This is set by the Borland C system when compiling for a DLL * (as above.) */ # define PNG_BUILD_DLL # else /* Add additional compiler cases here. */ # endif # endif # endif #endif /* Setting PNG_BUILD_DLL if required */ /* See pngconf.h for more details: the builder of the library may set this on * the command line to the right thing for the specific compilation system or it * may be automagically set above (at present we know of no system where it does * need to be set on the command line.) * * PNG_IMPEXP must be set here when building the library to prevent pngconf.h * setting it to the "import" setting for a DLL build. */ #ifndef PNG_IMPEXP # ifdef PNG_BUILD_DLL # define PNG_IMPEXP PNG_DLL_EXPORT # else /* Not building a DLL, or the DLL doesn't require specific export * definitions. */ # define PNG_IMPEXP # endif #endif /* No warnings for private or deprecated functions in the build: */ #ifndef PNG_DEPRECATED # define PNG_DEPRECATED #endif #ifndef PNG_PRIVATE # define PNG_PRIVATE #endif /* Symbol preprocessing support. * * To enable listing global, but internal, symbols the following macros should * always be used to declare an extern data or function object in this file. */ #ifndef PNG_INTERNAL_DATA # define PNG_INTERNAL_DATA(type, name, array) extern type name array #endif #ifndef PNG_INTERNAL_FUNCTION # define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\ extern PNG_FUNCTION(type, name, args, PNG_EMPTY attributes) #endif #ifndef PNG_INTERNAL_CALLBACK # define PNG_INTERNAL_CALLBACK(type, name, args, attributes)\ extern PNG_FUNCTION(type, (PNGCBAPI name), args, PNG_EMPTY attributes) #endif /* If floating or fixed point APIs are disabled they may still be compiled * internally. To handle this make sure they are declared as the appropriate * internal extern function (otherwise the symbol prefixing stuff won't work and * the functions will be used without definitions.) * * NOTE: although all the API functions are declared here they are not all * actually built! Because the declarations are still made it is necessary to * fake out types that they depend on. */ #ifndef PNG_FP_EXPORT # ifndef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); # ifndef PNG_VERSION_INFO_ONLY typedef struct png_incomplete png_double; typedef png_double* png_doublep; typedef const png_double* png_const_doublep; typedef png_double** png_doublepp; # endif # endif #endif #ifndef PNG_FIXED_EXPORT # ifndef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); # endif #endif #include "png.h" /* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */ #ifndef PNG_DLL_EXPORT # define PNG_DLL_EXPORT #endif /* SECURITY and SAFETY: * * By default libpng is built without any internal limits on image size, * individual heap (png_malloc) allocations or the total amount of memory used. * If PNG_SAFE_LIMITS_SUPPORTED is defined, however, the limits below are used * (unless individually overridden). These limits are believed to be fairly * safe, but builders of secure systems should verify the values against the * real system capabilities. */ #ifdef PNG_SAFE_LIMITS_SUPPORTED /* 'safe' limits */ # ifndef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 1000000 # endif # ifndef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 1000000 # endif # ifndef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 128 # endif # ifndef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 8000000 # endif #else /* values for no limits */ # ifndef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 0x7fffffff # endif # ifndef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 0x7fffffff # endif # ifndef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 0 # endif # ifndef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 0 # endif #endif /* Moved to pngpriv.h at libpng-1.5.0 */ /* NOTE: some of these may have been used in external applications as * these definitions were exposed in pngconf.h prior to 1.5. */ /* If you are running on a machine where you cannot allocate more * than 64K of memory at once, uncomment this. While libpng will not * normally need that much memory in a chunk (unless you load up a very * large file), zlib needs to know how big of a chunk it can use, and * libpng thus makes sure to check any memory allocation to verify it * will fit into memory. * * zlib provides 'MAXSEG_64K' which, if defined, indicates the * same limit and pngconf.h (already included) sets the limit * if certain operating systems are detected. */ #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) # define PNG_MAX_MALLOC_64K #endif #ifndef PNG_UNUSED /* Unused formal parameter warnings are silenced using the following macro * which is expected to have no bad effects on performance (optimizing * compilers will probably remove it entirely). Note that if you replace * it with something other than whitespace, you must include the terminating * semicolon. */ # define PNG_UNUSED(param) (void)param; #endif /* Just a little check that someone hasn't tried to define something * contradictory. */ #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) # undef PNG_ZBUF_SIZE # define PNG_ZBUF_SIZE 65536L #endif /* If warnings or errors are turned off the code is disabled or redirected here. * From 1.5.4 functions have been added to allow very limited formatting of * error and warning messages - this code will also be disabled here. */ #ifdef PNG_WARNINGS_SUPPORTED # define PNG_WARNING_PARAMETERS(p) png_warning_parameters p; #else # define png_warning_parameter(p,number,string) ((void)0) # define png_warning_parameter_unsigned(p,number,format,value) ((void)0) # define png_warning_parameter_signed(p,number,format,value) ((void)0) # define png_formatted_warning(pp,p,message) ((void)(pp)) # define PNG_WARNING_PARAMETERS(p) #endif #ifndef PNG_ERROR_TEXT_SUPPORTED # define png_fixed_error(s1,s2) png_err(s1) #endif /* C allows up-casts from (void*) to any pointer and (const void*) to any * pointer to a const object. C++ regards this as a type error and requires an * explicit, static, cast and provides the static_cast<> rune to ensure that * const is not cast away. */ #ifdef __cplusplus # define png_voidcast(type, value) static_cast(value) # define png_constcast(type, value) const_cast(value) # define png_aligncast(type, value) \ static_cast(static_cast(value)) # define png_aligncastconst(type, value) \ static_cast(static_cast(value)) #else # define png_voidcast(type, value) (value) # define png_constcast(type, value) ((type)(value)) # define png_aligncast(type, value) ((void*)(value)) # define png_aligncastconst(type, value) ((const void*)(value)) #endif /* __cplusplus */ /* Some fixed point APIs are still required even if not exported because * they get used by the corresponding floating point APIs. This magic * deals with this: */ #ifdef PNG_FIXED_POINT_SUPPORTED # define PNGFAPI PNGAPI #else # define PNGFAPI /* PRIVATE */ #endif #ifndef PNG_VERSION_INFO_ONLY /* Other defines specific to compilers can go here. Try to keep * them inside an appropriate ifdef/endif pair for portability. */ #if defined(PNG_FLOATING_POINT_SUPPORTED) ||\ defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) /* png.c requires the following ANSI-C constants if the conversion of * floating point to ASCII is implemented therein: * * DBL_DIG Maximum number of decimal digits (can be set to any constant) * DBL_MIN Smallest normalized fp number (can be set to an arbitrary value) * DBL_MAX Maximum floating point number (can be set to an arbitrary value) */ # include # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) /* We need to check that hasn't already been included earlier * as it seems it doesn't agree with , yet we should really use * if possible. */ # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) # include # endif # else # include # endif # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) /* Amiga SAS/C: We must include builtin FPU functions when compiling using * MATH=68881 */ # include # endif #endif /* This provides the non-ANSI (far) memory allocation routines. */ #if defined(__TURBOC__) && defined(__MSDOS__) # include # include #endif #if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \ defined(_WIN32) || defined(__WIN32__) # include /* defines _WINDOWS_ macro */ #endif #endif /* PNG_VERSION_INFO_ONLY */ /* Moved here around 1.5.0beta36 from pngconf.h */ /* Users may want to use these so they are not private. Any library * functions that are passed far data must be model-independent. */ /* Memory model/platform independent fns */ #ifndef PNG_ABORT # ifdef _WINDOWS_ # define PNG_ABORT() ExitProcess(0) # else # define PNG_ABORT() abort() # endif #endif /* These macros may need to be architecture dependent. */ #define PNG_ALIGN_NONE 0 /* do not use data alignment */ #define PNG_ALIGN_ALWAYS 1 /* assume unaligned accesses are OK */ #ifdef offsetof # define PNG_ALIGN_OFFSET 2 /* use offsetof to determine alignment */ #else # define PNG_ALIGN_OFFSET -1 /* prevent the use of this */ #endif #define PNG_ALIGN_SIZE 3 /* use sizeof to determine alignment */ #ifndef PNG_ALIGN_TYPE /* Default to using aligned access optimizations and requiring alignment to a * multiple of the data type size. Override in a compiler specific fashion * if necessary by inserting tests here: */ # define PNG_ALIGN_TYPE PNG_ALIGN_SIZE #endif #if PNG_ALIGN_TYPE == PNG_ALIGN_SIZE /* This is used because in some compiler implementations non-aligned * structure members are supported, so the offsetof approach below fails. * Set PNG_ALIGN_SIZE=0 for compiler combinations where unaligned access * is good for performance. Do not do this unless you have tested the result * and understand it. */ # define png_alignof(type) (sizeof (type)) #else # if PNG_ALIGN_TYPE == PNG_ALIGN_OFFSET # define png_alignof(type) offsetof(struct{char c; type t;}, t) # else # if PNG_ALIGN_TYPE == PNG_ALIGN_ALWAYS # define png_alignof(type) (1) # endif /* Else leave png_alignof undefined to prevent use thereof */ # endif #endif /* This implicitly assumes alignment is always to a power of 2. */ #ifdef png_alignof # define png_isaligned(ptr, type)\ ((((const char*)ptr-(const char*)0) & (png_alignof(type)-1)) == 0) #else # define png_isaligned(ptr, type) 0 #endif /* End of memory model/platform independent support */ /* End of 1.5.0beta36 move from pngconf.h */ /* CONSTANTS and UTILITY MACROS * These are used internally by libpng and not exposed in the API */ /* Various modes of operation. Note that after an init, mode is set to * zero automatically when the structure is created. Three of these * are defined in png.h because they need to be visible to applications * that call png_set_unknown_chunk(). */ /* #define PNG_HAVE_IHDR 0x01 (defined in png.h) */ /* #define PNG_HAVE_PLTE 0x02 (defined in png.h) */ #define PNG_HAVE_IDAT 0x04 /* #define PNG_AFTER_IDAT 0x08 (defined in png.h) */ #define PNG_HAVE_IEND 0x10 /* 0x20 (unused) */ /* 0x40 (unused) */ /* 0x80 (unused) */ #define PNG_HAVE_CHUNK_HEADER 0x100 #define PNG_WROTE_tIME 0x200 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400 #define PNG_BACKGROUND_IS_GRAY 0x800 #define PNG_HAVE_PNG_SIGNATURE 0x1000 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ /* 0x4000 (unused) */ #define PNG_IS_READ_STRUCT 0x8000 /* Else is a write struct */ /* Flags for the transformations the PNG library does on the image data */ #define PNG_BGR 0x0001 #define PNG_INTERLACE 0x0002 #define PNG_PACK 0x0004 #define PNG_SHIFT 0x0008 #define PNG_SWAP_BYTES 0x0010 #define PNG_INVERT_MONO 0x0020 #define PNG_QUANTIZE 0x0040 #define PNG_COMPOSE 0x0080 /* Was PNG_BACKGROUND */ #define PNG_BACKGROUND_EXPAND 0x0100 #define PNG_EXPAND_16 0x0200 /* Added to libpng 1.5.2 */ #define PNG_16_TO_8 0x0400 /* Becomes 'chop' in 1.5.4 */ #define PNG_RGBA 0x0800 #define PNG_EXPAND 0x1000 #define PNG_GAMMA 0x2000 #define PNG_GRAY_TO_RGB 0x4000 #define PNG_FILLER 0x8000 #define PNG_PACKSWAP 0x10000 #define PNG_SWAP_ALPHA 0x20000 #define PNG_STRIP_ALPHA 0x40000 #define PNG_INVERT_ALPHA 0x80000 #define PNG_USER_TRANSFORM 0x100000 #define PNG_RGB_TO_GRAY_ERR 0x200000 #define PNG_RGB_TO_GRAY_WARN 0x400000 #define PNG_RGB_TO_GRAY 0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */ #define PNG_ENCODE_ALPHA 0x800000 /* Added to libpng-1.5.4 */ #define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */ #define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */ #define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */ /* 0x8000000 unused */ /* 0x10000000 unused */ /* 0x20000000 unused */ /* 0x40000000 unused */ /* Flags for png_create_struct */ #define PNG_STRUCT_PNG 0x0001 #define PNG_STRUCT_INFO 0x0002 /* Scaling factor for filter heuristic weighting calculations */ #define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) #define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) /* Flags for the png_ptr->flags rather than declaring a byte for each one */ #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 #define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002 /* Added to libpng-1.6.0 */ /* 0x0004 unused */ #define PNG_FLAG_ZSTREAM_ENDED 0x0008 /* Added to libpng-1.6.0 */ /* 0x0010 unused */ /* 0x0020 unused */ #define PNG_FLAG_ROW_INIT 0x0040 #define PNG_FLAG_FILLER_AFTER 0x0080 #define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 #define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 #define PNG_FLAG_CRC_CRITICAL_USE 0x0400 #define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 #define PNG_FLAG_ASSUME_sRGB 0x1000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_OPTIMIZE_ALPHA 0x2000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_DETECT_UNINITIALIZED 0x4000 /* Added to libpng-1.5.4 */ /* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000 */ /* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000 */ #define PNG_FLAG_LIBRARY_MISMATCH 0x20000 #define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000 #define PNG_FLAG_STRIP_ERROR_TEXT 0x80000 #define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000 /* Added to libpng-1.4.0 */ #define PNG_FLAG_APP_WARNINGS_WARN 0x200000 /* Added to libpng-1.6.0 */ #define PNG_FLAG_APP_ERRORS_WARN 0x400000 /* Added to libpng-1.6.0 */ /* 0x800000 unused */ /* 0x1000000 unused */ /* 0x2000000 unused */ /* 0x4000000 unused */ /* 0x8000000 unused */ /* 0x10000000 unused */ /* 0x20000000 unused */ /* 0x40000000 unused */ #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ PNG_FLAG_CRC_ANCILLARY_NOWARN) #define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ PNG_FLAG_CRC_CRITICAL_IGNORE) #define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ PNG_FLAG_CRC_CRITICAL_MASK) /* Save typing and make code easier to understand */ #define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ abs((int)((c1).green) - (int)((c2).green)) + \ abs((int)((c1).blue) - (int)((c2).blue))) /* Added to libpng-1.6.0: scale a 16-bit value in the range 0..65535 to 0..255 * by dividing by 257 *with rounding*. This macro is exact for the given range. * See the discourse in pngrtran.c png_do_scale_16_to_8. The values in the * macro were established by experiment (modifying the added value). The macro * has a second variant that takes a value already scaled by 255 and divides by * 65535 - this has a maximum error of .502. Over the range 0..65535*65535 it * only gives off-by-one errors and only for 0.5% (1 in 200) of the values. */ #define PNG_DIV65535(v24) (((v24) + 32895) >> 16) #define PNG_DIV257(v16) PNG_DIV65535((png_uint_32)(v16) * 255) /* Added to libpng-1.2.6 JB */ #define PNG_ROWBYTES(pixel_bits, width) \ ((pixel_bits) >= 8 ? \ ((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \ (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) ) /* PNG_OUT_OF_RANGE returns true if value is outside the range * ideal-delta..ideal+delta. Each argument is evaluated twice. * "ideal" and "delta" should be constants, normally simple * integers, "value" a variable. Added to libpng-1.2.6 JB */ #define PNG_OUT_OF_RANGE(value, ideal, delta) \ ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) /* Conversions between fixed and floating point, only defined if * required (to make sure the code doesn't accidentally use float * when it is supposedly disabled.) */ #ifdef PNG_FLOATING_POINT_SUPPORTED /* The floating point conversion can't overflow, though it can and * does lose accuracy relative to the original fixed point value. * In practice this doesn't matter because png_fixed_point only * stores numbers with very low precision. The png_ptr and s * arguments are unused by default but are there in case error * checking becomes a requirement. */ #define png_float(png_ptr, fixed, s) (.00001 * (fixed)) /* The fixed point conversion performs range checking and evaluates * its argument multiple times, so must be used with care. The * range checking uses the PNG specification values for a signed * 32 bit fixed point value except that the values are deliberately * rounded-to-zero to an integral value - 21474 (21474.83 is roughly * (2^31-1) * 100000). 's' is a string that describes the value being * converted. * * NOTE: this macro will raise a png_error if the range check fails, * therefore it is normally only appropriate to use this on values * that come from API calls or other sources where an out of range * error indicates a programming error, not a data error! * * NOTE: by default this is off - the macro is not used - because the * function call saves a lot of code. */ #ifdef PNG_FIXED_POINT_MACRO_SUPPORTED #define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\ ((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0)) #endif /* else the corresponding function is defined below, inside the scope of the * cplusplus test. */ #endif /* Constants for known chunk types. If you need to add a chunk, define the name * here. For historical reasons these constants have the form png_; i.e. * the prefix is lower case. Please use decimal values as the parameters to * match the ISO PNG specification and to avoid relying on the C locale * interpretation of character values. * * Prior to 1.5.6 these constants were strings, as of 1.5.6 png_uint_32 values * are computed and a new macro (PNG_STRING_FROM_CHUNK) added to allow a string * to be generated if required. * * PNG_32b correctly produces a value shifted by up to 24 bits, even on * architectures where (int) is only 16 bits. */ #define PNG_32b(b,s) ((png_uint_32)(b) << (s)) #define PNG_U32(b1,b2,b3,b4) \ (PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0)) /* Constants for known chunk types. * * MAINTAINERS: If you need to add a chunk, define the name here. * For historical reasons these constants have the form png_; i.e. * the prefix is lower case. Please use decimal values as the parameters to * match the ISO PNG specification and to avoid relying on the C locale * interpretation of character values. Please keep the list sorted. * * Notice that PNG_U32 is used to define a 32-bit value for the 4 byte chunk * type. In fact the specification does not express chunk types this way, * however using a 32-bit value means that the chunk type can be read from the * stream using exactly the same code as used for a 32-bit unsigned value and * can be examined far more efficiently (using one arithmetic compare). * * Prior to 1.5.6 the chunk type constants were expressed as C strings. The * libpng API still uses strings for 'unknown' chunks and a macro, * PNG_STRING_FROM_CHUNK, allows a string to be generated if required. Notice * that for portable code numeric values must still be used; the string "IHDR" * is not portable and neither is PNG_U32('I', 'H', 'D', 'R'). * * In 1.7.0 the definitions will be made public in png.h to avoid having to * duplicate the same definitions in application code. */ #define png_IDAT PNG_U32( 73, 68, 65, 84) #define png_IEND PNG_U32( 73, 69, 78, 68) #define png_IHDR PNG_U32( 73, 72, 68, 82) #define png_PLTE PNG_U32( 80, 76, 84, 69) #define png_bKGD PNG_U32( 98, 75, 71, 68) #define png_cHRM PNG_U32( 99, 72, 82, 77) #define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */ #define png_gAMA PNG_U32(103, 65, 77, 65) #define png_gIFg PNG_U32(103, 73, 70, 103) #define png_gIFt PNG_U32(103, 73, 70, 116) /* deprecated */ #define png_gIFx PNG_U32(103, 73, 70, 120) #define png_hIST PNG_U32(104, 73, 83, 84) #define png_iCCP PNG_U32(105, 67, 67, 80) #define png_iTXt PNG_U32(105, 84, 88, 116) #define png_oFFs PNG_U32(111, 70, 70, 115) #define png_pCAL PNG_U32(112, 67, 65, 76) #define png_pHYs PNG_U32(112, 72, 89, 115) #define png_sBIT PNG_U32(115, 66, 73, 84) #define png_sCAL PNG_U32(115, 67, 65, 76) #define png_sPLT PNG_U32(115, 80, 76, 84) #define png_sRGB PNG_U32(115, 82, 71, 66) #define png_sTER PNG_U32(115, 84, 69, 82) #define png_tEXt PNG_U32(116, 69, 88, 116) #define png_tIME PNG_U32(116, 73, 77, 69) #define png_tRNS PNG_U32(116, 82, 78, 83) #define png_zTXt PNG_U32(122, 84, 88, 116) /* The following will work on (signed char*) strings, whereas the get_uint_32 * macro will fail on top-bit-set values because of the sign extension. */ #define PNG_CHUNK_FROM_STRING(s)\ PNG_U32(0xff&(s)[0], 0xff&(s)[1], 0xff&(s)[2], 0xff&(s)[3]) /* This uses (char), not (png_byte) to avoid warnings on systems where (char) is * signed and the argument is a (char[]) This macro will fail miserably on * systems where (char) is more than 8 bits. */ #define PNG_STRING_FROM_CHUNK(s,c)\ (void)(((char*)(s))[0]=(char)((c)>>24), ((char*)(s))[1]=(char)((c)>>16),\ ((char*)(s))[2]=(char)((c)>>8), ((char*)(s))[3]=(char)((c))) /* Do the same but terminate with a null character. */ #define PNG_CSTRING_FROM_CHUNK(s,c)\ (void)(PNG_STRING_FROM_CHUNK(s,c), ((char*)(s))[4] = 0) /* Test on flag values as defined in the spec (section 5.4): */ #define PNG_CHUNK_ANCILLARY(c) (1 & ((c) >> 29)) #define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c)) #define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21)) #define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13)) #define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5)) /* Gamma values (new at libpng-1.5.4): */ #define PNG_GAMMA_MAC_OLD 151724 /* Assume '1.8' is really 2.2/1.45! */ #define PNG_GAMMA_MAC_INVERSE 65909 #define PNG_GAMMA_sRGB_INVERSE 45455 /* Almost everything below is C specific; the #defines above can be used in * non-C code (so long as it is C-preprocessed) the rest of this stuff cannot. */ #ifndef PNG_VERSION_INFO_ONLY #include "pngstruct.h" #include "pnginfo.h" /* Validate the include paths - the include path used to generate pnglibconf.h * must match that used in the build, or we must be using pnglibconf.h.prebuilt: */ #if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM # error ZLIB_VERNUM != PNG_ZLIB_VERNUM \ "-I (include path) error: see the notes in pngpriv.h" /* This means that when pnglibconf.h was built the copy of zlib.h that it * used is not the same as the one being used here. Because the build of * libpng makes decisions to use inflateInit2 and inflateReset2 based on the * zlib version number and because this affects handling of certain broken * PNG files the -I directives must match. * * The most likely explanation is that you passed a -I in CFLAGS, this will * not work; all the preprocessor directories and in particular all the -I * directives must be in CPPFLAGS. */ #endif /* This is used for 16 bit gamma tables -- only the top level pointers are * const; this could be changed: */ typedef const png_uint_16p * png_const_uint_16pp; /* Added to libpng-1.5.7: sRGB conversion tables */ #if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) #ifdef PNG_SIMPLIFIED_READ_SUPPORTED PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]); /* Convert from an sRGB encoded value 0..255 to a 16-bit linear value, * 0..65535. This table gives the closest 16-bit answers (no errors). */ #endif PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]); PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]); #define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\ ((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8)) /* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB * encoded value with maximum error 0.646365. Note that the input is not a * 16-bit value; it has been multiplied by 255! */ #endif /* PNG_SIMPLIFIED_READ/WRITE */ /* Inhibit C++ name-mangling for libpng functions but not for system calls. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Internal functions; these are not exported from a DLL however because they * are used within several of the C source files they have to be C extern. * * All of these functions must be declared with PNG_INTERNAL_FUNCTION. */ /* Zlib support */ #define PNG_UNEXPECTED_ZLIB_RETURN (-7) PNG_INTERNAL_FUNCTION(void, png_zstream_error,(png_structrp png_ptr, int ret), PNG_EMPTY); /* Used by the zlib handling functions to ensure that z_stream::msg is always * set before they return. */ #ifdef PNG_WRITE_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_free_buffer_list,(png_structrp png_ptr, png_compression_bufferp *list),PNG_EMPTY); /* Free the buffer list used by the compressed write code. */ #endif #if defined(PNG_FLOATING_POINT_SUPPORTED) && \ !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \ (defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \ defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \ (defined(PNG_sCAL_SUPPORTED) && \ defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)) PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr, double fp, png_const_charp text),PNG_EMPTY); #endif /* Check the user version string for compatibility, returns false if the version * numbers aren't compatible. */ PNG_INTERNAL_FUNCTION(int,png_user_version_check,(png_structrp png_ptr, png_const_charp user_png_ver),PNG_EMPTY); /* Internal base allocator - no messages, NULL on failure to allocate. This * does, however, call the application provided allocator and that could call * png_error (although that would be a bug in the application implementation.) */ PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED); #if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\ defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) /* Internal array allocator, outputs no error or warning messages on failure, * just returns NULL. */ PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_array,(png_const_structrp png_ptr, int nelements, size_t element_size),PNG_ALLOCATED); /* The same but an existing array is extended by add_elements. This function * also memsets the new elements to 0 and copies the old elements. The old * array is not freed or altered. */ PNG_INTERNAL_FUNCTION(png_voidp,png_realloc_array,(png_const_structrp png_ptr, png_const_voidp array, int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED); #endif /* text, sPLT or unknown chunks */ /* Magic to create a struct when there is no struct to call the user supplied * memory allocators. Because error handling has not been set up the memory * handlers can't safely call png_error, but this is an obscure and undocumented * restriction so libpng has to assume that the 'free' handler, at least, might * call png_error. */ PNG_INTERNAL_FUNCTION(png_structp,png_create_png_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED); /* Free memory from internal libpng struct */ PNG_INTERNAL_FUNCTION(void,png_destroy_png_struct,(png_structrp png_ptr), PNG_EMPTY); /* Free an allocated jmp_buf (always succeeds) */ PNG_INTERNAL_FUNCTION(void,png_free_jmpbuf,(png_structrp png_ptr),PNG_EMPTY); /* Function to allocate memory for zlib. PNGAPI is disallowed. */ PNG_INTERNAL_FUNCTION(voidpf,png_zalloc,(voidpf png_ptr, uInt items, uInt size), PNG_ALLOCATED); /* Function to free memory for zlib. PNGAPI is disallowed. */ PNG_INTERNAL_FUNCTION(void,png_zfree,(voidpf png_ptr, voidpf ptr),PNG_EMPTY); /* Next four functions are used internally as callbacks. PNGCBAPI is required * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3, changed to * PNGCBAPI at 1.5.0 */ PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_read_data,(png_structp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_push_fill_buffer,(png_structp png_ptr, png_bytep buffer, png_size_t length),PNG_EMPTY); #endif PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_write_data,(png_structp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); #ifdef PNG_WRITE_FLUSH_SUPPORTED # ifdef PNG_STDIO_SUPPORTED PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_flush,(png_structp png_ptr), PNG_EMPTY); # endif #endif /* Reset the CRC variable */ PNG_INTERNAL_FUNCTION(void,png_reset_crc,(png_structrp png_ptr),PNG_EMPTY); /* Write the "data" buffer to whatever output you are using */ PNG_INTERNAL_FUNCTION(void,png_write_data,(png_structrp png_ptr, png_const_bytep data, png_size_t length),PNG_EMPTY); /* Read and check the PNG file signature */ PNG_INTERNAL_FUNCTION(void,png_read_sig,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); /* Read the chunk header (length + type name) */ PNG_INTERNAL_FUNCTION(png_uint_32,png_read_chunk_header,(png_structrp png_ptr), PNG_EMPTY); /* Read data from whatever input you are using into the "data" buffer */ PNG_INTERNAL_FUNCTION(void,png_read_data,(png_structrp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); /* Read bytes into buf, and update png_ptr->crc */ PNG_INTERNAL_FUNCTION(void,png_crc_read,(png_structrp png_ptr, png_bytep buf, png_uint_32 length),PNG_EMPTY); /* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ PNG_INTERNAL_FUNCTION(int,png_crc_finish,(png_structrp png_ptr, png_uint_32 skip),PNG_EMPTY); /* Read the CRC from the file and compare it to the libpng calculated CRC */ PNG_INTERNAL_FUNCTION(int,png_crc_error,(png_structrp png_ptr),PNG_EMPTY); /* Calculate the CRC over a section of data. Note that we are only * passing a maximum of 64K on systems that have this as a memory limit, * since this is the maximum buffer size we can specify. */ PNG_INTERNAL_FUNCTION(void,png_calculate_crc,(png_structrp png_ptr, png_const_bytep ptr, png_size_t length),PNG_EMPTY); #ifdef PNG_WRITE_FLUSH_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_flush,(png_structrp png_ptr),PNG_EMPTY); #endif /* Write various chunks */ /* Write the IHDR chunk, and update the png_struct with the necessary * information. */ PNG_INTERNAL_FUNCTION(void,png_write_IHDR,(png_structrp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int compression_method, int filter_method, int interlace_method),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_write_PLTE,(png_structrp png_ptr, png_const_colorp palette, png_uint_32 num_pal),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_compress_IDAT,(png_structrp png_ptr, png_const_bytep row_data, png_alloc_size_t row_data_length, int flush), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_write_IEND,(png_structrp png_ptr),PNG_EMPTY); #ifdef PNG_WRITE_gAMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_gAMA_fixed,(png_structrp png_ptr, png_fixed_point file_gamma),PNG_EMPTY); #endif #ifdef PNG_WRITE_sBIT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sBIT,(png_structrp png_ptr, png_const_color_8p sbit, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_cHRM_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr, const png_xy *xy), PNG_EMPTY); /* The xy value must have been previously validated */ #endif #ifdef PNG_WRITE_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr, int intent),PNG_EMPTY); #endif #ifdef PNG_WRITE_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr, png_const_charp name, png_const_bytep profile), PNG_EMPTY); /* The profile must have been previously validated for correctness, the * length comes from the first four bytes. Only the base, deflate, * compression is supported. */ #endif #ifdef PNG_WRITE_sPLT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sPLT,(png_structrp png_ptr, png_const_sPLT_tp palette),PNG_EMPTY); #endif #ifdef PNG_WRITE_tRNS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tRNS,(png_structrp png_ptr, png_const_bytep trans, png_const_color_16p values, int number, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_bKGD_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_bKGD,(png_structrp png_ptr, png_const_color_16p values, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_hIST_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_hIST,(png_structrp png_ptr, png_const_uint_16p hist, int num_hist),PNG_EMPTY); #endif /* Chunks that have keywords */ #ifdef PNG_WRITE_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len),PNG_EMPTY); #endif #ifdef PNG_WRITE_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len, int compression),PNG_EMPTY); #endif #ifdef PNG_WRITE_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_iTXt,(png_structrp png_ptr, int compression, png_const_charp key, png_const_charp lang, png_const_charp lang_key, png_const_charp text),PNG_EMPTY); #endif #ifdef PNG_TEXT_SUPPORTED /* Added at version 1.0.14 and 1.2.4 */ PNG_INTERNAL_FUNCTION(int,png_set_text_2,(png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text),PNG_EMPTY); #endif #ifdef PNG_WRITE_oFFs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_oFFs,(png_structrp png_ptr, png_int_32 x_offset, png_int_32 y_offset, int unit_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_pCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_pCAL,(png_structrp png_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params),PNG_EMPTY); #endif #ifdef PNG_WRITE_pHYs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_pHYs,(png_structrp png_ptr, png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, int unit_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_tIME_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tIME,(png_structrp png_ptr, png_const_timep mod_time),PNG_EMPTY); #endif #ifdef PNG_WRITE_sCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sCAL_s,(png_structrp png_ptr, int unit, png_const_charp width, png_const_charp height),PNG_EMPTY); #endif /* Called when finished processing a row of data */ PNG_INTERNAL_FUNCTION(void,png_write_finish_row,(png_structrp png_ptr), PNG_EMPTY); /* Internal use only. Called before first row of data */ PNG_INTERNAL_FUNCTION(void,png_write_start_row,(png_structrp png_ptr), PNG_EMPTY); /* Combine a row of data, dealing with alpha, etc. if requested. 'row' is an * array of png_ptr->width pixels. If the image is not interlaced or this * is the final pass this just does a memcpy, otherwise the "display" flag * is used to determine whether to copy pixels that are not in the current pass. * * Because 'png_do_read_interlace' (below) replicates pixels this allows this * function to achieve the documented 'blocky' appearance during interlaced read * if display is 1 and the 'sparkle' appearance, where existing pixels in 'row' * are not changed if they are not in the current pass, when display is 0. * * 'display' must be 0 or 1, otherwise the memcpy will be done regardless. * * The API always reads from the png_struct row buffer and always assumes that * it is full width (png_do_read_interlace has already been called.) * * This function is only ever used to write to row buffers provided by the * caller of the relevant libpng API and the row must have already been * transformed by the read transformations. * * The PNG_USE_COMPILE_TIME_MASKS option causes generation of pre-computed * bitmasks for use within the code, otherwise runtime generated masks are used. * The default is compile time masks. */ #ifndef PNG_USE_COMPILE_TIME_MASKS # define PNG_USE_COMPILE_TIME_MASKS 1 #endif PNG_INTERNAL_FUNCTION(void,png_combine_row,(png_const_structrp png_ptr, png_bytep row, int display),PNG_EMPTY); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Expand an interlaced row: the 'row_info' describes the pass data that has * been read in and must correspond to the pixels in 'row', the pixels are * expanded (moved apart) in 'row' to match the final layout, when doing this * the pixels are *replicated* to the intervening space. This is essential for * the correct operation of png_combine_row, above. */ PNG_INTERNAL_FUNCTION(void,png_do_read_interlace,(png_row_infop row_info, png_bytep row, int pass, png_uint_32 transformations),PNG_EMPTY); #endif /* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ #ifdef PNG_WRITE_INTERLACING_SUPPORTED /* Grab pixels out of a row for an interlaced pass */ PNG_INTERNAL_FUNCTION(void,png_do_write_interlace,(png_row_infop row_info, png_bytep row, int pass),PNG_EMPTY); #endif /* Unfilter a row: check the filter value before calling this, there is no point * calling it for PNG_FILTER_VALUE_NONE. */ PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); /* Choose the best filter to use and filter the row data */ PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr, png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY); /* Read 'avail_out' bytes of data from the IDAT stream. If the output buffer * is NULL the function checks, instead, for the end of the stream. In this * case a benign error will be issued if the stream end is not found or if * extra data has to be consumed. */ PNG_INTERNAL_FUNCTION(void,png_read_finish_IDAT,(png_structrp png_ptr), PNG_EMPTY); /* This cleans up when the IDAT LZ stream does not end when the last image * byte is read; there is still some pending input. */ PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr), PNG_EMPTY); /* Finish a row while reading, dealing with interlacing passes, etc. */ #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ /* Initialize the row buffers, etc. */ PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY); #ifdef PNG_READ_TRANSFORMS_SUPPORTED /* Optional call to update the users info structure */ PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); #endif /* Shared transform functions, defined in pngtran.c */ #if defined(PNG_WRITE_FILLER_SUPPORTED) || \ defined(PNG_READ_STRIP_ALPHA_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info, png_bytep row, int at_start),PNG_EMPTY); #endif #ifdef PNG_16BIT_SUPPORTED #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_swap,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_packswap,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif /* The following decodes the appropriate chunks, and does error correction, * then calls the appropriate callback for the chunk if it is valid. */ /* Decode the IHDR chunk */ PNG_INTERNAL_FUNCTION(void,png_handle_IHDR,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_PLTE,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_IEND,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #ifdef PNG_READ_bKGD_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_bKGD,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_cHRM_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_gAMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_hIST_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_hIST,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_iCCP,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif /* PNG_READ_iCCP_SUPPORTED */ #ifdef PNG_READ_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_iTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_oFFs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_oFFs,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_pCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_pCAL,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_pHYs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_pHYs,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sBIT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sBIT,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sCAL,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sPLT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sPLT,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif /* PNG_READ_sPLT_SUPPORTED */ #ifdef PNG_READ_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sRGB,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tEXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tIME_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tIME,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tRNS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tRNS,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY); /* This is the function that gets called for unknown chunks. The 'keep' * argument is either non-zero for a known chunk that has been set to be * handled as unknown or zero for an unknown chunk. By default the function * just skips the chunk or errors out if it is critical. */ #if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\ defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) PNG_INTERNAL_FUNCTION(int,png_chunk_unknown_handling, (png_const_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY); /* Exactly as the API png_handle_as_unknown() except that the argument is a * 32-bit chunk name, not a string. */ #endif /* READ_UNKNOWN_CHUNKS || HANDLE_AS_UNKNOWN */ /* Handle the transformations for reading and writing */ #ifdef PNG_READ_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_do_read_transformations,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_do_write_transformations,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #ifdef PNG_READ_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_init_read_transformations,(png_structrp png_ptr), PNG_EMPTY); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_read_chunk,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_sig,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_crc_skip,(png_structrp png_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_crc_finish,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr, png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_IDAT,(png_structrp png_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_process_IDAT_data,(png_structrp png_ptr, png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_handle_unknown,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr, png_bytep row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr), PNG_EMPTY); # ifdef PNG_READ_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_tEXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_tEXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif # ifdef PNG_READ_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_zTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_zTXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif # ifdef PNG_READ_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_iTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ /* Added at libpng version 1.6.0 */ #ifdef PNG_GAMMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_fixed_point gAMA), PNG_EMPTY); /* Set the colorspace gamma with a value provided by the application or by * the gAMA chunk on read. The value will override anything set by an ICC * profile. */ PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); /* Synchronize the info 'valid' flags with the colorspace */ PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); /* Copy the png_struct colorspace to the info_struct and call the above to * synchronize the flags. Checks for NULL info_ptr and does nothing. */ #endif /* Added at libpng version 1.4.0 */ #ifdef PNG_COLORSPACE_SUPPORTED /* These internal functions are for maintaining the colorspace structure within * a png_info or png_struct (or, indeed, both). */ PNG_INTERNAL_FUNCTION(int,png_colorspace_set_chromaticities, (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy, int preferred), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_colorspace_set_endpoints, (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_XYZ *XYZ, int preferred), PNG_EMPTY); #ifdef PNG_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(int,png_colorspace_set_sRGB,(png_const_structrp png_ptr, png_colorspacerp colorspace, int intent), PNG_EMPTY); /* This does set the colorspace gAMA and cHRM values too, but doesn't set the * flags to write them, if it returns false there was a problem and an error * message has already been output (but the colorspace may still need to be * synced to record the invalid flag). */ #endif /* sRGB */ #ifdef PNG_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, int color_type), PNG_EMPTY); /* The 'name' is used for information only */ /* Routines for checking parts of an ICC profile. */ PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile /* first 132 bytes only */, int color_type), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_icc_check_tag_table,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile /* header plus whole tag table */), PNG_EMPTY); #ifdef PNG_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_icc_set_sRGB,( png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_bytep profile, uLong adler), PNG_EMPTY); /* 'adler' is the Adler32 checksum of the uncompressed profile data. It may * be zero to indicate that it is not available. It is used, if provided, * as a fast check on the profile when checking to see if it is sRGB. */ #endif #endif /* iCCP */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_colorspace_set_rgb_coefficients, (png_structrp png_ptr), PNG_EMPTY); /* Set the rgb_to_gray coefficients from the colorspace Y values */ #endif /* READ_RGB_TO_GRAY */ #endif /* COLORSPACE */ /* Added at libpng version 1.4.0 */ PNG_INTERNAL_FUNCTION(void,png_check_IHDR,(png_const_structrp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type),PNG_EMPTY); /* Added at libpng version 1.5.10 */ #if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_check_palette_indexes, (png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN); #endif /* Puts 'string' into 'buffer' at buffer[pos], taking care never to overwrite * the end. Always leaves the buffer nul terminated. Never errors out (and * there is no error code.) */ PNG_INTERNAL_FUNCTION(size_t,png_safecat,(png_charp buffer, size_t bufsize, size_t pos, png_const_charp string),PNG_EMPTY); /* Various internal functions to handle formatted warning messages, currently * only implemented for warnings. */ #if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_TIME_RFC1123_SUPPORTED) /* Utility to dump an unsigned value into a buffer, given a start pointer and * and end pointer (which should point just *beyond* the end of the buffer!) * Returns the pointer to the start of the formatted string. This utility only * does unsigned values. */ PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start, png_charp end, int format, png_alloc_size_t number),PNG_EMPTY); /* Convenience macro that takes an array: */ #define PNG_FORMAT_NUMBER(buffer,format,number) \ png_format_number(buffer, buffer + (sizeof buffer), format, number) /* Suggested size for a number buffer (enough for 64 bits and a sign!) */ #define PNG_NUMBER_BUFFER_SIZE 24 /* These are the integer formats currently supported, the name is formed from * the standard printf(3) format string. */ #define PNG_NUMBER_FORMAT_u 1 /* chose unsigned API! */ #define PNG_NUMBER_FORMAT_02u 2 #define PNG_NUMBER_FORMAT_d 1 /* chose signed API! */ #define PNG_NUMBER_FORMAT_02d 2 #define PNG_NUMBER_FORMAT_x 3 #define PNG_NUMBER_FORMAT_02x 4 #define PNG_NUMBER_FORMAT_fixed 5 /* choose the signed API */ #endif #ifdef PNG_WARNINGS_SUPPORTED /* New defines and members adding in libpng-1.5.4 */ # define PNG_WARNING_PARAMETER_SIZE 32 # define PNG_WARNING_PARAMETER_COUNT 8 /* Maximum 9; see pngerror.c */ /* An l-value of this type has to be passed to the APIs below to cache the * values of the parameters to a formatted warning message. */ typedef char png_warning_parameters[PNG_WARNING_PARAMETER_COUNT][ PNG_WARNING_PARAMETER_SIZE]; PNG_INTERNAL_FUNCTION(void,png_warning_parameter,(png_warning_parameters p, int number, png_const_charp string),PNG_EMPTY); /* Parameters are limited in size to PNG_WARNING_PARAMETER_SIZE characters, * including the trailing '\0'. */ PNG_INTERNAL_FUNCTION(void,png_warning_parameter_unsigned, (png_warning_parameters p, int number, int format, png_alloc_size_t value), PNG_EMPTY); /* Use png_alloc_size_t because it is an unsigned type as big as any we * need to output. Use the following for a signed value. */ PNG_INTERNAL_FUNCTION(void,png_warning_parameter_signed, (png_warning_parameters p, int number, int format, png_int_32 value), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_formatted_warning,(png_const_structrp png_ptr, png_warning_parameters p, png_const_charp message),PNG_EMPTY); /* 'message' follows the X/Open approach of using @1, @2 to insert * parameters previously supplied using the above functions. Errors in * specifying the parameters will simply result in garbage substitutions. */ #endif #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Application errors (new in 1.6); use these functions (declared below) for * errors in the parameters or order of API function calls on read. The * 'warning' should be used for an error that can be handled completely; the * 'error' for one which can be handled safely but which may lose application * information or settings. * * By default these both result in a png_error call prior to release, while in a * released version the 'warning' is just a warning. However if the application * explicitly disables benign errors (explicitly permitting the code to lose * information) they both turn into warnings. * * If benign errors aren't supported they end up as the corresponding base call * (png_warning or png_error.) */ PNG_INTERNAL_FUNCTION(void,png_app_warning,(png_const_structrp png_ptr, png_const_charp message),PNG_EMPTY); /* The application provided invalid parameters to an API function or called * an API function at the wrong time, libpng can completely recover. */ PNG_INTERNAL_FUNCTION(void,png_app_error,(png_const_structrp png_ptr, png_const_charp message),PNG_EMPTY); /* As above but libpng will ignore the call, or attempt some other partial * recovery from the error. */ #else # define png_app_warning(pp,s) png_warning(pp,s) # define png_app_error(pp,s) png_error(pp,s) #endif PNG_INTERNAL_FUNCTION(void,png_chunk_report,(png_const_structrp png_ptr, png_const_charp message, int error),PNG_EMPTY); /* Report a recoverable issue in chunk data. On read this is used to report * a problem found while reading a particular chunk and the * png_chunk_benign_error or png_chunk_warning function is used as * appropriate. On write this is used to report an error that comes from * data set via an application call to a png_set_ API and png_app_error or * png_app_warning is used as appropriate. * * The 'error' parameter must have one of the following values: */ #define PNG_CHUNK_WARNING 0 /* never an error */ #define PNG_CHUNK_WRITE_ERROR 1 /* an error only on write */ #define PNG_CHUNK_ERROR 2 /* always an error */ /* ASCII to FP interfaces, currently only implemented if sCAL * support is required. */ #if defined(PNG_sCAL_SUPPORTED) /* MAX_DIGITS is actually the maximum number of characters in an sCAL * width or height, derived from the precision (number of significant * digits - a build time settable option) and assumptions about the * maximum ridiculous exponent. */ #define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/) #ifdef PNG_FLOATING_POINT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_ascii_from_fp,(png_const_structrp png_ptr, png_charp ascii, png_size_t size, double fp, unsigned int precision), PNG_EMPTY); #endif /* FLOATING_POINT */ #ifdef PNG_FIXED_POINT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr, png_charp ascii, png_size_t size, png_fixed_point fp),PNG_EMPTY); #endif /* FIXED_POINT */ #endif /* sCAL */ #if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) /* An internal API to validate the format of a floating point number. * The result is the index of the next character. If the number is * not valid it will be the index of a character in the supposed number. * * The format of a number is defined in the PNG extensions specification * and this API is strictly conformant to that spec, not anyone elses! * * The format as a regular expression is: * * [+-]?[0-9]+.?([Ee][+-]?[0-9]+)? * * or: * * [+-]?.[0-9]+(.[0-9]+)?([Ee][+-]?[0-9]+)? * * The complexity is that either integer or fraction must be present and the * fraction is permitted to have no digits only if the integer is present. * * NOTE: The dangling E problem. * There is a PNG valid floating point number in the following: * * PNG floating point numbers are not greedy. * * Working this out requires *TWO* character lookahead (because of the * sign), the parser does not do this - it will fail at the 'r' - this * doesn't matter for PNG sCAL chunk values, but it requires more care * if the value were ever to be embedded in something more complex. Use * ANSI-C strtod if you need the lookahead. */ /* State table for the parser. */ #define PNG_FP_INTEGER 0 /* before or in integer */ #define PNG_FP_FRACTION 1 /* before or in fraction */ #define PNG_FP_EXPONENT 2 /* before or in exponent */ #define PNG_FP_STATE 3 /* mask for the above */ #define PNG_FP_SAW_SIGN 4 /* Saw +/- in current state */ #define PNG_FP_SAW_DIGIT 8 /* Saw a digit in current state */ #define PNG_FP_SAW_DOT 16 /* Saw a dot in current state */ #define PNG_FP_SAW_E 32 /* Saw an E (or e) in current state */ #define PNG_FP_SAW_ANY 60 /* Saw any of the above 4 */ /* These three values don't affect the parser. They are set but not used. */ #define PNG_FP_WAS_VALID 64 /* Preceding substring is a valid fp number */ #define PNG_FP_NEGATIVE 128 /* A negative number, including "-0" */ #define PNG_FP_NONZERO 256 /* A non-zero value */ #define PNG_FP_STICKY 448 /* The above three flags */ /* This is available for the caller to store in 'state' if required. Do not * call the parser after setting it (the parser sometimes clears it.) */ #define PNG_FP_INVALID 512 /* Available for callers as a distinct value */ /* Result codes for the parser (boolean - true meants ok, false means * not ok yet.) */ #define PNG_FP_MAYBE 0 /* The number may be valid in the future */ #define PNG_FP_OK 1 /* The number is valid */ /* Tests on the sticky non-zero and negative flags. To pass these checks * the state must also indicate that the whole number is valid - this is * achieved by testing PNG_FP_SAW_DIGIT (see the implementation for why this * is equivalent to PNG_FP_OK above.) */ #define PNG_FP_NZ_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NEGATIVE | PNG_FP_NONZERO) /* NZ_MASK: the string is valid and a non-zero negative value */ #define PNG_FP_Z_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NONZERO) /* Z MASK: the string is valid and a non-zero value. */ /* PNG_FP_SAW_DIGIT: the string is valid. */ #define PNG_FP_IS_ZERO(state) (((state) & PNG_FP_Z_MASK) == PNG_FP_SAW_DIGIT) #define PNG_FP_IS_POSITIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_Z_MASK) #define PNG_FP_IS_NEGATIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_NZ_MASK) /* The actual parser. This can be called repeatedly. It updates * the index into the string and the state variable (which must * be initialized to 0). It returns a result code, as above. There * is no point calling the parser any more if it fails to advance to * the end of the string - it is stuck on an invalid character (or * terminated by '\0'). * * Note that the pointer will consume an E or even an E+ and then leave * a 'maybe' state even though a preceding integer.fraction is valid. * The PNG_FP_WAS_VALID flag indicates that a preceding substring was * a valid number. It's possible to recover from this by calling * the parser again (from the start, with state 0) but with a string * that omits the last character (i.e. set the size to the index of * the problem character.) This has not been tested within libpng. */ PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string, png_size_t size, int *statep, png_size_tp whereami),PNG_EMPTY); /* This is the same but it checks a complete string and returns true * only if it just contains a floating point number. As of 1.5.4 this * function also returns the state at the end of parsing the number if * it was valid (otherwise it returns 0.) This can be used for testing * for negative or zero values using the sticky flag. */ PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string, png_size_t size),PNG_EMPTY); #endif /* pCAL || sCAL */ #if defined(PNG_GAMMA_SUPPORTED) ||\ defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED) /* Added at libpng version 1.5.0 */ /* This is a utility to provide a*times/div (rounded) and indicate * if there is an overflow. The result is a boolean - false (0) * for overflow, true (1) if no overflow, in which case *res * holds the result. */ PNG_INTERNAL_FUNCTION(int,png_muldiv,(png_fixed_point_p res, png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY); #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED) /* Same deal, but issue a warning on overflow and return 0. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_muldiv_warn, (png_const_structrp png_ptr, png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY); #endif #ifdef PNG_GAMMA_SUPPORTED /* Calculate a reciprocal - used for gamma values. This returns * 0 if the argument is 0 in order to maintain an undefined value; * there are no warnings. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal,(png_fixed_point a), PNG_EMPTY); #ifdef PNG_READ_GAMMA_SUPPORTED /* The same but gives a reciprocal of the product of two fixed point * values. Accuracy is suitable for gamma calculations but this is * not exact - use png_muldiv for that. Only required at present on read. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal2,(png_fixed_point a, png_fixed_point b),PNG_EMPTY); #endif /* Return true if the gamma value is significantly different from 1.0 */ PNG_INTERNAL_FUNCTION(int,png_gamma_significant,(png_fixed_point gamma_value), PNG_EMPTY); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* Internal fixed point gamma correction. These APIs are called as * required to convert single values - they don't need to be fast, * they are not used when processing image pixel values. * * While the input is an 'unsigned' value it must actually be the * correct bit value - 0..255 or 0..65535 as required. */ PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_correct,(png_structrp png_ptr, unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_16bit_correct,(unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(png_byte,png_gamma_8bit_correct,(unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_destroy_gamma_table,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_build_gamma_table,(png_structrp png_ptr, int bit_depth),PNG_EMPTY); #endif /* SIMPLIFIED READ/WRITE SUPPORT */ #if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) /* The internal structure that png_image::opaque points to. */ typedef struct png_control { png_structp png_ptr; png_infop info_ptr; png_voidp error_buf; /* Always a jmp_buf at present. */ png_const_bytep memory; /* Memory buffer. */ png_size_t size; /* Size of the memory buffer. */ unsigned int for_write :1; /* Otherwise it is a read structure */ unsigned int owned_file :1; /* We own the file in io_ptr */ } png_control; /* Return the pointer to the jmp_buf from a png_control: necessary because C * does not reveal the type of the elements of jmp_buf. */ #ifdef __cplusplus # define png_control_jmp_buf(pc) (((jmp_buf*)((pc)->error_buf))[0]) #else # define png_control_jmp_buf(pc) ((pc)->error_buf) #endif /* Utility to safely execute a piece of libpng code catching and logging any * errors that might occur. Returns true on success, false on failure (either * of the function or as a result of a png_error.) */ PNG_INTERNAL_CALLBACK(void,png_safe_error,(png_structp png_ptr, png_const_charp error_message),PNG_NORETURN); #ifdef PNG_WARNINGS_SUPPORTED PNG_INTERNAL_CALLBACK(void,png_safe_warning,(png_structp png_ptr, png_const_charp warning_message),PNG_EMPTY); #else # define png_safe_warning 0/*dummy argument*/ #endif PNG_INTERNAL_FUNCTION(int,png_safe_execute,(png_imagep image, int (*function)(png_voidp), png_voidp arg),PNG_EMPTY); /* Utility to log an error; this also cleans up the png_image; the function * always returns 0 (false). */ PNG_INTERNAL_FUNCTION(int,png_image_error,(png_imagep image, png_const_charp error_message),PNG_EMPTY); #ifndef PNG_SIMPLIFIED_READ_SUPPORTED /* png_image_free is used by the write code but not exported */ PNG_INTERNAL_FUNCTION(void, png_image_free, (png_imagep image), PNG_EMPTY); #endif /* !SIMPLIFIED_READ */ #endif /* SIMPLIFIED READ/WRITE */ /* These are initialization functions for hardware specific PNG filter * optimizations; list these here then select the appropriate one at compile * time using the macro PNG_FILTER_OPTIMIZATIONS. If the macro is not defined * the generic code is used. */ #ifdef PNG_FILTER_OPTIMIZATIONS PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); /* Just declare the optimization that will be used */ #else /* List *all* the possible optimizations here - this branch is required if * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing. */ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); #endif /* Maintainer: Put new private prototypes here ^ */ #include "pngdebug.h" #ifdef __cplusplus } #endif #endif /* PNG_VERSION_INFO_ONLY */ #endif /* PNGPRIV_H */ ================================================ FILE: Libraries/Core/Windows/Headers/png/pngstruct.h ================================================ /* pngstruct.h - header file for PNG reference library * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.1 [March 28, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* The structure that holds the information to read and write PNG files. * The only people who need to care about what is inside of this are the * people who will be modifying the library for their own special needs. * It should NOT be accessed directly by an application. */ #ifndef PNGSTRUCT_H #define PNGSTRUCT_H /* zlib.h defines the structure z_stream, an instance of which is included * in this structure and is required for decompressing the LZ compressed * data in PNG files. */ #ifndef ZLIB_CONST /* We must ensure that zlib uses 'const' in declarations. */ # define ZLIB_CONST #endif #include "zlib.h" #ifdef const /* zlib.h sometimes #defines const to nothing, undo this. */ # undef const #endif /* zlib.h has mediocre z_const use before 1.2.6, this stuff is for compatibility * with older builds. */ #if ZLIB_VERNUM < 0x1260 # define PNGZ_MSG_CAST(s) png_constcast(char*,s) # define PNGZ_INPUT_CAST(b) png_constcast(png_bytep,b) #else # define PNGZ_MSG_CAST(s) (s) # define PNGZ_INPUT_CAST(b) (b) #endif /* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib * can handle at once. This type need be no larger than 16 bits (so maximum of * 65535), this define allows us to discover how big it is, but limited by the * maximuum for png_size_t. The value can be overriden in a library build * (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably * lower value (e.g. 255 works). A lower value may help memory usage (slightly) * and may even improve performance on some systems (and degrade it on others.) */ #ifndef ZLIB_IO_MAX # define ZLIB_IO_MAX ((uInt)-1) #endif #ifdef PNG_WRITE_SUPPORTED /* The type of a compression buffer list used by the write code. */ typedef struct png_compression_buffer { struct png_compression_buffer *next; png_byte output[1]; /* actually zbuf_size */ } png_compression_buffer, *png_compression_bufferp; #define PNG_COMPRESSION_BUFFER_SIZE(pp)\ (offsetof(png_compression_buffer, output) + (pp)->zbuffer_size) #endif /* Colorspace support; structures used in png_struct, png_info and in internal * functions to hold and communicate information about the color space. * * PNG_COLORSPACE_SUPPORTED is only required if the application will perform * colorspace corrections, otherwise all the colorspace information can be * skipped and the size of libpng can be reduced (significantly) by compiling * out the colorspace support. */ #ifdef PNG_COLORSPACE_SUPPORTED /* The chromaticities of the red, green and blue colorants and the chromaticity * of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)). */ typedef struct png_xy { png_fixed_point redx, redy; png_fixed_point greenx, greeny; png_fixed_point bluex, bluey; png_fixed_point whitex, whitey; } png_xy; /* The same data as above but encoded as CIE XYZ values. When this data comes * from chromaticities the sum of the Y values is assumed to be 1.0 */ typedef struct png_XYZ { png_fixed_point red_X, red_Y, red_Z; png_fixed_point green_X, green_Y, green_Z; png_fixed_point blue_X, blue_Y, blue_Z; } png_XYZ; #endif /* COLORSPACE */ #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) /* A colorspace is all the above plus, potentially, profile information, * however at present libpng does not use the profile internally so it is only * stored in the png_info struct (if iCCP is supported.) The rendering intent * is retained here and is checked. * * The file gamma encoding information is also stored here and gamma correction * is done by libpng, whereas color correction must currently be done by the * application. */ typedef struct png_colorspace { #ifdef PNG_GAMMA_SUPPORTED png_fixed_point gamma; /* File gamma */ #endif #ifdef PNG_COLORSPACE_SUPPORTED png_xy end_points_xy; /* End points as chromaticities */ png_XYZ end_points_XYZ; /* End points as CIE XYZ colorant values */ png_uint_16 rendering_intent; /* Rendering intent of a profile */ #endif /* Flags are always defined to simplify the code. */ png_uint_16 flags; /* As defined below */ } png_colorspace, * PNG_RESTRICT png_colorspacerp; typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp; /* General flags for the 'flags' field */ #define PNG_COLORSPACE_HAVE_GAMMA 0x0001 #define PNG_COLORSPACE_HAVE_ENDPOINTS 0x0002 #define PNG_COLORSPACE_HAVE_INTENT 0x0004 #define PNG_COLORSPACE_FROM_gAMA 0x0008 #define PNG_COLORSPACE_FROM_cHRM 0x0010 #define PNG_COLORSPACE_FROM_sRGB 0x0020 #define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040 #define PNG_COLORSPACE_MATCHES_sRGB 0x0080 /* exact match on profile */ #define PNG_COLORSPACE_INVALID 0x8000 #define PNG_COLORSPACE_CANCEL(flags) (0xffff ^ (flags)) #endif /* COLORSPACE || GAMMA */ struct png_struct_def { #ifdef PNG_SETJMP_SUPPORTED jmp_buf jmp_buf_local; /* New name in 1.6.0 for jmp_buf in png_struct */ png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */ jmp_buf *jmp_buf_ptr; /* passed to longjmp_fn */ size_t jmp_buf_size; /* size of the above, if allocated */ #endif png_error_ptr error_fn; /* function for printing errors and aborting */ #ifdef PNG_WARNINGS_SUPPORTED png_error_ptr warning_fn; /* function for printing warnings */ #endif png_voidp error_ptr; /* user supplied struct for error functions */ png_rw_ptr write_data_fn; /* function for writing output data */ png_rw_ptr read_data_fn; /* function for reading input data */ png_voidp io_ptr; /* ptr to application struct for I/O functions */ #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED png_user_transform_ptr read_user_transform_fn; /* user read transform */ #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED png_user_transform_ptr write_user_transform_fn; /* user write transform */ #endif /* These were added in libpng-1.0.2 */ #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) png_voidp user_transform_ptr; /* user supplied struct for user transform */ png_byte user_transform_depth; /* bit depth of user transformed pixels */ png_byte user_transform_channels; /* channels in user transformed pixels */ #endif #endif png_uint_32 mode; /* tells us where we are in the PNG file */ png_uint_32 flags; /* flags indicating various things to libpng */ png_uint_32 transformations; /* which transformations to perform */ png_uint_32 zowner; /* ID (chunk type) of zstream owner, 0 if none */ z_stream zstream; /* decompression structure */ #ifdef PNG_WRITE_SUPPORTED png_compression_bufferp zbuffer_list; /* Created on demand during write */ uInt zbuffer_size; /* size of the actual buffer */ int zlib_level; /* holds zlib compression level */ int zlib_method; /* holds zlib compression method */ int zlib_window_bits; /* holds zlib compression window bits */ int zlib_mem_level; /* holds zlib compression memory level */ int zlib_strategy; /* holds zlib compression strategy */ #endif /* Added at libpng 1.5.4 */ #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED int zlib_text_level; /* holds zlib compression level */ int zlib_text_method; /* holds zlib compression method */ int zlib_text_window_bits; /* holds zlib compression window bits */ int zlib_text_mem_level; /* holds zlib compression memory level */ int zlib_text_strategy; /* holds zlib compression strategy */ #endif /* End of material added at libpng 1.5.4 */ /* Added at libpng 1.6.0 */ #ifdef PNG_WRITE_SUPPORTED int zlib_set_level; /* Actual values set into the zstream on write */ int zlib_set_method; int zlib_set_window_bits; int zlib_set_mem_level; int zlib_set_strategy; #endif png_uint_32 width; /* width of image in pixels */ png_uint_32 height; /* height of image in pixels */ png_uint_32 num_rows; /* number of rows in current pass */ png_uint_32 usr_width; /* width of row at start of write */ png_size_t rowbytes; /* size of row in bytes */ png_uint_32 iwidth; /* width of current interlaced row in pixels */ png_uint_32 row_number; /* current row in interlace pass */ png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */ png_bytep prev_row; /* buffer to save previous (unfiltered) row. * This is a pointer into big_prev_row */ png_bytep row_buf; /* buffer to save current (unfiltered) row. * This is a pointer into big_row_buf */ #ifdef PNG_WRITE_SUPPORTED png_bytep sub_row; /* buffer to save "sub" row when filtering */ png_bytep up_row; /* buffer to save "up" row when filtering */ png_bytep avg_row; /* buffer to save "avg" row when filtering */ png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ #endif png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */ png_uint_32 idat_size; /* current IDAT size for read */ png_uint_32 crc; /* current chunk CRC value */ png_colorp palette; /* palette from the input file */ png_uint_16 num_palette; /* number of color entries in palette */ /* Added at libpng-1.5.10 */ #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED int num_palette_max; /* maximum palette index found in IDAT */ #endif png_uint_16 num_trans; /* number of transparency values */ png_byte compression; /* file compression type (always 0) */ png_byte filter; /* file filter type (always 0) */ png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ png_byte pass; /* current interlace pass (0 - 6) */ png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ png_byte color_type; /* color type of file */ png_byte bit_depth; /* bit depth of file */ png_byte usr_bit_depth; /* bit depth of users row: write only */ png_byte pixel_depth; /* number of bits per pixel */ png_byte channels; /* number of channels in file */ #ifdef PNG_WRITE_SUPPORTED png_byte usr_channels; /* channels at start of write: write only */ #endif png_byte sig_bytes; /* magic bytes read/written from start of file */ png_byte maximum_pixel_depth; /* pixel depth used for the row buffers */ png_byte transformed_pixel_depth; /* pixel depth after read/write transforms */ #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) png_uint_16 filler; /* filler bytes for pixel expansion */ #endif #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ defined(PNG_READ_ALPHA_MODE_SUPPORTED) png_byte background_gamma_type; png_fixed_point background_gamma; png_color_16 background; /* background color in screen gamma space */ #ifdef PNG_READ_GAMMA_SUPPORTED png_color_16 background_1; /* background normalized to gamma 1.0 */ #endif #endif /* PNG_bKGD_SUPPORTED */ #ifdef PNG_WRITE_FLUSH_SUPPORTED png_flush_ptr output_flush_fn; /* Function for flushing output */ png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ png_uint_32 flush_rows; /* number of rows written since last flush */ #endif #ifdef PNG_READ_GAMMA_SUPPORTED int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */ png_bytep gamma_table; /* gamma table for 8-bit depth files */ png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) png_bytep gamma_from_1; /* converts from 1.0 to screen */ png_bytep gamma_to_1; /* converts from file to 1.0 */ png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) png_color_8 sig_bit; /* significant bits in each available channel */ #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) png_color_8 shift; /* shift for significant bit tranformation */ #endif #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) png_bytep trans_alpha; /* alpha values for paletted files */ png_color_16 trans_color; /* transparent color for non-paletted files */ #endif png_read_status_ptr read_row_fn; /* called after each row is decoded */ png_write_status_ptr write_row_fn; /* called after each row is encoded */ #ifdef PNG_PROGRESSIVE_READ_SUPPORTED png_progressive_info_ptr info_fn; /* called after header data fully read */ png_progressive_row_ptr row_fn; /* called after a prog. row is decoded */ png_progressive_end_ptr end_fn; /* called after image is complete */ png_bytep save_buffer_ptr; /* current location in save_buffer */ png_bytep save_buffer; /* buffer for previously read data */ png_bytep current_buffer_ptr; /* current location in current_buffer */ png_bytep current_buffer; /* buffer for recently used data */ png_uint_32 push_length; /* size of current input chunk */ png_uint_32 skip_length; /* bytes to skip in input data */ png_size_t save_buffer_size; /* amount of data now in save_buffer */ png_size_t save_buffer_max; /* total size of save_buffer */ png_size_t buffer_size; /* total amount of available input data */ png_size_t current_buffer_size; /* amount of data now in current_buffer */ int process_mode; /* what push library is currently doing */ int cur_palette; /* current push library palette index */ #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) /* For the Borland special 64K segment handler */ png_bytepp offset_table_ptr; png_bytep offset_table; png_uint_16 offset_table_number; png_uint_16 offset_table_count; png_uint_16 offset_table_count_free; #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED png_bytep palette_lookup; /* lookup table for quantizing */ png_bytep quantize_index; /* index translation for palette files */ #endif #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED png_byte heuristic_method; /* heuristic for row filter selection */ png_byte num_prev_filters; /* number of weights for previous rows */ png_bytep prev_filters; /* filter type(s) of previous row(s) */ png_uint_16p filter_weights; /* weight(s) for previous line(s) */ png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ png_uint_16p filter_costs; /* relative filter calculation cost */ png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ #endif /* Options */ #ifdef PNG_SET_OPTION_SUPPORTED png_byte options; /* On/off state (up to 4 options) */ #endif #if PNG_LIBPNG_VER < 10700 /* To do: remove this from libpng-1.7 */ #ifdef PNG_TIME_RFC1123_SUPPORTED char time_buffer[29]; /* String to hold RFC 1123 time text */ #endif #endif /* New members added in libpng-1.0.6 */ png_uint_32 free_me; /* flags items libpng is responsible for freeing */ #ifdef PNG_USER_CHUNKS_SUPPORTED png_voidp user_chunk_ptr; #ifdef PNG_READ_USER_CHUNKS_SUPPORTED png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ #endif #endif #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED int unknown_default; /* As PNG_HANDLE_* */ unsigned int num_chunk_list; /* Number of entries in the list */ png_bytep chunk_list; /* List of png_byte[5]; the textual chunk name * followed by a PNG_HANDLE_* byte */ #endif /* New members added in libpng-1.0.3 */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED png_byte rgb_to_gray_status; /* Added in libpng 1.5.5 to record setting of coefficients: */ png_byte rgb_to_gray_coefficients_set; /* These were changed from png_byte in libpng-1.0.6 */ png_uint_16 rgb_to_gray_red_coeff; png_uint_16 rgb_to_gray_green_coeff; /* deleted in 1.5.5: rgb_to_gray_blue_coeff; */ #endif /* New member added in libpng-1.0.4 (renamed in 1.0.9) */ #if defined(PNG_MNG_FEATURES_SUPPORTED) /* Changed from png_byte to png_uint_32 at version 1.2.0 */ png_uint_32 mng_features_permitted; #endif /* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ #ifdef PNG_MNG_FEATURES_SUPPORTED png_byte filter_type; #endif /* New members added in libpng-1.2.0 */ /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ #ifdef PNG_USER_MEM_SUPPORTED png_voidp mem_ptr; /* user supplied struct for mem functions */ png_malloc_ptr malloc_fn; /* function for allocating memory */ png_free_ptr free_fn; /* function for freeing memory */ #endif /* New member added in libpng-1.0.13 and 1.2.0 */ png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ #ifdef PNG_READ_QUANTIZE_SUPPORTED /* The following three members were added at version 1.0.14 and 1.2.4 */ png_bytep quantize_sort; /* working sort array */ png_bytep index_to_palette; /* where the original index currently is in the palette */ png_bytep palette_to_index; /* which original index points to this palette color */ #endif /* New members added in libpng-1.0.16 and 1.2.6 */ png_byte compression_type; #ifdef PNG_USER_LIMITS_SUPPORTED png_uint_32 user_width_max; png_uint_32 user_height_max; /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown * chunks that can be stored (0 means unlimited). */ png_uint_32 user_chunk_cache_max; /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk * can occupy when decompressed. 0 means unlimited. */ png_alloc_size_t user_chunk_malloc_max; #endif /* New member added in libpng-1.0.25 and 1.2.17 */ #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED /* Temporary storage for unknown chunk that the library doesn't recognize, * used while reading the chunk. */ png_unknown_chunk unknown_chunk; #endif /* New member added in libpng-1.2.26 */ png_size_t old_big_row_buf_size; #ifdef PNG_READ_SUPPORTED /* New member added in libpng-1.2.30 */ png_bytep read_buffer; /* buffer for reading chunk data */ png_alloc_size_t read_buffer_size; /* current size of the buffer */ #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED uInt IDAT_read_size; /* limit on read buffer size for IDAT */ #endif #ifdef PNG_IO_STATE_SUPPORTED /* New member added in libpng-1.4.0 */ png_uint_32 io_state; #endif /* New member added in libpng-1.5.6 */ png_bytep big_prev_row; /* New member added in libpng-1.5.7 */ void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info, png_bytep row, png_const_bytep prev_row); #ifdef PNG_READ_SUPPORTED #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) png_colorspace colorspace; #endif #endif }; #endif /* PNGSTRUCT_H */ ================================================ FILE: Libraries/Core/Windows/Headers/rapidxml/rapidxml.hpp ================================================ #ifndef RAPIDXML_HPP_INCLUDED #define RAPIDXML_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml.hpp This file contains rapidxml parser and DOM implementation // If standard library is disabled, user must provide implementations of required functions and typedefs #if !defined(RAPIDXML_NO_STDLIB) #include // For std::size_t #include // For assert #include // For placement new #endif // On MSVC, disable "conditional expression is constant" warning (level 4). // This warning is almost impossible to avoid with certain types of templated code #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4127) // Conditional expression is constant #endif /////////////////////////////////////////////////////////////////////////// // RAPIDXML_PARSE_ERROR #if defined(RAPIDXML_NO_EXCEPTIONS) #define RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); } namespace rapidxml { //! When exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, //! this function is called to notify user about the error. //! It must be defined by the user. //!

//! This function cannot return. If it does, the results are undefined. //!

//! A very simple definition might look like that: //!
    //! void %rapidxml::%parse_error_handler(const char *what, void *where)
    //! {
    //!     std::cout << "Parse error: " << what << "\n";
    //!     std::abort();
    //! }
    //! 
//! \param what Human readable description of the error. //! \param where Pointer to character data where error was detected. void parse_error_handler(const char *what, void *where); } #else #include // For std::exception #define RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where) namespace rapidxml { //! Parse error exception. //! This exception is thrown by the parser when an error occurs. //! Use what() function to get human-readable error message. //! Use where() function to get a pointer to position within source text where error was detected. //!

//! If throwing exceptions by the parser is undesirable, //! it can be disabled by defining RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included. //! This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception. //! This function must be defined by the user. //!

//! This class derives from std::exception class. class parse_error: public std::exception { public: //! Constructs parse error parse_error(const char *what, void *where) : m_what(what) , m_where(where) { } //! Gets human readable description of error. //! \return Pointer to null terminated description of the error. virtual const char *what() const throw() { return m_what; } //! Gets pointer to character data where error happened. //! Ch should be the same as char type of xml_document that produced the error. //! \return Pointer to location within the parsed string where error occured. template Ch *where() const { return reinterpret_cast(m_where); } private: const char *m_what; void *m_where; }; } #endif /////////////////////////////////////////////////////////////////////////// // Pool sizes #ifndef RAPIDXML_STATIC_POOL_SIZE // Size of static memory block of memory_pool. // Define RAPIDXML_STATIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. // No dynamic memory allocations are performed by memory_pool until static memory is exhausted. #define RAPIDXML_STATIC_POOL_SIZE (64 * 1024) #endif #ifndef RAPIDXML_DYNAMIC_POOL_SIZE // Size of dynamic memory block of memory_pool. // Define RAPIDXML_DYNAMIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. // After the static block is exhausted, dynamic blocks with approximately this size are allocated by memory_pool. #define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024) #endif #ifndef RAPIDXML_ALIGNMENT // Memory allocation alignment. // Define RAPIDXML_ALIGNMENT before including rapidxml.hpp if you want to override the default value, which is the size of pointer. // All memory allocations for nodes, attributes and strings will be aligned to this value. // This must be a power of 2 and at least 1, otherwise memory_pool will not work. #define RAPIDXML_ALIGNMENT sizeof(void *) #endif namespace rapidxml { // Forward declarations template class xml_node; template class xml_attribute; template class xml_document; //! Enumeration listing all node types produced by the parser. //! Use xml_node::type() function to query node type. enum node_type { node_document, //!< A document node. Name and value are empty. node_element, //!< An element node. Name contains element name. Value contains text of first data node. node_data, //!< A data node. Name is empty. Value contains data text. node_cdata, //!< A CDATA node. Name is empty. Value contains data text. node_comment, //!< A comment node. Name is empty. Value contains comment text. node_declaration, //!< A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes. node_doctype, //!< A DOCTYPE node. Name is empty. Value contains DOCTYPE text. node_pi //!< A PI node. Name contains target. Value contains instructions. }; /////////////////////////////////////////////////////////////////////// // Parsing flags //! Parse flag instructing the parser to not create data nodes. //! Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_data_nodes = 0x1; //! Parse flag instructing the parser to not use text of first data node as a value of parent element. //! Can be combined with other flags by use of | operator. //! Note that child data nodes of element node take precendence over its value when printing. //! That is, if element has one or more child data nodes and a value, the value will be ignored. //! Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements. //!

//! See xml_document::parse() function. const int parse_no_element_values = 0x2; //! Parse flag instructing the parser to not place zero terminators after strings in the source text. //! By default zero terminators are placed, modifying source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_string_terminators = 0x4; //! Parse flag instructing the parser to not translate entities in the source text. //! By default entities are translated, modifying source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_entity_translation = 0x8; //! Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters. //! By default, UTF-8 handling is enabled. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_utf8 = 0x10; //! Parse flag instructing the parser to create XML declaration node. //! By default, declaration node is not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_declaration_node = 0x20; //! Parse flag instructing the parser to create comments nodes. //! By default, comment nodes are not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_comment_nodes = 0x40; //! Parse flag instructing the parser to create DOCTYPE node. //! By default, doctype node is not created. //! Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_doctype_node = 0x80; //! Parse flag instructing the parser to create PI nodes. //! By default, PI nodes are not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_pi_nodes = 0x100; //! Parse flag instructing the parser to validate closing tag names. //! If not set, name inside closing tag is irrelevant to the parser. //! By default, closing tags are not validated. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_validate_closing_tags = 0x200; //! Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes. //! By default, whitespace is not trimmed. //! This flag does not cause the parser to modify source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_trim_whitespace = 0x400; //! Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character. //! Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag. //! By default, whitespace is not normalized. //! If this flag is specified, source text will be modified. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_normalize_whitespace = 0x800; // Compound flags //! Parse flags which represent default behaviour of the parser. //! This is always equal to 0, so that all other flags can be simply ored together. //! Normally there is no need to inconveniently disable flags by anding with their negated (~) values. //! This also means that meaning of each flag is a negation of the default setting. //! For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is enabled by default, //! and using the flag will disable it. //!

//! See xml_document::parse() function. const int parse_default = 0; //! A combination of parse flags that forbids any modifications of the source text. //! This also results in faster parsing. However, note that the following will occur: //!
    //!
  • names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends
  • //!
  • entities will not be translated
  • //!
  • whitespace will not be normalized
  • //!
//! See xml_document::parse() function. const int parse_non_destructive = parse_no_string_terminators | parse_no_entity_translation; //! A combination of parse flags resulting in fastest possible parsing, without sacrificing important data. //!

//! See xml_document::parse() function. const int parse_fastest = parse_non_destructive | parse_no_data_nodes; //! A combination of parse flags resulting in largest amount of data being extracted. //! This usually results in slowest parsing. //!

//! See xml_document::parse() function. const int parse_full = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags; /////////////////////////////////////////////////////////////////////// // Internals //! \cond internal namespace internal { // Struct that contains lookup tables for the parser // It must be a template to allow correct linking (because it has static data members, which are defined in a header file). template struct lookup_tables { static const unsigned char lookup_whitespace[256]; // Whitespace table static const unsigned char lookup_node_name[256]; // Node name table static const unsigned char lookup_text[256]; // Text table static const unsigned char lookup_text_pure_no_ws[256]; // Text table static const unsigned char lookup_text_pure_with_ws[256]; // Text table static const unsigned char lookup_attribute_name[256]; // Attribute name table static const unsigned char lookup_attribute_data_1[256]; // Attribute data table with single quote static const unsigned char lookup_attribute_data_1_pure[256]; // Attribute data table with single quote static const unsigned char lookup_attribute_data_2[256]; // Attribute data table with double quotes static const unsigned char lookup_attribute_data_2_pure[256]; // Attribute data table with double quotes static const unsigned char lookup_digits[256]; // Digits static const unsigned char lookup_upcase[256]; // To uppercase conversion table for ASCII characters }; // Find length of the string template inline std::size_t measure(const Ch *p) { const Ch *tmp = p; while (*tmp) ++tmp; return tmp - p; } // Compare strings for equality template inline bool compare(const Ch *p1, std::size_t size1, const Ch *p2, std::size_t size2, bool case_sensitive) { if (size1 != size2) return false; if (case_sensitive) { for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) if (*p1 != *p2) return false; } else { for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) if (lookup_tables<0>::lookup_upcase[static_cast(*p1)] != lookup_tables<0>::lookup_upcase[static_cast(*p2)]) return false; } return true; } } //! \endcond /////////////////////////////////////////////////////////////////////// // Memory pool //! This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation. //! In most cases, you will not need to use this class directly. //! However, if you need to create nodes manually or modify names/values of nodes, //! you are encouraged to use memory_pool of relevant xml_document to allocate the memory. //! Not only is this faster than allocating them by using new operator, //! but also their lifetime will be tied to the lifetime of document, //! possibly simplyfing memory management. //!

//! Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. //! You can also call allocate_string() function to allocate strings. //! Such strings can then be used as names or values of nodes without worrying about their lifetime. //! Note that there is no free() function -- all allocations are freed at once when clear() function is called, //! or when the pool is destroyed. //!

//! It is also possible to create a standalone memory_pool, and use it //! to allocate nodes, whose lifetime will not be tied to any document. //!

//! Pool maintains RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. //! Until static memory is exhausted, no dynamic memory allocations are done. //! When static memory is exhausted, pool allocates additional blocks of memory of size RAPIDXML_DYNAMIC_POOL_SIZE each, //! by using global new[] and delete[] operators. //! This behaviour can be changed by setting custom allocation routines. //! Use set_allocator() function to set them. //!

//! Allocations for nodes, attributes and strings are aligned at RAPIDXML_ALIGNMENT bytes. //! This value defaults to the size of pointer on target architecture. //!

//! To obtain absolutely top performance from the parser, //! it is important that all nodes are allocated from a single, contiguous block of memory. //! Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably. //! If required, you can tweak RAPIDXML_STATIC_POOL_SIZE, RAPIDXML_DYNAMIC_POOL_SIZE and RAPIDXML_ALIGNMENT //! to obtain best wasted memory to performance compromise. //! To do it, define their values before rapidxml.hpp file is included. //! \param Ch Character type of created nodes. template class memory_pool { public: //! \cond internal typedef void *(rapidxml_alloc_func)(std::size_t); // Type of user-defined function used to allocate memory typedef void (free_func)(void *); // Type of user-defined function used to free memory //! \endcond //! Constructs empty pool with default allocator functions. memory_pool() : m_rapidxml_alloc_func(0) , m_free_func(0) { init(); } //! Destroys pool and frees all the memory. //! This causes memory occupied by nodes allocated by the pool to be freed. //! Nodes allocated from the pool are no longer valid. ~memory_pool() { clear(); } //! Allocates a new node from the pool, and optionally assigns name and value to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param type Type of node to create. //! \param name Name to assign to the node, or 0 to assign no name. //! \param value Value to assign to the node, or 0 to assign no value. //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. //! \return Pointer to allocated node. This pointer will never be NULL. xml_node *allocate_node(node_type type, const Ch *name = 0, const Ch *value = 0, std::size_t name_size = 0, std::size_t value_size = 0) { void *memory = allocate_aligned(sizeof(xml_node)); xml_node *node = new(memory) xml_node(type); if (name) { if (name_size > 0) node->name(name, name_size); else node->name(name); } if (value) { if (value_size > 0) node->value(value, value_size); else node->value(value); } return node; } //! Allocates a new attribute from the pool, and optionally assigns name and value to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param name Name to assign to the attribute, or 0 to assign no name. //! \param value Value to assign to the attribute, or 0 to assign no value. //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. //! \return Pointer to allocated attribute. This pointer will never be NULL. xml_attribute *allocate_attribute(const Ch *name = 0, const Ch *value = 0, std::size_t name_size = 0, std::size_t value_size = 0) { void *memory = allocate_aligned(sizeof(xml_attribute)); xml_attribute *attribute = new(memory) xml_attribute; if (name) { if (name_size > 0) attribute->name(name, name_size); else attribute->name(name); } if (value) { if (value_size > 0) attribute->value(value, value_size); else attribute->value(value); } return attribute; } //! Allocates a char array of given size from the pool, and optionally copies a given string to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param source String to initialize the allocated memory with, or 0 to not initialize it. //! \param size Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated. //! \return Pointer to allocated char array. This pointer will never be NULL. Ch *allocate_string(const Ch *source = 0, std::size_t size = 0) { assert(source || size); // Either source or size (or both) must be specified if (size == 0) size = internal::measure(source) + 1; Ch *result = static_cast(allocate_aligned(size * sizeof(Ch))); if (source) for (std::size_t i = 0; i < size; ++i) result[i] = source[i]; return result; } //! Clones an xml_node and its hierarchy of child nodes and attributes. //! Nodes and attributes are allocated from this memory pool. //! Names and values are not cloned, they are shared between the clone and the source. //! Result node can be optionally specified as a second parameter, //! in which case its contents will be replaced with cloned source node. //! This is useful when you want to clone entire document. //! \param source Node to clone. //! \param result Node to put results in, or 0 to automatically allocate result node //! \return Pointer to cloned node. This pointer will never be NULL. xml_node *clone_node(const xml_node *source, xml_node *result = 0) { // Prepare result node if (result) { result->remove_all_attributes(); result->remove_all_nodes(); result->type(source->type()); } else result = allocate_node(source->type()); // Clone name and value result->name(source->name(), source->name_size()); result->value(source->value(), source->value_size()); // Clone child nodes and attributes for (xml_node *child = source->first_node(); child; child = child->next_sibling()) result->append_node(clone_node(child)); for (xml_attribute *attr = source->first_attribute(); attr; attr = attr->next_attribute()) result->append_attribute(allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size())); return result; } //! Clears the pool. //! This causes memory occupied by nodes allocated by the pool to be freed. //! Any nodes or strings allocated from the pool will no longer be valid. void clear() { while (m_begin != m_static_memory) { char *previous_begin = reinterpret_cast
(align(m_begin))->previous_begin; if (m_free_func) m_free_func(m_begin); else delete[] m_begin; m_begin = previous_begin; } init(); } //! Sets or resets the user-defined memory allocation functions for the pool. //! This can only be called when no memory is allocated from the pool yet, otherwise results are undefined. //! Allocation function must not return invalid pointer on failure. It should either throw, //! stop the program, or use longjmp() function to pass control to other place of program. //! If it returns invalid pointer, results are undefined. //!

//! User defined allocation functions must have the following forms: //!
//!
void *allocate(std::size_t size); //!
void free(void *pointer); //!

//! \param af Allocation function, or 0 to restore default function //! \param ff Free function, or 0 to restore default function void set_allocator(rapidxml_alloc_func *af, free_func *ff) { assert(m_begin == m_static_memory && m_ptr == align(m_begin)); // Verify that no memory is allocated yet m_rapidxml_alloc_func = af; m_free_func = ff; } private: struct header { char *previous_begin; }; void init() { m_begin = m_static_memory; m_ptr = align(m_begin); m_end = m_static_memory + sizeof(m_static_memory); } char *align(char *ptr) { std::size_t alignment = ((RAPIDXML_ALIGNMENT - (std::size_t(ptr) & (RAPIDXML_ALIGNMENT - 1))) & (RAPIDXML_ALIGNMENT - 1)); return ptr + alignment; } char *allocate_raw(std::size_t size) { // Allocate void *memory; if (m_rapidxml_alloc_func) // Allocate memory using either user-specified allocation function or global operator new[] { memory = m_rapidxml_alloc_func(size); assert(memory); // Allocator is not allowed to return 0, on failure it must either throw, stop the program or use longjmp } else { memory = new char[size]; #ifdef RAPIDXML_NO_EXCEPTIONS if (!memory) // If exceptions are disabled, verify memory allocation, because new will not be able to throw bad_alloc RAPIDXML_PARSE_ERROR("out of memory", 0); #endif } return static_cast(memory); } void *allocate_aligned(std::size_t size) { // Calculate aligned pointer char *result = align(m_ptr); // If not enough memory left in current pool, allocate a new pool if (result + size > m_end) { // Calculate required pool size (may be bigger than RAPIDXML_DYNAMIC_POOL_SIZE) std::size_t pool_size = RAPIDXML_DYNAMIC_POOL_SIZE; if (pool_size < size) pool_size = size; // Allocate std::size_t alloc_size = sizeof(header) + (2 * RAPIDXML_ALIGNMENT - 2) + pool_size; // 2 alignments required in worst case: one for header, one for actual allocation char *raw_memory = allocate_raw(alloc_size); // Setup new pool in allocated memory char *pool = align(raw_memory); header *new_header = reinterpret_cast
(pool); new_header->previous_begin = m_begin; m_begin = raw_memory; m_ptr = pool + sizeof(header); m_end = raw_memory + alloc_size; // Calculate aligned pointer again using new pool result = align(m_ptr); } // Update pool and return aligned pointer m_ptr = result + size; return result; } char *m_begin; // Start of raw memory making up current pool char *m_ptr; // First free byte in current pool char *m_end; // One past last available byte in current pool char m_static_memory[RAPIDXML_STATIC_POOL_SIZE]; // Static raw memory rapidxml_alloc_func *m_rapidxml_alloc_func; // Allocator function, or 0 if default is to be used free_func *m_free_func; // Free function, or 0 if default is to be used }; /////////////////////////////////////////////////////////////////////////// // XML base //! Base class for xml_node and xml_attribute implementing common functions: //! name(), name_size(), value(), value_size() and parent(). //! \param Ch Character type to use template class xml_base { public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction // Construct a base with empty name, value and parent xml_base() : m_name(0) , m_value(0) , m_parent(0) { } /////////////////////////////////////////////////////////////////////////// // Node data access //! Gets name of the node. //! Interpretation of name depends on type of node. //! Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. //!

//! Use name_size() function to determine length of the name. //! \return Name of node, or empty string if node has no name. Ch *name() const { return m_name ? m_name : nullstr(); } //! Gets size of node name, not including terminator character. //! This function works correctly irrespective of whether name is or is not zero terminated. //! \return Size of node name, in characters. std::size_t name_size() const { return m_name ? m_name_size : 0; } //! Gets value of node. //! Interpretation of value depends on type of node. //! Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. //!

//! Use value_size() function to determine length of the value. //! \return Value of node, or empty string if node has no value. Ch *value() const { return m_value ? m_value : nullstr(); } //! Gets size of node value, not including terminator character. //! This function works correctly irrespective of whether value is or is not zero terminated. //! \return Size of node value, in characters. std::size_t value_size() const { return m_value ? m_value_size : 0; } /////////////////////////////////////////////////////////////////////////// // Node modification //! Sets name of node to a non zero-terminated string. //! See \ref ownership_of_strings. //!

//! Note that node does not own its name or value, it only stores a pointer to it. //! It will not delete or otherwise free the pointer on destruction. //! It is reponsibility of the user to properly manage lifetime of the string. //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - //! on destruction of the document the string will be automatically freed. //!

//! Size of name must be specified separately, because name does not have to be zero terminated. //! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated). //! \param name Name of node to set. Does not have to be zero terminated. //! \param size Size of name, in characters. This does not include zero terminator, if one is present. void name(const Ch *name, std::size_t size) { m_name = const_cast(name); m_name_size = size; } //! Sets name of node to a zero-terminated string. //! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t). //! \param name Name of node to set. Must be zero terminated. void name(const Ch *name) { this->name(name, internal::measure(name)); } //! Sets value of node to a non zero-terminated string. //! See \ref ownership_of_strings. //!

//! Note that node does not own its name or value, it only stores a pointer to it. //! It will not delete or otherwise free the pointer on destruction. //! It is reponsibility of the user to properly manage lifetime of the string. //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - //! on destruction of the document the string will be automatically freed. //!

//! Size of value must be specified separately, because it does not have to be zero terminated. //! Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated). //!

//! If an element has a child node of type node_data, it will take precedence over element value when printing. //! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser. //! \param value value of node to set. Does not have to be zero terminated. //! \param size Size of value, in characters. This does not include zero terminator, if one is present. void value(const Ch *value, std::size_t size) { m_value = const_cast(value); m_value_size = size; } //! Sets value of node to a zero-terminated string. //! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t). //! \param value Vame of node to set. Must be zero terminated. void value(const Ch *value) { this->value(value, internal::measure(value)); } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets node parent. //! \return Pointer to parent node, or 0 if there is no parent. xml_node *parent() const { return m_parent; } protected: // Return empty string static Ch *nullstr() { static Ch zero = Ch('\0'); return &zero; } Ch *m_name; // Name of node, or 0 if no name Ch *m_value; // Value of node, or 0 if no value std::size_t m_name_size; // Length of node name, or undefined of no name std::size_t m_value_size; // Length of node value, or undefined if no value xml_node *m_parent; // Pointer to parent node, or 0 if none }; //! Class representing attribute node of XML document. //! Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base). //! Note that after parse, both name and value of attribute will point to interior of source text used for parsing. //! Thus, this text must persist in memory for the lifetime of attribute. //! \param Ch Character type to use. template class xml_attribute: public xml_base { friend class xml_node; public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction //! Constructs an empty attribute with the specified type. //! Consider using memory_pool of appropriate xml_document if allocating attributes manually. xml_attribute() { } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets document of which attribute is a child. //! \return Pointer to document that contains this attribute, or 0 if there is no parent document. xml_document *document() const { if (xml_node *node = this->parent()) { while (node->parent()) node = node->parent(); return node->type() == node_document ? static_cast *>(node) : 0; } else return 0; } //! Gets previous attribute, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return this->m_parent ? m_prev_attribute : 0; } //! Gets next attribute, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *next_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return this->m_parent ? m_next_attribute : 0; } private: xml_attribute *m_prev_attribute; // Pointer to previous sibling of attribute, or 0 if none; only valid if parent is non-zero xml_attribute *m_next_attribute; // Pointer to next sibling of attribute, or 0 if none; only valid if parent is non-zero }; /////////////////////////////////////////////////////////////////////////// // XML node //! Class representing a node of XML document. //! Each node may have associated name and value strings, which are available through name() and value() functions. //! Interpretation of name and value depends on type of the node. //! Type of node can be determined by using type() function. //!

//! Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. //! Thus, this text must persist in the memory for the lifetime of node. //! \param Ch Character type to use. template class xml_node: public xml_base { public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction //! Constructs an empty node with the specified type. //! Consider using memory_pool of appropriate document to allocate nodes manually. //! \param type Type of node to construct. xml_node(node_type type) : m_type(type) , m_first_node(0) , m_first_attribute(0) { } /////////////////////////////////////////////////////////////////////////// // Node data access //! Gets type of node. //! \return Type of node. node_type type() const { return m_type; } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets document of which node is a child. //! \return Pointer to document that contains this node, or 0 if there is no parent document. xml_document *document() const { xml_node *node = const_cast *>(this); while (node->parent()) node = node->parent(); return node->type() == node_document ? static_cast *>(node) : 0; } //! Gets first child node, optionally matching node name. //! \param name Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found child, or 0 if not found. xml_node *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *child = m_first_node; child; child = child->next_sibling()) if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) return child; return 0; } else return m_first_node; } //! Gets last child node, optionally matching node name. //! Behaviour is undefined if node has no children. //! Use first_node() to test if node has children. //! \param name Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found child, or 0 if not found. xml_node *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(m_first_node); // Cannot query for last child if node has no children if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *child = m_last_node; child; child = child->previous_sibling()) if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) return child; return 0; } else return m_last_node; } //! Gets previous sibling node, optionally matching node name. //! Behaviour is undefined if node has no parent. //! Use parent() to test if node has a parent. //! \param name Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found sibling, or 0 if not found. xml_node *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(this->m_parent); // Cannot query for siblings if node has no parent if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling) if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) return sibling; return 0; } else return m_prev_sibling; } //! Gets next sibling node, optionally matching node name. //! Behaviour is undefined if node has no parent. //! Use parent() to test if node has a parent. //! \param name Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found sibling, or 0 if not found. xml_node *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(this->m_parent); // Cannot query for siblings if node has no parent if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling) if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) return sibling; return 0; } else return m_next_sibling; } //! Gets first attribute of node, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return m_first_attribute; } //! Gets last attribute of node, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return m_first_attribute ? m_last_attribute : 0; } /////////////////////////////////////////////////////////////////////////// // Node modification //! Sets type of node. //! \param type Type of node to set. void type(node_type type) { m_type = type; } /////////////////////////////////////////////////////////////////////////// // Node manipulation //! Prepends a new child node. //! The prepended child becomes the first child, and all existing children are moved one position back. //! \param child Node to prepend. void prepend_node(xml_node *child) { assert(child && !child->parent() && child->type() != node_document); if (first_node()) { child->m_next_sibling = m_first_node; m_first_node->m_prev_sibling = child; } else { child->m_next_sibling = 0; m_last_node = child; } m_first_node = child; child->m_parent = this; child->m_prev_sibling = 0; } //! Appends a new child node. //! The appended child becomes the last child. //! \param child Node to append. void append_node(xml_node *child) { assert(child && !child->parent() && child->type() != node_document); if (first_node()) { child->m_prev_sibling = m_last_node; m_last_node->m_next_sibling = child; } else { child->m_prev_sibling = 0; m_first_node = child; } m_last_node = child; child->m_parent = this; child->m_next_sibling = 0; } //! Inserts a new child node at specified place inside the node. //! All children after and including the specified node are moved one position back. //! \param where Place where to insert the child, or 0 to insert at the back. //! \param child Node to insert. void insert_node(xml_node *where, xml_node *child) { assert(!where || where->parent() == this); assert(child && !child->parent() && child->type() != node_document); if (where == m_first_node) prepend_node(child); else if (where == 0) append_node(child); else { child->m_prev_sibling = where->m_prev_sibling; child->m_next_sibling = where; where->m_prev_sibling->m_next_sibling = child; where->m_prev_sibling = child; child->m_parent = this; } } //! Removes first child node. //! If node has no children, behaviour is undefined. //! Use first_node() to test if node has children. void remove_first_node() { assert(first_node()); xml_node *child = m_first_node; m_first_node = child->m_next_sibling; if (child->m_next_sibling) child->m_next_sibling->m_prev_sibling = 0; else m_last_node = 0; child->m_parent = 0; } //! Removes last child of the node. //! If node has no children, behaviour is undefined. //! Use first_node() to test if node has children. void remove_last_node() { assert(first_node()); xml_node *child = m_last_node; if (child->m_prev_sibling) { m_last_node = child->m_prev_sibling; child->m_prev_sibling->m_next_sibling = 0; } else m_first_node = 0; child->m_parent = 0; } //! Removes specified child from the node // \param where Pointer to child to be removed. void remove_node(xml_node *where) { assert(where && where->parent() == this); assert(first_node()); if (where == m_first_node) remove_first_node(); else if (where == m_last_node) remove_last_node(); else { where->m_prev_sibling->m_next_sibling = where->m_next_sibling; where->m_next_sibling->m_prev_sibling = where->m_prev_sibling; where->m_parent = 0; } } //! Removes all child nodes (but not attributes). void remove_all_nodes() { for (xml_node *node = first_node(); node; node = node->m_next_sibling) node->m_parent = 0; m_first_node = 0; } //! Prepends a new attribute to the node. //! \param attribute Attribute to prepend. void prepend_attribute(xml_attribute *attribute) { assert(attribute && !attribute->parent()); if (first_attribute()) { attribute->m_next_attribute = m_first_attribute; m_first_attribute->m_prev_attribute = attribute; } else { attribute->m_next_attribute = 0; m_last_attribute = attribute; } m_first_attribute = attribute; attribute->m_parent = this; attribute->m_prev_attribute = 0; } //! Appends a new attribute to the node. //! \param attribute Attribute to append. void append_attribute(xml_attribute *attribute) { assert(attribute && !attribute->parent()); if (first_attribute()) { attribute->m_prev_attribute = m_last_attribute; m_last_attribute->m_next_attribute = attribute; } else { attribute->m_prev_attribute = 0; m_first_attribute = attribute; } m_last_attribute = attribute; attribute->m_parent = this; attribute->m_next_attribute = 0; } //! Inserts a new attribute at specified place inside the node. //! All attributes after and including the specified attribute are moved one position back. //! \param where Place where to insert the attribute, or 0 to insert at the back. //! \param attribute Attribute to insert. void insert_attribute(xml_attribute *where, xml_attribute *attribute) { assert(!where || where->parent() == this); assert(attribute && !attribute->parent()); if (where == m_first_attribute) prepend_attribute(attribute); else if (where == 0) append_attribute(attribute); else { attribute->m_prev_attribute = where->m_prev_attribute; attribute->m_next_attribute = where; where->m_prev_attribute->m_next_attribute = attribute; where->m_prev_attribute = attribute; attribute->m_parent = this; } } //! Removes first attribute of the node. //! If node has no attributes, behaviour is undefined. //! Use first_attribute() to test if node has attributes. void remove_first_attribute() { assert(first_attribute()); xml_attribute *attribute = m_first_attribute; if (attribute->m_next_attribute) { attribute->m_next_attribute->m_prev_attribute = 0; } else m_last_attribute = 0; attribute->m_parent = 0; m_first_attribute = attribute->m_next_attribute; } //! Removes last attribute of the node. //! If node has no attributes, behaviour is undefined. //! Use first_attribute() to test if node has attributes. void remove_last_attribute() { assert(first_attribute()); xml_attribute *attribute = m_last_attribute; if (attribute->m_prev_attribute) { attribute->m_prev_attribute->m_next_attribute = 0; m_last_attribute = attribute->m_prev_attribute; } else m_first_attribute = 0; attribute->m_parent = 0; } //! Removes specified attribute from node. //! \param where Pointer to attribute to be removed. void remove_attribute(xml_attribute *where) { assert(first_attribute() && where->parent() == this); if (where == m_first_attribute) remove_first_attribute(); else if (where == m_last_attribute) remove_last_attribute(); else { where->m_prev_attribute->m_next_attribute = where->m_next_attribute; where->m_next_attribute->m_prev_attribute = where->m_prev_attribute; where->m_parent = 0; } } //! Removes all attributes of node. void remove_all_attributes() { for (xml_attribute *attribute = first_attribute(); attribute; attribute = attribute->m_next_attribute) attribute->m_parent = 0; m_first_attribute = 0; } private: /////////////////////////////////////////////////////////////////////////// // Restrictions // No copying xml_node(const xml_node &); void operator =(const xml_node &); /////////////////////////////////////////////////////////////////////////// // Data members // Note that some of the pointers below have UNDEFINED values if certain other pointers are 0. // This is required for maximum performance, as it allows the parser to omit initialization of // unneded/redundant values. // // The rules are as follows: // 1. first_node and first_attribute contain valid pointers, or 0 if node has no children/attributes respectively // 2. last_node and last_attribute are valid only if node has at least one child/attribute respectively, otherwise they contain garbage // 3. prev_sibling and next_sibling are valid only if node has a parent, otherwise they contain garbage node_type m_type; // Type of node; always valid xml_node *m_first_node; // Pointer to first child node, or 0 if none; always valid xml_node *m_last_node; // Pointer to last child node, or 0 if none; this value is only valid if m_first_node is non-zero xml_attribute *m_first_attribute; // Pointer to first attribute of node, or 0 if none; always valid xml_attribute *m_last_attribute; // Pointer to last attribute of node, or 0 if none; this value is only valid if m_first_attribute is non-zero xml_node *m_prev_sibling; // Pointer to previous sibling of node, or 0 if none; this value is only valid if m_parent is non-zero xml_node *m_next_sibling; // Pointer to next sibling of node, or 0 if none; this value is only valid if m_parent is non-zero }; /////////////////////////////////////////////////////////////////////////// // XML document //! This class represents root of the DOM hierarchy. //! It is also an xml_node and a memory_pool through public inheritance. //! Use parse() function to build a DOM tree from a zero-terminated XML text string. //! parse() function allocates memory for nodes and attributes by using functions of xml_document, //! which are inherited from memory_pool. //! To access root node of the document, use the document itself, as if it was an xml_node. //! \param Ch Character type to use. template class xml_document: public xml_node, public memory_pool { public: //! Constructs empty XML document xml_document() : xml_node(node_document) { } //! Parses zero-terminated XML string according to given flags. //! Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. //! The string must persist for the lifetime of the document. //! In case of error, rapidxml::parse_error exception will be thrown. //!

//! If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. //! Make sure that data is zero-terminated. //!

//! Document can be parsed into multiple times. //! Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool. //! \param text XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser. template void parse(Ch *text) { assert(text); // Remove current contents this->remove_all_nodes(); this->remove_all_attributes(); // Parse BOM, if any parse_bom(text); // Parse children while (1) { // Skip whitespace before node skip(text); if (*text == 0) break; // Parse and append new child if (*text == Ch('<')) { ++text; // Skip '<' if (xml_node *node = parse_node(text)) this->append_node(node); } else RAPIDXML_PARSE_ERROR("expected <", text); } } //! Clears the document by deleting all nodes and clearing the memory pool. //! All nodes owned by document pool are destroyed. void clear() { this->remove_all_nodes(); this->remove_all_attributes(); memory_pool::clear(); } private: /////////////////////////////////////////////////////////////////////// // Internal character utility functions // Detect whitespace character struct whitespace_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_whitespace[static_cast(ch)]; } }; // Detect node name character struct node_name_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_node_name[static_cast(ch)]; } }; // Detect attribute name character struct attribute_name_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_attribute_name[static_cast(ch)]; } }; // Detect text character (PCDATA) struct text_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text[static_cast(ch)]; } }; // Detect text character (PCDATA) that does not require processing struct text_pure_no_ws_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text_pure_no_ws[static_cast(ch)]; } }; // Detect text character (PCDATA) that does not require processing struct text_pure_with_ws_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text_pure_with_ws[static_cast(ch)]; } }; // Detect attribute value character template struct attribute_value_pred { static unsigned char test(Ch ch) { if (Quote == Ch('\'')) return internal::lookup_tables<0>::lookup_attribute_data_1[static_cast(ch)]; if (Quote == Ch('\"')) return internal::lookup_tables<0>::lookup_attribute_data_2[static_cast(ch)]; return 0; // Should never be executed, to avoid warnings on Comeau } }; // Detect attribute value character template struct attribute_value_pure_pred { static unsigned char test(Ch ch) { if (Quote == Ch('\'')) return internal::lookup_tables<0>::lookup_attribute_data_1_pure[static_cast(ch)]; if (Quote == Ch('\"')) return internal::lookup_tables<0>::lookup_attribute_data_2_pure[static_cast(ch)]; return 0; // Should never be executed, to avoid warnings on Comeau } }; // Insert coded character, using UTF8 or 8-bit ASCII template static void insert_coded_character(Ch *&text, unsigned long code) { if (Flags & parse_no_utf8) { // Insert 8-bit ASCII character // Todo: possibly verify that code is less than 256 and use replacement char otherwise? text[0] = static_cast(code); text += 1; } else { // Insert UTF8 sequence if (code < 0x80) // 1 byte sequence { text[0] = static_cast(code); text += 1; } else if (code < 0x800) // 2 byte sequence { text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xC0); text += 2; } else if (code < 0x10000) // 3 byte sequence { text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xE0); text += 3; } else if (code < 0x110000) // 4 byte sequence { text[3] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xF0); text += 4; } else // Invalid, only codes up to 0x10FFFF are allowed in Unicode { RAPIDXML_PARSE_ERROR("invalid numeric character entity", text); } } } // Skip characters until predicate evaluates to true template static void skip(Ch *&text) { Ch *tmp = text; while (StopPred::test(*tmp)) ++tmp; text = tmp; } // Skip characters until predicate evaluates to true while doing the following: // - replacing XML character entity references with proper characters (' & " < > &#...;) // - condensing whitespace sequences to single space character template static Ch *skip_and_expand_character_refs(Ch *&text) { // If entity translation, whitespace condense and whitespace trimming is disabled, use plain skip if (Flags & parse_no_entity_translation && !(Flags & parse_normalize_whitespace) && !(Flags & parse_trim_whitespace)) { skip(text); return text; } // Use simple skip until first modification is detected skip(text); // Use translation skip Ch *src = text; Ch *dest = src; while (StopPred::test(*src)) { // If entity translation is enabled if (!(Flags & parse_no_entity_translation)) { // Test if replacement is needed if (src[0] == Ch('&')) { switch (src[1]) { // & ' case Ch('a'): if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';')) { *dest = Ch('&'); ++dest; src += 5; continue; } if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';')) { *dest = Ch('\''); ++dest; src += 6; continue; } break; // " case Ch('q'): if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';')) { *dest = Ch('"'); ++dest; src += 6; continue; } break; // > case Ch('g'): if (src[2] == Ch('t') && src[3] == Ch(';')) { *dest = Ch('>'); ++dest; src += 4; continue; } break; // < case Ch('l'): if (src[2] == Ch('t') && src[3] == Ch(';')) { *dest = Ch('<'); ++dest; src += 4; continue; } break; // &#...; - assumes ASCII case Ch('#'): if (src[2] == Ch('x')) { unsigned long code = 0; src += 3; // Skip &#x while (1) { unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; if (digit == 0xFF) break; code = code * 16 + digit; ++src; } insert_coded_character(dest, code); // Put character in output } else { unsigned long code = 0; src += 2; // Skip &# while (1) { unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; if (digit == 0xFF) break; code = code * 10 + digit; ++src; } insert_coded_character(dest, code); // Put character in output } if (*src == Ch(';')) ++src; else RAPIDXML_PARSE_ERROR("expected ;", src); continue; // Something else default: // Ignore, just copy '&' verbatim break; } } } // If whitespace condensing is enabled if (Flags & parse_normalize_whitespace) { // Test if condensing is needed if (whitespace_pred::test(*src)) { *dest = Ch(' '); ++dest; // Put single space in dest ++src; // Skip first whitespace char // Skip remaining whitespace chars while (whitespace_pred::test(*src)) ++src; continue; } } // No replacement, only copy character *dest++ = *src++; } // Return new end text = src; return dest; } /////////////////////////////////////////////////////////////////////// // Internal parsing functions // Parse BOM, if any template void parse_bom(Ch *&text) { // UTF-8? if (static_cast(text[0]) == 0xEF && static_cast(text[1]) == 0xBB && static_cast(text[2]) == 0xBF) { text += 3; // Skup utf-8 bom } } // Parse XML declaration ( xml_node *parse_xml_declaration(Ch *&text) { // If parsing of declaration is disabled if (!(Flags & parse_declaration_node)) { // Skip until end of declaration while (text[0] != Ch('?') || text[1] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 2; // Skip '?>' return 0; } // Create declaration xml_node *declaration = this->allocate_node(node_declaration); // Skip whitespace before attributes or ?> skip(text); // Parse declaration attributes parse_node_attributes(text, declaration); // Skip ?> if (text[0] != Ch('?') || text[1] != Ch('>')) RAPIDXML_PARSE_ERROR("expected ?>", text); text += 2; return declaration; } // Parse XML comment (' return 0; // Do not produce comment node } // Remember value start Ch *value = text; // Skip until end of comment while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Create comment node xml_node *comment = this->allocate_node(node_comment); comment->value(value, text - value); // Place zero terminator after comment value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 3; // Skip '-->' return comment; } // Parse DOCTYPE template xml_node *parse_doctype(Ch *&text) { // Remember value start Ch *value = text; // Skip to > while (*text != Ch('>')) { // Determine character type switch (*text) { // If '[' encountered, scan for matching ending ']' using naive algorithm with depth // This works for all W3C test files except for 2 most wicked case Ch('['): { ++text; // Skip '[' int depth = 1; while (depth > 0) { switch (*text) { case Ch('['): ++depth; break; case Ch(']'): --depth; break; case 0: RAPIDXML_PARSE_ERROR("unexpected end of data", text); } ++text; } break; } // Error on end of text case Ch('\0'): RAPIDXML_PARSE_ERROR("unexpected end of data", text); // Other character, skip it default: ++text; } } // If DOCTYPE nodes enabled if (Flags & parse_doctype_node) { // Create a new doctype node xml_node *doctype = this->allocate_node(node_doctype); doctype->value(value, text - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 1; // skip '>' return doctype; } else { text += 1; // skip '>' return 0; } } // Parse PI template xml_node *parse_pi(Ch *&text) { // If creation of PI nodes is enabled if (Flags & parse_pi_nodes) { // Create pi node xml_node *pi = this->allocate_node(node_pi); // Extract PI target name Ch *name = text; skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected PI target", text); pi->name(name, text - name); // Skip whitespace between pi target and pi skip(text); // Remember start of pi Ch *value = text; // Skip to '?>' while (text[0] != Ch('?') || text[1] != Ch('>')) { if (*text == Ch('\0')) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Set pi value (verbatim, no entity expansion or whitespace normalization) pi->value(value, text - value); // Place zero terminator after name and value if (!(Flags & parse_no_string_terminators)) { pi->name()[pi->name_size()] = Ch('\0'); pi->value()[pi->value_size()] = Ch('\0'); } text += 2; // Skip '?>' return pi; } else { // Skip to '?>' while (text[0] != Ch('?') || text[1] != Ch('>')) { if (*text == Ch('\0')) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 2; // Skip '?>' return 0; } } // Parse and append data // Return character that ends data. // This is necessary because this character might have been overwritten by a terminating 0 template Ch parse_and_append_data(xml_node *node, Ch *&text, Ch *contents_start) { // Backup to contents start if whitespace trimming is disabled if (!(Flags & parse_trim_whitespace)) text = contents_start; // Skip until end of data Ch *value = text, *end; if (Flags & parse_normalize_whitespace) end = skip_and_expand_character_refs(text); else end = skip_and_expand_character_refs(text); // Trim trailing whitespace if flag is set; leading was already trimmed by whitespace skip after > if (Flags & parse_trim_whitespace) { if (Flags & parse_normalize_whitespace) { // Whitespace is already condensed to single space characters by skipping function, so just trim 1 char off the end if (*(end - 1) == Ch(' ')) --end; } else { // Backup until non-whitespace character is found while (whitespace_pred::test(*(end - 1))) --end; } } // If characters are still left between end and value (this test is only necessary if normalization is enabled) // Create new data node if (!(Flags & parse_no_data_nodes)) { xml_node *data = this->allocate_node(node_data); data->value(value, end - value); node->append_node(data); } // Add data to parent node if no data exists yet if (!(Flags & parse_no_element_values)) if (*node->value() == Ch('\0')) node->value(value, end - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) { Ch ch = *text; *end = Ch('\0'); return ch; // Return character that ends data; this is required because zero terminator overwritten it } // Return character that ends data return *text; } // Parse CDATA template xml_node *parse_cdata(Ch *&text) { // If CDATA is disabled if (Flags & parse_no_data_nodes) { // Skip until end of cdata while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 3; // Skip ]]> return 0; // Do not produce CDATA node } // Skip until end of cdata Ch *value = text; while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Create new cdata node xml_node *cdata = this->allocate_node(node_cdata); cdata->value(value, text - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 3; // Skip ]]> return cdata; } // Parse element node template xml_node *parse_element(Ch *&text) { // Create element node xml_node *element = this->allocate_node(node_element); // Extract element name Ch *name = text; skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected element name", text); element->name(name, text - name); // Skip whitespace between element name and attributes or > skip(text); // Parse attributes, if any parse_node_attributes(text, element); // Determine ending type if (*text == Ch('>')) { ++text; parse_node_contents(text, element); } else if (*text == Ch('/')) { ++text; if (*text != Ch('>')) RAPIDXML_PARSE_ERROR("expected >", text); ++text; } else RAPIDXML_PARSE_ERROR("expected >", text); // Place zero terminator after name if (!(Flags & parse_no_string_terminators)) element->name()[element->name_size()] = Ch('\0'); // Return parsed element return element; } // Determine node type, and parse it template xml_node *parse_node(Ch *&text) { // Parse proper node type switch (text[0]) { // <... default: // Parse and append element node return parse_element(text); // (text); } else { // Parse PI return parse_pi(text); } // (text); } break; // (text); } break; // (text); } } // switch // Attempt to skip other, unrecognized node types starting with ')) { if (*text == 0) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } ++text; // Skip '>' return 0; // No node recognized } } // Parse contents of the node - children, data etc. template void parse_node_contents(Ch *&text, xml_node *node) { // For all children and text while (1) { // Skip whitespace between > and node contents Ch *contents_start = text; // Store start of node contents before whitespace is skipped skip(text); Ch next_char = *text; // After data nodes, instead of continuing the loop, control jumps here. // This is because zero termination inside parse_and_append_data() function // would wreak havoc with the above code. // Also, skipping whitespace after data nodes is unnecessary. after_data_node: // Determine what comes next: node closing, child node, data node, or 0? switch (next_char) { // Node closing or child node case Ch('<'): if (text[1] == Ch('/')) { // Node closing text += 2; // Skip '(text); if (!internal::compare(node->name(), node->name_size(), closing_name, text - closing_name, true)) RAPIDXML_PARSE_ERROR("invalid closing tag name", text); } else { // No validation, just skip name skip(text); } // Skip remaining whitespace after node name skip(text); if (*text != Ch('>')) RAPIDXML_PARSE_ERROR("expected >", text); ++text; // Skip '>' return; // Node closed, finished parsing contents } else { // Child node ++text; // Skip '<' if (xml_node *child = parse_node(text)) node->append_node(child); } break; // End of data - error case Ch('\0'): RAPIDXML_PARSE_ERROR("unexpected end of data", text); // Data node default: next_char = parse_and_append_data(node, text, contents_start); goto after_data_node; // Bypass regular processing after data nodes } } } // Parse XML attributes of the node template void parse_node_attributes(Ch *&text, xml_node *node) { // For all attributes while (attribute_name_pred::test(*text)) { // Extract attribute name Ch *name = text; ++text; // Skip first character of attribute name skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected attribute name", name); // Create new attribute xml_attribute *attribute = this->allocate_attribute(); attribute->name(name, text - name); node->append_attribute(attribute); // Skip whitespace after attribute name skip(text); // Skip = if (*text != Ch('=')) RAPIDXML_PARSE_ERROR("expected =", text); ++text; // Add terminating zero after name if (!(Flags & parse_no_string_terminators)) attribute->name()[attribute->name_size()] = 0; // Skip whitespace after = skip(text); // Skip quote and remember if it was ' or " Ch quote = *text; if (quote != Ch('\'') && quote != Ch('"')) RAPIDXML_PARSE_ERROR("expected ' or \"", text); ++text; // Extract attribute value and expand char refs in it Ch *value = text, *end; const int AttFlags = Flags & ~parse_normalize_whitespace; // No whitespace normalization in attributes if (quote == Ch('\'')) end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text); else end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text); // Set attribute value attribute->value(value, end - value); // Make sure that end quote is present if (*text != quote) RAPIDXML_PARSE_ERROR("expected ' or \"", text); ++text; // Skip quote // Add terminating zero after value if (!(Flags & parse_no_string_terminators)) attribute->value()[attribute->value_size()] = 0; // Skip whitespace after attribute value skip(text); } } }; //! \cond internal namespace internal { // Whitespace (space \n \r \t) template const unsigned char lookup_tables::lookup_whitespace[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 5 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 7 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // F }; // Node name (anything but space \n \r \t / > ? \0) template const unsigned char lookup_tables::lookup_node_name[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) (anything but < \0) template const unsigned char lookup_tables::lookup_text[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) that does not require processing when ws normalization is disabled // (anything but < \0 &) template const unsigned char lookup_tables::lookup_text_pure_no_ws[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) that does not require processing when ws normalizationis is enabled // (anything but < \0 & space \n \r \t) template const unsigned char lookup_tables::lookup_text_pure_with_ws[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute name (anything but space \n \r \t / < > = ? ! \0) template const unsigned char lookup_tables::lookup_attribute_name[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with single quote (anything but ' \0) template const unsigned char lookup_tables::lookup_attribute_data_1[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with single quote that does not require processing (anything but ' \0 &) template const unsigned char lookup_tables::lookup_attribute_data_1_pure[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with double quote (anything but " \0) template const unsigned char lookup_tables::lookup_attribute_data_2[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with double quote that does not require processing (anything but " \0 &) template const unsigned char lookup_tables::lookup_attribute_data_2_pure[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Digits (dec and hex, 255 denotes end of numeric character reference) template const unsigned char lookup_tables::lookup_digits[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 1 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, // 3 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 4 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 5 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 6 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 7 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 8 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 9 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // A 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // B 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // C 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // D 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // E 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 // F }; // Upper case conversion template const unsigned char lookup_tables::lookup_upcase[256] = { // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A B C D E F 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // 0 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, // 1 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, // 2 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, // 3 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 4 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, // 5 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 6 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127, // 7 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 8 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 9 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // A 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // B 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // C 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // D 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // E 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // F }; } //! \endcond } // Undefine internal macros #undef RAPIDXML_PARSE_ERROR // On MSVC, restore warnings state #ifdef _MSC_VER #pragma warning(pop) #endif #endif ================================================ FILE: Libraries/Core/Windows/Headers/rapidxml/rapidxml_iterators.hpp ================================================ #ifndef RAPIDXML_ITERATORS_HPP_INCLUDED #define RAPIDXML_ITERATORS_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_iterators.hpp This file contains rapidxml iterators #include "rapidxml.hpp" namespace rapidxml { //! Iterator of child nodes of xml_node template class node_iterator { public: typedef typename xml_node value_type; typedef typename xml_node &reference; typedef typename xml_node *pointer; typedef std::ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; node_iterator() : m_node(0) { } node_iterator(xml_node *node) : m_node(node->first_node()) { } reference operator *() const { assert(m_node); return *m_node; } pointer operator->() const { assert(m_node); return m_node; } node_iterator& operator++() { assert(m_node); m_node = m_node->next_sibling(); return *this; } node_iterator operator++(int) { node_iterator tmp = *this; ++this; return tmp; } node_iterator& operator--() { assert(m_node && m_node->previous_sibling()); m_node = m_node->previous_sibling(); return *this; } node_iterator operator--(int) { node_iterator tmp = *this; ++this; return tmp; } bool operator ==(const node_iterator &rhs) { return m_node == rhs.m_node; } bool operator !=(const node_iterator &rhs) { return m_node != rhs.m_node; } private: xml_node *m_node; }; //! Iterator of child attributes of xml_node template class attribute_iterator { public: typedef typename xml_attribute value_type; typedef typename xml_attribute &reference; typedef typename xml_attribute *pointer; typedef std::ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; attribute_iterator() : m_attribute(0) { } attribute_iterator(xml_node *node) : m_attribute(node->first_attribute()) { } reference operator *() const { assert(m_attribute); return *m_attribute; } pointer operator->() const { assert(m_attribute); return m_attribute; } attribute_iterator& operator++() { assert(m_attribute); m_attribute = m_attribute->next_attribute(); return *this; } attribute_iterator operator++(int) { attribute_iterator tmp = *this; ++this; return tmp; } attribute_iterator& operator--() { assert(m_attribute && m_attribute->previous_attribute()); m_attribute = m_attribute->previous_attribute(); return *this; } attribute_iterator operator--(int) { attribute_iterator tmp = *this; ++this; return tmp; } bool operator ==(const attribute_iterator &rhs) { return m_attribute == rhs.m_attribute; } bool operator !=(const attribute_iterator &rhs) { return m_attribute != rhs.m_attribute; } private: xml_attribute *m_attribute; }; } #endif ================================================ FILE: Libraries/Core/Windows/Headers/rapidxml/rapidxml_print.hpp ================================================ #ifndef RAPIDXML_PRINT_HPP_INCLUDED #define RAPIDXML_PRINT_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_print.hpp This file contains rapidxml printer implementation #include "rapidxml.hpp" // Only include streams if not disabled #ifndef RAPIDXML_NO_STREAMS #include #include #endif namespace rapidxml { /////////////////////////////////////////////////////////////////////// // Printing flags const int print_no_indenting = 0x1; //!< Printer flag instructing the printer to suppress indenting of XML. See print() function. /////////////////////////////////////////////////////////////////////// // Internal //! \cond internal namespace internal { /////////////////////////////////////////////////////////////////////////// // Function declarations template inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out); template inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out); template inline OutIt fill_chars(OutIt out, int n, Ch ch); template inline bool find_char(const Ch *begin, const Ch *end); template inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_attributes(OutIt out, const xml_node *node, int flags); template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent); /////////////////////////////////////////////////////////////////////////// // Internal character operations // Copy characters from given range to given output iterator template inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out) { while (begin != end) *out++ = *begin++; return out; } // Copy characters from given range to given output iterator and expand // characters into references (< > ' " &) template inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out) { while (begin != end) { if (*begin == noexpand) { *out++ = *begin; // No expansion, copy character } else { switch (*begin) { case Ch('<'): *out++ = Ch('&'); *out++ = Ch('l'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('>'): *out++ = Ch('&'); *out++ = Ch('g'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('\''): *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('p'); *out++ = Ch('o'); *out++ = Ch('s'); *out++ = Ch(';'); break; case Ch('"'): *out++ = Ch('&'); *out++ = Ch('q'); *out++ = Ch('u'); *out++ = Ch('o'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('&'): *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('m'); *out++ = Ch('p'); *out++ = Ch(';'); break; default: *out++ = *begin; // No expansion, copy character } } ++begin; // Step to next character } return out; } // Fill given output iterator with repetitions of the same character template inline OutIt fill_chars(OutIt out, int n, Ch ch) { for (int i = 0; i < n; ++i) *out++ = ch; return out; } // Find character template inline bool find_char(const Ch *begin, const Ch *end) { while (begin != end) if (*begin++ == ch) return true; return false; } /////////////////////////////////////////////////////////////////////////// // Internal printing operations // Print node template inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) { // Print proper node type switch (node->type()) { // Document case node_document: out = print_children(out, node, flags, indent); break; // Element case node_element: out = print_element_node(out, node, flags, indent); break; // Data case node_data: out = print_data_node(out, node, flags, indent); break; // CDATA case node_cdata: out = print_cdata_node(out, node, flags, indent); break; // Declaration case node_declaration: out = print_declaration_node(out, node, flags, indent); break; // Comment case node_comment: out = print_comment_node(out, node, flags, indent); break; // Doctype case node_doctype: out = print_doctype_node(out, node, flags, indent); break; // Pi case node_pi: out = print_pi_node(out, node, flags, indent); break; // Unknown default: assert(0); break; } // If indenting not disabled, add line break after node if (!(flags & print_no_indenting)) *out = Ch('\n'), ++out; // Return modified iterator return out; } // Print children of the node template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent) { for (xml_node *child = node->first_node(); child; child = child->next_sibling()) out = print_node(out, child, flags, indent); return out; } // Print attributes of the node template inline OutIt print_attributes(OutIt out, const xml_node *node, int flags) { for (xml_attribute *attribute = node->first_attribute(); attribute; attribute = attribute->next_attribute()) { if (attribute->name() && attribute->value()) { // Print attribute name *out = Ch(' '), ++out; out = copy_chars(attribute->name(), attribute->name() + attribute->name_size(), out); *out = Ch('='), ++out; // Print attribute value using appropriate quote type if (find_char(attribute->value(), attribute->value() + attribute->value_size())) { *out = Ch('\''), ++out; out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('"'), out); *out = Ch('\''), ++out; } else { *out = Ch('"'), ++out; out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('\''), out); *out = Ch('"'), ++out; } } } return out; } // Print data node template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_data); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); return out; } // Print data node template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_cdata); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'); ++out; *out = Ch('!'); ++out; *out = Ch('['); ++out; *out = Ch('C'); ++out; *out = Ch('D'); ++out; *out = Ch('A'); ++out; *out = Ch('T'); ++out; *out = Ch('A'); ++out; *out = Ch('['); ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch(']'); ++out; *out = Ch(']'); ++out; *out = Ch('>'); ++out; return out; } // Print element node template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_element); // Print element name and attributes, if any if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); out = print_attributes(out, node, flags); // If node is childless if (node->value_size() == 0 && !node->first_node()) { // Print childless node tag ending *out = Ch('/'), ++out; *out = Ch('>'), ++out; } else { // Print normal node tag ending *out = Ch('>'), ++out; // Test if node contains a single data node only (and no other nodes) xml_node *child = node->first_node(); if (!child) { // If node has no children, only print its value without indenting out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); } else if (child->next_sibling() == 0 && child->type() == node_data) { // If node has a sole data child, only print its value without indenting out = copy_and_expand_chars(child->value(), child->value() + child->value_size(), Ch(0), out); } else { // Print all children with full indenting if (!(flags & print_no_indenting)) *out = Ch('\n'), ++out; out = print_children(out, node, flags, indent + 1); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); } // Print node end *out = Ch('<'), ++out; *out = Ch('/'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); *out = Ch('>'), ++out; } return out; } // Print declaration node template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent) { // Print declaration start if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('?'), ++out; *out = Ch('x'), ++out; *out = Ch('m'), ++out; *out = Ch('l'), ++out; // Print attributes out = print_attributes(out, node, flags); // Print declaration end *out = Ch('?'), ++out; *out = Ch('>'), ++out; return out; } // Print comment node template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_comment); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('!'), ++out; *out = Ch('-'), ++out; *out = Ch('-'), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('-'), ++out; *out = Ch('-'), ++out; *out = Ch('>'), ++out; return out; } // Print doctype node template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_doctype); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('!'), ++out; *out = Ch('D'), ++out; *out = Ch('O'), ++out; *out = Ch('C'), ++out; *out = Ch('T'), ++out; *out = Ch('Y'), ++out; *out = Ch('P'), ++out; *out = Ch('E'), ++out; *out = Ch(' '), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('>'), ++out; return out; } // Print pi node template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_pi); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('?'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); *out = Ch(' '), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('?'), ++out; *out = Ch('>'), ++out; return out; } } //! \endcond /////////////////////////////////////////////////////////////////////////// // Printing //! Prints XML to given output iterator. //! \param out Output iterator to print to. //! \param node Node to be printed. Pass xml_document to print entire document. //! \param flags Flags controlling how XML is printed. //! \return Output iterator pointing to position immediately after last character of printed text. template inline OutIt print(OutIt out, const xml_node &node, int flags = 0) { return internal::print_node(out, &node, flags, 0); } #ifndef RAPIDXML_NO_STREAMS //! Prints XML to given output stream. //! \param out Output stream to print to. //! \param node Node to be printed. Pass xml_document to print entire document. //! \param flags Flags controlling how XML is printed. //! \return Output stream. template inline std::basic_ostream &print(std::basic_ostream &out, const xml_node &node, int flags = 0) { print(std::ostream_iterator(out), node, flags); return out; } //! Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process. //! \param out Output stream to print to. //! \param node Node to be printed. //! \return Output stream. template inline std::basic_ostream &operator <<(std::basic_ostream &out, const xml_node &node) { return print(out, node); } #endif } #endif ================================================ FILE: Libraries/Core/Windows/Headers/rapidxml/rapidxml_utils.hpp ================================================ #ifndef RAPIDXML_UTILS_HPP_INCLUDED #define RAPIDXML_UTILS_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_utils.hpp This file contains high-level rapidxml utilities that can be useful //! in certain simple scenarios. They should probably not be used if maximizing performance is the main objective. #include "rapidxml.hpp" #include #include #include #include namespace rapidxml { //! Represents data loaded from a file template class file { public: //! Loads file into the memory. Data will be automatically destroyed by the destructor. //! \param filename Filename to load. file(const char *filename) { using namespace std; // Open stream basic_ifstream stream(filename, ios::binary); if (!stream) throw runtime_error(string("cannot open file ") + filename); stream.unsetf(ios::skipws); // Determine stream size stream.seekg(0, ios::end); size_t size = stream.tellg(); stream.seekg(0); // Load data and add terminating 0 m_data.resize(size + 1); stream.read(&m_data.front(), static_cast(size)); m_data[size] = 0; } //! Loads file into the memory. Data will be automatically destroyed by the destructor //! \param stream Stream to load from file(std::basic_istream &stream) { using namespace std; // Load data and add terminating 0 stream.unsetf(ios::skipws); m_data.assign(istreambuf_iterator(stream), istreambuf_iterator()); if (stream.fail() || stream.bad()) throw runtime_error("error reading stream"); m_data.push_back(0); } //! Gets file data. //! \return Pointer to data of file. Ch *data() { return &m_data.front(); } //! Gets file data. //! \return Pointer to data of file. const Ch *data() const { return &m_data.front(); } //! Gets file data size. //! \return Size of file data, in characters. std::size_t size() const { return m_data.size(); } private: std::vector m_data; // File data }; //! Counts children of node. Time complexity is O(n). //! \return Number of children of node template inline std::size_t count_children(xml_node *node) { xml_node *child = node->first_node(); std::size_t count = 0; while (child) { ++count; child = child->next_sibling(); } return count; } //! Counts attributes of node. Time complexity is O(n). //! \return Number of attributes of node template inline std::size_t count_attributes(xml_node *node) { xml_attribute *attr = node->first_attribute(); std::size_t count = 0; while (attr) { ++count; attr = attr->next_attribute(); } return count; } } #endif ================================================ FILE: Libraries/Core/Windows/Headers/zconf.h ================================================ /* zconf.h -- configuration of the zlib compression library * Copyright (C) 1995-2010 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ /* @(#) $Id$ */ #ifndef ZCONF_H #define ZCONF_H /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. * Even better than compiling with -DZ_PREFIX would be to use configure to set * this permanently in zconf.h using "./configure --zprefix". */ #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ /* all linked symbols */ # define _dist_code z__dist_code # define _length_code z__length_code # define _tr_align z__tr_align # define _tr_flush_block z__tr_flush_block # define _tr_init z__tr_init # define _tr_stored_block z__tr_stored_block # define _tr_tally z__tr_tally # define adler32 z_adler32 # define adler32_combine z_adler32_combine # define adler32_combine64 z_adler32_combine64 # define compress z_compress # define compress2 z_compress2 # define compressBound z_compressBound # define crc32 z_crc32 # define crc32_combine z_crc32_combine # define crc32_combine64 z_crc32_combine64 # define deflate z_deflate # define deflateBound z_deflateBound # define deflateCopy z_deflateCopy # define deflateEnd z_deflateEnd # define deflateInit2_ z_deflateInit2_ # define deflateInit_ z_deflateInit_ # define deflateParams z_deflateParams # define deflatePrime z_deflatePrime # define deflateReset z_deflateReset # define deflateSetDictionary z_deflateSetDictionary # define deflateSetHeader z_deflateSetHeader # define deflateTune z_deflateTune # define deflate_copyright z_deflate_copyright # define get_crc_table z_get_crc_table # define gz_error z_gz_error # define gz_intmax z_gz_intmax # define gz_strwinerror z_gz_strwinerror # define gzbuffer z_gzbuffer # define gzclearerr z_gzclearerr # define gzclose z_gzclose # define gzclose_r z_gzclose_r # define gzclose_w z_gzclose_w # define gzdirect z_gzdirect # define gzdopen z_gzdopen # define gzeof z_gzeof # define gzerror z_gzerror # define gzflush z_gzflush # define gzgetc z_gzgetc # define gzgets z_gzgets # define gzoffset z_gzoffset # define gzoffset64 z_gzoffset64 # define gzopen z_gzopen # define gzopen64 z_gzopen64 # define gzprintf z_gzprintf # define gzputc z_gzputc # define gzputs z_gzputs # define gzread z_gzread # define gzrewind z_gzrewind # define gzseek z_gzseek # define gzseek64 z_gzseek64 # define gzsetparams z_gzsetparams # define gztell z_gztell # define gztell64 z_gztell64 # define gzungetc z_gzungetc # define gzwrite z_gzwrite # define inflate z_inflate # define inflateBack z_inflateBack # define inflateBackEnd z_inflateBackEnd # define inflateBackInit_ z_inflateBackInit_ # define inflateCopy z_inflateCopy # define inflateEnd z_inflateEnd # define inflateGetHeader z_inflateGetHeader # define inflateInit2_ z_inflateInit2_ # define inflateInit_ z_inflateInit_ # define inflateMark z_inflateMark # define inflatePrime z_inflatePrime # define inflateReset z_inflateReset # define inflateReset2 z_inflateReset2 # define inflateSetDictionary z_inflateSetDictionary # define inflateSync z_inflateSync # define inflateSyncPoint z_inflateSyncPoint # define inflateUndermine z_inflateUndermine # define inflate_copyright z_inflate_copyright # define inflate_fast z_inflate_fast # define inflate_table z_inflate_table # define uncompress z_uncompress # define zError z_zError # define zcalloc z_zcalloc # define zcfree z_zcfree # define zlibCompileFlags z_zlibCompileFlags # define zlibVersion z_zlibVersion /* all zlib typedefs in zlib.h and zconf.h */ # define Byte z_Byte # define Bytef z_Bytef # define alloc_func z_alloc_func # define charf z_charf # define free_func z_free_func # define gzFile z_gzFile # define gz_header z_gz_header # define gz_headerp z_gz_headerp # define in_func z_in_func # define intf z_intf # define out_func z_out_func # define uInt z_uInt # define uIntf z_uIntf # define uLong z_uLong # define uLongf z_uLongf # define voidp z_voidp # define voidpc z_voidpc # define voidpf z_voidpf /* all zlib structs in zlib.h and zconf.h */ # define gz_header_s z_gz_header_s # define internal_state z_internal_state #endif #if defined(__MSDOS__) && !defined(MSDOS) # define MSDOS #endif #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) # define OS2 #endif #if defined(_WINDOWS) && !defined(WINDOWS) # define WINDOWS #endif #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) # ifndef WIN32 # define WIN32 # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) # ifndef SYS16BIT # define SYS16BIT # endif # endif #endif /* * Compile with -DMAXSEG_64K if the alloc function cannot allocate more * than 64k bytes at a time (needed on systems with 16-bit int). */ #ifdef SYS16BIT # define MAXSEG_64K #endif #ifdef MSDOS # define UNALIGNED_OK #endif #ifdef __STDC_VERSION__ # ifndef STDC # define STDC # endif # if __STDC_VERSION__ >= 199901L # ifndef STDC99 # define STDC99 # endif # endif #endif #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) # define STDC #endif #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) # define STDC #endif #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) # define STDC #endif #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) # define STDC #endif #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ # define STDC #endif #ifndef STDC # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ # define const /* note: need a more gentle solution here */ # endif #endif /* Some Mac compilers merge all .h files incorrectly: */ #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) # define NO_DUMMY_DECL #endif /* Maximum value for memLevel in deflateInit2 */ #ifndef MAX_MEM_LEVEL # ifdef MAXSEG_64K # define MAX_MEM_LEVEL 8 # else # define MAX_MEM_LEVEL 9 # endif #endif /* Maximum value for windowBits in deflateInit2 and inflateInit2. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files * created by gzip. (Files created by minigzip can still be extracted by * gzip.) */ #ifndef MAX_WBITS # define MAX_WBITS 15 /* 32K LZ77 window */ #endif /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) plus a few kilobytes for small objects. For example, if you want to reduce the default memory requirements from 256K to 128K, compile with make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" Of course this will generally degrade compression (there's no free lunch). The memory requirements for inflate are (in bytes) 1 << windowBits that is, 32K for windowBits=15 (default value) plus a few kilobytes for small objects. */ /* Type declarations */ #ifndef OF /* function prototypes */ # ifdef STDC # define OF(args) args # else # define OF(args) () # endif #endif /* The following definitions for FAR are needed only for MSDOS mixed * model programming (small or medium model with some far allocations). * This was tested only with MSC; for other MSDOS compilers you may have * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, * just define FAR to be empty. */ #ifdef SYS16BIT # if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ # define SMALL_MEDIUM # ifdef _MSC_VER # define FAR _far # else # define FAR far # endif # endif # if (defined(__SMALL__) || defined(__MEDIUM__)) /* Turbo C small or medium model */ # define SMALL_MEDIUM # ifdef __BORLANDC__ # define FAR _far # else # define FAR far # endif # endif #endif #if defined(WINDOWS) || defined(WIN32) /* If building or using zlib as a DLL, define ZLIB_DLL. * This is not mandatory, but it offers a little performance increase. */ # ifdef ZLIB_DLL # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) # ifdef ZLIB_INTERNAL # define ZEXTERN extern __declspec(dllexport) # else # define ZEXTERN extern __declspec(dllimport) # endif # endif # endif /* ZLIB_DLL */ /* If building or using zlib with the WINAPI/WINAPIV calling convention, * define ZLIB_WINAPI. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. */ # ifdef ZLIB_WINAPI # ifdef FAR # undef FAR # endif # include /* No need for _export, use ZLIB.DEF instead. */ /* For complete Windows compatibility, use WINAPI, not __stdcall. */ # define ZEXPORT WINAPI # ifdef WIN32 # define ZEXPORTVA WINAPIV # else # define ZEXPORTVA FAR CDECL # endif # endif #endif #if defined (__BEOS__) # ifdef ZLIB_DLL # ifdef ZLIB_INTERNAL # define ZEXPORT __declspec(dllexport) # define ZEXPORTVA __declspec(dllexport) # else # define ZEXPORT __declspec(dllimport) # define ZEXPORTVA __declspec(dllimport) # endif # endif #endif #ifndef ZEXTERN # define ZEXTERN extern #endif #ifndef ZEXPORT # define ZEXPORT #endif #ifndef ZEXPORTVA # define ZEXPORTVA #endif #ifndef FAR # define FAR #endif #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif typedef unsigned int uInt; /* 16 bits or more */ typedef unsigned long uLong; /* 32 bits or more */ #ifdef SMALL_MEDIUM /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ # define Bytef Byte FAR #else typedef Byte FAR Bytef; #endif typedef char FAR charf; typedef int FAR intf; typedef uInt FAR uIntf; typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; typedef void FAR *voidpf; typedef void *voidp; #else typedef Byte const *voidpc; typedef Byte FAR *voidpf; typedef Byte *voidp; #endif #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ # define Z_HAVE_UNISTD_H #endif #ifdef STDC # include /* for off_t */ #endif /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even * though the former does not conform to the LFS document), but considering * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as * equivalently requesting no 64-bit operations */ #if -_LARGEFILE64_SOURCE - -1 == 1 # undef _LARGEFILE64_SOURCE #endif #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) # include /* for SEEK_* and off_t */ # ifdef VMS # include /* for off_t */ # endif # ifndef z_off_t # define z_off_t off_t # endif #endif #ifndef SEEK_SET # define SEEK_SET 0 /* Seek from beginning of file. */ # define SEEK_CUR 1 /* Seek from current position. */ # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ #endif #ifndef z_off_t # define z_off_t long #endif #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 # define z_off64_t off64_t #else # define z_off64_t z_off_t #endif #if defined(__OS400__) # define NO_vsnprintf #endif #if defined(__MVS__) # define NO_vsnprintf #endif /* MVS linker does not support external names larger than 8 bytes */ #if defined(__MVS__) #pragma map(deflateInit_,"DEIN") #pragma map(deflateInit2_,"DEIN2") #pragma map(deflateEnd,"DEEND") #pragma map(deflateBound,"DEBND") #pragma map(inflateInit_,"ININ") #pragma map(inflateInit2_,"ININ2") #pragma map(inflateEnd,"INEND") #pragma map(inflateSync,"INSY") #pragma map(inflateSetDictionary,"INSEDI") #pragma map(compressBound,"CMBND") #pragma map(inflate_table,"INTABL") #pragma map(inflate_fast,"INFA") #pragma map(inflate_copyright,"INCOPY") #endif #endif /* ZCONF_H */ ================================================ FILE: Libraries/Core/Windows/Headers/zlib.h ================================================ /* zlib.h -- interface of the 'zlib' general purpose compression library version 1.2.5, April 19th, 2010 Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. Jean-loup Gailly Mark Adler jloup@gzip.org madler@alumni.caltech.edu The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). */ #ifndef ZLIB_H #define ZLIB_H #include "zconf.h" #ifdef __cplusplus extern "C" { #endif #define ZLIB_VERSION "1.2.5" #define ZLIB_VERNUM 0x1250 #define ZLIB_VER_MAJOR 1 #define ZLIB_VER_MINOR 2 #define ZLIB_VER_REVISION 5 #define ZLIB_VER_SUBREVISION 0 /* The 'zlib' compression library provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the library supports only one compression method (deflation) but other algorithms will be added later and will have the same stream interface. Compression can be done in a single step if the buffers are large enough, or can be done by repeated calls of the compression function. In the latter case, the application must provide more input and/or consume the output (providing more output space) before each call. The compressed data format used by default by the in-memory functions is the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. This library can optionally read and write gzip streams in memory as well. The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- file compression on file systems, has a larger header than zlib to maintain directory information, and uses a different, slower check method than zlib. The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never crash even in case of corrupted input. */ typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); typedef void (*free_func) OF((voidpf opaque, voidpf address)); struct internal_state; typedef struct z_stream_s { Bytef *next_in; /* next input byte */ uInt avail_in; /* number of bytes available at next_in */ uLong total_in; /* total nb of input bytes read so far */ Bytef *next_out; /* next output byte should be put there */ uInt avail_out; /* remaining free space at next_out */ uLong total_out; /* total nb of bytes output so far */ char *msg; /* last error message, NULL if no error */ struct internal_state FAR *state; /* not visible by applications */ alloc_func zalloc; /* used to allocate the internal state */ free_func zfree; /* used to free the internal state */ voidpf opaque; /* private data object passed to zalloc and zfree */ int data_type; /* best guess about the data type: binary or text */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ } z_stream; typedef z_stream FAR *z_streamp; /* gzip header information passed to and from zlib routines. See RFC 1952 for more details on the meanings of these fields. */ typedef struct gz_header_s { int text; /* true if compressed data believed to be text */ uLong time; /* modification time */ int xflags; /* extra flags (not used when writing a gzip file) */ int os; /* operating system */ Bytef *extra; /* pointer to extra field or Z_NULL if none */ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ uInt extra_max; /* space at extra (only when reading header) */ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ uInt name_max; /* space at name (only when reading header) */ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ uInt comm_max; /* space at comment (only when reading header) */ int hcrc; /* true if there was or will be a header crc */ int done; /* true when done reading gzip header (not used when writing a gzip file) */ } gz_header; typedef gz_header FAR *gz_headerp; /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out has dropped to zero. The application must initialize zalloc, zfree and opaque before calling the init function. All other fields are set by the compression library and must not be updated by the application. The opaque value provided by the application will be passed as the first parameter for calls of zalloc and zfree. This can be useful for custom memory management. The compression library attaches no meaning to the opaque value. zalloc must return Z_NULL if there is not enough memory for the object. If zlib is used in a multi-threaded application, zalloc and zfree must be thread safe. On 16-bit systems, the functions zalloc and zfree must be able to allocate exactly 65536 bytes, but will not be required to allocate more than this if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers returned by zalloc for objects of exactly 65536 bytes *must* have their offset normalized to zero. The default allocation function provided by this library ensures this (see zutil.c). To reduce memory requirements and avoid any allocation of 64K objects, at the expense of compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h). The fields total_in and total_out can be used for statistics or progress reports. After compression, total_in holds the total size of the uncompressed data and may be saved for use in the decompressor (particularly if the decompressor wants to decompress everything in a single step). */ /* constants */ #define Z_NO_FLUSH 0 #define Z_PARTIAL_FLUSH 1 #define Z_SYNC_FLUSH 2 #define Z_FULL_FLUSH 3 #define Z_FINISH 4 #define Z_BLOCK 5 #define Z_TREES 6 /* Allowed flush values; see deflate() and inflate() below for details */ #define Z_OK 0 #define Z_STREAM_END 1 #define Z_NEED_DICT 2 #define Z_ERRNO (-1) #define Z_STREAM_ERROR (-2) #define Z_DATA_ERROR (-3) #define Z_MEM_ERROR (-4) #define Z_BUF_ERROR (-5) #define Z_VERSION_ERROR (-6) /* Return codes for the compression/decompression functions. Negative values * are errors, positive values are used for special but normal events. */ #define Z_NO_COMPRESSION 0 #define Z_BEST_SPEED 1 #define Z_BEST_COMPRESSION 9 #define Z_DEFAULT_COMPRESSION (-1) /* compression levels */ #define Z_FILTERED 1 #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 #define Z_FIXED 4 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 #define Z_TEXT 1 #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 /* Possible values of the data_type field (though see inflate()) */ #define Z_DEFLATED 8 /* The deflate compression method (the only one supported in this version) */ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ #define zlib_version zlibVersion() /* for compatibility with versions < 1.0.2 */ /* basic functions */ ZEXTERN const char * ZEXPORT zlibVersion OF((void)); /* The application can compare zlibVersion and ZLIB_VERSION for consistency. If the first character differs, the library code actually used is not compatible with the zlib.h header file used by the application. This check is automatically made by deflateInit and inflateInit. */ /* ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); Initializes the internal stream state for compression. The fields zalloc, zfree and opaque must be initialized before by the caller. If zalloc and zfree are set to Z_NULL, deflateInit updates them to use default allocation functions. The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION requests a default compromise between speed and compression (currently equivalent to level 6). deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if level is not a valid compression level, or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); /* deflate compresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. deflate performs one or both of the following actions: - Compress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in and avail_in are updated and processing will resume at this point for the next call of deflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. This action is forced if the parameter flush is non zero. Forcing flush frequently degrades the compression ratio, so this parameter should be set only when necessary (in interactive applications). Some output may be provided even if flush is not set. Before the call of deflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating avail_in or avail_out accordingly; avail_out should never be zero before the call. The application can consume the compressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to decide how much data to accumulate before producing output, in order to maximize compression. If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so that the decompressor can get all input data available so far. (In particular avail_in is zero after the call if enough output space has been provided before the call.) Flushing may degrade compression for some compression algorithms and so it should be used only when necessary. This completes the current deflate block and follows it with an empty stored block that is three bits plus filler bits to the next byte, followed by four bytes (00 00 ff ff). If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the output buffer, but the output is not aligned to a byte boundary. All of the input data so far will be available to the decompressor, as for Z_SYNC_FLUSH. This completes the current deflate block and follows it with an empty fixed codes block that is 10 bits long. This assures that enough bytes are output in order for the decompressor to finish the block before the empty fixed code block. If flush is set to Z_BLOCK, a deflate block is completed and emitted, as for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to seven bits of the current block are held to be written as the next byte after the next deflate block is completed. In this case, the decompressor may not be provided enough bits at this point in order to complete decompression of the data provided so far to the compressor. It may need to wait for the next block to be emitted. This is for advanced applications that need to control the emission of deflate blocks. If flush is set to Z_FULL_FLUSH, all output is flushed as with Z_SYNC_FLUSH, and the compression state is reset so that decompression can restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade compression. If deflate returns with avail_out == 0, this function must be called again with the same value of the flush parameter and more output space (updated avail_out), until the flush is complete (deflate returns with non-zero avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that avail_out is greater than six to avoid repeated flush markers due to avail_out == 0 on return. If the parameter flush is set to Z_FINISH, pending input is processed, pending output is flushed and deflate returns with Z_STREAM_END if there was enough output space; if deflate returns with Z_OK, this function must be called again with Z_FINISH and more output space (updated avail_out) but no more input data, until it returns with Z_STREAM_END or an error. After deflate has returned Z_STREAM_END, the only possible operations on the stream are deflateReset or deflateEnd. Z_FINISH can be used immediately after deflateInit if all the compression is to be done in a single step. In this case, avail_out must be at least the value returned by deflateBound (see below). If deflate does not return Z_STREAM_END, then it must be called again as described above. deflate() sets strm->adler to the adler32 checksum of all input read so far (that is, total_in bytes). deflate() may update strm->data_type if it can make a good guess about the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. deflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if all input has been consumed and all output has been produced (only when flush is set to Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possible (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and deflate() can be called again with more input and more output space to continue compressing. */ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent, Z_DATA_ERROR if the stream was freed prematurely (some input or output was discarded). In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. If next_in is not Z_NULL and avail_in is large enough (the exact value depends on the compression method), inflateInit determines the compression method from the zlib header and allocates all data structures accordingly; otherwise the allocation will be deferred to the first call of inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to use default allocation functions. inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may introduce some output latency (reading input without producing any output) except when forced to flush. The detailed semantics are as follows. inflate performs one or both of the following actions: - Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in is updated and processing will resume at this point for the next call of inflate(). - Provide more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter). Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending. The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH, Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop if and when it gets to the next deflate block boundary. When decoding the zlib or gzip format, this will cause inflate() to return immediately after the header and before the first block. When doing a raw inflate, inflate() will go ahead and process the first block, and will return when it gets to the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. Also to assist in this, on return inflate() will set strm->data_type to the number of unused bits in the last byte taken from strm->next_in, plus 64 if inflate() is currently decoding the last block in the deflate stream, plus 128 if inflate() returned immediately after decoding an end-of-block code or decoding the complete header up to just before the first byte of the deflate stream. The end-of-block will not be indicated until all of the uncompressed data from that block has been written to strm->next_out. The number of unused bits may in general be greater than seven, except when bit 7 of data_type is set, in which case the number of unused bits will be less than eight. data_type is set as noted here every time inflate() returns for all flush options, and so can be used to determine the amount of currently consumed input in bits. The Z_TREES option behaves as Z_BLOCK does, but it also returns when the end of each deflate block header is reached, before any actual data in that block is decoded. This allows the caller to determine the length of the deflate block header for later use in random access within a deflate block. 256 is added to the value of strm->data_type when inflate() returns immediately after reaching the end of the deflate block header. inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all the uncompressed data. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The next operation on this stream must be inflateEnd to deallocate the decompression state. The use of Z_FINISH is never required, but can be used to inform inflate that a faster approach may be used for the single inflate() call. In this implementation, inflate() always flushes as much output as possible to the output buffer, and always uses the faster approach on the first call. So the only effect of the flush parameter in this implementation is on the return value of inflate(), as noted below, or when it returns early because Z_BLOCK or Z_TREES is used. If a preset dictionary is needed after this call (see inflateSetDictionary below), inflate sets strm->adler to the adler32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the adler32 checksum of all output produced so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described below. At the end of the stream, inflate() checks that its computed adler32 checksum is equal to that saved by the compressor and returns Z_STREAM_END only if the checksum is correct. inflate() can decompress and check either zlib-wrapped or gzip-wrapped deflate data. The header type is detected automatically, if requested when initializing with inflateInit2(). Any information contained in the gzip header is not retained, so applications that need that information should instead use raw inflate, see inflateInit2() below, or inflateBack() and perform their own processing of the gzip header and trailer. inflate() returns Z_OK if some progress has been made (more input processed or more output produced), Z_STREAM_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_NEED_DICT if a preset dictionary is needed at this point, Z_DATA_ERROR if the input data was corrupted (input stream not conforming to the zlib format or incorrect check value), Z_STREAM_ERROR if the stream structure was inconsistent (for example next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress is possible or if there was not enough room in the output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and inflate() can be called again with more input and more output space to continue decompressing. If Z_DATA_ERROR is returned, the application may then call inflateSync() to look for a good compression block if a partial recovery of the data is desired. */ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any pending output. inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state was inconsistent. In the error case, msg may be set but then points to a static string (which must not be deallocated). */ /* Advanced functions */ /* The following functions are needed only in some special applications. */ /* ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy)); This is another version of deflateInit with more compression options. The fields next_in, zalloc, zfree and opaque must be initialized before by the caller. The method parameter is the compression method. It must be Z_DEFLATED in this version of the library. The windowBits parameter is the base two logarithm of the window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. Larger values of this parameter result in better compression at the expense of memory usage. The default value is 15 if deflateInit is used instead. windowBits can also be -8..-15 for raw deflate. In this case, -windowBits determines the window size. deflate() will then generate raw deflate data with no zlib header or trailer, and will not compute an adler32 check value. windowBits can also be greater than 15 for optional gzip encoding. Add 16 to windowBits to write a simple gzip header and trailer around the compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), no header crc, and the operating system will be set to 255 (unknown). If a gzip stream is being written, strm->adler is a crc32 instead of an adler32. The memLevel parameter specifies how much memory should be allocated for the internal compression state. memLevel=1 uses minimum memory but is slow and reduces compression ratio; memLevel=9 uses maximum memory for optimal speed. The default value is 8. See zconf.h for total memory usage as a function of windowBits and memLevel. The strategy parameter is used to tune the compression algorithm. Use the value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no string match), or Z_RLE to limit match distances to one (run-length encoding). Filtered data consists mostly of small values with a somewhat random distribution. In this case, the compression algorithm is tuned to compress them better. The effect of Z_FILTERED is to force more Huffman coding and less string matching; it is somewhat intermediate between Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the compressed output even if it is not set appropriately. Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler decoder for special applications. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible with the version assumed by the caller (ZLIB_VERSION). msg is set to null if there is no error message. deflateInit2 does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* Initializes the compression dictionary from the given byte sequence without producing any compressed output. This function must be called immediately after deflateInit, deflateInit2 or deflateReset, before any call of deflate. The compressor and decompressor must use exactly the same dictionary (see inflateSetDictionary). The dictionary should consist of strings (byte sequences) that are likely to be encountered later in the data to be compressed, with the most commonly used strings preferably put towards the end of the dictionary. Using a dictionary is most useful when the data to be compressed is short and can be predicted with good accuracy; the data can then be compressed better than with the default empty dictionary. Depending on the size of the compression data structures selected by deflateInit or deflateInit2, a part of the dictionary may in effect be discarded, for example if the dictionary is larger than the window size provided in deflateInit or deflateInit2. Thus the strings most likely to be useful should be put at the end of the dictionary, not at the front. In addition, the current implementation of deflate will use at most the window size minus 262 bytes of the provided dictionary. Upon return of this function, strm->adler is set to the adler32 value of the dictionary; the decompressor may later use this value to determine which dictionary has been used by the compressor. (The adler32 value applies to the whole dictionary even if only a subset of the dictionary is actually used by the compressor.) If a raw deflate was requested, then the adler32 value is not computed and strm->adler is not set. deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent (for example if deflate has already been called for this stream or if the compression method is bsort). deflateSetDictionary does not perform any compression: this will be done by deflate(). */ ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when several compression strategies will be tried, for example when there are several ways of pre-processing the input data with a filter. The streams that will be discarded should then be freed by calling deflateEnd. Note that deflateCopy duplicates the internal compression state which can be quite large, so this strategy is slow and can consume lots of memory. deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); /* This function is equivalent to deflateEnd followed by deflateInit, but does not free and reallocate all the internal compression state. The stream will keep the same compression level and any other attributes that may have been set by deflateInit2. deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, int level, int strategy)); /* Dynamically update the compression level and compression strategy. The interpretation of level and strategy is as in deflateInit2. This can be used to switch between compression and straight copy of the input data, or to switch to a different kind of input data requiring a different strategy. If the compression level is changed, the input available so far is compressed with the old level (and may be flushed); the new level will take effect only at the next call of deflate(). Before the call of deflateParams, the stream state must be set as for a call of deflate(), since the currently available input may have to be compressed and flushed. In particular, strm->avail_out must be non-zero. deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR if strm->avail_out was zero. */ ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, int good_length, int max_lazy, int nice_length, int max_chain)); /* Fine tune deflate's internal compression parameters. This should only be used by someone who understands the algorithm used by zlib's deflate for searching for the best matching string, and even then only by the most fanatic optimizer trying to squeeze out the last compressed bit for their specific input data. Read the deflate.c source code for the meaning of the max_lazy, good_length, nice_length, and max_chain parameters. deflateTune() can be called after deflateInit() or deflateInit2(), and returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. */ ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, uLong sourceLen)); /* deflateBound() returns an upper bound on the compressed size after deflation of sourceLen bytes. It must be called after deflateInit() or deflateInit2(), and after deflateSetHeader(), if used. This would be used to allocate an output buffer for deflation in a single pass, and so would be called before deflate(). */ ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, int bits, int value)); /* deflatePrime() inserts bits in the deflate output stream. The intent is that this function is used to start off the deflate output with the bits leftover from a previous deflate stream when appending to it. As such, this function can only be used for raw deflate, and must be used before the first deflate() call after a deflateInit2() or deflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the output. deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, gz_headerp head)); /* deflateSetHeader() provides gzip header information for when a gzip stream is requested by deflateInit2(). deflateSetHeader() may be called after deflateInit2() or deflateReset() and before the first call of deflate(). The text, time, os, extra field, name, and comment information in the provided gz_header structure are written to the gzip header (xflag is ignored -- the extra flags are set according to the compression level). The caller must assure that, if not Z_NULL, name and comment are terminated with a zero byte, and that if extra is not Z_NULL, that extra_len bytes are available there. If hcrc is true, a gzip header crc is included. Note that the current versions of the command-line version of gzip (up through version 1.3.x) do not support header crc's, and will report that it is a "multi-part gzip file" and give up. If deflateSetHeader is not used, the default gzip header has text false, the time set to zero, and os set to 255, with no extra, name, or comment fields. The gzip header is returned to the default state by deflateReset(). deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, int windowBits)); This is another version of inflateInit with an extra parameter. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by the caller. The windowBits parameter is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The default value is 15 if inflateInit is used instead. windowBits must be greater than or equal to the windowBits value provided to deflateInit2() while compressing, or it must be equal to 15 if deflateInit2() was not used. If a compressed stream with a larger window size is given as input, inflate() will return with the error code Z_DATA_ERROR instead of trying to allocate a larger window. windowBits can also be zero to request that inflate use the window size in the zlib header of the compressed stream. windowBits can also be -8..-15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. This is for use with other formats that use the deflate compressed data format such as zip. Those formats provide their own check values. If a custom format is developed using the raw deflate format for compressed data, it is recommended that a check value such as an adler32 or a crc32 be applied to the uncompressed data as is done in the zlib, gzip, and zip formats. For most applications, the zlib format should be used as is. Note that comments above on the use in deflateInit2() applies to the magnitude of windowBits. windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a crc32 instead of an adler32. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_VERSION_ERROR if the zlib library version is incompatible with the version assumed by the caller, or Z_STREAM_ERROR if the parameters are invalid, such as a null pointer to the structure. msg is set to null if there is no error message. inflateInit2 does not perform any decompression apart from possibly reading the zlib header if present: actual decompression will be done by inflate(). (So next_in and avail_in may be modified, but next_out and avail_out are unused and unchanged.) The current implementation of inflateInit2() does not process any header information -- that is deferred until inflate() is called. */ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); /* Initializes the decompression dictionary from the given uncompressed byte sequence. This function must be called immediately after a call of inflate, if that call returned Z_NEED_DICT. The dictionary chosen by the compressor can be determined from the adler32 value returned by that call of inflate. The compressor and decompressor must use exactly the same dictionary (see deflateSetDictionary). For raw inflate, this function can be called immediately after inflateInit2() or inflateReset() and before any call of inflate() to set the dictionary. The application must insure that the dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the expected one (incorrect adler32 value). inflateSetDictionary does not perform any decompression: this will be done by subsequent calls of inflate(). */ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until a full flush point (see above the description of deflate with Z_FULL_FLUSH) can be found, or until all available input is skipped. No output is provided. inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point has been found, or Z_STREAM_ERROR if the stream structure was inconsistent. In the success case, the application may save the current current value of total_in which indicates where valid compressed data was found. In the error case, the application may repeatedly call inflateSync, providing more input each time, until success or end of the input data. */ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, z_streamp source)); /* Sets the destination stream as a complete copy of the source stream. This function can be useful when randomly accessing a large stream. The first pass through the stream can periodically record the inflate state, allowing restarting inflate at those points when randomly accessing the stream. inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc being Z_NULL). msg is left unchanged in both source and destination. */ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. The stream will keep attributes that may have been set by inflateInit2. inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL). */ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, int windowBits)); /* This function is the same as inflateReset, but it also permits changing the wrap and window size requests. The windowBits parameter is interpreted the same as it is for inflateInit2. inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent (such as zalloc or state being Z_NULL), or if the windowBits parameter is invalid. */ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, int bits, int value)); /* This function inserts bits in the inflate input stream. The intent is that this function is used to start inflating at a bit position in the middle of a byte. The provided bits will be used before any bytes are used from next_in. This function should only be used with raw inflate, and should be used before the first inflate() call after inflateInit2() or inflateReset(). bits must be less than or equal to 16, and that many of the least significant bits of value will be inserted in the input. If bits is negative, then the input stream bit buffer is emptied. Then inflatePrime() can be called again to put bits in the buffer. This is used to clear out bits leftover after feeding inflate a block description prior to feeding inflate codes. inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); /* This function returns two values, one in the lower 16 bits of the return value, and the other in the remaining upper bits, obtained by shifting the return value down 16 bits. If the upper value is -1 and the lower value is zero, then inflate() is currently decoding information outside of a block. If the upper value is -1 and the lower value is non-zero, then inflate is in the middle of a stored block, with the lower value equaling the number of bytes from the input remaining to copy. If the upper value is not -1, then it is the number of bits back from the current bit position in the input of the code (literal or length/distance pair) currently being processed. In that case the lower value is the number of bytes already emitted for that code. A code is being processed if inflate is waiting for more input to complete decoding of the code, or if it has completed decoding but is waiting for more output space to write the literal or match data. inflateMark() is used to mark locations in the input data for random access, which may be at bit positions, and to note those cases where the output of a code may span boundaries of random access blocks. The current location in the input stream can be determined from avail_in and data_type as noted in the description for the Z_BLOCK flush parameter for inflate. inflateMark returns the value noted above or -1 << 16 if the provided source stream state was inconsistent. */ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, gz_headerp head)); /* inflateGetHeader() requests that gzip header information be stored in the provided gz_header structure. inflateGetHeader() may be called after inflateInit2() or inflateReset(), and before the first call of inflate(). As inflate() processes the gzip stream, head->done is zero until the header is completed, at which time head->done is set to one. If a zlib stream is being decoded, then head->done is set to -1 to indicate that there will be no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be used to force inflate() to return immediately after header processing is complete and before any actual data is decompressed. The text, time, xflags, and os fields are filled in with the gzip header contents. hcrc is set to true if there is a header CRC. (The header CRC was valid if done is set to one.) If extra is not Z_NULL, then extra_max contains the maximum number of bytes to write to extra. Once done is true, extra_len contains the actual extra field length, and extra contains the extra field, or that field truncated if extra_max is less than extra_len. If name is not Z_NULL, then up to name_max characters are written there, terminated with a zero unless the length is greater than name_max. If comment is not Z_NULL, then up to comm_max characters are written there, terminated with a zero unless the length is greater than comm_max. When any of extra, name, or comment are not Z_NULL and the respective field is not present in the header, then that field is set to Z_NULL to signal its absence. This allows the use of deflateSetHeader() with the returned structure to duplicate the header. However if those fields are set to allocated memory, then the application will need to save those pointers elsewhere so that they can be eventually freed. If inflateGetHeader is not used, then the header information is simply discarded. The header is always checked for validity, including the header CRC if present. inflateReset() will reset the process to discard the header information. The application would need to call inflateGetHeader() again to retrieve the header from the next gzip stream. inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source stream state was inconsistent. */ /* ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, unsigned char FAR *window)); Initialize the internal stream state for decompression using inflateBack() calls. The fields zalloc, zfree and opaque in strm must be initialized before the call. If zalloc and zfree are Z_NULL, then the default library- derived memory allocation routines are used. windowBits is the base two logarithm of the window size, in the range 8..15. window is a caller supplied buffer of that size. Except for special applications where it is assured that deflate was used with small window sizes, windowBits must be 15 and a 32K byte window must be supplied to be able to decompress general deflate streams. See inflateBack() for the usage of these routines. inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of the paramaters are invalid, Z_MEM_ERROR if the internal state could not be allocated, or Z_VERSION_ERROR if the version of the library does not match the version of the header file. */ typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc)); /* inflateBack() does a raw inflate with a single call using a call-back interface for input and output. This is more efficient than inflate() for file i/o applications in that it avoids copying between the output and the sliding window by simply making the window itself the output buffer. This function trusts the application to not change the output buffer passed by the output function, at least until inflateBack() returns. inflateBackInit() must be called first to allocate the internal state and to initialize the state with the user-provided window buffer. inflateBack() may then be used multiple times to inflate a complete, raw deflate stream with each call. inflateBackEnd() is then called to free the allocated state. A raw deflate stream is one with no zlib or gzip header or trailer. This routine would normally be used in a utility that reads zip or gzip files and writes out uncompressed files. The utility would decode the header and process the trailer on its own, hence this routine expects only the raw deflate stream to decompress. This is different from the normal behavior of inflate(), which expects either a zlib or gzip header and trailer around the deflate stream. inflateBack() uses two subroutines supplied by the caller that are then called by inflateBack() for input and output. inflateBack() calls those routines until it reads a complete deflate stream and writes out all of the uncompressed data, or until it encounters an error. The function's parameters and return types are defined above in the in_func and out_func typedefs. inflateBack() will call in(in_desc, &buf) which should return the number of bytes of provided input, and a pointer to that input in buf. If there is no input available, in() must return zero--buf is ignored in that case--and inflateBack() will return a buffer error. inflateBack() will call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1]. out() should return zero on success, or non-zero on failure. If out() returns non-zero, inflateBack() will return with an error. Neither in() nor out() are permitted to change the contents of the window provided to inflateBackInit(), which is also the buffer that out() uses to write from. The length written by out() will be at most the window size. Any non-zero amount of input may be provided by in(). For convenience, inflateBack() can be provided input on the first call by setting strm->next_in and strm->avail_in. If that input is exhausted, then in() will be called. Therefore strm->next_in must be initialized before calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in must also be initialized, and then if strm->avail_in is not zero, input will initially be taken from strm->next_in[0 .. strm->avail_in - 1]. The in_desc and out_desc parameters of inflateBack() is passed as the first parameter of in() and out() respectively when they are called. These descriptors can be optionally used to pass any information that the caller- supplied in() and out() functions need to do their job. On return, inflateBack() will set strm->next_in and strm->avail_in to pass back any unused input that was provided by the last in() call. The return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR if in() or out() returned an error, Z_DATA_ERROR if there was a format error in the deflate stream (in which case strm->msg is set to indicate the nature of the error), or Z_STREAM_ERROR if the stream was not properly initialized. In the case of Z_BUF_ERROR, an input or output error can be distinguished using strm->next_in which will be Z_NULL only if in() returned an error. If strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning non-zero. (in() will always be called before out(), so strm->next_in is assured to be defined if out() returns non-zero.) Note that inflateBack() cannot return Z_OK. */ ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); /* All memory allocated by inflateBackInit() is freed. inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream state was inconsistent. */ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void)); /* Return flags indicating compile-time options. Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other: 1.0: size of uInt 3.2: size of uLong 5.4: size of voidpf (pointer) 7.6: size of z_off_t Compiler, assembler, and debug options: 8: DEBUG 9: ASMV or ASMINF -- use ASM code 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention 11: 0 (reserved) One-time table building (smaller code, but not thread-safe if true): 12: BUILDFIXED -- build static block decoding tables when needed 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed 14,15: 0 (reserved) Library content (indicates missing functionality): 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking deflate code when not needed) 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect and decode gzip streams (to avoid linking crc code) 18-19: 0 (reserved) Operation variations (changes in library functionality): 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate 21: FASTEST -- deflate algorithm with only one, lowest compression level 22,23: 0 (reserved) The sprintf variant used by gzprintf (zero is best): 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! 26: 0 = returns value, 1 = void -- 1 means inferred string length returned Remainder: 27-31: 0 (reserved) */ /* utility functions */ /* The following utility functions are implemented on top of the basic stream-oriented functions. To simplify the interface, some default options are assumed (compression level and memory usage, standard memory allocation functions). The source code of these utility functions can be modified if you need special options. */ ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Compresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. compress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer. */ ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen, int level)); /* Compresses the source buffer into the destination buffer. The level parameter has the same meaning as in deflateInit. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be at least the value returned by compressBound(sourceLen). Upon exit, destLen is the actual size of the compressed buffer. compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, Z_STREAM_ERROR if the level parameter is invalid. */ ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); /* compressBound() returns an upper bound on the compressed size after compress() or compress2() on sourceLen bytes. It would be used before a compress() or compress2() call to allocate the destination buffer. */ ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); /* Decompresses the source buffer into the destination buffer. sourceLen is the byte length of the source buffer. Upon entry, destLen is the total size of the destination buffer, which must be large enough to hold the entire uncompressed data. (The size of the uncompressed data must have been saved previously by the compressor and transmitted to the decompressor by some mechanism outside the scope of this compression library.) Upon exit, destLen is the actual size of the uncompressed buffer. uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if there was not enough room in the output buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. */ /* gzip file access functions */ /* This library supports reading and writing files in gzip (.gz) format with an interface similar to that of stdio, using the functions that start with "gz". The gzip format is different from the zlib format. gzip is a gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. */ typedef voidp gzFile; /* opaque gzip file descriptor */ /* ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); Opens a gzip (.gz) file for reading or writing. The mode parameter is as in fopen ("rb" or "wb") but can also include a compression level ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression as in "wb9F". (See the description of deflateInit2 for more information about the strategy parameter.) Also "a" can be used instead of "w" to request that the gzip stream that will be written be appended to the file. "+" will result in an error, since reading and writing to the same gzip file is not supported. gzopen can be used to read a file which is not in gzip format; in this case gzread will directly read from the file without decompression. gzopen returns NULL if the file could not be opened, if there was insufficient memory to allocate the gzFile state, or if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). errno can be checked to determine if the reason gzopen failed was that the file could not be opened. */ ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); /* gzdopen associates a gzFile with the file descriptor fd. File descriptors are obtained from calls like open, dup, creat, pipe or fileno (if the file has been previously opened with fopen). The mode parameter is as in gzopen. The next call of gzclose on the returned gzFile will also close the file descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd, mode);. The duplicated descriptor should be saved to avoid a leak, since gzdopen does not close fd if it fails. gzdopen returns NULL if there was insufficient memory to allocate the gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not provided, or '+' was provided), or if fd is -1. The file descriptor is not used until the next gz* read, write, seek, or close operation, so gzdopen will not detect if fd is invalid (unless fd is -1). */ ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); /* Set the internal buffer size used by this library's functions. The default buffer size is 8192 bytes. This function must be called after gzopen() or gzdopen(), and before any other calls that read or write the file. The buffer memory allocation is always deferred to the first read or write. Two buffers are allocated, either both of the specified size when writing, or one of the specified size and the other twice that size when reading. A larger buffer size of, for example, 64K or 128K bytes will noticeably increase the speed of decompression (reading). The new buffer size also affects the maximum length for gzprintf(). gzbuffer() returns 0 on success, or -1 on failure, such as being called too late. */ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); /* Dynamically update the compression level or strategy. See the description of deflateInit2 for the meaning of these parameters. gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not opened for writing. */ ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); /* Reads the given number of uncompressed bytes from the compressed file. If the input file was not in gzip format, gzread copies the given number of bytes into the buffer. After reaching the end of a gzip stream in the input, gzread will continue to read, looking for another gzip stream, or failing that, reading the rest of the input file directly without decompression. The entire input file will be read if gzread is called until it returns less than the requested len. gzread returns the number of uncompressed bytes actually read, less than len for end of file, or -1 for error. */ ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len)); /* Writes the given number of uncompressed bytes into the compressed file. gzwrite returns the number of uncompressed bytes written or 0 in case of error. */ ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); /* Converts, formats, and writes the arguments to the compressed file under control of the format string, as in fprintf. gzprintf returns the number of uncompressed bytes actually written, or 0 in case of error. The number of uncompressed bytes written is limited to 8191, or one less than the buffer size given to gzbuffer(). The caller should assure that this limit is not exceeded. If it is exceeded, then gzprintf() will return an error (0) with nothing written. In this case, there may also be a buffer overflow with unpredictable consequences, which is possible only if zlib was compiled with the insecure functions sprintf() or vsprintf() because the secure snprintf() or vsnprintf() functions were not available. This can be determined using zlibCompileFlags(). */ ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); /* Writes the given null-terminated string to the compressed file, excluding the terminating null character. gzputs returns the number of characters written, or -1 in case of error. */ ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); /* Reads bytes from the compressed file until len-1 characters are read, or a newline character is read and transferred to buf, or an end-of-file condition is encountered. If any characters are read or if len == 1, the string is terminated with a null character. If no characters are read due to an end-of-file or len < 1, then the buffer is left untouched. gzgets returns buf which is a null-terminated string, or it returns NULL for end-of-file or in case of error. If there was an error, the contents at buf are indeterminate. */ ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); /* Writes c, converted to an unsigned char, into the compressed file. gzputc returns the value that was written, or -1 in case of error. */ ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); /* Reads one byte from the compressed file. gzgetc returns this byte or -1 in case of end of file or error. */ ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); /* Push one character back onto the stream to be read as the first character on the next read. At least one character of push-back is allowed. gzungetc() returns the character pushed, or -1 on failure. gzungetc() will fail if c is -1, and may fail if a character has been pushed but not read yet. If gzungetc is used immediately after gzopen or gzdopen, at least the output buffer size of pushed characters is allowed. (See gzbuffer above.) The pushed character will be discarded if the stream is repositioned with gzseek() or gzrewind(). */ ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); /* Flushes all pending output into the compressed file. The parameter flush is as in the deflate() function. The return value is the zlib error number (see function gzerror below). gzflush is only permitted when writing. If the flush parameter is Z_FINISH, the remaining data is written and the gzip stream is completed in the output. If gzwrite() is called again, a new gzip stream will be started in the output. gzread() is able to read such concatented gzip streams. gzflush should be called only when strictly necessary because it will degrade compression if called too often. */ /* ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, z_off_t offset, int whence)); Sets the starting position for the next gzread or gzwrite on the given compressed file. The offset represents a number of bytes in the uncompressed data stream. The whence parameter is defined as in lseek(2); the value SEEK_END is not supported. If the file is opened for reading, this function is emulated but can be extremely slow. If the file is opened for writing, only forward seeks are supported; gzseek then compresses a sequence of zeroes up to the new starting position. gzseek returns the resulting offset location as measured in bytes from the beginning of the uncompressed stream, or -1 in case of error, in particular if the file is opened for writing and the new starting position would be before the current position. */ ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); /* Rewinds the given file. This function is supported only for reading. gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) */ /* ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); Returns the starting position for the next gzread or gzwrite on the given compressed file. This position represents a number of bytes in the uncompressed data stream, and is zero when starting, even if appending or reading a gzip stream from the middle of a file using gzdopen(). gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) */ /* ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); Returns the current offset in the file being read or written. This offset includes the count of bytes that precede the gzip stream, for example when appending or when using gzdopen() for reading. When reading, the offset does not include as yet unused buffered input. This information can be used for a progress indicator. On error, gzoffset() returns -1. */ ZEXTERN int ZEXPORT gzeof OF((gzFile file)); /* Returns true (1) if the end-of-file indicator has been set while reading, false (0) otherwise. Note that the end-of-file indicator is set only if the read tried to go past the end of the input, but came up short. Therefore, just like feof(), gzeof() may return false even if there is no more data to read, in the event that the last read request was for the exact number of bytes remaining in the input file. This will happen if the input file size is an exact multiple of the buffer size. If gzeof() returns true, then the read functions will return no more data, unless the end-of-file indicator is reset by gzclearerr() and the input file has grown since the previous end of file was detected. */ ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); /* Returns true (1) if file is being copied directly while reading, or false (0) if file is a gzip stream being decompressed. This state can change from false to true while reading the input file if the end of a gzip stream is reached, but is followed by data that is not another gzip stream. If the input file is empty, gzdirect() will return true, since the input does not contain a gzip stream. If gzdirect() is used immediately after gzopen() or gzdopen() it will cause buffers to be allocated to allow reading the file to determine if it is a gzip file. Therefore if gzbuffer() is used, it should be called before gzdirect(). */ ZEXTERN int ZEXPORT gzclose OF((gzFile file)); /* Flushes all pending output if necessary, closes the compressed file and deallocates the (de)compression state. Note that once file is closed, you cannot call gzerror with file, since its structures have been deallocated. gzclose must not be called more than once on the same file, just as free must not be called more than once on the same allocation. gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a file operation error, or Z_OK on success. */ ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); /* Same as gzclose(), but gzclose_r() is only for use when reading, and gzclose_w() is only for use when writing or appending. The advantage to using these instead of gzclose() is that they avoid linking in zlib compression or decompression code that is not used when only reading or only writing respectively. If gzclose() is used, then both compression and decompression code will be included the application when linking to a static zlib library. */ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); /* Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. The application must not modify the returned string. Future calls to this function may invalidate the previously returned string. If file is closed, then the string previously returned by gzerror will no longer be available. gzerror() should be used to distinguish errors from end-of-file for those functions above that do not distinguish those cases in their return values. */ ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); /* Clears the error and end-of-file flags for file. This is analogous to the clearerr() function in stdio. This is useful for continuing to read a gzip file that is being written concurrently. */ /* checksum functions */ /* These functions are not related to compression but are exported anyway because they might be useful in applications using the compression library. */ ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and return the updated checksum. If buf is Z_NULL, this function returns the required initial value for the checksum. An Adler-32 checksum is almost as reliable as a CRC32 but can be computed much faster. Usage example: uLong adler = adler32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { adler = adler32(adler, buffer, length); } if (adler != original_adler) error(); */ /* ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, z_off_t len2)); Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. */ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); /* Update a running CRC-32 with the bytes buf[0..len-1] and return the updated CRC-32. If buf is Z_NULL, this function returns the required initial value for the for the crc. Pre- and post-conditioning (one's complement) is performed within this function so it shouldn't be done by the application. Usage example: uLong crc = crc32(0L, Z_NULL, 0); while (read_buffer(buffer, length) != EOF) { crc = crc32(crc, buffer, length); } if (crc != original_crc) error(); */ /* ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); Combine two CRC-32 check values into one. For two sequences of bytes, seq1 and seq2 with lengths len1 and len2, CRC-32 check values were calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and len2. */ /* various hacks, don't look :) */ /* deflateInit and inflateInit are macros to allow checking the zlib version * and the compiler's view of z_stream: */ ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, const char *version, int stream_size)); ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, int stream_size)); #define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) #define inflateInit(strm) \ inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, sizeof(z_stream)) #define inflateInit2(strm, windowBits) \ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) #define inflateBackInit(strm, windowBits, window) \ inflateBackInit_((strm), (windowBits), (window), \ ZLIB_VERSION, sizeof(z_stream)) /* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if * both are true, the application gets the *64 functions, and the regular * functions are changed to 64 bits) -- in case these are set on systems * without large file support, _LFS64_LARGEFILE must also be true */ #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); #endif #if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 # define gzopen gzopen64 # define gzseek gzseek64 # define gztell gztell64 # define gzoffset gzoffset64 # define adler32_combine adler32_combine64 # define crc32_combine crc32_combine64 # ifdef _LARGEFILE64_SOURCE ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); # endif #else ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif /* hack for buggy compilers */ #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) struct internal_state {int dummy;}; #endif /* undocumented functions */ ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); #ifdef __cplusplus } #endif #endif /* ZLIB_H */ ================================================ FILE: Libraries/Core/Windows/Libs/Win32/Release/CSBase.lib ================================================ [File too large to display: 11.7 MB] ================================================ FILE: Libraries/Core/Windows/Libs/x64/Release/CSBase.lib ================================================ [File too large to display: 11.7 MB] ================================================ FILE: Libraries/Core/iOS/Headers/Reachability/CSReachability.h ================================================ /* File: Reachability.h Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. Version: 3.5 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (C) 2014 Apple Inc. All Rights Reserved. */ #import #import #import typedef enum : NSInteger { NotReachable = 0, ReachableViaWiFi, ReachableViaWWAN } NetworkStatus; extern NSString *kReachabilityChangedNotification; @interface CSReachability : NSObject /*! * Use to check the reachability of a given host name. */ + (instancetype)reachabilityWithHostName:(NSString *)hostName; /*! * Use to check the reachability of a given IP address. */ + (instancetype)reachabilityWithAddress:(const struct sockaddr_in *)hostAddress; /*! * Checks whether the default route is available. Should be used by applications that do not connect to a particular host. */ + (instancetype)reachabilityForInternetConnection; /*! * Checks whether a local WiFi connection is available. */ + (instancetype)reachabilityForLocalWiFi; /*! * Start listening for reachability notifications on the current run loop. */ - (BOOL)startNotifier; - (void)stopNotifier; - (NetworkStatus)currentReachabilityStatus; /*! * WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand. */ - (BOOL)connectionRequired; @end ================================================ FILE: Libraries/Core/iOS/Headers/SHA1/HMAC_SHA1.h ================================================ /* 100% free public domain implementation of the HMAC-SHA1 algorithm by Chien-Chung, Chung (Jim Chung) */ #ifndef __HMAC_SHA1_H__ #define __HMAC_SHA1_H__ #include "SHA1.h" typedef unsigned char BYTE ; class CHMAC_SHA1 : public CSHA1 { private: BYTE m_ipad[64]; BYTE m_opad[64]; char * szReport ; char * SHA1_Key ; char * AppendBuf1 ; char * AppendBuf2 ; public: enum { SHA1_DIGEST_LENGTH = 20, SHA1_BLOCK_SIZE = 64, HMAC_BUF_LEN = 4096 } ; CHMAC_SHA1() :szReport(new char[HMAC_BUF_LEN]), AppendBuf1(new char[HMAC_BUF_LEN]), AppendBuf2(new char[HMAC_BUF_LEN]), SHA1_Key(new char[HMAC_BUF_LEN]) {} ~CHMAC_SHA1() { delete[] szReport ; delete[] AppendBuf1 ; delete[] AppendBuf2 ; delete[] SHA1_Key ; } void HMAC_SHA1(BYTE *text, int text_len, BYTE *key, int key_len, BYTE *digest); }; #endif /* __HMAC_SHA1_H__ */ ================================================ FILE: Libraries/Core/iOS/Headers/SHA1/SHA1.h ================================================ /* 100% free public domain implementation of the SHA-1 algorithm by Dominik Reichl Web: http://www.dominik-reichl.de/ Version 2.1 - 2012-06-19 - Deconstructor (resetting internal variables) is now only implemented if SHA1_WIPE_VARIABLES is defined (which is the default). - Renamed inclusion guard to contain a GUID. - Demo application is now using C++/STL objects and functions. - Unicode build of the demo application now outputs the hashes of both the ANSI and Unicode representations of strings. - Various other demo application improvements. Version 2.0 - 2012-06-14 - Added 'limits.h' include. - Renamed inclusion guard and macros for compliancy (names beginning with an underscore are reserved). Version 1.9 - 2011-11-10 - Added Unicode test vectors. - Improved support for hashing files using the HashFile method that are larger than 4 GB. - Improved file hashing performance (by using a larger buffer). - Disabled unnecessary compiler warnings. - Internal variables are now private. Version 1.8 - 2009-03-16 - Converted project files to Visual Studio 2008 format. - Added Unicode support for HashFile utility method. - Added support for hashing files using the HashFile method that are larger than 2 GB. - HashFile now returns an error code instead of copying an error message into the output buffer. - GetHash now returns an error code and validates the input parameter. - Added ReportHashStl STL utility method. - Added REPORT_HEX_SHORT reporting mode. - Improved Linux compatibility of test program. Version 1.7 - 2006-12-21 - Fixed buffer underrun warning that appeared when compiling with Borland C Builder (thanks to Rex Bloom and Tim Gallagher for the patch). - Breaking change: ReportHash writes the final hash to the start of the buffer, i.e. it's not appending it to the string anymore. - Made some function parameters const. - Added Visual Studio 2005 project files to demo project. Version 1.6 - 2005-02-07 (thanks to Howard Kapustein for patches) - You can set the endianness in your files, no need to modify the header file of the CSHA1 class anymore. - Aligned data support. - Made support/compilation of the utility functions (ReportHash and HashFile) optional (useful when bytes count, for example in embedded environments). Version 1.5 - 2005-01-01 - 64-bit compiler compatibility added. - Made variable wiping optional (define SHA1_WIPE_VARIABLES). - Removed unnecessary variable initializations. - ROL32 improvement for the Microsoft compiler (using _rotl). Version 1.4 - 2004-07-22 - CSHA1 now compiles fine with GCC 3.3 under Mac OS X (thanks to Larry Hastings). Version 1.3 - 2003-08-17 - Fixed a small memory bug and made a buffer array a class member to ensure correct working when using multiple CSHA1 class instances at one time. Version 1.2 - 2002-11-16 - Borlands C++ compiler seems to have problems with string addition using sprintf. Fixed the bug which caused the digest report function not to work properly. CSHA1 is now Borland compatible. Version 1.1 - 2002-10-11 - Removed two unnecessary header file includes and changed BOOL to bool. Fixed some minor bugs in the web page contents. Version 1.0 - 2002-06-20 - First official release. ================ Test Vectors ================ SHA1("abc" in ANSI) = A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D SHA1("abc" in Unicode LE) = 9F04F41A 84851416 2050E3D6 8C1A7ABB 441DC2B5 SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" in ANSI) = 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 SHA1("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" in Unicode LE) = 51D7D876 9AC72C40 9C5B0E3F 69C60ADC 9A039014 SHA1(A million repetitions of "a" in ANSI) = 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F SHA1(A million repetitions of "a" in Unicode LE) = C4609560 A108A0C6 26AA7F2B 38A65566 739353C5 */ #ifndef SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 #define SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 #if !defined(SHA1_UTILITY_FUNCTIONS) && !defined(SHA1_NO_UTILITY_FUNCTIONS) #define SHA1_UTILITY_FUNCTIONS #endif #if !defined(SHA1_STL_FUNCTIONS) && !defined(SHA1_NO_STL_FUNCTIONS) #define SHA1_STL_FUNCTIONS #if !defined(SHA1_UTILITY_FUNCTIONS) #error STL functions require SHA1_UTILITY_FUNCTIONS. #endif #endif #include #include #ifdef SHA1_UTILITY_FUNCTIONS #include #include #endif #ifdef SHA1_STL_FUNCTIONS #include #endif #ifdef _MSC_VER #include #endif // You can define the endian mode in your files without modifying the SHA-1 // source files. Just #define SHA1_LITTLE_ENDIAN or #define SHA1_BIG_ENDIAN // in your files, before including the SHA1.h header file. If you don't // define anything, the class defaults to little endian. #if !defined(SHA1_LITTLE_ENDIAN) && !defined(SHA1_BIG_ENDIAN) #define SHA1_LITTLE_ENDIAN #endif // If you want variable wiping, #define SHA1_WIPE_VARIABLES, if not, // #define SHA1_NO_WIPE_VARIABLES. If you don't define anything, it // defaults to wiping. #if !defined(SHA1_WIPE_VARIABLES) && !defined(SHA1_NO_WIPE_VARIABLES) #define SHA1_WIPE_VARIABLES #endif #if defined(SHA1_HAS_TCHAR) #include #else #ifdef _MSC_VER #include #else #ifndef TCHAR #define TCHAR char #endif #ifndef _T #define _T(__x) (__x) #define _tmain main #define _tprintf printf #define _getts gets #define _tcslen strlen #define _tfopen fopen #define _tcscpy strcpy #define _tcscat strcat #define _sntprintf snprintf #endif #endif #endif /////////////////////////////////////////////////////////////////////////// // Define variable types #ifndef UINT_8 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_8 unsigned __int8 #else // !_MSC_VER #define UINT_8 unsigned char #endif // _MSC_VER #endif #ifndef UINT_32 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_32 unsigned __int32 #else // !_MSC_VER #if (ULONG_MAX == 0xFFFFFFFFUL) #define UINT_32 unsigned long #else #define UINT_32 unsigned int #endif #endif // _MSC_VER #endif // UINT_32 #ifndef INT_64 #ifdef _MSC_VER // Compiling with Microsoft compiler #define INT_64 __int64 #else // !_MSC_VER #define INT_64 long long #endif // _MSC_VER #endif // INT_64 #ifndef UINT_64 #ifdef _MSC_VER // Compiling with Microsoft compiler #define UINT_64 unsigned __int64 #else // !_MSC_VER #define UINT_64 unsigned long long #endif // _MSC_VER #endif // UINT_64 /////////////////////////////////////////////////////////////////////////// // Declare SHA-1 workspace typedef union { UINT_8 c[64]; UINT_32 l[16]; } SHA1_WORKSPACE_BLOCK; class CSHA1 { public: #ifdef SHA1_UTILITY_FUNCTIONS // Different formats for ReportHash(Stl) enum REPORT_TYPE { REPORT_HEX = 0, REPORT_DIGIT = 1, REPORT_HEX_SHORT = 2 }; #endif // Constructor and destructor CSHA1(); #ifdef SHA1_WIPE_VARIABLES ~CSHA1(); #endif void Reset(); // Hash in binary data and strings void Update(const UINT_8* pbData, UINT_32 uLen); #ifdef SHA1_UTILITY_FUNCTIONS // Hash in file contents bool HashFile(const TCHAR* tszFileName); #endif // Finalize hash; call it before using ReportHash(Stl) void Final(); #ifdef SHA1_UTILITY_FUNCTIONS bool ReportHash(TCHAR* tszReport, REPORT_TYPE rtReportType = REPORT_HEX) const; #endif #ifdef SHA1_STL_FUNCTIONS bool ReportHashStl(std::basic_string& strOut, REPORT_TYPE rtReportType = REPORT_HEX) const; #endif // Get the raw message digest (20 bytes) bool GetHash(UINT_8* pbDest20) const; private: // Private SHA-1 transformation void Transform(UINT_32* pState, const UINT_8* pBuffer); // Member variables UINT_32 m_state[5]; UINT_32 m_count[2]; UINT_32 m_reserved0[1]; // Memory alignment padding UINT_8 m_buffer[64]; UINT_8 m_digest[20]; UINT_32 m_reserved1[3]; // Memory alignment padding UINT_8 m_workspace[64]; SHA1_WORKSPACE_BLOCK* m_block; // SHA1 pointer to the byte array above }; #endif // SHA1_H_A545E61D43E9404E8D736869AB3CBFE7 ================================================ FILE: Libraries/Core/iOS/Headers/SHA256/sha256.h ================================================ // ////////////////////////////////////////////////////////// // sha256.h // Copyright (c) 2014,2015 Stephan Brumme. All rights reserved. // see http://create.stephan-brumme.com/disclaimer.html // #pragma once //#include "hash.h" #include // define fixed size integer types #ifdef _MSC_VER // Windows typedef unsigned __int8 uint8_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; #else // GCC #include #endif /// compute SHA256 hash /** Usage: SHA256 sha256; std::string myHash = sha256("Hello World"); // std::string std::string myHash2 = sha256("How are you", 11); // arbitrary data, 11 bytes // or in a streaming fashion: SHA256 sha256; while (more data available) sha256.add(pointer to fresh data, number of new bytes); std::string myHash3 = sha256.getHash(); */ class SHA256 //: public Hash { public: /// split into 64 byte blocks (=> 512 bits), hash is 32 bytes long enum { BlockSize = 512 / 8, HashBytes = 32 }; /// same as reset() SHA256(); /// compute SHA256 of a memory block std::string operator()(const void* data, size_t numBytes); /// compute SHA256 of a string, excluding final zero std::string operator()(const std::string& text); /// add arbitrary number of bytes void add(const void* data, size_t numBytes); /// return latest hash as 64 hex characters std::string getHash(); /// return latest hash as bytes void getHash(unsigned char buffer[HashBytes]); /// restart void reset(); private: /// process 64 bytes void processBlock(const void* data); /// process everything left in the internal buffer void processBuffer(); /// size of processed data in bytes uint64_t m_numBytes; /// valid bytes in m_buffer size_t m_bufferSize; /// bytes not processed yet uint8_t m_buffer[BlockSize]; enum { HashValues = HashBytes / 4 }; /// hash, stored as integers uint32_t m_hash[HashValues]; }; ================================================ FILE: Libraries/Core/iOS/Headers/aes/aes.h ================================================ /* The MIT License Copyright (C) 2011 Zilong Tan (labytan@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* * aes.h * * @version 3.0 (December 2000) * * Optimised ANSI C code for the Rijndael cipher (now AES) * * @author Vincent Rijmen * @author Antoon Bosselaers * @author Paulo Barreto * * This code is hereby placed in the public domain. * * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef __ULIB_AES_H #define __ULIB_AES_H #include #define AES_MAXNR 14 #define AES_BLOCK_SIZE 16 struct aes_key_st { uint32_t rd_key[4 *(AES_MAXNR + 1)]; int rounds; }; typedef struct aes_key_st AES_KEY; #ifdef __cplusplus extern "C" { #endif /* bits can be 128, 192 or 256 */ int AES_set_encrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); int AES_set_decrypt_key(const unsigned char *userKey, const int bits, AES_KEY *key); /* in/out can be the same for ECB encryption/decryption */ void AES_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); void AES_decrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key); /* in/out can be the same */ void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, unsigned long nblock, const AES_KEY *key); /* in/out MUST be DIFFERENT */ void AES_cbc_decrypt(const unsigned char *in, unsigned char *out, unsigned char *ivec, unsigned long nblock, const AES_KEY *key); #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/iOS/Headers/base64/base64.h ================================================ #include std::string base64_encode(unsigned char const* , unsigned int len); std::string base64_decode(std::string const& s); ================================================ FILE: Libraries/Core/iOS/Headers/json/assertions.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED #define CPPTL_JSON_ASSERTIONS_H_INCLUDED #include #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) #if JSON_USE_EXCEPTION #include #define JSON_ASSERT(condition) \ assert(condition); // @todo <= change this into an exception throw #define JSON_FAIL_MESSAGE(message) throw std::runtime_error(message); #else // JSON_USE_EXCEPTION #define JSON_ASSERT(condition) assert(condition); // The call to assert() will show the failure message in debug builds. In // release bugs we write to invalid memory in order to crash hard, so that a // debugger or crash reporter gets the chance to take over. We still call exit() // afterward in order to tell the compiler that this macro doesn't return. #define JSON_FAIL_MESSAGE(message) \ { \ assert(false &&message); \ strcpy(reinterpret_cast(666), message); \ exit(123); \ } #endif #define JSON_ASSERT_MESSAGE(condition, message) \ if (!(condition)) { \ JSON_FAIL_MESSAGE(message) \ } #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED ================================================ FILE: Libraries/Core/iOS/Headers/json/autolink.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_AUTOLINK_H_INCLUDED #define JSON_AUTOLINK_H_INCLUDED #include "config.h" #ifdef JSON_IN_CPPTL #include #endif #if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \ !defined(JSON_IN_CPPTL) #define CPPTL_AUTOLINK_NAME "json" #undef CPPTL_AUTOLINK_DLL #ifdef JSON_DLL #define CPPTL_AUTOLINK_DLL #endif #include "autolink.h" #endif #endif // JSON_AUTOLINK_H_INCLUDED ================================================ FILE: Libraries/Core/iOS/Headers/json/config.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_CONFIG_H_INCLUDED #define JSON_CONFIG_H_INCLUDED /// If defined, indicates that json library is embedded in CppTL library. //# define JSON_IN_CPPTL 1 /// If defined, indicates that json may leverage CppTL library //# define JSON_USE_CPPTL 1 /// If defined, indicates that cpptl vector based map should be used instead of /// std::map /// as Value container. //# define JSON_USE_CPPTL_SMALLMAP 1 /// If defined, indicates that Json specific container should be used /// (hash table & simple deque container with customizable allocator). /// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332 //# define JSON_VALUE_USE_INTERNAL_MAP 1 /// Force usage of standard new/malloc based allocator instead of memory pool /// based allocator. /// The memory pools allocator used optimization (initializing Value and /// ValueInternalLink /// as if it was a POD) that may cause some validation tool to report errors. /// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. //# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 // If non-zero, the library uses exceptions to report bad input instead of C // assertion macros. The default is to use exceptions. #ifndef JSON_USE_EXCEPTION #define JSON_USE_EXCEPTION 1 #endif /// If defined, indicates that the source file is amalgated /// to prevent private header inclusion. /// Remarks: it is automatically defined in the generated amalgated header. // #define JSON_IS_AMALGAMATION #ifdef JSON_IN_CPPTL #include #ifndef JSON_USE_CPPTL #define JSON_USE_CPPTL 1 #endif #endif #ifdef JSON_IN_CPPTL #define JSON_API CPPTL_API #elif defined(JSON_DLL_BUILD) #if defined(_MSC_VER) #define JSON_API __declspec(dllexport) #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING #endif // if defined(_MSC_VER) #elif defined(JSON_DLL) #if defined(_MSC_VER) #define JSON_API __declspec(dllimport) #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING #endif // if defined(_MSC_VER) #endif // ifdef JSON_IN_CPPTL #if !defined(JSON_API) #define JSON_API #endif // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for // integer // Storages, and 64 bits integer support is disabled. // #define JSON_NO_INT64 1 #if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 // Microsoft Visual Studio 6 only support conversion from __int64 to double // (no conversion from unsigned __int64). #define JSON_USE_INT64_DOUBLE_CONVERSION 1 // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255' // characters in the debug information) // All projects I've ever seen with VS6 were using this globally (not bothering // with pragma push/pop). #pragma warning(disable : 4786) #endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 #if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 /// Indicates that the following function is deprecated. #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) #endif #if !defined(JSONCPP_DEPRECATED) #define JSONCPP_DEPRECATED(message) #endif // if !defined(JSONCPP_DEPRECATED) namespace Json { typedef int Int; typedef unsigned int UInt; #if defined(JSON_NO_INT64) typedef int LargestInt; typedef unsigned int LargestUInt; #undef JSON_HAS_INT64 #else // if defined(JSON_NO_INT64) // For Microsoft Visual use specific types as long long is not supported #if defined(_MSC_VER) // Microsoft Visual Studio typedef __int64 Int64; typedef unsigned __int64 UInt64; #else // if defined(_MSC_VER) // Other platforms, use long long typedef long long int Int64; typedef unsigned long long int UInt64; #endif // if defined(_MSC_VER) typedef Int64 LargestInt; typedef UInt64 LargestUInt; #define JSON_HAS_INT64 #endif // if defined(JSON_NO_INT64) } // end namespace Json #endif // JSON_CONFIG_H_INCLUDED ================================================ FILE: Libraries/Core/iOS/Headers/json/features.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_FEATURES_H_INCLUDED #define CPPTL_JSON_FEATURES_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { /** \brief Configuration passed to reader and writer. * This configuration object can be used to force the Reader or Writer * to behave in a standard conforming way. */ class JSON_API Features { public: /** \brief A configuration that allows all features and assumes all strings * are UTF-8. * - C & C++ comments are allowed * - Root object can be any JSON value * - Assumes Value strings are encoded in UTF-8 */ static Features all(); /** \brief A configuration that is strictly compatible with the JSON * specification. * - Comments are forbidden. * - Root object must be either an array or an object value. * - Assumes Value strings are encoded in UTF-8 */ static Features strictMode(); /** \brief Initialize the configuration like JsonConfig::allFeatures; */ Features(); /// \c true if comments are allowed. Default: \c true. bool allowComments_; /// \c true if root must be either an array or an object value. Default: \c /// false. bool strictRoot_; /// \c true if dropped null placeholders are allowed. Default: \c false. bool allowDroppedNullPlaceholders_; /// \c true if numeric object key are allowed. Default: \c false. bool allowNumericKeys_; }; } // namespace Json #endif // CPPTL_JSON_FEATURES_H_INCLUDED ================================================ FILE: Libraries/Core/iOS/Headers/json/forwards.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_FORWARDS_H_INCLUDED #define JSON_FORWARDS_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "config.h" #endif // if !defined(JSON_IS_AMALGAMATION) namespace Json { // writer.h class FastWriter; class StyledWriter; // reader.h class Reader; // features.h class Features; // value.h typedef unsigned int ArrayIndex; class StaticString; class Path; class PathArgument; class Value; class ValueIteratorBase; class ValueIterator; class ValueConstIterator; #ifdef JSON_VALUE_USE_INTERNAL_MAP class ValueMapAllocator; class ValueInternalLink; class ValueInternalArray; class ValueInternalMap; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP } // namespace Json #endif // JSON_FORWARDS_H_INCLUDED ================================================ FILE: Libraries/Core/iOS/Headers/json/json.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_JSON_H_INCLUDED #define JSON_JSON_H_INCLUDED #include "autolink.h" #include "value.h" #include "reader.h" #include "writer.h" #include "features.h" #endif // JSON_JSON_H_INCLUDED ================================================ FILE: Libraries/Core/iOS/Headers/json/json_batchallocator.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED #define JSONCPP_BATCHALLOCATOR_H_INCLUDED #include #include #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION namespace Json { /* Fast memory allocator. * * This memory allocator allocates memory for a batch of object (specified by * the page size, the number of object in each page). * * It does not allow the destruction of a single object. All the allocated * objects can be destroyed at once. The memory can be either released or reused * for future allocation. * * The in-place new operator must be used to construct the object using the * pointer returned by allocate. */ template class BatchAllocator { public: BatchAllocator(unsigned int objectsPerPage = 255) : freeHead_(0), objectsPerPage_(objectsPerPage) { // printf( "Size: %d => %s\n", sizeof(AllocatedType), // typeid(AllocatedType).name() ); assert(sizeof(AllocatedType) * objectPerAllocation >= sizeof(AllocatedType *)); // We must be able to store a slist in the // object free space. assert(objectsPerPage >= 16); batches_ = allocateBatch(0); // allocated a dummy page currentBatch_ = batches_; } ~BatchAllocator() { for (BatchInfo *batch = batches_; batch;) { BatchInfo *nextBatch = batch->next_; free(batch); batch = nextBatch; } } /// allocate space for an array of objectPerAllocation object. /// @warning it is the responsability of the caller to call objects /// constructors. AllocatedType *allocate() { if (freeHead_) // returns node from free list. { AllocatedType *object = freeHead_; freeHead_ = *(AllocatedType **)object; return object; } if (currentBatch_->used_ == currentBatch_->end_) { currentBatch_ = currentBatch_->next_; while (currentBatch_ && currentBatch_->used_ == currentBatch_->end_) currentBatch_ = currentBatch_->next_; if (!currentBatch_) // no free batch found, allocate a new one { currentBatch_ = allocateBatch(objectsPerPage_); currentBatch_->next_ = batches_; // insert at the head of the list batches_ = currentBatch_; } } AllocatedType *allocated = currentBatch_->used_; currentBatch_->used_ += objectPerAllocation; return allocated; } /// Release the object. /// @warning it is the responsability of the caller to actually destruct the /// object. void release(AllocatedType *object) { assert(object != 0); *(AllocatedType **)object = freeHead_; freeHead_ = object; } private: struct BatchInfo { BatchInfo *next_; AllocatedType *used_; AllocatedType *end_; AllocatedType buffer_[objectPerAllocation]; }; // disabled copy constructor and assignement operator. BatchAllocator(const BatchAllocator &); void operator=(const BatchAllocator &); static BatchInfo *allocateBatch(unsigned int objectsPerPage) { const unsigned int mallocSize = sizeof(BatchInfo) - sizeof(AllocatedType) * objectPerAllocation + sizeof(AllocatedType) * objectPerAllocation * objectsPerPage; BatchInfo *batch = static_cast(malloc(mallocSize)); batch->next_ = 0; batch->used_ = batch->buffer_; batch->end_ = batch->buffer_ + objectsPerPage; return batch; } BatchInfo *batches_; BatchInfo *currentBatch_; /// Head of a single linked list within the allocated space of freeed object AllocatedType *freeHead_; unsigned int objectsPerPage_; }; } // namespace Json #endif // ifndef JSONCPP_DOC_INCLUDE_IMPLEMENTATION #endif // JSONCPP_BATCHALLOCATOR_H_INCLUDED // vim: et ts=2 sts=2 sw=2 tw=0 ================================================ FILE: Libraries/Core/iOS/Headers/json/json_internalarray.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueArrayAllocator::~ValueArrayAllocator() { } // ////////////////////////////////////////////////////////////////// // class DefaultValueArrayAllocator // ////////////////////////////////////////////////////////////////// #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destructArray( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; #else // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray(); // placement new return array; } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { ValueInternalArray *array = arraysAllocator_.allocate(); new (array) ValueInternalArray( other ); // placement new return array; } virtual void destructArray( ValueInternalArray *array ) { if ( array ) { array->~ValueInternalArray(); arraysAllocator_.release( array ); } } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); JSON_ASSERT_MESSAGE(newIndexes, "Couldn't realloc."); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( pagesAllocator_.allocate() ); } virtual void releaseArrayPage( Value *value ) { if ( value ) pagesAllocator_.release( value ); } private: BatchAllocator arraysAllocator_; BatchAllocator pagesAllocator_; }; #endif // #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR static ValueArrayAllocator *&arrayAllocator() { static DefaultValueArrayAllocator defaultAllocator; static ValueArrayAllocator *arrayAllocator = &defaultAllocator; return arrayAllocator; } static struct DummyArrayAllocatorInitializer { DummyArrayAllocatorInitializer() { arrayAllocator(); // ensure arrayAllocator() statics are initialized before main(). } } dummyArrayAllocatorInitializer; // ////////////////////////////////////////////////////////////////// // class ValueInternalArray // ////////////////////////////////////////////////////////////////// bool ValueInternalArray::equals( const IteratorState &x, const IteratorState &other ) { return x.array_ == other.array_ && x.currentItemIndex_ == other.currentItemIndex_ && x.currentPageIndex_ == other.currentPageIndex_; } void ValueInternalArray::increment( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ != it.array_->size_, "ValueInternalArray::increment(): moving iterator beyond end" ); ++(it.currentItemIndex_); if ( it.currentItemIndex_ == itemsPerPage ) { it.currentItemIndex_ = 0; ++(it.currentPageIndex_); } } void ValueInternalArray::decrement( IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && it.currentPageIndex_ == it.array_->pages_ && it.currentItemIndex_ == 0, "ValueInternalArray::decrement(): moving iterator beyond end" ); if ( it.currentItemIndex_ == 0 ) { it.currentItemIndex_ = itemsPerPage-1; --(it.currentPageIndex_); } else { --(it.currentItemIndex_); } } Value & ValueInternalArray::unsafeDereference( const IteratorState &it ) { return (*(it.currentPageIndex_))[it.currentItemIndex_]; } Value & ValueInternalArray::dereference( const IteratorState &it ) { JSON_ASSERT_MESSAGE( it.array_ && (it.currentPageIndex_ - it.array_->pages_)*itemsPerPage + it.currentItemIndex_ < it.array_->size_, "ValueInternalArray::dereference(): dereferencing invalid iterator" ); return unsafeDereference( it ); } void ValueInternalArray::makeBeginIterator( IteratorState &it ) const { it.array_ = const_cast( this ); it.currentItemIndex_ = 0; it.currentPageIndex_ = pages_; } void ValueInternalArray::makeIterator( IteratorState &it, ArrayIndex index ) const { it.array_ = const_cast( this ); it.currentItemIndex_ = index % itemsPerPage; it.currentPageIndex_ = pages_ + index / itemsPerPage; } void ValueInternalArray::makeEndIterator( IteratorState &it ) const { makeIterator( it, size_ ); } ValueInternalArray::ValueInternalArray() : pages_( 0 ) , size_( 0 ) , pageCount_( 0 ) { } ValueInternalArray::ValueInternalArray( const ValueInternalArray &other ) : pages_( 0 ) , size_( other.size_ ) , pageCount_( 0 ) { PageIndex minNewPages = other.size_ / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); IteratorState itOther; other.makeBeginIterator( itOther ); Value *value; for ( ArrayIndex index = 0; index < size_; ++index, increment(itOther) ) { if ( index % itemsPerPage == 0 ) { PageIndex pageIndex = index / itemsPerPage; value = arrayAllocator()->allocateArrayPage(); pages_[pageIndex] = value; } new (value) Value( dereference( itOther ) ); } } ValueInternalArray & ValueInternalArray::operator=(ValueInternalArray other) { swap(other); return *this; } ValueInternalArray::~ValueInternalArray() { // destroy all constructed items IteratorState it; IteratorState itEnd; makeBeginIterator( it); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } // release all pages PageIndex lastPageIndex = size_ / itemsPerPage; for ( PageIndex pageIndex = 0; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); // release pages index arrayAllocator()->releaseArrayPageIndex( pages_, pageCount_ ); } void ValueInternalArray::swap( ValueInternalArray &other ) { Value **tempPages = pages_; pages_ = other.pages_; other.pages_ = tempPages; ArrayIndex tempSize = size_; size_ = other.size_; other.size_ = tempSize; PageIndex tempPageCount = pageCount_; pageCount_ = other.pageCount_; other.pageCount_ = tempPageCount; } void ValueInternalArray::clear() { ValueInternalArray dummy; swap( dummy ); } void ValueInternalArray::resize( ArrayIndex newSize ) { if ( newSize == 0 ) clear(); else if ( newSize < size_ ) { IteratorState it; IteratorState itEnd; makeIterator( it, newSize ); makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); value->~Value(); } PageIndex pageIndex = (newSize + itemsPerPage - 1) / itemsPerPage; PageIndex lastPageIndex = size_ / itemsPerPage; for ( ; pageIndex < lastPageIndex; ++pageIndex ) arrayAllocator()->releaseArrayPage( pages_[pageIndex] ); size_ = newSize; } else if ( newSize > size_ ) resolveReference( newSize ); } void ValueInternalArray::makeIndexValid( ArrayIndex index ) { // Need to enlarge page index ? if ( index >= pageCount_ * itemsPerPage ) { PageIndex minNewPages = (index + 1) / itemsPerPage; arrayAllocator()->reallocateArrayPageIndex( pages_, pageCount_, minNewPages ); JSON_ASSERT_MESSAGE( pageCount_ >= minNewPages, "ValueInternalArray::reserve(): bad reallocation" ); } // Need to allocate new pages ? ArrayIndex nextPageIndex = (size_ % itemsPerPage) != 0 ? size_ - (size_%itemsPerPage) + itemsPerPage : size_; if ( nextPageIndex <= index ) { PageIndex pageIndex = nextPageIndex / itemsPerPage; PageIndex pageToAllocate = (index - nextPageIndex) / itemsPerPage + 1; for ( ; pageToAllocate-- > 0; ++pageIndex ) pages_[pageIndex] = arrayAllocator()->allocateArrayPage(); } // Initialize all new entries IteratorState it; IteratorState itEnd; makeIterator( it, size_ ); size_ = index + 1; makeIterator( itEnd, size_ ); for ( ; !equals(it,itEnd); increment(it) ) { Value *value = &dereference(it); new (value) Value(); // Construct a default value using placement new } } Value & ValueInternalArray::resolveReference( ArrayIndex index ) { if ( index >= size_ ) makeIndexValid( index ); return pages_[index/itemsPerPage][index%itemsPerPage]; } Value * ValueInternalArray::find( ArrayIndex index ) const { if ( index >= size_ ) return 0; return &(pages_[index/itemsPerPage][index%itemsPerPage]); } ValueInternalArray::ArrayIndex ValueInternalArray::size() const { return size_; } int ValueInternalArray::distance( const IteratorState &x, const IteratorState &y ) { return indexOf(y) - indexOf(x); } ValueInternalArray::ArrayIndex ValueInternalArray::indexOf( const IteratorState &iterator ) { if ( !iterator.array_ ) return ArrayIndex(-1); return ArrayIndex( (iterator.currentPageIndex_ - iterator.array_->pages_) * itemsPerPage + iterator.currentItemIndex_ ); } int ValueInternalArray::compare( const ValueInternalArray &other ) const { int sizeDiff( size_ - other.size_ ); if ( sizeDiff != 0 ) return sizeDiff; for ( ArrayIndex index =0; index < size_; ++index ) { int diff = pages_[index/itemsPerPage][index%itemsPerPage].compare( other.pages_[index/itemsPerPage][index%itemsPerPage] ); if ( diff != 0 ) return diff; } return 0; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/iOS/Headers/json/json_internalmap.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueInternalMap // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// /** \internal MUST be safely initialized using memset( this, 0, sizeof(ValueInternalLink) ); * This optimization is used by the fast allocator. */ ValueInternalLink::ValueInternalLink() : previous_( 0 ) , next_( 0 ) { } ValueInternalLink::~ValueInternalLink() { for ( int index =0; index < itemPerLink; ++index ) { if ( !items_[index].isItemAvailable() ) { if ( !items_[index].isMemberNameStatic() ) free( keys_[index] ); } else break; } } ValueMapAllocator::~ValueMapAllocator() { } #ifdef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; #else /// @todo make this thread-safe (lock when accessign batch allocator) class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap(); // placement new return map; } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { ValueInternalMap *map = mapsAllocator_.allocate(); new (map) ValueInternalMap( other ); // placement new return map; } virtual void destructMap( ValueInternalMap *map ) { if ( map ) { map->~ValueInternalMap(); mapsAllocator_.release( map ); } } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { ValueInternalLink *link = linksAllocator_.allocate(); memset( link, 0, sizeof(ValueInternalLink) ); return link; } virtual void releaseMapLink( ValueInternalLink *link ) { link->~ValueInternalLink(); linksAllocator_.release( link ); } private: BatchAllocator mapsAllocator_; BatchAllocator linksAllocator_; }; #endif static ValueMapAllocator *&mapAllocator() { static DefaultValueMapAllocator defaultAllocator; static ValueMapAllocator *mapAllocator = &defaultAllocator; return mapAllocator; } static struct DummyMapAllocatorInitializer { DummyMapAllocatorInitializer() { mapAllocator(); // ensure mapAllocator() statics are initialized before main(). } } dummyMapAllocatorInitializer; // h(K) = value * K >> w ; with w = 32 & K prime w.r.t. 2^32. /* use linked list hash map. buckets array is a container. linked list element contains 6 key/values. (memory = (16+4) * 6 + 4 = 124) value have extra state: valid, available, deleted */ ValueInternalMap::ValueInternalMap() : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { } ValueInternalMap::ValueInternalMap( const ValueInternalMap &other ) : buckets_( 0 ) , tailLink_( 0 ) , bucketsSize_( 0 ) , itemCount_( 0 ) { reserve( other.itemCount_ ); IteratorState it; IteratorState itEnd; other.makeBeginIterator( it ); other.makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { bool isStatic; const char *memberName = key( it, isStatic ); const Value &aValue = value( it ); resolveReference(memberName, isStatic) = aValue; } } ValueInternalMap & ValueInternalMap::operator=(ValueInternalMap other) { swap(other); return *this; } ValueInternalMap::~ValueInternalMap() { if ( buckets_ ) { for ( BucketIndex bucketIndex =0; bucketIndex < bucketsSize_; ++bucketIndex ) { ValueInternalLink *link = buckets_[bucketIndex].next_; while ( link ) { ValueInternalLink *linkToRelease = link; link = link->next_; mapAllocator()->releaseMapLink( linkToRelease ); } } mapAllocator()->releaseMapBuckets( buckets_ ); } } void ValueInternalMap::swap( ValueInternalMap &other ) { ValueInternalLink *tempBuckets = buckets_; buckets_ = other.buckets_; other.buckets_ = tempBuckets; ValueInternalLink *tempTailLink = tailLink_; tailLink_ = other.tailLink_; other.tailLink_ = tempTailLink; BucketIndex tempBucketsSize = bucketsSize_; bucketsSize_ = other.bucketsSize_; other.bucketsSize_ = tempBucketsSize; BucketIndex tempItemCount = itemCount_; itemCount_ = other.itemCount_; other.itemCount_ = tempItemCount; } void ValueInternalMap::clear() { ValueInternalMap dummy; swap( dummy ); } ValueInternalMap::BucketIndex ValueInternalMap::size() const { return itemCount_; } bool ValueInternalMap::reserveDelta( BucketIndex growth ) { return reserve( itemCount_ + growth ); } bool ValueInternalMap::reserve( BucketIndex newItemCount ) { if ( !buckets_ && newItemCount > 0 ) { buckets_ = mapAllocator()->allocateMapBuckets( 1 ); bucketsSize_ = 1; tailLink_ = &buckets_[0]; } // BucketIndex idealBucketCount = (newItemCount + ValueInternalLink::itemPerLink) / ValueInternalLink::itemPerLink; return true; } const Value * ValueInternalMap::find( const char *key ) const { if ( !bucketsSize_ ) return 0; HashKey hashedKey = hash( key ); BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( const ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; current = current->next_ ) { for ( BucketIndex index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return 0; if ( strcmp( key, current->keys_[index] ) == 0 ) return ¤t->items_[index]; } } return 0; } Value * ValueInternalMap::find( const char *key ) { const ValueInternalMap *constThis = this; return const_cast( constThis->find( key ) ); } Value & ValueInternalMap::resolveReference( const char *key, bool isStatic ) { HashKey hashedKey = hash( key ); if ( bucketsSize_ ) { BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink **previous = 0; BucketIndex index; for ( ValueInternalLink *current = &buckets_[bucketIndex]; current != 0; previous = ¤t->next_, current = current->next_ ) { for ( index=0; index < ValueInternalLink::itemPerLink; ++index ) { if ( current->items_[index].isItemAvailable() ) return setNewItem( key, isStatic, current, index ); if ( strcmp( key, current->keys_[index] ) == 0 ) return current->items_[index]; } } } reserveDelta( 1 ); return unsafeAdd( key, isStatic, hashedKey ); } void ValueInternalMap::remove( const char *key ) { HashKey hashedKey = hash( key ); if ( !bucketsSize_ ) return; BucketIndex bucketIndex = hashedKey % bucketsSize_; for ( ValueInternalLink *link = &buckets_[bucketIndex]; link != 0; link = link->next_ ) { BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) return; if ( strcmp( key, link->keys_[index] ) == 0 ) { doActualRemove( link, index, bucketIndex ); return; } } } } void ValueInternalMap::doActualRemove( ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex ) { // find last item of the bucket and swap it with the 'removed' one. // set removed items flags to 'available'. // if last page only contains 'available' items, then desallocate it (it's empty) ValueInternalLink *&lastLink = getLastLinkInBucket( index ); BucketIndex lastItemIndex = 1; // a link can never be empty, so start at 1 for ( ; lastItemIndex < ValueInternalLink::itemPerLink; ++lastItemIndex ) // may be optimized with dicotomic search { if ( lastLink->items_[lastItemIndex].isItemAvailable() ) break; } BucketIndex lastUsedIndex = lastItemIndex - 1; Value *valueToDelete = &link->items_[index]; Value *valueToPreserve = &lastLink->items_[lastUsedIndex]; if ( valueToDelete != valueToPreserve ) valueToDelete->swap( *valueToPreserve ); if ( lastUsedIndex == 0 ) // page is now empty { // remove it from bucket linked list and delete it. ValueInternalLink *linkPreviousToLast = lastLink->previous_; if ( linkPreviousToLast != 0 ) // can not deleted bucket link. { mapAllocator()->releaseMapLink( lastLink ); linkPreviousToLast->next_ = 0; lastLink = linkPreviousToLast; } } else { Value dummy; valueToPreserve->swap( dummy ); // restore deleted to default Value. valueToPreserve->setItemUsed( false ); } --itemCount_; } ValueInternalLink *& ValueInternalMap::getLastLinkInBucket( BucketIndex bucketIndex ) { if ( bucketIndex == bucketsSize_ - 1 ) return tailLink_; ValueInternalLink *&previous = buckets_[bucketIndex+1].previous_; if ( !previous ) previous = &buckets_[bucketIndex]; return previous; } Value & ValueInternalMap::setNewItem( const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index ) { char *duplicatedKey = makeMemberName( key ); ++itemCount_; link->keys_[index] = duplicatedKey; link->items_[index].setItemUsed(); link->items_[index].setMemberNameIsStatic( isStatic ); return link->items_[index]; // items already default constructed. } Value & ValueInternalMap::unsafeAdd( const char *key, bool isStatic, HashKey hashedKey ) { JSON_ASSERT_MESSAGE( bucketsSize_ > 0, "ValueInternalMap::unsafeAdd(): internal logic error." ); BucketIndex bucketIndex = hashedKey % bucketsSize_; ValueInternalLink *&previousLink = getLastLinkInBucket( bucketIndex ); ValueInternalLink *link = previousLink; BucketIndex index; for ( index =0; index < ValueInternalLink::itemPerLink; ++index ) { if ( link->items_[index].isItemAvailable() ) break; } if ( index == ValueInternalLink::itemPerLink ) // need to add a new page { ValueInternalLink *newLink = mapAllocator()->allocateMapLink(); index = 0; link->next_ = newLink; previousLink = newLink; link = newLink; } return setNewItem( key, isStatic, link, index ); } ValueInternalMap::HashKey ValueInternalMap::hash( const char *key ) const { HashKey hash = 0; while ( *key ) hash += *key++ * 37; return hash; } int ValueInternalMap::compare( const ValueInternalMap &other ) const { int sizeDiff( itemCount_ - other.itemCount_ ); if ( sizeDiff != 0 ) return sizeDiff; // Strict order guaranty is required. Compare all keys FIRST, then compare values. IteratorState it; IteratorState itEnd; makeBeginIterator( it ); makeEndIterator( itEnd ); for ( ; !equals(it,itEnd); increment(it) ) { if ( !other.find( key( it ) ) ) return 1; } // All keys are equals, let's compare values makeBeginIterator( it ); for ( ; !equals(it,itEnd); increment(it) ) { const Value *otherValue = other.find( key( it ) ); int valueDiff = value(it).compare( *otherValue ); if ( valueDiff != 0 ) return valueDiff; } return 0; } void ValueInternalMap::makeBeginIterator( IteratorState &it ) const { it.map_ = const_cast( this ); it.bucketIndex_ = 0; it.itemIndex_ = 0; it.link_ = buckets_; } void ValueInternalMap::makeEndIterator( IteratorState &it ) const { it.map_ = const_cast( this ); it.bucketIndex_ = bucketsSize_; it.itemIndex_ = 0; it.link_ = 0; } bool ValueInternalMap::equals( const IteratorState &x, const IteratorState &other ) { return x.map_ == other.map_ && x.bucketIndex_ == other.bucketIndex_ && x.link_ == other.link_ && x.itemIndex_ == other.itemIndex_; } void ValueInternalMap::incrementBucket( IteratorState &iterator ) { ++iterator.bucketIndex_; JSON_ASSERT_MESSAGE( iterator.bucketIndex_ <= iterator.map_->bucketsSize_, "ValueInternalMap::increment(): attempting to iterate beyond end." ); if ( iterator.bucketIndex_ == iterator.map_->bucketsSize_ ) iterator.link_ = 0; else iterator.link_ = &(iterator.map_->buckets_[iterator.bucketIndex_]); iterator.itemIndex_ = 0; } void ValueInternalMap::increment( IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterator using invalid iterator." ); ++iterator.itemIndex_; if ( iterator.itemIndex_ == ValueInternalLink::itemPerLink ) { JSON_ASSERT_MESSAGE( iterator.link_ != 0, "ValueInternalMap::increment(): attempting to iterate beyond end." ); iterator.link_ = iterator.link_->next_; if ( iterator.link_ == 0 ) incrementBucket( iterator ); } else if ( iterator.link_->items_[iterator.itemIndex_].isItemAvailable() ) { incrementBucket( iterator ); } } void ValueInternalMap::decrement( IteratorState &iterator ) { if ( iterator.itemIndex_ == 0 ) { JSON_ASSERT_MESSAGE( iterator.map_, "Attempting to iterate using invalid iterator." ); if ( iterator.link_ == &iterator.map_->buckets_[iterator.bucketIndex_] ) { JSON_ASSERT_MESSAGE( iterator.bucketIndex_ > 0, "Attempting to iterate beyond beginning." ); --(iterator.bucketIndex_); } iterator.link_ = iterator.link_->previous_; iterator.itemIndex_ = ValueInternalLink::itemPerLink - 1; } } const char * ValueInternalMap::key( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->keys_[iterator.itemIndex_]; } const char * ValueInternalMap::key( const IteratorState &iterator, bool &isStatic ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); isStatic = iterator.link_->items_[iterator.itemIndex_].isMemberNameStatic(); return iterator.link_->keys_[iterator.itemIndex_]; } Value & ValueInternalMap::value( const IteratorState &iterator ) { JSON_ASSERT_MESSAGE( iterator.link_, "Attempting to iterate using invalid iterator." ); return iterator.link_->items_[iterator.itemIndex_]; } int ValueInternalMap::distance( const IteratorState &x, const IteratorState &y ) { int offset = 0; IteratorState it = x; while ( !equals( it, y ) ) increment( it ); return offset; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/iOS/Headers/json/json_tool.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED /* This header provides common string manipulation support, such as UTF-8, * portable conversion from/to string... * * It is an internal header that must not be exposed. */ namespace Json { /// Converts a unicode code-point to UTF-8. static inline std::string codePointToUTF8(unsigned int cp) { std::string result; // based on description from http://en.wikipedia.org/wiki/UTF-8 if (cp <= 0x7f) { result.resize(1); result[0] = static_cast(cp); } else if (cp <= 0x7FF) { result.resize(2); result[1] = static_cast(0x80 | (0x3f & cp)); result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); } else if (cp <= 0xFFFF) { result.resize(3); result[2] = static_cast(0x80 | (0x3f & cp)); result[1] = 0x80 | static_cast((0x3f & (cp >> 6))); result[0] = 0xE0 | static_cast((0xf & (cp >> 12))); } else if (cp <= 0x10FFFF) { result.resize(4); result[3] = static_cast(0x80 | (0x3f & cp)); result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); } return result; } /// Returns true if ch is a control character (in range [0,32[). static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; } enum { /// Constant that specify the size of the buffer that must be passed to /// uintToString. uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 }; // Defines a char buffer for use with uintToString(). typedef char UIntToStringBuffer[uintToStringBufferSize]; /** Converts an unsigned integer to string. * @param value Unsigned interger to convert to string * @param current Input/Output string buffer. * Must have at least uintToStringBufferSize chars free. */ static inline void uintToString(LargestUInt value, char *¤t) { *--current = 0; do { *--current = char(value % 10) + '0'; value /= 10; } while (value != 0); } /** Change ',' to '.' everywhere in buffer. * * We had a sophisticated way, but it did not work in WinCE. * @see https://github.com/open-source-parsers/jsoncpp/pull/9 */ static inline void fixNumericLocale(char* begin, char* end) { while (begin < end) { if (*begin == ',') { *begin = '.'; } ++begin; } } } // namespace Json { #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED // vim: et ts=2 sts=2 sw=2 tw=0 ================================================ FILE: Libraries/Core/iOS/Headers/json/json_valueiterator.inl ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE // included by json_value.cpp namespace Json { // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIteratorBase // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIteratorBase::ValueIteratorBase() #ifndef JSON_VALUE_USE_INTERNAL_MAP : current_() , isNull_( true ) { } #else : isArray_( true ) , isNull_( true ) { iterator_.array_ = ValueInternalArray::IteratorState(); } #endif #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIteratorBase::ValueIteratorBase( const Value::ObjectValues::iterator ¤t ) : current_( current ) , isNull_( false ) { } #else ValueIteratorBase::ValueIteratorBase( const ValueInternalArray::IteratorState &state ) : isArray_( true ) { iterator_.array_ = state; } ValueIteratorBase::ValueIteratorBase( const ValueInternalMap::IteratorState &state ) : isArray_( false ) { iterator_.map_ = state; } #endif Value & ValueIteratorBase::deref() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP return current_->second; #else if ( isArray_ ) return ValueInternalArray::dereference( iterator_.array_ ); return ValueInternalMap::value( iterator_.map_ ); #endif } void ValueIteratorBase::increment() { #ifndef JSON_VALUE_USE_INTERNAL_MAP ++current_; #else if ( isArray_ ) ValueInternalArray::increment( iterator_.array_ ); ValueInternalMap::increment( iterator_.map_ ); #endif } void ValueIteratorBase::decrement() { #ifndef JSON_VALUE_USE_INTERNAL_MAP --current_; #else if ( isArray_ ) ValueInternalArray::decrement( iterator_.array_ ); ValueInternalMap::decrement( iterator_.map_ ); #endif } ValueIteratorBase::difference_type ValueIteratorBase::computeDistance( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP # ifdef JSON_USE_CPPTL_SMALLMAP return current_ - other.current_; # else // Iterator for null value are initialized using the default // constructor, which initialize current_ to the default // std::map::iterator. As begin() and end() are two instance // of the default std::map::iterator, they can not be compared. // To allow this, we handle this comparison specifically. if ( isNull_ && other.isNull_ ) { return 0; } // Usage of std::distance is not portable (does not compile with Sun Studio 12 RogueWave STL, // which is the one used by default). // Using a portable hand-made version for non random iterator instead: // return difference_type( std::distance( current_, other.current_ ) ); difference_type myDistance = 0; for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it ) { ++myDistance; } return myDistance; # endif #else if ( isArray_ ) return ValueInternalArray::distance( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::distance( iterator_.map_, other.iterator_.map_ ); #endif } bool ValueIteratorBase::isEqual( const SelfType &other ) const { #ifndef JSON_VALUE_USE_INTERNAL_MAP if ( isNull_ ) { return other.isNull_; } return current_ == other.current_; #else if ( isArray_ ) return ValueInternalArray::equals( iterator_.array_, other.iterator_.array_ ); return ValueInternalMap::equals( iterator_.map_, other.iterator_.map_ ); #endif } void ValueIteratorBase::copy( const SelfType &other ) { #ifndef JSON_VALUE_USE_INTERNAL_MAP current_ = other.current_; isNull_ = other.isNull_; #else if ( isArray_ ) iterator_.array_ = other.iterator_.array_; iterator_.map_ = other.iterator_.map_; #endif } Value ValueIteratorBase::key() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( czstring.c_str() ) { if ( czstring.isStaticString() ) return Value( StaticString( czstring.c_str() ) ); return Value( czstring.c_str() ); } return Value( czstring.index() ); #else if ( isArray_ ) return Value( ValueInternalArray::indexOf( iterator_.array_ ) ); bool isStatic; const char *memberName = ValueInternalMap::key( iterator_.map_, isStatic ); if ( isStatic ) return Value( StaticString( memberName ) ); return Value( memberName ); #endif } UInt ValueIteratorBase::index() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const Value::CZString czstring = (*current_).first; if ( !czstring.c_str() ) return czstring.index(); return Value::UInt( -1 ); #else if ( isArray_ ) return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) ); return Value::UInt( -1 ); #endif } const char * ValueIteratorBase::memberName() const { #ifndef JSON_VALUE_USE_INTERNAL_MAP const char *name = (*current_).first.c_str(); return name ? name : ""; #else if ( !isArray_ ) return ValueInternalMap::key( iterator_.map_ ); return ""; #endif } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueConstIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueConstIterator::ValueConstIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueConstIterator::ValueConstIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueConstIterator::ValueConstIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueConstIterator::ValueConstIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueConstIterator & ValueConstIterator::operator =( const ValueIteratorBase &other ) { copy( other ); return *this; } // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // class ValueIterator // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////// ValueIterator::ValueIterator() { } #ifndef JSON_VALUE_USE_INTERNAL_MAP ValueIterator::ValueIterator( const Value::ObjectValues::iterator ¤t ) : ValueIteratorBase( current ) { } #else ValueIterator::ValueIterator( const ValueInternalArray::IteratorState &state ) : ValueIteratorBase( state ) { } ValueIterator::ValueIterator( const ValueInternalMap::IteratorState &state ) : ValueIteratorBase( state ) { } #endif ValueIterator::ValueIterator( const ValueConstIterator &other ) : ValueIteratorBase( other ) { } ValueIterator::ValueIterator( const ValueIterator &other ) : ValueIteratorBase( other ) { } ValueIterator & ValueIterator::operator =( const SelfType &other ) { copy( other ); return *this; } } // namespace Json // vim: et ts=3 sts=3 sw=3 tw=0 ================================================ FILE: Libraries/Core/iOS/Headers/json/reader.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_READER_H_INCLUDED #define CPPTL_JSON_READER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "features.h" #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include #include #include // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) namespace Json { /** \brief Unserialize a JSON document into a *Value. * */ class JSON_API Reader { public: typedef char Char; typedef const Char *Location; /** \brief An error tagged with where in the JSON text it was encountered. * * The offsets give the [start, limit) range of bytes within the text. Note * that this is bytes, not codepoints. * */ struct StructuredError { size_t offset_start; size_t offset_limit; std::string message; }; /** \brief Constructs a Reader allowing all features * for parsing. */ Reader(); /** \brief Constructs a Reader allowing the specified feature set * for parsing. */ Reader(const Features &features); /** \brief Read a Value from a JSON * document. * \param document UTF-8 encoded string containing the document to read. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them * back during * serialization, \c false to discard comments. * This parameter is ignored if * Features::allowComments_ * is \c false. * \return \c true if the document was successfully parsed, \c false if an * error occurred. */ bool parse(const std::string &document, Value &root, bool collectComments = true); /** \brief Read a Value from a JSON document. * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the document to read. * \param endDoc Pointer on the end of the UTF-8 encoded string of the document to read. \ Must be >= beginDoc. * \param root [out] Contains the root value of the document if it was * successfully parsed. * \param collectComments \c true to collect comment and allow writing them back during * serialization, \c false to discard comments. * This parameter is ignored if Features::allowComments_ * is \c false. * \return \c true if the document was successfully parsed, \c false if an error occurred. */ bool parse(const char *beginDoc, const char *endDoc, Value &root, bool collectComments = true); /// \brief Parse from input stream. /// \see Json::operator>>(std::istream&, Json::Value&). bool parse(std::istream &is, Value &root, bool collectComments = true); /** \brief Returns a user friendly string that list errors in the parsed * document. * \return Formatted error message with the list of errors with their location * in * the parsed document. An empty string is returned if no error * occurred * during parsing. * \deprecated Use getFormattedErrorMessages() instead (typo fix). */ JSONCPP_DEPRECATED("Use getFormattedErrorMessages instead") std::string getFormatedErrorMessages() const; /** \brief Returns a user friendly string that list errors in the parsed * document. * \return Formatted error message with the list of errors with their location * in * the parsed document. An empty string is returned if no error * occurred * during parsing. */ std::string getFormattedErrorMessages() const; /** \brief Returns a vector of structured erros encounted while parsing. * \return A (possibly empty) vector of StructuredError objects. Currently * only one error can be returned, but the caller should tolerate * multiple * errors. This can occur if the parser recovers from a non-fatal * parse error and then encounters additional errors. */ std::vector getStructuredErrors() const; private: enum TokenType { tokenEndOfStream = 0, tokenObjectBegin, tokenObjectEnd, tokenArrayBegin, tokenArrayEnd, tokenString, tokenNumber, tokenTrue, tokenFalse, tokenNull, tokenArraySeparator, tokenMemberSeparator, tokenComment, tokenError }; class Token { public: TokenType type_; Location start_; Location end_; }; class ErrorInfo { public: Token token_; std::string message_; Location extra_; }; typedef std::deque Errors; bool expectToken(TokenType type, Token &token, const char *message); bool readToken(Token &token); void skipSpaces(); bool match(Location pattern, int patternLength); bool readComment(); bool readCStyleComment(); bool readCppStyleComment(); bool readString(); void readNumber(); bool readValue(); bool readObject(Token &token); bool readArray(Token &token); bool decodeNumber(Token &token); bool decodeNumber(Token &token, Value &decoded); bool decodeString(Token &token); bool decodeString(Token &token, std::string &decoded); bool decodeDouble(Token &token); bool decodeDouble(Token &token, Value &decoded); bool decodeUnicodeCodePoint(Token &token, Location ¤t, Location end, unsigned int &unicode); bool decodeUnicodeEscapeSequence(Token &token, Location ¤t, Location end, unsigned int &unicode); bool addError(const std::string &message, Token &token, Location extra = 0); bool recoverFromError(TokenType skipUntilToken); bool addErrorAndRecover(const std::string &message, Token &token, TokenType skipUntilToken); void skipUntilSpace(); Value ¤tValue(); Char getNextChar(); void getLocationLineAndColumn(Location location, int &line, int &column) const; std::string getLocationLineAndColumn(Location location) const; void addComment(Location begin, Location end, CommentPlacement placement); void skipCommentTokens(Token &token); typedef std::stack Nodes; Nodes nodes_; Errors errors_; std::string document_; Location begin_; Location end_; Location current_; Location lastValueEnd_; Value *lastValue_; std::string commentsBefore_; Features features_; bool collectComments_; }; /** \brief Read from 'sin' into 'root'. Always keep comments from the input JSON. This can be used to read a file into a particular sub-object. For example: \code Json::Value root; cin >> root["dir"]["file"]; cout << root; \endcode Result: \verbatim { "dir": { "file": { // The input stream JSON would be nested here. } } } \endverbatim \throw std::exception on parse error. \see Json::operator<<() */ JSON_API std::istream &operator>>(std::istream &, Value &); } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // CPPTL_JSON_READER_H_INCLUDED ================================================ FILE: Libraries/Core/iOS/Headers/json/value.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef CPPTL_JSON_H_INCLUDED #define CPPTL_JSON_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "forwards.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include #ifndef JSON_USE_CPPTL_SMALLMAP #include #else #include #endif #ifdef JSON_USE_CPPTL #include #endif // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) /** \brief JSON (JavaScript Object Notation). */ namespace Json { /** \brief Type of the value held by a Value object. */ enum ValueType { nullValue = 0, ///< 'null' value intValue, ///< signed integer value uintValue, ///< unsigned integer value realValue, ///< double value stringValue, ///< UTF-8 string value booleanValue, ///< bool value arrayValue, ///< array value (ordered list) objectValue ///< object value (collection of name/value pairs). }; enum CommentPlacement { commentBefore = 0, ///< a comment placed on the line before a value commentAfterOnSameLine, ///< a comment just after a value on the same line commentAfter, ///< a comment on the line after a value (only make sense for /// root value) numberOfCommentPlacement }; //# ifdef JSON_USE_CPPTL // typedef CppTL::AnyEnumerator EnumMemberNames; // typedef CppTL::AnyEnumerator EnumValues; //# endif /** \brief Lightweight wrapper to tag static string. * * Value constructor and objectValue member assignement takes advantage of the * StaticString and avoid the cost of string duplication when storing the * string or the member name. * * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ class JSON_API StaticString { public: explicit StaticString(const char *czstring) : str_(czstring) {} operator const char *() const { return str_; } const char *c_str() const { return str_; } private: const char *str_; }; /** \brief Represents a JSON value. * * This class is a discriminated union wrapper that can represents a: * - signed integer [range: Value::minInt - Value::maxInt] * - unsigned integer (range: 0 - Value::maxUInt) * - double * - UTF-8 string * - boolean * - 'null' * - an ordered list of Value * - collection of name/value pairs (javascript object) * * The type of the held value is represented by a #ValueType and * can be obtained using type(). * * values of an #objectValue or #arrayValue can be accessed using operator[]() *methods. * Non const methods will automatically create the a #nullValue element * if it does not exist. * The sequence of an #arrayValue will be automatically resize and initialized * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. * * The get() methods can be used to obtanis default value in the case the *required element * does not exist. * * It is possible to iterate over the list of a #objectValue values using * the getMemberNames() method. */ class JSON_API Value { friend class ValueIteratorBase; #ifdef JSON_VALUE_USE_INTERNAL_MAP friend class ValueInternalLink; friend class ValueInternalMap; #endif public: typedef std::vector Members; typedef ValueIterator iterator; typedef ValueConstIterator const_iterator; typedef Json::UInt UInt; typedef Json::Int Int; #if defined(JSON_HAS_INT64) typedef Json::UInt64 UInt64; typedef Json::Int64 Int64; #endif // defined(JSON_HAS_INT64) typedef Json::LargestInt LargestInt; typedef Json::LargestUInt LargestUInt; typedef Json::ArrayIndex ArrayIndex; static const Value& null; /// Minimum signed integer value that can be stored in a Json::Value. static const LargestInt minLargestInt; /// Maximum signed integer value that can be stored in a Json::Value. static const LargestInt maxLargestInt; /// Maximum unsigned integer value that can be stored in a Json::Value. static const LargestUInt maxLargestUInt; /// Minimum signed int value that can be stored in a Json::Value. static const Int minInt; /// Maximum signed int value that can be stored in a Json::Value. static const Int maxInt; /// Maximum unsigned int value that can be stored in a Json::Value. static const UInt maxUInt; #if defined(JSON_HAS_INT64) /// Minimum signed 64 bits int value that can be stored in a Json::Value. static const Int64 minInt64; /// Maximum signed 64 bits int value that can be stored in a Json::Value. static const Int64 maxInt64; /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. static const UInt64 maxUInt64; #endif // defined(JSON_HAS_INT64) private: #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION #ifndef JSON_VALUE_USE_INTERNAL_MAP class CZString { public: enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy }; CZString(ArrayIndex index); CZString(const char *cstr, DuplicationPolicy allocate); CZString(const CZString &other); ~CZString(); CZString &operator=(CZString other); bool operator<(const CZString &other) const; bool operator==(const CZString &other) const; ArrayIndex index() const; const char *c_str() const; bool isStaticString() const; private: void swap(CZString &other); const char *cstr_; ArrayIndex index_; }; public: #ifndef JSON_USE_CPPTL_SMALLMAP typedef std::map ObjectValues; #else typedef CppTL::SmallMap ObjectValues; #endif // ifndef JSON_USE_CPPTL_SMALLMAP #endif // ifndef JSON_VALUE_USE_INTERNAL_MAP #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION public: /** \brief Create a default Value of the given type. This is a very useful constructor. To create an empty array, pass arrayValue. To create an empty object, pass objectValue. Another Value can then be set to this one by assignment. This is useful since clear() and resize() will not alter types. Examples: \code Json::Value null_value; // null Json::Value arr_value(Json::arrayValue); // [] Json::Value obj_value(Json::objectValue); // {} \endcode */ Value(ValueType type = nullValue); Value(Int value); Value(UInt value); #if defined(JSON_HAS_INT64) Value(Int64 value); Value(UInt64 value); #endif // if defined(JSON_HAS_INT64) Value(double value); Value(const char *value); Value(const char *beginValue, const char *endValue); /** \brief Constructs a value from a static string. * Like other value string constructor but do not duplicate the string for * internal storage. The given string must remain alive after the call to this * constructor. * Example of usage: * \code * Json::Value aValue( StaticString("some text") ); * \endcode */ Value(const StaticString &value); Value(const std::string &value); #ifdef JSON_USE_CPPTL Value(const CppTL::ConstString &value); #endif Value(bool value); Value(const Value &other); ~Value(); Value &operator=(Value other); /// Swap values. /// \note Currently, comments are intentionally not swapped, for /// both logic and efficiency. void swap(Value &other); ValueType type() const; bool operator<(const Value &other) const; bool operator<=(const Value &other) const; bool operator>=(const Value &other) const; bool operator>(const Value &other) const; bool operator==(const Value &other) const; bool operator!=(const Value &other) const; int compare(const Value &other) const; const char *asCString() const; std::string asString() const; #ifdef JSON_USE_CPPTL CppTL::ConstString asConstString() const; #endif Int asInt() const; UInt asUInt() const; #if defined(JSON_HAS_INT64) Int64 asInt64() const; UInt64 asUInt64() const; #endif // if defined(JSON_HAS_INT64) LargestInt asLargestInt() const; LargestUInt asLargestUInt() const; float asFloat() const; double asDouble() const; bool asBool() const; bool isNull() const; bool isBool() const; bool isInt() const; bool isInt64() const; bool isUInt() const; bool isUInt64() const; bool isIntegral() const; bool isDouble() const; bool isNumeric() const; bool isString() const; bool isArray() const; bool isObject() const; bool isConvertibleTo(ValueType other) const; /// Number of values in array or object ArrayIndex size() const; /// \brief Return true if empty array, empty object, or null; /// otherwise, false. bool empty() const; /// Return isNull() bool operator!() const; /// Remove all object members and array elements. /// \pre type() is arrayValue, objectValue, or nullValue /// \post type() is unchanged void clear(); /// Resize the array to size elements. /// New elements are initialized to null. /// May only be called on nullValue or arrayValue. /// \pre type() is arrayValue or nullValue /// \post type() is arrayValue void resize(ArrayIndex size); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are /// inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) Value &operator[](ArrayIndex index); /// Access an array element (zero based index ). /// If the array contains less than index element, then null value are /// inserted /// in the array so that its size is index+1. /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) Value &operator[](int index); /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) const Value &operator[](ArrayIndex index) const; /// Access an array element (zero based index ) /// (You may need to say 'value[0u]' to get your compiler to distinguish /// this from the operator[] which takes a string.) const Value &operator[](int index) const; /// If the array contains at least index+1 elements, returns the element /// value, /// otherwise returns defaultValue. Value get(ArrayIndex index, const Value &defaultValue) const; /// Return true if index < size(). bool isValidIndex(ArrayIndex index) const; /// \brief Append value to array at the end. /// /// Equivalent to jsonvalue[jsonvalue.size()] = value; Value &append(const Value &value); /// Access an object value by name, create a null member if it does not exist. Value &operator[](const char *key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const char *key) const; /// Access an object value by name, create a null member if it does not exist. Value &operator[](const std::string &key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const std::string &key) const; /** \brief Access an object value by name, create a null member if it does not exist. * If the object as no entry for that name, then the member name used to store * the new entry is not duplicated. * Example of use: * \code * Json::Value object; * static const StaticString code("code"); * object[code] = 1234; * \endcode */ Value &operator[](const StaticString &key); #ifdef JSON_USE_CPPTL /// Access an object value by name, create a null member if it does not exist. Value &operator[](const CppTL::ConstString &key); /// Access an object value by name, returns null if there is no member with /// that name. const Value &operator[](const CppTL::ConstString &key) const; #endif /// Return the member named key if it exist, defaultValue otherwise. Value get(const char *key, const Value &defaultValue) const; /// Return the member named key if it exist, defaultValue otherwise. Value get(const std::string &key, const Value &defaultValue) const; #ifdef JSON_USE_CPPTL /// Return the member named key if it exist, defaultValue otherwise. Value get(const CppTL::ConstString &key, const Value &defaultValue) const; #endif /// \brief Remove and return the named member. /// /// Do nothing if it did not exist. /// \return the removed Value, or null. /// \pre type() is objectValue or nullValue /// \post type() is unchanged Value removeMember(const char *key); /// Same as removeMember(const char*) Value removeMember(const std::string &key); /// Return true if the object has a member named key. bool isMember(const char *key) const; /// Return true if the object has a member named key. bool isMember(const std::string &key) const; #ifdef JSON_USE_CPPTL /// Return true if the object has a member named key. bool isMember(const CppTL::ConstString &key) const; #endif /// \brief Return a list of the member names. /// /// If null, return an empty list. /// \pre type() is objectValue or nullValue /// \post if type() was nullValue, it remains nullValue Members getMemberNames() const; //# ifdef JSON_USE_CPPTL // EnumMemberNames enumMemberNames() const; // EnumValues enumValues() const; //# endif /// Comments must be //... or /* ... */ void setComment(const char *comment, CommentPlacement placement); /// Comments must be //... or /* ... */ void setComment(const std::string &comment, CommentPlacement placement); bool hasComment(CommentPlacement placement) const; /// Include delimiters and embedded newlines. std::string getComment(CommentPlacement placement) const; std::string toStyledString() const; const_iterator begin() const; const_iterator end() const; iterator begin(); iterator end(); // Accessors for the [start, limit) range of bytes within the JSON text from // which this value was parsed, if any. void setOffsetStart(size_t start); void setOffsetLimit(size_t limit); size_t getOffsetStart() const; size_t getOffsetLimit() const; private: Value &resolveReference(const char *key, bool isStatic); #ifdef JSON_VALUE_USE_INTERNAL_MAP inline bool isItemAvailable() const { return itemIsUsed_ == 0; } inline void setItemUsed(bool isUsed = true) { itemIsUsed_ = isUsed ? 1 : 0; } inline bool isMemberNameStatic() const { return memberNameIsStatic_ == 0; } inline void setMemberNameIsStatic(bool isStatic) { memberNameIsStatic_ = isStatic ? 1 : 0; } #endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP private: struct CommentInfo { CommentInfo(); ~CommentInfo(); void setComment(const char *text); char *comment_; }; // struct MemberNamesTransform //{ // typedef const char *result_type; // const char *operator()( const CZString &name ) const // { // return name.c_str(); // } //}; union ValueHolder { LargestInt int_; LargestUInt uint_; double real_; bool bool_; char *string_; #ifdef JSON_VALUE_USE_INTERNAL_MAP ValueInternalArray *array_; ValueInternalMap *map_; #else ObjectValues *map_; #endif } value_; ValueType type_ : 8; int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. #ifdef JSON_VALUE_USE_INTERNAL_MAP unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. #endif CommentInfo *comments_; // [start, limit) byte offsets in the source JSON text from which this Value // was extracted. size_t start_; size_t limit_; }; /** \brief Experimental and untested: represents an element of the "path" to * access a node. */ class JSON_API PathArgument { public: friend class Path; PathArgument(); PathArgument(ArrayIndex index); PathArgument(const char *key); PathArgument(const std::string &key); private: enum Kind { kindNone = 0, kindIndex, kindKey }; std::string key_; ArrayIndex index_; Kind kind_; }; /** \brief Experimental and untested: represents a "path" to access a node. * * Syntax: * - "." => root node * - ".[n]" => elements at index 'n' of root node (an array value) * - ".name" => member named 'name' of root node (an object value) * - ".name1.name2.name3" * - ".[0][1][2].name1[3]" * - ".%" => member name is provided as parameter * - ".[%]" => index is provied as parameter */ class JSON_API Path { public: Path(const std::string &path, const PathArgument &a1 = PathArgument(), const PathArgument &a2 = PathArgument(), const PathArgument &a3 = PathArgument(), const PathArgument &a4 = PathArgument(), const PathArgument &a5 = PathArgument()); const Value &resolve(const Value &root) const; Value resolve(const Value &root, const Value &defaultValue) const; /// Creates the "path" to access the specified node and returns a reference on /// the node. Value &make(Value &root) const; private: typedef std::vector InArgs; typedef std::vector Args; void makePath(const std::string &path, const InArgs &in); void addPathInArg(const std::string &path, const InArgs &in, InArgs::const_iterator &itInArg, PathArgument::Kind kind); void invalidPath(const std::string &path, int location); Args args_; }; #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief Allocator to customize Value internal map. * Below is an example of a simple implementation (default implementation actually * use memory pool for speed). * \code class DefaultValueMapAllocator : public ValueMapAllocator { public: // overridden from ValueMapAllocator virtual ValueInternalMap *newMap() { return new ValueInternalMap(); } virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) { return new ValueInternalMap( other ); } virtual void destructMap( ValueInternalMap *map ) { delete map; } virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) { return new ValueInternalLink[size]; } virtual void releaseMapBuckets( ValueInternalLink *links ) { delete [] links; } virtual ValueInternalLink *allocateMapLink() { return new ValueInternalLink(); } virtual void releaseMapLink( ValueInternalLink *link ) { delete link; } }; * \endcode */ class JSON_API ValueMapAllocator { public: virtual ~ValueMapAllocator(); virtual ValueInternalMap *newMap() = 0; virtual ValueInternalMap *newMapCopy(const ValueInternalMap &other) = 0; virtual void destructMap(ValueInternalMap *map) = 0; virtual ValueInternalLink *allocateMapBuckets(unsigned int size) = 0; virtual void releaseMapBuckets(ValueInternalLink *links) = 0; virtual ValueInternalLink *allocateMapLink() = 0; virtual void releaseMapLink(ValueInternalLink *link) = 0; }; /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). * \internal previous_ & next_ allows for bidirectional traversal. */ class JSON_API ValueInternalLink { public: enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. enum InternalFlags { flagAvailable = 0, flagUsed = 1 }; ValueInternalLink(); ~ValueInternalLink(); Value items_[itemPerLink]; char *keys_[itemPerLink]; ValueInternalLink *previous_; ValueInternalLink *next_; }; /** \brief A linked page based hash-table implementation used internally by *Value. * \internal ValueInternalMap is a tradional bucket based hash-table, with a *linked * list in each bucket to handle collision. There is an addional twist in that * each node of the collision linked list is a page containing a fixed amount of * value. This provides a better compromise between memory usage and speed. * * Each bucket is made up of a chained list of ValueInternalLink. The last * link of a given bucket can be found in the 'previous_' field of the following *bucket. * The last link of the last bucket is stored in tailLink_ as it has no *following bucket. * Only the last link of a bucket may contains 'available' item. The last link *always * contains at least one element unless is it the bucket one very first link. */ class JSON_API ValueInternalMap { friend class ValueIteratorBase; friend class Value; public: typedef unsigned int HashKey; typedef unsigned int BucketIndex; #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState { IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {} ValueInternalMap *map_; ValueInternalLink *link_; BucketIndex itemIndex_; BucketIndex bucketIndex_; }; #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalMap(); ValueInternalMap(const ValueInternalMap &other); ValueInternalMap &operator=(ValueInternalMap other); ~ValueInternalMap(); void swap(ValueInternalMap &other); BucketIndex size() const; void clear(); bool reserveDelta(BucketIndex growth); bool reserve(BucketIndex newItemCount); const Value *find(const char *key) const; Value *find(const char *key); Value &resolveReference(const char *key, bool isStatic); void remove(const char *key); void doActualRemove(ValueInternalLink *link, BucketIndex index, BucketIndex bucketIndex); ValueInternalLink *&getLastLinkInBucket(BucketIndex bucketIndex); Value &setNewItem(const char *key, bool isStatic, ValueInternalLink *link, BucketIndex index); Value &unsafeAdd(const char *key, bool isStatic, HashKey hashedKey); HashKey hash(const char *key) const; int compare(const ValueInternalMap &other) const; private: void makeBeginIterator(IteratorState &it) const; void makeEndIterator(IteratorState &it) const; static bool equals(const IteratorState &x, const IteratorState &other); static void increment(IteratorState &iterator); static void incrementBucket(IteratorState &iterator); static void decrement(IteratorState &iterator); static const char *key(const IteratorState &iterator); static const char *key(const IteratorState &iterator, bool &isStatic); static Value &value(const IteratorState &iterator); static int distance(const IteratorState &x, const IteratorState &y); private: ValueInternalLink *buckets_; ValueInternalLink *tailLink_; BucketIndex bucketsSize_; BucketIndex itemCount_; }; /** \brief A simplified deque implementation used internally by Value. * \internal * It is based on a list of fixed "page", each page contains a fixed number of *items. * Instead of using a linked-list, a array of pointer is used for fast item *look-up. * Look-up for an element is as follow: * - compute page index: pageIndex = itemIndex / itemsPerPage * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] * * Insertion is amortized constant time (only the array containing the index of *pointers * need to be reallocated when items are appended). */ class JSON_API ValueInternalArray { friend class Value; friend class ValueIteratorBase; public: enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. typedef Value::ArrayIndex ArrayIndex; typedef unsigned int PageIndex; #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION struct IteratorState // Must be a POD { IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {} ValueInternalArray *array_; Value **currentPageIndex_; unsigned int currentItemIndex_; }; #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION ValueInternalArray(); ValueInternalArray(const ValueInternalArray &other); ValueInternalArray &operator=(ValueInternalArray other); ~ValueInternalArray(); void swap(ValueInternalArray &other); void clear(); void resize(ArrayIndex newSize); Value &resolveReference(ArrayIndex index); Value *find(ArrayIndex index) const; ArrayIndex size() const; int compare(const ValueInternalArray &other) const; private: static bool equals(const IteratorState &x, const IteratorState &other); static void increment(IteratorState &iterator); static void decrement(IteratorState &iterator); static Value &dereference(const IteratorState &iterator); static Value &unsafeDereference(const IteratorState &iterator); static int distance(const IteratorState &x, const IteratorState &y); static ArrayIndex indexOf(const IteratorState &iterator); void makeBeginIterator(IteratorState &it) const; void makeEndIterator(IteratorState &it) const; void makeIterator(IteratorState &it, ArrayIndex index) const; void makeIndexValid(ArrayIndex index); Value **pages_; ArrayIndex size_; PageIndex pageCount_; }; /** \brief Experimental: do not use. Allocator to customize Value internal array. * Below is an example of a simple implementation (actual implementation use * memory pool). \code class DefaultValueArrayAllocator : public ValueArrayAllocator { public: // overridden from ValueArrayAllocator virtual ~DefaultValueArrayAllocator() { } virtual ValueInternalArray *newArray() { return new ValueInternalArray(); } virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) { return new ValueInternalArray( other ); } virtual void destruct( ValueInternalArray *array ) { delete array; } virtual void reallocateArrayPageIndex( Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount ) { ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; if ( minNewIndexCount > newIndexCount ) newIndexCount = minNewIndexCount; void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); if ( !newIndexes ) throw std::bad_alloc(); indexCount = newIndexCount; indexes = static_cast( newIndexes ); } virtual void releaseArrayPageIndex( Value **indexes, ValueInternalArray::PageIndex indexCount ) { if ( indexes ) free( indexes ); } virtual Value *allocateArrayPage() { return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); } virtual void releaseArrayPage( Value *value ) { if ( value ) free( value ); } }; \endcode */ class JSON_API ValueArrayAllocator { public: virtual ~ValueArrayAllocator(); virtual ValueInternalArray *newArray() = 0; virtual ValueInternalArray *newArrayCopy(const ValueInternalArray &other) = 0; virtual void destructArray(ValueInternalArray *array) = 0; /** \brief Reallocate array page index. * Reallocates an array of pointer on each page. * \param indexes [input] pointer on the current index. May be \c NULL. * [output] pointer on the new index of at least * \a minNewIndexCount pages. * \param indexCount [input] current number of pages in the index. * [output] number of page the reallocated index can handle. * \b MUST be >= \a minNewIndexCount. * \param minNewIndexCount Minimum number of page the new index must be able * to * handle. */ virtual void reallocateArrayPageIndex(Value **&indexes, ValueInternalArray::PageIndex &indexCount, ValueInternalArray::PageIndex minNewIndexCount) = 0; virtual void releaseArrayPageIndex(Value **indexes, ValueInternalArray::PageIndex indexCount) = 0; virtual Value *allocateArrayPage() = 0; virtual void releaseArrayPage(Value *value) = 0; }; #endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP /** \brief base class for Value iterators. * */ class JSON_API ValueIteratorBase { public: typedef std::bidirectional_iterator_tag iterator_category; typedef unsigned int size_t; typedef int difference_type; typedef ValueIteratorBase SelfType; ValueIteratorBase(); #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIteratorBase(const Value::ObjectValues::iterator ¤t); #else ValueIteratorBase(const ValueInternalArray::IteratorState &state); ValueIteratorBase(const ValueInternalMap::IteratorState &state); #endif bool operator==(const SelfType &other) const { return isEqual(other); } bool operator!=(const SelfType &other) const { return !isEqual(other); } difference_type operator-(const SelfType &other) const { return computeDistance(other); } /// Return either the index or the member name of the referenced value as a /// Value. Value key() const; /// Return the index of the referenced Value. -1 if it is not an arrayValue. UInt index() const; /// Return the member name of the referenced Value. "" if it is not an /// objectValue. const char *memberName() const; protected: Value &deref() const; void increment(); void decrement(); difference_type computeDistance(const SelfType &other) const; bool isEqual(const SelfType &other) const; void copy(const SelfType &other); private: #ifndef JSON_VALUE_USE_INTERNAL_MAP Value::ObjectValues::iterator current_; // Indicates that iterator is for a null value. bool isNull_; #else union { ValueInternalArray::IteratorState array_; ValueInternalMap::IteratorState map_; } iterator_; bool isArray_; #endif }; /** \brief const iterator for object and array value. * */ class JSON_API ValueConstIterator : public ValueIteratorBase { friend class Value; public: typedef const Value value_type; typedef unsigned int size_t; typedef int difference_type; typedef const Value &reference; typedef const Value *pointer; typedef ValueConstIterator SelfType; ValueConstIterator(); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueConstIterator(const Value::ObjectValues::iterator ¤t); #else ValueConstIterator(const ValueInternalArray::IteratorState &state); ValueConstIterator(const ValueInternalMap::IteratorState &state); #endif public: SelfType &operator=(const ValueIteratorBase &other); SelfType operator++(int) { SelfType temp(*this); ++*this; return temp; } SelfType operator--(int) { SelfType temp(*this); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator*() const { return deref(); } }; /** \brief Iterator for object and array value. */ class JSON_API ValueIterator : public ValueIteratorBase { friend class Value; public: typedef Value value_type; typedef unsigned int size_t; typedef int difference_type; typedef Value &reference; typedef Value *pointer; typedef ValueIterator SelfType; ValueIterator(); ValueIterator(const ValueConstIterator &other); ValueIterator(const ValueIterator &other); private: /*! \internal Use by Value to create an iterator. */ #ifndef JSON_VALUE_USE_INTERNAL_MAP explicit ValueIterator(const Value::ObjectValues::iterator ¤t); #else ValueIterator(const ValueInternalArray::IteratorState &state); ValueIterator(const ValueInternalMap::IteratorState &state); #endif public: SelfType &operator=(const SelfType &other); SelfType operator++(int) { SelfType temp(*this); ++*this; return temp; } SelfType operator--(int) { SelfType temp(*this); --*this; return temp; } SelfType &operator--() { decrement(); return *this; } SelfType &operator++() { increment(); return *this; } reference operator*() const { return deref(); } }; } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // CPPTL_JSON_H_INCLUDED ================================================ FILE: Libraries/Core/iOS/Headers/json/writer.h ================================================ // Copyright 2007-2010 Baptiste Lepilleur // Distributed under MIT license, or public domain if desired and // recognized in your jurisdiction. // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE #ifndef JSON_WRITER_H_INCLUDED #define JSON_WRITER_H_INCLUDED #if !defined(JSON_IS_AMALGAMATION) #include "value.h" #endif // if !defined(JSON_IS_AMALGAMATION) #include #include // Disable warning C4251: : needs to have dll-interface to // be used by... #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(push) #pragma warning(disable : 4251) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) namespace Json { class Value; /** \brief Abstract class for writers. */ class JSON_API Writer { public: virtual ~Writer(); virtual std::string write(const Value &root) = 0; }; /** \brief Outputs a Value in JSON format *without formatting (not human friendly). * * The JSON document is written in a single line. It is not intended for 'human' *consumption, * but may be usefull to support feature such as RPC where bandwith is limited. * \sa Reader, Value */ class JSON_API FastWriter : public Writer { public: FastWriter(); virtual ~FastWriter() {} void enableYAMLCompatibility(); /** \brief Drop the "null" string from the writer's output for nullValues. * Strictly speaking, this is not valid JSON. But when the output is being * fed to a browser's Javascript, it makes for smaller output and the * browser can handle the output just fine. */ void dropNullPlaceholders(); void omitEndingLineFeed(); public: // overridden from Writer virtual std::string write(const Value &root); private: void writeValue(const Value &value); std::string document_; bool yamlCompatiblityEnabled_; bool dropNullPlaceholders_; bool omitEndingLineFeed_; }; /** \brief Writes a Value in JSON format in a *human friendly way. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per *line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value *types, * and all the values fit on one lines, then print the array on a single *line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their *#CommentPlacement. * * \sa Reader, Value, Value::setComment() */ class JSON_API StyledWriter : public Writer { public: StyledWriter(); virtual ~StyledWriter() {} public: // overridden from Writer /** \brief Serialize a Value in JSON format. * \param root Value to serialize. * \return String containing the JSON document that represents the root value. */ virtual std::string write(const Value &root); private: void writeValue(const Value &value); void writeArrayValue(const Value &value); bool isMultineArray(const Value &value); void pushValue(const std::string &value); void writeIndent(); void writeWithIndent(const std::string &value); void indent(); void unindent(); void writeCommentBeforeValue(const Value &root); void writeCommentAfterValueOnSameLine(const Value &root); bool hasCommentForValue(const Value &value); static std::string normalizeEOL(const std::string &text); typedef std::vector ChildValues; ChildValues childValues_; std::string document_; std::string indentString_; int rightMargin_; int indentSize_; bool addChildValues_; }; /** \brief Writes a Value in JSON format in a human friendly way, to a stream rather than to a string. * * The rules for line break and indent are as follow: * - Object value: * - if empty then print {} without indent and line break * - if not empty the print '{', line break & indent, print one value per line * and then unindent and line break and print '}'. * - Array value: * - if empty then print [] without indent and line break * - if the array contains no object value, empty array or some other value types, * and all the values fit on one lines, then print the array on a single line. * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. * * If the Value have comments then they are outputed according to their #CommentPlacement. * * \param indentation Each level will be indented by this amount extra. * \sa Reader, Value, Value::setComment() */ class JSON_API StyledStreamWriter { public: StyledStreamWriter(std::string indentation = "\t"); ~StyledStreamWriter() {} public: /** \brief Serialize a Value in JSON format. * \param out Stream to write to. (Can be ostringstream, e.g.) * \param root Value to serialize. * \note There is no point in deriving from Writer, since write() should not * return a value. */ void write(std::ostream &out, const Value &root); private: void writeValue(const Value &value); void writeArrayValue(const Value &value); bool isMultineArray(const Value &value); void pushValue(const std::string &value); void writeIndent(); void writeWithIndent(const std::string &value); void indent(); void unindent(); void writeCommentBeforeValue(const Value &root); void writeCommentAfterValueOnSameLine(const Value &root); bool hasCommentForValue(const Value &value); static std::string normalizeEOL(const std::string &text); typedef std::vector ChildValues; ChildValues childValues_; std::ostream *document_; std::string indentString_; int rightMargin_; std::string indentation_; bool addChildValues_; }; #if defined(JSON_HAS_INT64) std::string JSON_API valueToString(Int value); std::string JSON_API valueToString(UInt value); #endif // if defined(JSON_HAS_INT64) std::string JSON_API valueToString(LargestInt value); std::string JSON_API valueToString(LargestUInt value); std::string JSON_API valueToString(double value); std::string JSON_API valueToString(bool value); std::string JSON_API valueToQuotedString(const char *value); /// \brief Output using the StyledStreamWriter. /// \see Json::operator>>() JSON_API std::ostream &operator<<(std::ostream &, const Value &root); } // namespace Json #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #pragma warning(pop) #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) #endif // JSON_WRITER_H_INCLUDED ================================================ FILE: Libraries/Core/iOS/Headers/md5/md5.h ================================================ /* MD5 converted to C++ class by Frank Thilo (thilo@unix-ag.org) for bzflag (http://www.bzflag.org) based on: md5.h and md5.c reference implementation of RFC 1321 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #ifndef BZF_MD5_H #define BZF_MD5_H #include #include // a small class for calculating MD5 hashes of strings or byte arrays // it is not meant to be fast or secure // // usage: 1) feed it blocks of uchars with update() // 2) finalize() // 3) get hexdigest() string // or // MD5(std::string).hexdigest() // // assumes that char is 8 bit and int is 32 bit class MD5 { public: typedef unsigned int size_type; // must be 32bit MD5(); MD5(const std::string& text); void update(const unsigned char *buf, size_type length); void update(const char *buf, size_type length); MD5& finalize(); std::string hexdigest() const; friend std::ostream& operator<<(std::ostream&, MD5 md5); std::string binarydigest() const {return std::string(reinterpret_cast(digest), 16);} //Ian Copland, 09/06/2014: added accessor for the raw digest. private: void init(); typedef unsigned char uint1; // 8bit typedef unsigned int uint4; // 32bit enum {blocksize = 64}; // VC6 won't eat a const static int here void transform(const uint1 block[blocksize]); static void decode(uint4 output[], const uint1 input[], size_type len); static void encode(uint1 output[], const uint4 input[], size_type len); bool finalized; uint1 buffer[blocksize]; // bytes that didn't fit in last 64 byte chunk uint4 count[2]; // 64bit counter for number of bits (lo, hi) uint4 state[4]; // digest so far uint1 digest[16]; // the result // low level logic operations static inline uint4 F(uint4 x, uint4 y, uint4 z); static inline uint4 G(uint4 x, uint4 y, uint4 z); static inline uint4 H(uint4 x, uint4 y, uint4 z); static inline uint4 I(uint4 x, uint4 y, uint4 z); static inline uint4 rotate_left(uint4 x, int n); static inline void FF(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void GG(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void HH(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); static inline void II(uint4 &a, uint4 b, uint4 c, uint4 d, uint4 x, uint4 s, uint4 ac); }; std::string md5(const std::string str); #endif ================================================ FILE: Libraries/Core/iOS/Headers/minizip/crypt.h ================================================ /* crypt.h -- base code for crypt/uncrypt ZIPfile Version 1.01e, February 12th, 2005 Copyright (C) 1998-2005 Gilles Vollant This code is a modified version of crypting code in Infozip distribution The encryption/decryption parts of this source code (as opposed to the non-echoing password parts) were originally written in Europe. The whole source package can be freely distributed, including from the USA. (Prior to January 2000, re-export from the US was a violation of US law.) This encryption code is a direct transcription of the algorithm from Roger Schlafly, described by Phil Katz in the file appnote.txt. This file (appnote.txt) is distributed with the PKZIP program (even in the version without encryption capabilities). If you don't need crypting in your application, just define symbols NOCRYPT and NOUNCRYPT. This code support the "Traditional PKWARE Encryption". The new AES encryption added on Zip format by Winzip (see the page http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong Encryption is not supported. */ #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) /*********************************************************************** * Return the next byte in the pseudo-random sequence */ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) { unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an * unpredictable manner on 16-bit systems; not a problem * with any known compiler so far, though */ temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); } /*********************************************************************** * Update the encryption keys with the next byte of plain text */ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) { (*(pkeys+0)) = CRC32((*(pkeys+0)), c); (*(pkeys+1)) += (*(pkeys+0)) & 0xff; (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; { register int keyshift = (int)((*(pkeys+1)) >> 24); (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); } return c; } /*********************************************************************** * Initialize the encryption keys and the random header according to * the given password. */ static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) { *(pkeys+0) = 305419896L; *(pkeys+1) = 591751049L; *(pkeys+2) = 878082192L; while (*passwd != '\0') { update_keys(pkeys,pcrc_32_tab,(int)*passwd); passwd++; } } #define zdecode(pkeys,pcrc_32_tab,c) \ (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) #define zencode(pkeys,pcrc_32_tab,c,t) \ (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED #define RAND_HEAD_LEN 12 /* "last resort" source for second part of crypt seed pattern */ # ifndef ZCR_SEED2 # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ # endif static int crypthead(const char* passwd, /* password string */ unsigned char* buf, /* where to write header */ int bufSize, unsigned long* pkeys, const unsigned long* pcrc_32_tab, unsigned long crcForCrypting) { int n; /* index in random header */ int t; /* temporary */ int c; /* random byte */ unsigned char header[RAND_HEAD_LEN-2]; /* random header */ static unsigned calls = 0; /* ensure different random header each time */ if (bufSize> 7) & 0xff; header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); } /* Encrypt random header (last two bytes is high word of crc) */ init_keys(passwd, pkeys, pcrc_32_tab); for (n = 0; n < RAND_HEAD_LEN-2; n++) { buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); } buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); return n; } #endif ================================================ FILE: Libraries/Core/iOS/Headers/minizip/ioapi.h ================================================ /* ioapi.h -- IO base function header for compress/uncompress .zip part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt Changes Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. More if/def section may be needed to support other platforms Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. (but you should use iowin32.c for windows instead) */ #ifndef _ZLIBIOAPI64_H #define _ZLIBIOAPI64_H #if (!defined(_WIN32)) && (!defined(WIN32)) // Linux needs this to support file operation on files larger then 4+GB // But might need better if/def to select just the platforms that needs them. #ifndef __USE_FILE_OFFSET64 #define __USE_FILE_OFFSET64 #endif #ifndef __USE_LARGEFILE64 #define __USE_LARGEFILE64 #endif #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif #ifndef _FILE_OFFSET_BIT #define _FILE_OFFSET_BIT 64 #endif #endif #include #include #include "zlib.h" #if defined(USE_FILE32API) #define fopen64 fopen #define ftello64 ftell #define fseeko64 fseek #else #ifdef _MSC_VER #define fopen64 fopen #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) #define ftello64 _ftelli64 #define fseeko64 _fseeki64 #else // old MSC #define ftello64 ftell #define fseeko64 fseek #endif #endif #endif /* #ifndef ZPOS64_T #ifdef _WIN32 #define ZPOS64_T fpos_t #else #include #define ZPOS64_T uint64_t #endif #endif */ #ifdef HAVE_MINIZIP64_CONF_H #include "mz64conf.h" #endif /* a type choosen by DEFINE */ #ifdef HAVE_64BIT_INT_CUSTOM typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; #else #ifdef HAS_STDINT_H #include "stdint.h" typedef uint64_t ZPOS64_T; #else #if defined(_MSC_VER) || defined(__BORLANDC__) typedef unsigned __int64 ZPOS64_T; #else typedef unsigned long long int ZPOS64_T; #endif #endif #endif #ifdef __cplusplus extern "C" { #endif #define ZLIB_FILEFUNC_SEEK_CUR (1) #define ZLIB_FILEFUNC_SEEK_END (2) #define ZLIB_FILEFUNC_SEEK_SET (0) #define ZLIB_FILEFUNC_MODE_READ (1) #define ZLIB_FILEFUNC_MODE_WRITE (2) #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) #define ZLIB_FILEFUNC_MODE_EXISTING (4) #define ZLIB_FILEFUNC_MODE_CREATE (8) #ifndef ZCALLBACK #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) #define ZCALLBACK CALLBACK #else #define ZCALLBACK #endif #endif typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); /* here is the "old" 32 bits structure structure */ typedef struct zlib_filefunc_def_s { open_file_func zopen_file; read_file_func zread_file; write_file_func zwrite_file; tell_file_func ztell_file; seek_file_func zseek_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; } zlib_filefunc_def; typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); typedef struct zlib_filefunc64_def_s { open64_file_func zopen64_file; read_file_func zread_file; write_file_func zwrite_file; tell64_file_func ztell64_file; seek64_file_func zseek64_file; close_file_func zclose_file; testerror_file_func zerror_file; voidpf opaque; } zlib_filefunc64_def; void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); /* now internal definition, only for zip.c and unzip.h */ typedef struct zlib_filefunc64_32_def_s { zlib_filefunc64_def zfile_func64; open_file_func zopen32_file; tell_file_func ztell32_file; seek_file_func zseek32_file; } zlib_filefunc64_32_def; #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) //#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) //#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) #ifdef __cplusplus } #endif #endif ================================================ FILE: Libraries/Core/iOS/Headers/minizip/mztools.h ================================================ /* Additional tools for Minizip Code: Xavier Roche '2004 License: Same as ZLIB (www.gzip.org) */ #ifndef _zip_tools_H #define _zip_tools_H #ifdef __cplusplus extern "C" { #endif #ifndef _ZLIB_H #include "zlib.h" #endif #include "unzip.h" /* Repair a ZIP file (missing central directory) file: file to recover fileOut: output file after recovery fileOutTmp: temporary file name used for recovery */ extern int ZEXPORT unzRepair(const char* file, const char* fileOut, const char* fileOutTmp, uLong* nRecovered, uLong* bytesRecovered); #endif ================================================ FILE: Libraries/Core/iOS/Headers/minizip/unzip.h ================================================ /* unzip.h -- IO for uncompress .zip files using zlib Version 1.1, February 14h, 2010 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications of Unzip for Zip64 Copyright (C) 2007-2008 Even Rouault Modifications for Zip64 support on both zip and unzip Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt --------------------------------------------------------------------------------- Condition of use and distribution are the same than zlib : This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------------- Changes See header of unzip64.c */ #ifndef _unz64_H #define _unz64_H #ifdef __cplusplus extern "C" { #endif #ifndef _ZLIB_H #include "zlib.h" #endif #ifndef _ZLIBIOAPI_H #include "ioapi.h" #endif #ifdef HAVE_BZIP2 #include "bzlib.h" #endif #define Z_BZIP2ED 12 #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ typedef struct TagunzFile__ { int unused; } unzFile__; typedef unzFile__ *unzFile; #else typedef voidp unzFile; #endif #define UNZ_OK (0) #define UNZ_END_OF_LIST_OF_FILE (-100) #define UNZ_ERRNO (Z_ERRNO) #define UNZ_EOF (0) #define UNZ_PARAMERROR (-102) #define UNZ_BADZIPFILE (-103) #define UNZ_INTERNALERROR (-104) #define UNZ_CRCERROR (-105) /* tm_unz contain date/time info */ typedef struct tm_unz_s { uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mon; /* months since January - [0,11] */ uInt tm_year; /* years - [1980..2044] */ } tm_unz; /* unz_global_info structure contain global data about the ZIPfile These data comes from the end of central dir */ typedef struct unz_global_info64_s { ZPOS64_T number_entry; /* total number of entries in the central dir on this disk */ uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info64; typedef struct unz_global_info_s { uLong number_entry; /* total number of entries in the central dir on this disk */ uLong size_comment; /* size of the global comment of the zipfile */ } unz_global_info; /* unz_file_info contain information about a file in the zipfile */ typedef struct unz_file_info64_s { uLong version; /* version made by 2 bytes */ uLong version_needed; /* version needed to extract 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */ uLong compression_method; /* compression method 2 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong crc; /* crc-32 4 bytes */ ZPOS64_T compressed_size; /* compressed size 8 bytes */ ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ uLong size_filename; /* filename length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */ uLong disk_num_start; /* disk number start 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info64; typedef struct unz_file_info_s { uLong version; /* version made by 2 bytes */ uLong version_needed; /* version needed to extract 2 bytes */ uLong flag; /* general purpose bit flag 2 bytes */ uLong compression_method; /* compression method 2 bytes */ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ uLong crc; /* crc-32 4 bytes */ uLong compressed_size; /* compressed size 4 bytes */ uLong uncompressed_size; /* uncompressed size 4 bytes */ uLong size_filename; /* filename length 2 bytes */ uLong size_file_extra; /* extra field length 2 bytes */ uLong size_file_comment; /* file comment length 2 bytes */ uLong disk_num_start; /* disk number start 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ tm_unz tmu_date; } unz_file_info; extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, const char* fileName2, int iCaseSensitivity)); /* Compare two filename (fileName1,fileName2). If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi or strcasecmp) If iCaseSenisivity = 0, case sensitivity is defaut of your operating system (like 1 on Unix, 2 on Windows) */ extern unzFile ZEXPORT unzOpen OF((const char *path)); extern unzFile ZEXPORT unzOpen64 OF((const void *path)); /* Open a Zip file. path contain the full pathname (by example, on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip". If the zipfile cannot be opened (file don't exist or in not valid), the return value is NULL. Else, the return value is a unzFile Handle, usable with other function of this unzip package. the "64" function take a const void* pointer, because the path is just the value passed to the open64_file_func callback. Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* does not describe the reality */ extern unzFile ZEXPORT unzOpen2 OF((const char *path, zlib_filefunc_def* pzlib_filefunc_def)); /* Open a Zip file, like unzOpen, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, zlib_filefunc64_def* pzlib_filefunc_def)); /* Open a Zip file, like unz64Open, but provide a set of file low level API for read/write the zip file (see ioapi.h) */ extern int ZEXPORT unzClose OF((unzFile file)); /* Close a ZipFile opened with unzipOpen. If there is files inside the .Zip opened with unzOpenCurrentFile (see later), these files MUST be closed with unzipCloseCurrentFile before call unzipClose. return UNZ_OK if there is no problem. */ extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, unz_global_info *pglobal_info)); extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, unz_global_info64 *pglobal_info)); /* Write info about the ZipFile in the *pglobal_info structure. No preparation of the structure is needed return UNZ_OK if there is no problem. */ extern int ZEXPORT unzGetGlobalComment OF((unzFile file, char *szComment, uLong uSizeBuf)); /* Get the global comment string of the ZipFile, in the szComment buffer. uSizeBuf is the size of the szComment buffer. return the number of byte copied or an error code <0 */ /***************************************************************************/ /* Unzip package allow you browse the directory of the zipfile */ extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); /* Set the current file of the zipfile to the first file. return UNZ_OK if there is no problem */ extern int ZEXPORT unzGoToNextFile OF((unzFile file)); /* Set the current file of the zipfile to the next file. return UNZ_OK if there is no problem return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. */ extern int ZEXPORT unzLocateFile OF((unzFile file, const char *szFileName, int iCaseSensitivity)); /* Try locate the file szFileName in the zipfile. For the iCaseSensitivity signification, see unzStringFileNameCompare return value : UNZ_OK if the file is found. It becomes the current file. UNZ_END_OF_LIST_OF_FILE if the file is not found */ /* ****************************************** */ /* Ryan supplied functions */ /* unz_file_info contain information about a file in the zipfile */ typedef struct unz_file_pos_s { uLong pos_in_zip_directory; /* offset in zip file directory */ uLong num_of_file; /* # of file */ } unz_file_pos; extern int ZEXPORT unzGetFilePos( unzFile file, unz_file_pos* file_pos); extern int ZEXPORT unzGoToFilePos( unzFile file, unz_file_pos* file_pos); typedef struct unz64_file_pos_s { ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ ZPOS64_T num_of_file; /* # of file */ } unz64_file_pos; extern int ZEXPORT unzGetFilePos64( unzFile file, unz64_file_pos* file_pos); extern int ZEXPORT unzGoToFilePos64( unzFile file, const unz64_file_pos* file_pos); /* ****************************************** */ extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, unz_file_info64 *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)); extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, unz_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)); /* Get Info about the current file if pfile_info!=NULL, the *pfile_info structure will contain somes info about the current file if szFileName!=NULL, the filemane string will be copied in szFileName (fileNameBufferSize is the size of the buffer) if extraField!=NULL, the extra field information will be copied in extraField (extraFieldBufferSize is the size of the buffer). This is the Central-header version of the extra field if szComment!=NULL, the comment string of the file will be copied in szComment (commentBufferSize is the size of the buffer) */ /** Addition for GDAL : START */ extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); /** Addition for GDAL : END */ /***************************************************************************/ /* for reading the content of the current zipfile, you can open it, read data from it, and close it (you can close it before reading all the file) */ extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); /* Open for reading data the current file in the zipfile. If there is no error, the return value is UNZ_OK. */ extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, const char* password)); /* Open for reading data the current file in the zipfile. password is a crypting password If there is no error, the return value is UNZ_OK. */ extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, int* method, int* level, int raw)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 *method will receive method of compression, *level will receive level of compression note : you can set level parameter as NULL (if you did not want known level, but you CANNOT set method parameter as NULL */ extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, int* method, int* level, int raw, const char* password)); /* Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) if raw==1 *method will receive method of compression, *level will receive level of compression note : you can set level parameter as NULL (if you did not want known level, but you CANNOT set method parameter as NULL */ extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); /* Close the file in zip opened with unzOpenCurrentFile Return UNZ_CRCERROR if all the file was read but the CRC is not good */ extern int ZEXPORT unzReadCurrentFile OF((unzFile file, voidp buf, unsigned len)); /* Read bytes from the current file (opened by unzOpenCurrentFile) buf contain buffer where data must be copied len the size of buf. return the number of byte copied if somes bytes are copied return 0 if the end of file was reached return <0 with error code if there is an error (UNZ_ERRNO for IO error, or zLib error for uncompress error) */ extern z_off_t ZEXPORT unztell OF((unzFile file)); extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); /* Give the current position in uncompressed data */ extern int ZEXPORT unzeof OF((unzFile file)); /* return 1 if the end of file was reached, 0 elsewhere */ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, voidp buf, unsigned len)); /* Read extra field from the current file (opened by unzOpenCurrentFile) This is the local-header version of the extra field (sometimes, there is more info in the local-header version than in the central-header) if buf==NULL, it return the size of the local extra field if buf!=NULL, len is the size of the buffer, the extra header is copied in buf. the return value is the number of bytes copied in buf, or (if <0) the error code */ /***************************************************************************/ /* Get the current file offset */ extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); extern uLong ZEXPORT unzGetOffset (unzFile file); /* Set the current file offset */ extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); #ifdef __cplusplus } #endif #endif /* _unz64_H */ ================================================ FILE: Libraries/Core/iOS/Headers/minizip/zip.h ================================================ /* zip.h -- IO on .zip files using zlib Version 1.1, February 14h, 2010 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) Modifications for Zip64 support Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) For more info read MiniZip_info.txt --------------------------------------------------------------------------- Condition of use and distribution are the same than zlib : This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. --------------------------------------------------------------------------- Changes See header of zip.h */ #ifndef _zip12_H #define _zip12_H #ifdef __cplusplus extern "C" { #endif //#define HAVE_BZIP2 #ifndef _ZLIB_H #include "zlib.h" #endif #ifndef _ZLIBIOAPI_H #include "ioapi.h" #endif #ifdef HAVE_BZIP2 #include "bzlib.h" #endif #define Z_BZIP2ED 12 #if defined(STRICTZIP) || defined(STRICTZIPUNZIP) /* like the STRICT of WIN32, we define a pointer that cannot be converted from (void*) without cast */ typedef struct TagzipFile__ { int unused; } zipFile__; typedef zipFile__ *zipFile; #else typedef voidp zipFile; #endif #define ZIP_OK (0) #define ZIP_EOF (0) #define ZIP_ERRNO (Z_ERRNO) #define ZIP_PARAMERROR (-102) #define ZIP_BADZIPFILE (-103) #define ZIP_INTERNALERROR (-104) #ifndef DEF_MEM_LEVEL # if MAX_MEM_LEVEL >= 8 # define DEF_MEM_LEVEL 8 # else # define DEF_MEM_LEVEL MAX_MEM_LEVEL # endif #endif /* default memLevel */ /* tm_zip contain date/time info */ typedef struct tm_zip_s { uInt tm_sec; /* seconds after the minute - [0,59] */ uInt tm_min; /* minutes after the hour - [0,59] */ uInt tm_hour; /* hours since midnight - [0,23] */ uInt tm_mday; /* day of the month - [1,31] */ uInt tm_mon; /* months since January - [0,11] */ uInt tm_year; /* years - [1980..2044] */ } tm_zip; typedef struct { tm_zip tmz_date; /* date in understandable format */ uLong dosDate; /* if dos_date == 0, tmu_date is used */ /* uLong flag; */ /* general purpose bit flag 2 bytes */ uLong internal_fa; /* internal file attributes 2 bytes */ uLong external_fa; /* external file attributes 4 bytes */ } zip_fileinfo; typedef const char* zipcharpc; #define APPEND_STATUS_CREATE (0) #define APPEND_STATUS_CREATEAFTER (1) #define APPEND_STATUS_ADDINZIP (2) extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append)); extern zipFile ZEXPORT zipOpen64 OF((const void *pathname, int append)); /* Create a zipfile. pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on an Unix computer "zlib/zlib113.zip". if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip will be created at the end of the file. (useful if the file contain a self extractor code) if the file pathname exist and append==APPEND_STATUS_ADDINZIP, we will add files in existing zip (be sure you don't add file that doesn't exist) If the zipfile cannot be opened, the return value is NULL. Else, the return value is a zipFile Handle, usable with other function of this zip package. */ /* Note : there is no delete function into a zipfile. If you want delete file into a zipfile, you must open a zipfile, and create another Of couse, you can use RAW reading and writing to copy the file you did not want delte */ extern zipFile ZEXPORT zipOpen2 OF((const char *pathname, int append, zipcharpc* globalcomment, zlib_filefunc_def* pzlib_filefunc_def)); extern zipFile ZEXPORT zipOpen2_64 OF((const void *pathname, int append, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def)); extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level)); extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int zip64)); /* Open a file in the ZIP for writing. filename : the filename in zip (if NULL, '-' without quote will be used *zipfi contain supplemental information if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local contains the extrafield data the the local header if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global contains the extrafield data the the local header if comment != NULL, comment contain the comment string method contain the compression method (0 for store, Z_DEFLATED for deflate) level contain the level of compression (can be Z_DEFAULT_COMPRESSION) zip64 is set to 1 if a zip64 extended information block should be added to the local file header. this MUST be '1' if the uncompressed size is >= 0xffffffff. */ extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw)); extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int zip64)); /* Same than zipOpenNewFileInZip, except if raw=1, we write raw file */ extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting)); extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, int zip64 )); /* Same than zipOpenNewFileInZip2, except windowBits,memLevel,,strategy : see parameter strategy in deflateInit2 password : crypting password (NULL for no crypting) crcForCrypting : crc of file to compress (needed for crypting) */ extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase )); extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file, const char* filename, const zip_fileinfo* zipfi, const void* extrafield_local, uInt size_extrafield_local, const void* extrafield_global, uInt size_extrafield_global, const char* comment, int method, int level, int raw, int windowBits, int memLevel, int strategy, const char* password, uLong crcForCrypting, uLong versionMadeBy, uLong flagBase, int zip64 )); /* Same than zipOpenNewFileInZip4, except versionMadeBy : value for Version made by field flag : value for flag field (compression level info will be added) */ extern int ZEXPORT zipWriteInFileInZip OF((zipFile file, const void* buf, unsigned len)); /* Write data in the zipfile */ extern int ZEXPORT zipCloseFileInZip OF((zipFile file)); /* Close the current file in the zipfile */ extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, uLong uncompressed_size, uLong crc32)); extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, ZPOS64_T uncompressed_size, uLong crc32)); /* Close the current file in the zipfile, for file opened with parameter raw=1 in zipOpenNewFileInZip2 uncompressed_size and crc32 are value for the uncompressed size */ extern int ZEXPORT zipClose OF((zipFile file, const char* global_comment)); /* Close the zipfile */ extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader)); /* zipRemoveExtraInfoBlock - Added by Mathias Svensson Remove extra information block from a extra information data for the local file header or central directory header It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode. 0x0001 is the signature header for the ZIP64 extra information blocks usage. Remove ZIP64 Extra information from a central director extra field data zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001); Remove ZIP64 Extra information from a Local File Header extra field data zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001); */ #ifdef __cplusplus } #endif #endif /* _zip64_H */ ================================================ FILE: Libraries/Core/iOS/Headers/png/png.h ================================================ /* png.h - header file for PNG reference library * * libpng version 1.6.10 - March 6, 2014 * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license (See LICENSE, below) * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.97, January 1998, through 1.6.10 - March 6, 2014: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: * * Due to various miscommunications, unforeseen code incompatibilities * and occasional factors outside the authors' control, version numbering * on the library has not always been consistent and straightforward. * The following table summarizes matters since version 0.89c, which was * the first widely used release: * * source png.h png.h shared-lib * version string int version * ------- ------ ----- ---------- * 0.89c "1.0 beta 3" 0.89 89 1.0.89 * 0.90 "1.0 beta 4" 0.90 90 0.90 [should have been 2.0.90] * 0.95 "1.0 beta 5" 0.95 95 0.95 [should have been 2.0.95] * 0.96 "1.0 beta 6" 0.96 96 0.96 [should have been 2.0.96] * 0.97b "1.00.97 beta 7" 1.00.97 97 1.0.1 [should have been 2.0.97] * 0.97c 0.97 97 2.0.97 * 0.98 0.98 98 2.0.98 * 0.99 0.99 98 2.0.99 * 0.99a-m 0.99 99 2.0.99 * 1.00 1.00 100 2.1.0 [100 should be 10000] * 1.0.0 (from here on, the 100 2.1.0 [100 should be 10000] * 1.0.1 png.h string is 10001 2.1.0 * 1.0.1a-e identical to the 10002 from here on, the shared library * 1.0.2 source version) 10002 is 2.V where V is the source code * 1.0.2a-b 10003 version, except as noted. * 1.0.3 10003 * 1.0.3a-d 10004 * 1.0.4 10004 * 1.0.4a-f 10005 * 1.0.5 (+ 2 patches) 10005 * 1.0.5a-d 10006 * 1.0.5e-r 10100 (not source compatible) * 1.0.5s-v 10006 (not binary compatible) * 1.0.6 (+ 3 patches) 10006 (still binary incompatible) * 1.0.6d-f 10007 (still binary incompatible) * 1.0.6g 10007 * 1.0.6h 10007 10.6h (testing xy.z so-numbering) * 1.0.6i 10007 10.6i * 1.0.6j 10007 2.1.0.6j (incompatible with 1.0.0) * 1.0.7beta11-14 DLLNUM 10007 2.1.0.7beta11-14 (binary compatible) * 1.0.7beta15-18 1 10007 2.1.0.7beta15-18 (binary compatible) * 1.0.7rc1-2 1 10007 2.1.0.7rc1-2 (binary compatible) * 1.0.7 1 10007 (still compatible) * 1.0.8beta1-4 1 10008 2.1.0.8beta1-4 * 1.0.8rc1 1 10008 2.1.0.8rc1 * 1.0.8 1 10008 2.1.0.8 * 1.0.9beta1-6 1 10009 2.1.0.9beta1-6 * 1.0.9rc1 1 10009 2.1.0.9rc1 * 1.0.9beta7-10 1 10009 2.1.0.9beta7-10 * 1.0.9rc2 1 10009 2.1.0.9rc2 * 1.0.9 1 10009 2.1.0.9 * 1.0.10beta1 1 10010 2.1.0.10beta1 * 1.0.10rc1 1 10010 2.1.0.10rc1 * 1.0.10 1 10010 2.1.0.10 * 1.0.11beta1-3 1 10011 2.1.0.11beta1-3 * 1.0.11rc1 1 10011 2.1.0.11rc1 * 1.0.11 1 10011 2.1.0.11 * 1.0.12beta1-2 2 10012 2.1.0.12beta1-2 * 1.0.12rc1 2 10012 2.1.0.12rc1 * 1.0.12 2 10012 2.1.0.12 * 1.1.0a-f - 10100 2.1.1.0a-f (branch abandoned) * 1.2.0beta1-2 2 10200 2.1.2.0beta1-2 * 1.2.0beta3-5 3 10200 3.1.2.0beta3-5 * 1.2.0rc1 3 10200 3.1.2.0rc1 * 1.2.0 3 10200 3.1.2.0 * 1.2.1beta1-4 3 10201 3.1.2.1beta1-4 * 1.2.1rc1-2 3 10201 3.1.2.1rc1-2 * 1.2.1 3 10201 3.1.2.1 * 1.2.2beta1-6 12 10202 12.so.0.1.2.2beta1-6 * 1.0.13beta1 10 10013 10.so.0.1.0.13beta1 * 1.0.13rc1 10 10013 10.so.0.1.0.13rc1 * 1.2.2rc1 12 10202 12.so.0.1.2.2rc1 * 1.0.13 10 10013 10.so.0.1.0.13 * 1.2.2 12 10202 12.so.0.1.2.2 * 1.2.3rc1-6 12 10203 12.so.0.1.2.3rc1-6 * 1.2.3 12 10203 12.so.0.1.2.3 * 1.2.4beta1-3 13 10204 12.so.0.1.2.4beta1-3 * 1.0.14rc1 13 10014 10.so.0.1.0.14rc1 * 1.2.4rc1 13 10204 12.so.0.1.2.4rc1 * 1.0.14 10 10014 10.so.0.1.0.14 * 1.2.4 13 10204 12.so.0.1.2.4 * 1.2.5beta1-2 13 10205 12.so.0.1.2.5beta1-2 * 1.0.15rc1-3 10 10015 10.so.0.1.0.15rc1-3 * 1.2.5rc1-3 13 10205 12.so.0.1.2.5rc1-3 * 1.0.15 10 10015 10.so.0.1.0.15 * 1.2.5 13 10205 12.so.0.1.2.5 * 1.2.6beta1-4 13 10206 12.so.0.1.2.6beta1-4 * 1.0.16 10 10016 10.so.0.1.0.16 * 1.2.6 13 10206 12.so.0.1.2.6 * 1.2.7beta1-2 13 10207 12.so.0.1.2.7beta1-2 * 1.0.17rc1 10 10017 12.so.0.1.0.17rc1 * 1.2.7rc1 13 10207 12.so.0.1.2.7rc1 * 1.0.17 10 10017 12.so.0.1.0.17 * 1.2.7 13 10207 12.so.0.1.2.7 * 1.2.8beta1-5 13 10208 12.so.0.1.2.8beta1-5 * 1.0.18rc1-5 10 10018 12.so.0.1.0.18rc1-5 * 1.2.8rc1-5 13 10208 12.so.0.1.2.8rc1-5 * 1.0.18 10 10018 12.so.0.1.0.18 * 1.2.8 13 10208 12.so.0.1.2.8 * 1.2.9beta1-3 13 10209 12.so.0.1.2.9beta1-3 * 1.2.9beta4-11 13 10209 12.so.0.9[.0] * 1.2.9rc1 13 10209 12.so.0.9[.0] * 1.2.9 13 10209 12.so.0.9[.0] * 1.2.10beta1-7 13 10210 12.so.0.10[.0] * 1.2.10rc1-2 13 10210 12.so.0.10[.0] * 1.2.10 13 10210 12.so.0.10[.0] * 1.4.0beta1-5 14 10400 14.so.0.0[.0] * 1.2.11beta1-4 13 10211 12.so.0.11[.0] * 1.4.0beta7-8 14 10400 14.so.0.0[.0] * 1.2.11 13 10211 12.so.0.11[.0] * 1.2.12 13 10212 12.so.0.12[.0] * 1.4.0beta9-14 14 10400 14.so.0.0[.0] * 1.2.13 13 10213 12.so.0.13[.0] * 1.4.0beta15-36 14 10400 14.so.0.0[.0] * 1.4.0beta37-87 14 10400 14.so.14.0[.0] * 1.4.0rc01 14 10400 14.so.14.0[.0] * 1.4.0beta88-109 14 10400 14.so.14.0[.0] * 1.4.0rc02-08 14 10400 14.so.14.0[.0] * 1.4.0 14 10400 14.so.14.0[.0] * 1.4.1beta01-03 14 10401 14.so.14.1[.0] * 1.4.1rc01 14 10401 14.so.14.1[.0] * 1.4.1beta04-12 14 10401 14.so.14.1[.0] * 1.4.1 14 10401 14.so.14.1[.0] * 1.4.2 14 10402 14.so.14.2[.0] * 1.4.3 14 10403 14.so.14.3[.0] * 1.4.4 14 10404 14.so.14.4[.0] * 1.5.0beta01-58 15 10500 15.so.15.0[.0] * 1.5.0rc01-07 15 10500 15.so.15.0[.0] * 1.5.0 15 10500 15.so.15.0[.0] * 1.5.1beta01-11 15 10501 15.so.15.1[.0] * 1.5.1rc01-02 15 10501 15.so.15.1[.0] * 1.5.1 15 10501 15.so.15.1[.0] * 1.5.2beta01-03 15 10502 15.so.15.2[.0] * 1.5.2rc01-03 15 10502 15.so.15.2[.0] * 1.5.2 15 10502 15.so.15.2[.0] * 1.5.3beta01-10 15 10503 15.so.15.3[.0] * 1.5.3rc01-02 15 10503 15.so.15.3[.0] * 1.5.3beta11 15 10503 15.so.15.3[.0] * 1.5.3 [omitted] * 1.5.4beta01-08 15 10504 15.so.15.4[.0] * 1.5.4rc01 15 10504 15.so.15.4[.0] * 1.5.4 15 10504 15.so.15.4[.0] * 1.5.5beta01-08 15 10505 15.so.15.5[.0] * 1.5.5rc01 15 10505 15.so.15.5[.0] * 1.5.5 15 10505 15.so.15.5[.0] * 1.5.6beta01-07 15 10506 15.so.15.6[.0] * 1.5.6rc01-03 15 10506 15.so.15.6[.0] * 1.5.6 15 10506 15.so.15.6[.0] * 1.5.7beta01-05 15 10507 15.so.15.7[.0] * 1.5.7rc01-03 15 10507 15.so.15.7[.0] * 1.5.7 15 10507 15.so.15.7[.0] * 1.6.0beta01-40 16 10600 16.so.16.0[.0] * 1.6.0rc01-08 16 10600 16.so.16.0[.0] * 1.6.0 16 10600 16.so.16.0[.0] * 1.6.1beta01-09 16 10601 16.so.16.1[.0] * 1.6.1rc01 16 10601 16.so.16.1[.0] * 1.6.1 16 10601 16.so.16.1[.0] * 1.6.2beta01 16 10602 16.so.16.2[.0] * 1.6.2rc01-06 16 10602 16.so.16.2[.0] * 1.6.2 16 10602 16.so.16.2[.0] * 1.6.3beta01-11 16 10603 16.so.16.3[.0] * 1.6.3rc01 16 10603 16.so.16.3[.0] * 1.6.3 16 10603 16.so.16.3[.0] * 1.6.4beta01-02 16 10604 16.so.16.4[.0] * 1.6.4rc01 16 10604 16.so.16.4[.0] * 1.6.4 16 10604 16.so.16.4[.0] * 1.6.5 16 10605 16.so.16.5[.0] * 1.6.6 16 10606 16.so.16.6[.0] * 1.6.7beta01-04 16 10607 16.so.16.7[.0] * 1.6.7rc01-03 16 10607 16.so.16.7[.0] * 1.6.7 16 10607 16.so.16.7[.0] * 1.6.8beta01-02 16 10608 16.so.16.8[.0] * 1.6.8rc01-02 16 10608 16.so.16.8[.0] * 1.6.8 16 10608 16.so.16.8[.0] * 1.6.9beta01-04 16 10609 16.so.16.9[.0] * 1.6.9rc01-02 16 10609 16.so.16.9[.0] * 1.6.9 16 10609 16.so.16.9[.0] * 1.6.10beta01-03 16 10610 16.so.16.10[.0] * 1.6.10betarc01-04 16 10610 16.so.16.10[.0] * 1.6.10beta 16 10610 16.so.16.10[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be * used for changes in backward compatibility, as it is intended. The * PNG_LIBPNG_VER macro, which is not used within libpng but is available * for applications, is an unsigned integer of the form xyyzz corresponding * to the source version x.y.z (leading zeros in y and z). Beta versions * were given the previous public release number plus a letter, until * version 1.0.6j; from then on they were given the upcoming public * release number plus "betaNN" or "rcNN". * * Binary incompatibility exists only when applications make direct access * to the info_ptr or png_ptr members through png.h, and the compiled * application is loaded with a different version of the library. * * DLLNUM will change each time there are forward or backward changes * in binary compatibility (e.g., when a new feature is added). * * See libpng-manual.txt or libpng.3 for more information. The PNG * specification is available as a W3C Recommendation and as an ISO * Specification, defines should NOT be changed. */ #define PNG_INFO_gAMA 0x0001 #define PNG_INFO_sBIT 0x0002 #define PNG_INFO_cHRM 0x0004 #define PNG_INFO_PLTE 0x0008 #define PNG_INFO_tRNS 0x0010 #define PNG_INFO_bKGD 0x0020 #define PNG_INFO_hIST 0x0040 #define PNG_INFO_pHYs 0x0080 #define PNG_INFO_oFFs 0x0100 #define PNG_INFO_tIME 0x0200 #define PNG_INFO_pCAL 0x0400 #define PNG_INFO_sRGB 0x0800 /* GR-P, 0.96a */ #define PNG_INFO_iCCP 0x1000 /* ESR, 1.0.6 */ #define PNG_INFO_sPLT 0x2000 /* ESR, 1.0.6 */ #define PNG_INFO_sCAL 0x4000 /* ESR, 1.0.6 */ #define PNG_INFO_IDAT 0x8000 /* ESR, 1.0.6 */ /* This is used for the transformation routines, as some of them * change these values for the row. It also should enable using * the routines for other purposes. */ typedef struct png_row_info_struct { png_uint_32 width; /* width of row */ png_size_t rowbytes; /* number of bytes in row */ png_byte color_type; /* color type of row */ png_byte bit_depth; /* bit depth of row */ png_byte channels; /* number of channels (1, 2, 3, or 4) */ png_byte pixel_depth; /* bits per pixel (depth * channels) */ } png_row_info; typedef png_row_info * png_row_infop; typedef png_row_info * * png_row_infopp; /* These are the function types for the I/O functions and for the functions * that allow the user to override the default I/O functions with his or her * own. The png_error_ptr type should match that of user-supplied warning * and error functions, while the png_rw_ptr type should match that of the * user read/write data functions. Note that the 'write' function must not * modify the buffer it is passed. The 'read' function, on the other hand, is * expected to return the read data in the buffer. */ typedef PNG_CALLBACK(void, *png_error_ptr, (png_structp, png_const_charp)); typedef PNG_CALLBACK(void, *png_rw_ptr, (png_structp, png_bytep, png_size_t)); typedef PNG_CALLBACK(void, *png_flush_ptr, (png_structp)); typedef PNG_CALLBACK(void, *png_read_status_ptr, (png_structp, png_uint_32, int)); typedef PNG_CALLBACK(void, *png_write_status_ptr, (png_structp, png_uint_32, int)); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); /* The following callback receives png_uint_32 row_number, int pass for the * png_bytep data of the row. When transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ typedef PNG_CALLBACK(void, *png_progressive_row_ptr, (png_structp, png_bytep, png_uint_32, int)); #endif #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) typedef PNG_CALLBACK(void, *png_user_transform_ptr, (png_structp, png_row_infop, png_bytep)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp, png_unknown_chunkp)); #endif #ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED /* not used anywhere */ /* typedef PNG_CALLBACK(void, *png_unknown_chunk_ptr, (png_structp)); */ #endif #ifdef PNG_SETJMP_SUPPORTED /* This must match the function definition in , and the application * must include this before png.h to obtain the definition of jmp_buf. The * function is required to be PNG_NORETURN, but this is not checked. If the * function does return the application will crash via an abort() or similar * system level call. * * If you get a warning here while building the library you may need to make * changes to ensure that pnglibconf.h records the calling convention used by * your compiler. This may be very difficult - try using a different compiler * to build the library! */ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef); #endif /* Transform masks for the high-level interface */ #define PNG_TRANSFORM_IDENTITY 0x0000 /* read and write */ #define PNG_TRANSFORM_STRIP_16 0x0001 /* read only */ #define PNG_TRANSFORM_STRIP_ALPHA 0x0002 /* read only */ #define PNG_TRANSFORM_PACKING 0x0004 /* read and write */ #define PNG_TRANSFORM_PACKSWAP 0x0008 /* read and write */ #define PNG_TRANSFORM_EXPAND 0x0010 /* read only */ #define PNG_TRANSFORM_INVERT_MONO 0x0020 /* read and write */ #define PNG_TRANSFORM_SHIFT 0x0040 /* read and write */ #define PNG_TRANSFORM_BGR 0x0080 /* read and write */ #define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ #define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ #define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* write only */ /* Added to libpng-1.2.34 */ #define PNG_TRANSFORM_STRIP_FILLER_BEFORE PNG_TRANSFORM_STRIP_FILLER #define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* write only */ /* Added to libpng-1.4.0 */ #define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */ /* Added to libpng-1.5.4 */ #define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */ #define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */ /* Flags for MNG supported features */ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 #define PNG_FLAG_MNG_FILTER_64 0x04 #define PNG_ALL_MNG_FEATURES 0x05 /* NOTE: prior to 1.5 these functions had no 'API' style declaration, * this allowed the zlib default functions to be used on Windows * platforms. In 1.5 the zlib default malloc (which just calls malloc and * ignores the first argument) should be completely compatible with the * following. */ typedef PNG_CALLBACK(png_voidp, *png_malloc_ptr, (png_structp, png_alloc_size_t)); typedef PNG_CALLBACK(void, *png_free_ptr, (png_structp, png_voidp)); /* Section 3: exported functions * Here are the function definitions most commonly used. This is not * the place to find out how to use libpng. See libpng-manual.txt for the * full explanation, see example.c for the summary. This just provides * a simple one line description of the use of each function. * * The PNG_EXPORT() and PNG_EXPORTA() macros used below are defined in * pngconf.h and in the *.dfn files in the scripts directory. * * PNG_EXPORT(ordinal, type, name, (args)); * * ordinal: ordinal that is used while building * *.def files. The ordinal value is only * relevant when preprocessing png.h with * the *.dfn files for building symbol table * entries, and are removed by pngconf.h. * type: return type of the function * name: function name * args: function arguments, with types * * When we wish to append attributes to a function prototype we use * the PNG_EXPORTA() macro instead. * * PNG_EXPORTA(ordinal, type, name, (args), attributes); * * ordinal, type, name, and args: same as in PNG_EXPORT(). * attributes: function attributes */ /* Returns the version number of the library */ PNG_EXPORT(1, png_uint_32, png_access_version_number, (void)); /* Tell lib we have already handled the first magic bytes. * Handling more than 8 bytes from the beginning of the file is an error. */ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes)); /* Check sig[start] through sig[start + num_to_check - 1] to see if it's a * PNG file. Returns zero if the supplied bytes match the 8-byte PNG * signature, and non-zero otherwise. Having num_to_check == 0 or * start > 7 will always fail (ie return non-zero). */ PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, png_size_t start, png_size_t num_to_check)); /* Simple signature checking function. This is the same as calling * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n). */ #define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n)) /* Allocate and initialize png_ptr struct for reading, and any other memory. */ PNG_EXPORTA(4, png_structp, png_create_read_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); /* Allocate and initialize png_ptr struct for writing, and any other memory */ PNG_EXPORTA(5, png_structp, png_create_write_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn), PNG_ALLOCATED); PNG_EXPORT(6, png_size_t, png_get_compression_buffer_size, (png_const_structrp png_ptr)); PNG_EXPORT(7, void, png_set_compression_buffer_size, (png_structrp png_ptr, png_size_t size)); /* Moved from pngconf.h in 1.4.0 and modified to ensure setjmp/longjmp * match up. */ #ifdef PNG_SETJMP_SUPPORTED /* This function returns the jmp_buf built in to *png_ptr. It must be * supplied with an appropriate 'longjmp' function to use on that jmp_buf * unless the default error function is overridden in which case NULL is * acceptable. The size of the jmp_buf is checked against the actual size * allocated by the library - the call will return NULL on a mismatch * indicating an ABI mismatch. */ PNG_EXPORT(8, jmp_buf*, png_set_longjmp_fn, (png_structrp png_ptr, png_longjmp_ptr longjmp_fn, size_t jmp_buf_size)); # define png_jmpbuf(png_ptr) \ (*png_set_longjmp_fn((png_ptr), longjmp, (sizeof (jmp_buf)))) #else # define png_jmpbuf(png_ptr) \ (LIBPNG_WAS_COMPILED_WITH__PNG_NO_SETJMP) #endif /* This function should be used by libpng applications in place of * longjmp(png_ptr->jmpbuf, val). If longjmp_fn() has been set, it * will use it; otherwise it will call PNG_ABORT(). This function was * added in libpng-1.5.0. */ PNG_EXPORTA(9, void, png_longjmp, (png_const_structrp png_ptr, int val), PNG_NORETURN); #ifdef PNG_READ_SUPPORTED /* Reset the compression stream */ PNG_EXPORTA(10, int, png_reset_zstream, (png_structrp png_ptr), PNG_DEPRECATED); #endif /* New functions added in libpng-1.0.2 (not enabled by default until 1.2.0) */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(11, png_structp, png_create_read_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); PNG_EXPORTA(12, png_structp, png_create_write_struct_2, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn), PNG_ALLOCATED); #endif /* Write the PNG file signature. */ PNG_EXPORT(13, void, png_write_sig, (png_structrp png_ptr)); /* Write a PNG chunk - size, type, (optional) data, CRC. */ PNG_EXPORT(14, void, png_write_chunk, (png_structrp png_ptr, png_const_bytep chunk_name, png_const_bytep data, png_size_t length)); /* Write the start of a PNG chunk - length and chunk name. */ PNG_EXPORT(15, void, png_write_chunk_start, (png_structrp png_ptr, png_const_bytep chunk_name, png_uint_32 length)); /* Write the data of a PNG chunk started with png_write_chunk_start(). */ PNG_EXPORT(16, void, png_write_chunk_data, (png_structrp png_ptr, png_const_bytep data, png_size_t length)); /* Finish a chunk started with png_write_chunk_start() (includes CRC). */ PNG_EXPORT(17, void, png_write_chunk_end, (png_structrp png_ptr)); /* Allocate and initialize the info structure */ PNG_EXPORTA(18, png_infop, png_create_info_struct, (png_const_structrp png_ptr), PNG_ALLOCATED); /* DEPRECATED: this function allowed init structures to be created using the * default allocation method (typically malloc). Use is deprecated in 1.6.0 and * the API will be removed in the future. */ PNG_EXPORTA(19, void, png_info_init_3, (png_infopp info_ptr, png_size_t png_info_struct_size), PNG_DEPRECATED); /* Writes all the PNG information before the image. */ PNG_EXPORT(20, void, png_write_info_before_PLTE, (png_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(21, void, png_write_info, (png_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the information before the actual image data. */ PNG_EXPORT(22, void, png_read_info, (png_structrp png_ptr, png_inforp info_ptr)); #endif #ifdef PNG_TIME_RFC1123_SUPPORTED /* Convert to a US string format: there is no localization support in this * routine. The original implementation used a 29 character buffer in * png_struct, this will be removed in future versions. */ #if PNG_LIBPNG_VER < 10700 /* To do: remove this from libpng17 (and from libpng17/png.c and pngstruct.h) */ PNG_EXPORTA(23, png_const_charp, png_convert_to_rfc1123, (png_structrp png_ptr, png_const_timep ptime),PNG_DEPRECATED); #endif PNG_EXPORT(241, int, png_convert_to_rfc1123_buffer, (char out[29], png_const_timep ptime)); #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Convert from a struct tm to png_time */ PNG_EXPORT(24, void, png_convert_from_struct_tm, (png_timep ptime, const struct tm * ttime)); /* Convert from time_t to png_time. Uses gmtime() */ PNG_EXPORT(25, void, png_convert_from_time_t, (png_timep ptime, time_t ttime)); #endif /* PNG_CONVERT_tIME_SUPPORTED */ #ifdef PNG_READ_EXPAND_SUPPORTED /* Expand data to 24-bit RGB, or 8-bit grayscale, with alpha if available. */ PNG_EXPORT(26, void, png_set_expand, (png_structrp png_ptr)); PNG_EXPORT(27, void, png_set_expand_gray_1_2_4_to_8, (png_structrp png_ptr)); PNG_EXPORT(28, void, png_set_palette_to_rgb, (png_structrp png_ptr)); PNG_EXPORT(29, void, png_set_tRNS_to_alpha, (png_structrp png_ptr)); #endif #ifdef PNG_READ_EXPAND_16_SUPPORTED /* Expand to 16-bit channels, forces conversion of palette to RGB and expansion * of a tRNS chunk if present. */ PNG_EXPORT(221, void, png_set_expand_16, (png_structrp png_ptr)); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) /* Use blue, green, red order for pixels. */ PNG_EXPORT(30, void, png_set_bgr, (png_structrp png_ptr)); #endif #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED /* Expand the grayscale to 24-bit RGB if necessary. */ PNG_EXPORT(31, void, png_set_gray_to_rgb, (png_structrp png_ptr)); #endif #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED /* Reduce RGB to grayscale. */ #define PNG_ERROR_ACTION_NONE 1 #define PNG_ERROR_ACTION_WARN 2 #define PNG_ERROR_ACTION_ERROR 3 #define PNG_RGB_TO_GRAY_DEFAULT (-1)/*for red/green coefficients*/ PNG_FP_EXPORT(32, void, png_set_rgb_to_gray, (png_structrp png_ptr, int error_action, double red, double green)) PNG_FIXED_EXPORT(33, void, png_set_rgb_to_gray_fixed, (png_structrp png_ptr, int error_action, png_fixed_point red, png_fixed_point green)) PNG_EXPORT(34, png_byte, png_get_rgb_to_gray_status, (png_const_structrp png_ptr)); #endif #ifdef PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED PNG_EXPORT(35, void, png_build_grayscale_palette, (int bit_depth, png_colorp palette)); #endif #ifdef PNG_READ_ALPHA_MODE_SUPPORTED /* How the alpha channel is interpreted - this affects how the color channels * of a PNG file are returned to the calling application when an alpha channel, * or a tRNS chunk in a palette file, is present. * * This has no effect on the way pixels are written into a PNG output * datastream. The color samples in a PNG datastream are never premultiplied * with the alpha samples. * * The default is to return data according to the PNG specification: the alpha * channel is a linear measure of the contribution of the pixel to the * corresponding composited pixel, and the color channels are unassociated * (not premultiplied). The gamma encoded color channels must be scaled * according to the contribution and to do this it is necessary to undo * the encoding, scale the color values, perform the composition and reencode * the values. This is the 'PNG' mode. * * The alternative is to 'associate' the alpha with the color information by * storing color channel values that have been scaled by the alpha. * image. These are the 'STANDARD', 'ASSOCIATED' or 'PREMULTIPLIED' modes * (the latter being the two common names for associated alpha color channels). * * For the 'OPTIMIZED' mode, a pixel is treated as opaque only if the alpha * value is equal to the maximum value. * * The final choice is to gamma encode the alpha channel as well. This is * broken because, in practice, no implementation that uses this choice * correctly undoes the encoding before handling alpha composition. Use this * choice only if other serious errors in the software or hardware you use * mandate it; the typical serious error is for dark halos to appear around * opaque areas of the composited PNG image because of arithmetic overflow. * * The API function png_set_alpha_mode specifies which of these choices to use * with an enumerated 'mode' value and the gamma of the required output: */ #define PNG_ALPHA_PNG 0 /* according to the PNG standard */ #define PNG_ALPHA_STANDARD 1 /* according to Porter/Duff */ #define PNG_ALPHA_ASSOCIATED 1 /* as above; this is the normal practice */ #define PNG_ALPHA_PREMULTIPLIED 1 /* as above */ #define PNG_ALPHA_OPTIMIZED 2 /* 'PNG' for opaque pixels, else 'STANDARD' */ #define PNG_ALPHA_BROKEN 3 /* the alpha channel is gamma encoded */ PNG_FP_EXPORT(227, void, png_set_alpha_mode, (png_structrp png_ptr, int mode, double output_gamma)) PNG_FIXED_EXPORT(228, void, png_set_alpha_mode_fixed, (png_structrp png_ptr, int mode, png_fixed_point output_gamma)) #endif #if defined(PNG_GAMMA_SUPPORTED) || defined(PNG_READ_ALPHA_MODE_SUPPORTED) /* The output_gamma value is a screen gamma in libpng terminology: it expresses * how to decode the output values, not how they are encoded. */ #define PNG_DEFAULT_sRGB -1 /* sRGB gamma and color space */ #define PNG_GAMMA_MAC_18 -2 /* Old Mac '1.8' gamma and color space */ #define PNG_GAMMA_sRGB 220000 /* Television standards--matches sRGB gamma */ #define PNG_GAMMA_LINEAR PNG_FP_1 /* Linear */ #endif /* The following are examples of calls to png_set_alpha_mode to achieve the * required overall gamma correction and, where necessary, alpha * premultiplication. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * This is the default libpng handling of the alpha channel - it is not * pre-multiplied into the color components. In addition the call states * that the output is for a sRGB system and causes all PNG files without gAMA * chunks to be assumed to be encoded using sRGB. * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * In this case the output is assumed to be something like an sRGB conformant * display preceeded by a power-law lookup table of power 1.45. This is how * early Mac systems behaved. * * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_GAMMA_LINEAR); * This is the classic Jim Blinn approach and will work in academic * environments where everything is done by the book. It has the shortcoming * of assuming that input PNG data with no gamma information is linear - this * is unlikely to be correct unless the PNG files where generated locally. * Most of the time the output precision will be so low as to show * significant banding in dark areas of the image. * * png_set_expand_16(pp); * png_set_alpha_mode(pp, PNG_ALPHA_STANDARD, PNG_DEFAULT_sRGB); * This is a somewhat more realistic Jim Blinn inspired approach. PNG files * are assumed to have the sRGB encoding if not marked with a gamma value and * the output is always 16 bits per component. This permits accurate scaling * and processing of the data. If you know that your input PNG files were * generated locally you might need to replace PNG_DEFAULT_sRGB with the * correct value for your system. * * png_set_alpha_mode(pp, PNG_ALPHA_OPTIMIZED, PNG_DEFAULT_sRGB); * If you just need to composite the PNG image onto an existing background * and if you control the code that does this you can use the optimization * setting. In this case you just copy completely opaque pixels to the * output. For pixels that are not completely transparent (you just skip * those) you do the composition math using png_composite or png_composite_16 * below then encode the resultant 8-bit or 16-bit values to match the output * encoding. * * Other cases * If neither the PNG nor the standard linear encoding work for you because * of the software or hardware you use then you have a big problem. The PNG * case will probably result in halos around the image. The linear encoding * will probably result in a washed out, too bright, image (it's actually too * contrasty.) Try the ALPHA_OPTIMIZED mode above - this will probably * substantially reduce the halos. Alternatively try: * * png_set_alpha_mode(pp, PNG_ALPHA_BROKEN, PNG_DEFAULT_sRGB); * This option will also reduce the halos, but there will be slight dark * halos round the opaque parts of the image where the background is light. * In the OPTIMIZED mode the halos will be light halos where the background * is dark. Take your pick - the halos are unavoidable unless you can get * your hardware/software fixed! (The OPTIMIZED approach is slightly * faster.) * * When the default gamma of PNG files doesn't match the output gamma. * If you have PNG files with no gamma information png_set_alpha_mode allows * you to provide a default gamma, but it also sets the ouput gamma to the * matching value. If you know your PNG files have a gamma that doesn't * match the output you can take advantage of the fact that * png_set_alpha_mode always sets the output gamma but only sets the PNG * default if it is not already set: * * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB); * png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_GAMMA_MAC); * The first call sets both the default and the output gamma values, the * second call overrides the output gamma without changing the default. This * is easier than achieving the same effect with png_set_gamma. You must use * PNG_ALPHA_PNG for the first call - internal checking in png_set_alpha will * fire if more than one call to png_set_alpha_mode and png_set_background is * made in the same read operation, however multiple calls with PNG_ALPHA_PNG * are ignored. */ #ifdef PNG_READ_STRIP_ALPHA_SUPPORTED PNG_EXPORT(36, void, png_set_strip_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SWAP_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) PNG_EXPORT(37, void, png_set_swap_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_ALPHA_SUPPORTED) || \ defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) PNG_EXPORT(38, void, png_set_invert_alpha, (png_structrp png_ptr)); #endif #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) /* Add a filler byte to 8-bit Gray or 24-bit RGB images. */ PNG_EXPORT(39, void, png_set_filler, (png_structrp png_ptr, png_uint_32 filler, int flags)); /* The values of the PNG_FILLER_ defines should NOT be changed */ # define PNG_FILLER_BEFORE 0 # define PNG_FILLER_AFTER 1 /* Add an alpha byte to 8-bit Gray or 24-bit RGB images. */ PNG_EXPORT(40, void, png_set_add_alpha, (png_structrp png_ptr, png_uint_32 filler, int flags)); #endif /* PNG_READ_FILLER_SUPPORTED || PNG_WRITE_FILLER_SUPPORTED */ #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) /* Swap bytes in 16-bit depth files. */ PNG_EXPORT(41, void, png_set_swap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACK_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) /* Use 1 byte per pixel in 1, 2, or 4-bit depth files. */ PNG_EXPORT(42, void, png_set_packing, (png_structrp png_ptr)); #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) /* Swap packing order of pixels in bytes. */ PNG_EXPORT(43, void, png_set_packswap, (png_structrp png_ptr)); #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) /* Converts files to legal bit depths. */ PNG_EXPORT(44, void, png_set_shift, (png_structrp png_ptr, png_const_color_8p true_bits)); #endif #if defined(PNG_READ_INTERLACING_SUPPORTED) || \ defined(PNG_WRITE_INTERLACING_SUPPORTED) /* Have the code handle the interlacing. Returns the number of passes. * MUST be called before png_read_update_info or png_start_read_image, * otherwise it will not have the desired effect. Note that it is still * necessary to call png_read_row or png_read_rows png_get_image_height * times for each pass. */ PNG_EXPORT(45, int, png_set_interlace_handling, (png_structrp png_ptr)); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) /* Invert monochrome files */ PNG_EXPORT(46, void, png_set_invert_mono, (png_structrp png_ptr)); #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED /* Handle alpha and tRNS by replacing with a background color. Prior to * libpng-1.5.4 this API must not be called before the PNG file header has been * read. Doing so will result in unexpected behavior and possible warnings or * errors if the PNG file contains a bKGD chunk. */ PNG_FP_EXPORT(47, void, png_set_background, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma)) PNG_FIXED_EXPORT(215, void, png_set_background_fixed, (png_structrp png_ptr, png_const_color_16p background_color, int background_gamma_code, int need_expand, png_fixed_point background_gamma)) #endif #ifdef PNG_READ_BACKGROUND_SUPPORTED # define PNG_BACKGROUND_GAMMA_UNKNOWN 0 # define PNG_BACKGROUND_GAMMA_SCREEN 1 # define PNG_BACKGROUND_GAMMA_FILE 2 # define PNG_BACKGROUND_GAMMA_UNIQUE 3 #endif #ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED /* Scale a 16-bit depth file down to 8-bit, accurately. */ PNG_EXPORT(229, void, png_set_scale_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_STRIP_16_TO_8_SUPPORTED #define PNG_READ_16_TO_8 SUPPORTED /* Name prior to 1.5.4 */ /* Strip the second byte of information from a 16-bit depth file. */ PNG_EXPORT(48, void, png_set_strip_16, (png_structrp png_ptr)); #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED /* Turn on quantizing, and reduce the palette to the number of colors * available. */ PNG_EXPORT(49, void, png_set_quantize, (png_structrp png_ptr, png_colorp palette, int num_palette, int maximum_colors, png_const_uint_16p histogram, int full_quantize)); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* The threshold on gamma processing is configurable but hard-wired into the * library. The following is the floating point variant. */ #define PNG_GAMMA_THRESHOLD (PNG_GAMMA_THRESHOLD_FIXED*.00001) /* Handle gamma correction. Screen_gamma=(display_exponent). * NOTE: this API simply sets the screen and file gamma values. It will * therefore override the value for gamma in a PNG file if it is called after * the file header has been read - use with care - call before reading the PNG * file for best results! * * These routines accept the same gamma values as png_set_alpha_mode (described * above). The PNG_GAMMA_ defines and PNG_DEFAULT_sRGB can be passed to either * API (floating point or fixed.) Notice, however, that the 'file_gamma' value * is the inverse of a 'screen gamma' value. */ PNG_FP_EXPORT(50, void, png_set_gamma, (png_structrp png_ptr, double screen_gamma, double override_file_gamma)) PNG_FIXED_EXPORT(208, void, png_set_gamma_fixed, (png_structrp png_ptr, png_fixed_point screen_gamma, png_fixed_point override_file_gamma)) #endif #ifdef PNG_WRITE_FLUSH_SUPPORTED /* Set how many lines between output flushes - 0 for no flushing */ PNG_EXPORT(51, void, png_set_flush, (png_structrp png_ptr, int nrows)); /* Flush the current PNG output buffer */ PNG_EXPORT(52, void, png_write_flush, (png_structrp png_ptr)); #endif /* Optional update palette with requested transformations */ PNG_EXPORT(53, void, png_start_read_image, (png_structrp png_ptr)); /* Optional call to update the users info structure */ PNG_EXPORT(54, void, png_read_update_info, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read one or more rows of image data. */ PNG_EXPORT(55, void, png_read_rows, (png_structrp png_ptr, png_bytepp row, png_bytepp display_row, png_uint_32 num_rows)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read a row of data. */ PNG_EXPORT(56, void, png_read_row, (png_structrp png_ptr, png_bytep row, png_bytep display_row)); #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the whole image into memory at once. */ PNG_EXPORT(57, void, png_read_image, (png_structrp png_ptr, png_bytepp image)); #endif /* Write a row of image data */ PNG_EXPORT(58, void, png_write_row, (png_structrp png_ptr, png_const_bytep row)); /* Write a few rows of image data: (*row) is not written; however, the type * is declared as writeable to maintain compatibility with previous versions * of libpng and to allow the 'display_row' array from read_rows to be passed * unchanged to write_rows. */ PNG_EXPORT(59, void, png_write_rows, (png_structrp png_ptr, png_bytepp row, png_uint_32 num_rows)); /* Write the image data */ PNG_EXPORT(60, void, png_write_image, (png_structrp png_ptr, png_bytepp image)); /* Write the end of the PNG file. */ PNG_EXPORT(61, void, png_write_end, (png_structrp png_ptr, png_inforp info_ptr)); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED /* Read the end of the PNG file. */ PNG_EXPORT(62, void, png_read_end, (png_structrp png_ptr, png_inforp info_ptr)); #endif /* Free any memory associated with the png_info_struct */ PNG_EXPORT(63, void, png_destroy_info_struct, (png_const_structrp png_ptr, png_infopp info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(64, void, png_destroy_read_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr, png_infopp end_info_ptr_ptr)); /* Free any memory associated with the png_struct and the png_info_structs */ PNG_EXPORT(65, void, png_destroy_write_struct, (png_structpp png_ptr_ptr, png_infopp info_ptr_ptr)); /* Set the libpng method of handling chunk CRC errors */ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action, int ancil_action)); /* Values for png_set_crc_action() say how to handle CRC errors in * ancillary and critical chunks, and whether to use the data contained * therein. Note that it is impossible to "discard" data in a critical * chunk. For versions prior to 0.90, the action was always error/quit, * whereas in version 0.90 and later, the action for CRC errors in ancillary * chunks is warn/discard. These values should NOT be changed. * * value action:critical action:ancillary */ #define PNG_CRC_DEFAULT 0 /* error/quit warn/discard data */ #define PNG_CRC_ERROR_QUIT 1 /* error/quit error/quit */ #define PNG_CRC_WARN_DISCARD 2 /* (INVALID) warn/discard data */ #define PNG_CRC_WARN_USE 3 /* warn/use data warn/use data */ #define PNG_CRC_QUIET_USE 4 /* quiet/use data quiet/use data */ #define PNG_CRC_NO_CHANGE 5 /* use current value use current value */ /* These functions give the user control over the scan-line filtering in * libpng and the compression methods used by zlib. These functions are * mainly useful for testing, as the defaults should work with most users. * Those users who are tight on memory or want faster performance at the * expense of compression can modify them. See the compression library * header file (zlib.h) for an explination of the compression functions. */ /* Set the filtering method(s) used by libpng. Currently, the only valid * value for "method" is 0. */ PNG_EXPORT(67, void, png_set_filter, (png_structrp png_ptr, int method, int filters)); /* Flags for png_set_filter() to say which filters to use. The flags * are chosen so that they don't conflict with real filter types * below, in case they are supplied instead of the #defined constants. * These values should NOT be changed. */ #define PNG_NO_FILTERS 0x00 #define PNG_FILTER_NONE 0x08 #define PNG_FILTER_SUB 0x10 #define PNG_FILTER_UP 0x20 #define PNG_FILTER_AVG 0x40 #define PNG_FILTER_PAETH 0x80 #define PNG_ALL_FILTERS (PNG_FILTER_NONE | PNG_FILTER_SUB | PNG_FILTER_UP | \ PNG_FILTER_AVG | PNG_FILTER_PAETH) /* Filter values (not flags) - used in pngwrite.c, pngwutil.c for now. * These defines should NOT be changed. */ #define PNG_FILTER_VALUE_NONE 0 #define PNG_FILTER_VALUE_SUB 1 #define PNG_FILTER_VALUE_UP 2 #define PNG_FILTER_VALUE_AVG 3 #define PNG_FILTER_VALUE_PAETH 4 #define PNG_FILTER_VALUE_LAST 5 #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED /* EXPERIMENTAL */ /* The "heuristic_method" is given by one of the PNG_FILTER_HEURISTIC_ * defines, either the default (minimum-sum-of-absolute-differences), or * the experimental method (weighted-minimum-sum-of-absolute-differences). * * Weights are factors >= 1.0, indicating how important it is to keep the * filter type consistent between rows. Larger numbers mean the current * filter is that many times as likely to be the same as the "num_weights" * previous filters. This is cumulative for each previous row with a weight. * There needs to be "num_weights" values in "filter_weights", or it can be * NULL if the weights aren't being specified. Weights have no influence on * the selection of the first row filter. Well chosen weights can (in theory) * improve the compression for a given image. * * Costs are factors >= 1.0 indicating the relative decoding costs of a * filter type. Higher costs indicate more decoding expense, and are * therefore less likely to be selected over a filter with lower computational * costs. There needs to be a value in "filter_costs" for each valid filter * type (given by PNG_FILTER_VALUE_LAST), or it can be NULL if you aren't * setting the costs. Costs try to improve the speed of decompression without * unduly increasing the compressed image size. * * A negative weight or cost indicates the default value is to be used, and * values in the range [0.0, 1.0) indicate the value is to remain unchanged. * The default values for both weights and costs are currently 1.0, but may * change if good general weighting/cost heuristics can be found. If both * the weights and costs are set to 1.0, this degenerates the WEIGHTED method * to the UNWEIGHTED method, but with added encoding time/computation. */ PNG_FP_EXPORT(68, void, png_set_filter_heuristics, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_doublep filter_weights, png_const_doublep filter_costs)) PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed, (png_structrp png_ptr, int heuristic_method, int num_weights, png_const_fixed_point_p filter_weights, png_const_fixed_point_p filter_costs)) #endif /* PNG_WRITE_WEIGHTED_FILTER_SUPPORTED */ /* Heuristic used for row filter selection. These defines should NOT be * changed. */ #define PNG_FILTER_HEURISTIC_DEFAULT 0 /* Currently "UNWEIGHTED" */ #define PNG_FILTER_HEURISTIC_UNWEIGHTED 1 /* Used by libpng < 0.95 */ #define PNG_FILTER_HEURISTIC_WEIGHTED 2 /* Experimental feature */ #define PNG_FILTER_HEURISTIC_LAST 3 /* Not a valid value */ #ifdef PNG_WRITE_SUPPORTED /* Set the library compression level. Currently, valid values range from * 0 - 9, corresponding directly to the zlib compression levels 0 - 9 * (0 - no compression, 9 - "maximal" compression). Note that tests have * shown that zlib compression levels 3-6 usually perform as well as level 9 * for PNG images, and do considerably fewer caclulations. In the future, * these values may not correspond directly to the zlib compression levels. */ PNG_EXPORT(69, void, png_set_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(70, void, png_set_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(71, void, png_set_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(72, void, png_set_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(73, void, png_set_compression_method, (png_structrp png_ptr, int method)); #endif #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED /* Also set zlib parameters for compressing non-IDAT chunks */ PNG_EXPORT(222, void, png_set_text_compression_level, (png_structrp png_ptr, int level)); PNG_EXPORT(223, void, png_set_text_compression_mem_level, (png_structrp png_ptr, int mem_level)); PNG_EXPORT(224, void, png_set_text_compression_strategy, (png_structrp png_ptr, int strategy)); /* If PNG_WRITE_OPTIMIZE_CMF_SUPPORTED is defined, libpng will use a * smaller value of window_bits if it can do so safely. */ PNG_EXPORT(225, void, png_set_text_compression_window_bits, (png_structrp png_ptr, int window_bits)); PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr, int method)); #endif /* PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED */ /* These next functions are called for input/output, memory, and error * handling. They are in the file pngrio.c, pngwio.c, and pngerror.c, * and call standard C I/O routines such as fread(), fwrite(), and * fprintf(). These functions can be made to use other I/O routines * at run time for those applications that need to handle I/O in a * different manner by calling png_set_???_fn(). See libpng-manual.txt for * more information. */ #ifdef PNG_STDIO_SUPPORTED /* Initialize the input/output for the PNG file to the default functions. */ PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp)); #endif /* Replace the (error and abort), and warning functions with user * supplied functions. If no messages are to be printed you must still * write and use replacement functions. The replacement error_fn should * still do a longjmp to the last setjmp location if you are using this * method of error handling. If error_fn or warning_fn is NULL, the * default function will be used. */ PNG_EXPORT(75, void, png_set_error_fn, (png_structrp png_ptr, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warning_fn)); /* Return the user pointer associated with the error functions */ PNG_EXPORT(76, png_voidp, png_get_error_ptr, (png_const_structrp png_ptr)); /* Replace the default data output functions with a user supplied one(s). * If buffered output is not used, then output_flush_fn can be set to NULL. * If PNG_WRITE_FLUSH_SUPPORTED is not defined at libpng compile time * output_flush_fn will be ignored (and thus can be NULL). * It is probably a mistake to use NULL for output_flush_fn if * write_data_fn is not also NULL unless you have built libpng with * PNG_WRITE_FLUSH_SUPPORTED undefined, because in this case libpng's * default flush function, which uses the standard *FILE structure, will * be used. */ PNG_EXPORT(77, void, png_set_write_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr write_data_fn, png_flush_ptr output_flush_fn)); /* Replace the default data input function with a user supplied one. */ PNG_EXPORT(78, void, png_set_read_fn, (png_structrp png_ptr, png_voidp io_ptr, png_rw_ptr read_data_fn)); /* Return the user pointer associated with the I/O functions */ PNG_EXPORT(79, png_voidp, png_get_io_ptr, (png_const_structrp png_ptr)); PNG_EXPORT(80, void, png_set_read_status_fn, (png_structrp png_ptr, png_read_status_ptr read_row_fn)); PNG_EXPORT(81, void, png_set_write_status_fn, (png_structrp png_ptr, png_write_status_ptr write_row_fn)); #ifdef PNG_USER_MEM_SUPPORTED /* Replace the default memory allocation functions with user supplied one(s). */ PNG_EXPORT(82, void, png_set_mem_fn, (png_structrp png_ptr, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn)); /* Return the user pointer associated with the memory functions */ PNG_EXPORT(83, png_voidp, png_get_mem_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED PNG_EXPORT(84, void, png_set_read_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr read_user_transform_fn)); #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED PNG_EXPORT(85, void, png_set_write_user_transform_fn, (png_structrp png_ptr, png_user_transform_ptr write_user_transform_fn)); #endif #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED PNG_EXPORT(86, void, png_set_user_transform_info, (png_structrp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels)); /* Return the user pointer associated with the user transform functions */ PNG_EXPORT(87, png_voidp, png_get_user_transform_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_USER_TRANSFORM_INFO_SUPPORTED /* Return information about the row currently being processed. Note that these * APIs do not fail but will return unexpected results if called outside a user * transform callback. Also note that when transforming an interlaced image the * row number is the row number within the sub-image of the interlace pass, so * the value will increase to the height of the sub-image (not the full image) * then reset to 0 for the next pass. * * Use PNG_ROW_FROM_PASS_ROW(row, pass) and PNG_COL_FROM_PASS_COL(col, pass) to * find the output pixel (x,y) given an interlaced sub-image pixel * (row,col,pass). (See below for these macros.) */ PNG_EXPORT(217, png_uint_32, png_get_current_row_number, (png_const_structrp)); PNG_EXPORT(218, png_byte, png_get_current_pass_number, (png_const_structrp)); #endif #ifdef PNG_READ_USER_CHUNKS_SUPPORTED /* This callback is called only for *unknown* chunks. If * PNG_HANDLE_AS_UNKNOWN_SUPPORTED is set then it is possible to set known * chunks to be treated as unknown, however in this case the callback must do * any processing required by the chunk (e.g. by calling the appropriate * png_set_ APIs.) * * There is no write support - on write, by default, all the chunks in the * 'unknown' list are written in the specified position. * * The integer return from the callback function is interpreted thus: * * negative: An error occured, png_chunk_error will be called. * zero: The chunk was not handled, the chunk will be saved. A critical * chunk will cause an error at this point unless it is to be saved. * positive: The chunk was handled, libpng will ignore/discard it. * * See "INTERACTION WTIH USER CHUNK CALLBACKS" below for important notes about * how this behavior will change in libpng 1.7 */ PNG_EXPORT(88, void, png_set_read_user_chunk_fn, (png_structrp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn)); #endif #ifdef PNG_USER_CHUNKS_SUPPORTED PNG_EXPORT(89, png_voidp, png_get_user_chunk_ptr, (png_const_structrp png_ptr)); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED /* Sets the function callbacks for the push reader, and a pointer to a * user-defined structure available to the callback functions. */ PNG_EXPORT(90, void, png_set_progressive_read_fn, (png_structrp png_ptr, png_voidp progressive_ptr, png_progressive_info_ptr info_fn, png_progressive_row_ptr row_fn, png_progressive_end_ptr end_fn)); /* Returns the user pointer associated with the push read functions */ PNG_EXPORT(91, png_voidp, png_get_progressive_ptr, (png_const_structrp png_ptr)); /* Function to be called when data becomes available */ PNG_EXPORT(92, void, png_process_data, (png_structrp png_ptr, png_inforp info_ptr, png_bytep buffer, png_size_t buffer_size)); /* A function which may be called *only* within png_process_data to stop the * processing of any more data. The function returns the number of bytes * remaining, excluding any that libpng has cached internally. A subsequent * call to png_process_data must supply these bytes again. If the argument * 'save' is set to true the routine will first save all the pending data and * will always return 0. */ PNG_EXPORT(219, png_size_t, png_process_data_pause, (png_structrp, int save)); /* A function which may be called *only* outside (after) a call to * png_process_data. It returns the number of bytes of data to skip in the * input. Normally it will return 0, but if it returns a non-zero value the * application must skip than number of bytes of input data and pass the * following data to the next call to png_process_data. */ PNG_EXPORT(220, png_uint_32, png_process_data_skip, (png_structrp)); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Function that combines rows. 'new_row' is a flag that should come from * the callback and be non-NULL if anything needs to be done; the library * stores its own version of the new data internally and ignores the passed * in value. */ PNG_EXPORT(93, void, png_progressive_combine_row, (png_const_structrp png_ptr, png_bytep old_row, png_const_bytep new_row)); #endif /* PNG_READ_INTERLACING_SUPPORTED */ #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ PNG_EXPORTA(94, png_voidp, png_malloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.4.0 */ PNG_EXPORTA(95, png_voidp, png_calloc, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Added at libpng version 1.2.4 */ PNG_EXPORTA(96, png_voidp, png_malloc_warn, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED); /* Frees a pointer allocated by png_malloc() */ PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr)); /* Free data that was allocated internally */ PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 free_me, int num)); /* Reassign responsibility for freeing existing data, whether allocated * by libpng or by the application; this works on the png_info structure passed * in, it does not change the state for other png_info structures. * * It is unlikely that this function works correctly as of 1.6.0 and using it * may result either in memory leaks or double free of allocated data. */ PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr, png_inforp info_ptr, int freer, png_uint_32 mask)); /* Assignments for png_data_freer */ #define PNG_DESTROY_WILL_FREE_DATA 1 #define PNG_SET_WILL_FREE_DATA 1 #define PNG_USER_WILL_FREE_DATA 2 /* Flags for png_ptr->free_me and info_ptr->free_me */ #define PNG_FREE_HIST 0x0008 #define PNG_FREE_ICCP 0x0010 #define PNG_FREE_SPLT 0x0020 #define PNG_FREE_ROWS 0x0040 #define PNG_FREE_PCAL 0x0080 #define PNG_FREE_SCAL 0x0100 #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED # define PNG_FREE_UNKN 0x0200 #endif /* PNG_FREE_LIST 0x0400 removed in 1.6.0 because it is ignored */ #define PNG_FREE_PLTE 0x1000 #define PNG_FREE_TRNS 0x2000 #define PNG_FREE_TEXT 0x4000 #define PNG_FREE_ALL 0x7fff #define PNG_FREE_MUL 0x4220 /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */ #ifdef PNG_USER_MEM_SUPPORTED PNG_EXPORTA(100, png_voidp, png_malloc_default, (png_const_structrp png_ptr, png_alloc_size_t size), PNG_ALLOCATED PNG_DEPRECATED); PNG_EXPORTA(101, void, png_free_default, (png_const_structrp png_ptr, png_voidp ptr), PNG_DEPRECATED); #endif #ifdef PNG_ERROR_TEXT_SUPPORTED /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(102, void, png_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); /* The same, but the chunk name is prepended to the error string. */ PNG_EXPORTA(103, void, png_chunk_error, (png_const_structrp png_ptr, png_const_charp error_message), PNG_NORETURN); #else /* Fatal error in PNG image of libpng - can't continue */ PNG_EXPORTA(104, void, png_err, (png_const_structrp png_ptr), PNG_NORETURN); # define png_error(s1,s2) png_err(s1) # define png_chunk_error(s1,s2) png_err(s1) #endif #ifdef PNG_WARNINGS_SUPPORTED /* Non-fatal error in libpng. Can continue, but may have a problem. */ PNG_EXPORT(105, void, png_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); /* Non-fatal error in libpng, chunk name is prepended to message. */ PNG_EXPORT(106, void, png_chunk_warning, (png_const_structrp png_ptr, png_const_charp warning_message)); #else # define png_warning(s1,s2) ((void)(s1)) # define png_chunk_warning(s1,s2) ((void)(s1)) #endif #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Benign error in libpng. Can continue, but may have a problem. * User can choose whether to handle as a fatal error or as a warning. */ PNG_EXPORT(107, void, png_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #ifdef PNG_READ_SUPPORTED /* Same, chunk name is prepended to message (only during read) */ PNG_EXPORT(108, void, png_chunk_benign_error, (png_const_structrp png_ptr, png_const_charp warning_message)); #endif PNG_EXPORT(109, void, png_set_benign_errors, (png_structrp png_ptr, int allowed)); #else # ifdef PNG_ALLOW_BENIGN_ERRORS # define png_benign_error png_warning # define png_chunk_benign_error png_chunk_warning # else # define png_benign_error png_error # define png_chunk_benign_error png_chunk_error # endif #endif /* The png_set_ functions are for storing values in the png_info_struct. * Similarly, the png_get_ calls are used to read values from the * png_info_struct, either storing the parameters in the passed variables, or * setting pointers into the png_info_struct where the data is stored. The * png_get_ functions return a non-zero value if the data was available * in info_ptr, or return zero and do not change any of the parameters if the * data was not available. * * These functions should be used instead of directly accessing png_info * to avoid problems with future changes in the size and internal layout of * png_info_struct. */ /* Returns "flag" if chunk data is valid in info_ptr. */ PNG_EXPORT(110, png_uint_32, png_get_valid, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 flag)); /* Returns number of bytes needed to hold a transformed row. */ PNG_EXPORT(111, png_size_t, png_get_rowbytes, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* Returns row_pointers, which is an array of pointers to scanlines that was * returned from png_read_png(). */ PNG_EXPORT(112, png_bytepp, png_get_rows, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Set row_pointers, which is an array of pointers to scanlines for use * by png_write_png(). */ PNG_EXPORT(113, void, png_set_rows, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytepp row_pointers)); #endif /* Returns number of color channels in image. */ PNG_EXPORT(114, png_byte, png_get_channels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #ifdef PNG_EASY_ACCESS_SUPPORTED /* Returns image width in pixels. */ PNG_EXPORT(115, png_uint_32, png_get_image_width, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image height in pixels. */ PNG_EXPORT(116, png_uint_32, png_get_image_height, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image bit_depth. */ PNG_EXPORT(117, png_byte, png_get_bit_depth, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image color_type. */ PNG_EXPORT(118, png_byte, png_get_color_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image filter_type. */ PNG_EXPORT(119, png_byte, png_get_filter_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image interlace_type. */ PNG_EXPORT(120, png_byte, png_get_interlace_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image compression_type. */ PNG_EXPORT(121, png_byte, png_get_compression_type, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns image resolution in pixels per meter, from pHYs chunk data. */ PNG_EXPORT(122, png_uint_32, png_get_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(123, png_uint_32, png_get_x_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(124, png_uint_32, png_get_y_pixels_per_meter, (png_const_structrp png_ptr, png_const_inforp info_ptr)); /* Returns pixel aspect ratio, computed from pHYs chunk data. */ PNG_FP_EXPORT(125, float, png_get_pixel_aspect_ratio, (png_const_structrp png_ptr, png_const_inforp info_ptr)) PNG_FIXED_EXPORT(210, png_fixed_point, png_get_pixel_aspect_ratio_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) /* Returns image x, y offset in pixels or microns, from oFFs chunk data. */ PNG_EXPORT(126, png_int_32, png_get_x_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(127, png_int_32, png_get_y_offset_pixels, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(128, png_int_32, png_get_x_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(129, png_int_32, png_get_y_offset_microns, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif /* PNG_EASY_ACCESS_SUPPORTED */ #ifdef PNG_READ_SUPPORTED /* Returns pointer to signature string read from PNG header */ PNG_EXPORT(130, png_const_bytep, png_get_signature, (png_const_structrp png_ptr, png_const_inforp info_ptr)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(131, png_uint_32, png_get_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_16p *background)); #endif #ifdef PNG_bKGD_SUPPORTED PNG_EXPORT(132, void, png_set_bKGD, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_16p background)); #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(133, png_uint_32, png_get_cHRM, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *white_x, double *white_y, double *red_x, double *red_y, double *green_x, double *green_y, double *blue_x, double *blue_y)) PNG_FP_EXPORT(230, png_uint_32, png_get_cHRM_XYZ, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *red_X, double *red_Y, double *red_Z, double *green_X, double *green_Y, double *green_Z, double *blue_X, double *blue_Y, double *blue_Z)) PNG_FIXED_EXPORT(134, png_uint_32, png_get_cHRM_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_white_x, png_fixed_point *int_white_y, png_fixed_point *int_red_x, png_fixed_point *int_red_y, png_fixed_point *int_green_x, png_fixed_point *int_green_y, png_fixed_point *int_blue_x, png_fixed_point *int_blue_y)) PNG_FIXED_EXPORT(231, png_uint_32, png_get_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_red_X, png_fixed_point *int_red_Y, png_fixed_point *int_red_Z, png_fixed_point *int_green_X, png_fixed_point *int_green_Y, png_fixed_point *int_green_Z, png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y, png_fixed_point *int_blue_Z)) #endif #ifdef PNG_cHRM_SUPPORTED PNG_FP_EXPORT(135, void, png_set_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y)) PNG_FP_EXPORT(232, void, png_set_cHRM_XYZ, (png_const_structrp png_ptr, png_inforp info_ptr, double red_X, double red_Y, double red_Z, double green_X, double green_Y, double green_Z, double blue_X, double blue_Y, double blue_Z)) PNG_FIXED_EXPORT(136, void, png_set_cHRM_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_white_x, png_fixed_point int_white_y, png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, png_fixed_point int_blue_y)) PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_red_X, png_fixed_point int_red_Y, png_fixed_point int_red_Z, png_fixed_point int_green_X, png_fixed_point int_green_Y, png_fixed_point int_green_Z, png_fixed_point int_blue_X, png_fixed_point int_blue_Y, png_fixed_point int_blue_Z)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr, png_const_inforp info_ptr, double *file_gamma)) PNG_FIXED_EXPORT(138, png_uint_32, png_get_gAMA_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_fixed_point *int_file_gamma)) #endif #ifdef PNG_gAMA_SUPPORTED PNG_FP_EXPORT(139, void, png_set_gAMA, (png_const_structrp png_ptr, png_inforp info_ptr, double file_gamma)) PNG_FIXED_EXPORT(140, void, png_set_gAMA_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, png_fixed_point int_file_gamma)) #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_16p *hist)); #endif #ifdef PNG_hIST_SUPPORTED PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_uint_16p hist)); #endif PNG_EXPORT(143, png_uint_32, png_get_IHDR, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *width, png_uint_32 *height, int *bit_depth, int *color_type, int *interlace_method, int *compression_method, int *filter_method)); PNG_EXPORT(144, void, png_set_IHDR, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_method, int compression_method, int filter_method)); #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(145, png_uint_32, png_get_oFFs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_int_32 *offset_x, png_int_32 *offset_y, int *unit_type)); #endif #ifdef PNG_oFFs_SUPPORTED PNG_EXPORT(146, void, png_set_oFFs, (png_const_structrp png_ptr, png_inforp info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(147, png_uint_32, png_get_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_charp *purpose, png_int_32 *X0, png_int_32 *X1, int *type, int *nparams, png_charp *units, png_charpp *params)); #endif #ifdef PNG_pCAL_SUPPORTED PNG_EXPORT(148, void, png_set_pCAL, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(149, png_uint_32, png_get_pHYs, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); #endif #ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(150, void, png_set_pHYs, (png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type)); #endif PNG_EXPORT(151, png_uint_32, png_get_PLTE, (png_const_structrp png_ptr, png_inforp info_ptr, png_colorp *palette, int *num_palette)); PNG_EXPORT(152, void, png_set_PLTE, (png_structrp png_ptr, png_inforp info_ptr, png_const_colorp palette, int num_palette)); #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(153, png_uint_32, png_get_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_color_8p *sig_bit)); #endif #ifdef PNG_sBIT_SUPPORTED PNG_EXPORT(154, void, png_set_sBIT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_color_8p sig_bit)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(155, png_uint_32, png_get_sRGB, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *file_srgb_intent)); #endif #ifdef PNG_sRGB_SUPPORTED PNG_EXPORT(156, void, png_set_sRGB, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); PNG_EXPORT(157, void, png_set_sRGB_gAMA_and_cHRM, (png_const_structrp png_ptr, png_inforp info_ptr, int srgb_intent)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(158, png_uint_32, png_get_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_charpp name, int *compression_type, png_bytepp profile, png_uint_32 *proflen)); #endif #ifdef PNG_iCCP_SUPPORTED PNG_EXPORT(159, void, png_set_iCCP, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_charp name, int compression_type, png_const_bytep profile, png_uint_32 proflen)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(160, int, png_get_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_sPLT_tpp entries)); #endif #ifdef PNG_sPLT_SUPPORTED PNG_EXPORT(161, void, png_set_sPLT, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_sPLT_tp entries, int nentries)); #endif #ifdef PNG_TEXT_SUPPORTED /* png_get_text also returns the number of text chunks in *num_text */ PNG_EXPORT(162, int, png_get_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_textp *text_ptr, int *num_text)); #endif /* Note while png_set_text() will accept a structure whose text, * language, and translated keywords are NULL pointers, the structure * returned by png_get_text will always contain regular * zero-terminated C strings. They might be empty strings but * they will never be NULL pointers. */ #ifdef PNG_TEXT_SUPPORTED PNG_EXPORT(163, void, png_set_text, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(164, png_uint_32, png_get_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_timep *mod_time)); #endif #ifdef PNG_tIME_SUPPORTED PNG_EXPORT(165, void, png_set_tIME, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_timep mod_time)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(166, png_uint_32, png_get_tRNS, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)); #endif #ifdef PNG_tRNS_SUPPORTED PNG_EXPORT(167, void, png_set_tRNS, (png_structrp png_ptr, png_inforp info_ptr, png_const_bytep trans_alpha, int num_trans, png_const_color_16p trans_color)); #endif #ifdef PNG_sCAL_SUPPORTED PNG_FP_EXPORT(168, png_uint_32, png_get_sCAL, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, double *width, double *height)) #if defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) || \ defined(PNG_FLOATING_POINT_SUPPORTED) /* NOTE: this API is currently implemented using floating point arithmetic, * consequently it can only be used on systems with floating point support. * In any case the range of values supported by png_fixed_point is small and it * is highly recommended that png_get_sCAL_s be used instead. */ PNG_FIXED_EXPORT(214, png_uint_32, png_get_sCAL_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_fixed_point *width, png_fixed_point *height)) #endif PNG_EXPORT(169, png_uint_32, png_get_sCAL_s, (png_const_structrp png_ptr, png_const_inforp info_ptr, int *unit, png_charpp swidth, png_charpp sheight)); PNG_FP_EXPORT(170, void, png_set_sCAL, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, double width, double height)) PNG_FIXED_EXPORT(213, void, png_set_sCAL_fixed, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_fixed_point width, png_fixed_point height)) PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr, png_inforp info_ptr, int unit, png_const_charp swidth, png_const_charp sheight)); #endif /* PNG_sCAL_SUPPORTED */ #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED /* Provide the default handling for all unknown chunks or, optionally, for * specific unknown chunks. * * NOTE: prior to 1.6.0 the handling specified for particular chunks on read was * ignored and the default was used, the per-chunk setting only had an effect on * write. If you wish to have chunk-specific handling on read in code that must * work on earlier versions you must use a user chunk callback to specify the * desired handling (keep or discard.) * * The 'keep' parameter is a PNG_HANDLE_CHUNK_ value as listed below. The * parameter is interpreted as follows: * * READ: * PNG_HANDLE_CHUNK_AS_DEFAULT: * Known chunks: do normal libpng processing, do not keep the chunk (but * see the comments below about PNG_HANDLE_AS_UNKNOWN_SUPPORTED) * Unknown chunks: for a specific chunk use the global default, when used * as the default discard the chunk data. * PNG_HANDLE_CHUNK_NEVER: * Discard the chunk data. * PNG_HANDLE_CHUNK_IF_SAFE: * Keep the chunk data if the chunk is not critical else raise a chunk * error. * PNG_HANDLE_CHUNK_ALWAYS: * Keep the chunk data. * * If the chunk data is saved it can be retrieved using png_get_unknown_chunks, * below. Notice that specifying "AS_DEFAULT" as a global default is equivalent * to specifying "NEVER", however when "AS_DEFAULT" is used for specific chunks * it simply resets the behavior to the libpng default. * * INTERACTION WTIH USER CHUNK CALLBACKS: * The per-chunk handling is always used when there is a png_user_chunk_ptr * callback and the callback returns 0; the chunk is then always stored *unless* * it is critical and the per-chunk setting is other than ALWAYS. Notice that * the global default is *not* used in this case. (In effect the per-chunk * value is incremented to at least IF_SAFE.) * * IMPORTANT NOTE: this behavior will change in libpng 1.7 - the global and * per-chunk defaults will be honored. If you want to preserve the current * behavior when your callback returns 0 you must set PNG_HANDLE_CHUNK_IF_SAFE * as the default - if you don't do this libpng 1.6 will issue a warning. * * If you want unhandled unknown chunks to be discarded in libpng 1.6 and * earlier simply return '1' (handled). * * PNG_HANDLE_AS_UNKNOWN_SUPPORTED: * If this is *not* set known chunks will always be handled by libpng and * will never be stored in the unknown chunk list. Known chunks listed to * png_set_keep_unknown_chunks will have no effect. If it is set then known * chunks listed with a keep other than AS_DEFAULT will *never* be processed * by libpng, in addition critical chunks must either be processed by the * callback or saved. * * The IHDR and IEND chunks must not be listed. Because this turns off the * default handling for chunks that would otherwise be recognized the * behavior of libpng transformations may well become incorrect! * * WRITE: * When writing chunks the options only apply to the chunks specified by * png_set_unknown_chunks (below), libpng will *always* write known chunks * required by png_set_ calls and will always write the core critical chunks * (as required for PLTE). * * Each chunk in the png_set_unknown_chunks list is looked up in the * png_set_keep_unknown_chunks list to find the keep setting, this is then * interpreted as follows: * * PNG_HANDLE_CHUNK_AS_DEFAULT: * Write safe-to-copy chunks and write other chunks if the global * default is set to _ALWAYS, otherwise don't write this chunk. * PNG_HANDLE_CHUNK_NEVER: * Do not write the chunk. * PNG_HANDLE_CHUNK_IF_SAFE: * Write the chunk if it is safe-to-copy, otherwise do not write it. * PNG_HANDLE_CHUNK_ALWAYS: * Write the chunk. * * Note that the default behavior is effectively the opposite of the read case - * in read unknown chunks are not stored by default, in write they are written * by default. Also the behavior of PNG_HANDLE_CHUNK_IF_SAFE is very different * - on write the safe-to-copy bit is checked, on read the critical bit is * checked and on read if the chunk is critical an error will be raised. * * num_chunks: * =========== * If num_chunks is positive, then the "keep" parameter specifies the manner * for handling only those chunks appearing in the chunk_list array, * otherwise the chunk list array is ignored. * * If num_chunks is 0 the "keep" parameter specifies the default behavior for * unknown chunks, as described above. * * If num_chunks is negative, then the "keep" parameter specifies the manner * for handling all unknown chunks plus all chunks recognized by libpng * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to * be processed by libpng. */ PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr, int keep, png_const_bytep chunk_list, int num_chunks)); /* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; * the result is therefore true (non-zero) if special handling is required, * false for the default handling. */ PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr, png_const_bytep chunk_name)); #endif #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_const_unknown_chunkp unknowns, int num_unknowns)); /* NOTE: prior to 1.6.0 this routine set the 'location' field of the added * unknowns to the location currently stored in the png_struct. This is * invariably the wrong value on write. To fix this call the following API * for each chunk in the list with the correct location. If you know your * code won't be compiled on earlier versions you can rely on * png_set_unknown_chunks(write-ptr, png_get_unknown_chunks(read-ptr)) doing * the correct thing. */ PNG_EXPORT(175, void, png_set_unknown_chunk_location, (png_const_structrp png_ptr, png_inforp info_ptr, int chunk, int location)); PNG_EXPORT(176, int, png_get_unknown_chunks, (png_const_structrp png_ptr, png_inforp info_ptr, png_unknown_chunkpp entries)); #endif /* Png_free_data() will turn off the "valid" flag for anything it frees. * If you need to turn it off for a chunk that your application has freed, * you can use png_set_invalid(png_ptr, info_ptr, PNG_INFO_CHNK); */ PNG_EXPORT(177, void, png_set_invalid, (png_const_structrp png_ptr, png_inforp info_ptr, int mask)); #ifdef PNG_INFO_IMAGE_SUPPORTED /* The "params" pointer is currently not used and is for future expansion. */ #ifdef PNG_SEQUENTIAL_READ_SUPPORTED PNG_EXPORT(178, void, png_read_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #ifdef PNG_WRITE_SUPPORTED PNG_EXPORT(179, void, png_write_png, (png_structrp png_ptr, png_inforp info_ptr, int transforms, png_voidp params)); #endif #endif PNG_EXPORT(180, png_const_charp, png_get_copyright, (png_const_structrp png_ptr)); PNG_EXPORT(181, png_const_charp, png_get_header_ver, (png_const_structrp png_ptr)); PNG_EXPORT(182, png_const_charp, png_get_header_version, (png_const_structrp png_ptr)); PNG_EXPORT(183, png_const_charp, png_get_libpng_ver, (png_const_structrp png_ptr)); #ifdef PNG_MNG_FEATURES_SUPPORTED PNG_EXPORT(184, png_uint_32, png_permit_mng_features, (png_structrp png_ptr, png_uint_32 mng_features_permitted)); #endif /* For use in png_set_keep_unknown, added to version 1.2.6 */ #define PNG_HANDLE_CHUNK_AS_DEFAULT 0 #define PNG_HANDLE_CHUNK_NEVER 1 #define PNG_HANDLE_CHUNK_IF_SAFE 2 #define PNG_HANDLE_CHUNK_ALWAYS 3 #define PNG_HANDLE_CHUNK_LAST 4 /* Strip the prepended error numbers ("#nnn ") from error and warning * messages before passing them to the error or warning handler. */ #ifdef PNG_ERROR_NUMBERS_SUPPORTED PNG_EXPORT(185, void, png_set_strip_error_numbers, (png_structrp png_ptr, png_uint_32 strip_mode)); #endif /* Added in libpng-1.2.6 */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED PNG_EXPORT(186, void, png_set_user_limits, (png_structrp png_ptr, png_uint_32 user_width_max, png_uint_32 user_height_max)); PNG_EXPORT(187, png_uint_32, png_get_user_width_max, (png_const_structrp png_ptr)); PNG_EXPORT(188, png_uint_32, png_get_user_height_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.0 */ PNG_EXPORT(189, void, png_set_chunk_cache_max, (png_structrp png_ptr, png_uint_32 user_chunk_cache_max)); PNG_EXPORT(190, png_uint_32, png_get_chunk_cache_max, (png_const_structrp png_ptr)); /* Added in libpng-1.4.1 */ PNG_EXPORT(191, void, png_set_chunk_malloc_max, (png_structrp png_ptr, png_alloc_size_t user_chunk_cache_max)); PNG_EXPORT(192, png_alloc_size_t, png_get_chunk_malloc_max, (png_const_structrp png_ptr)); #endif #if defined(PNG_INCH_CONVERSIONS_SUPPORTED) PNG_EXPORT(193, png_uint_32, png_get_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(194, png_uint_32, png_get_x_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_EXPORT(195, png_uint_32, png_get_y_pixels_per_inch, (png_const_structrp png_ptr, png_const_inforp info_ptr)); PNG_FP_EXPORT(196, float, png_get_x_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(211, png_fixed_point, png_get_x_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif PNG_FP_EXPORT(197, float, png_get_y_offset_inches, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #ifdef PNG_FIXED_POINT_SUPPORTED /* otherwise not implemented. */ PNG_FIXED_EXPORT(212, png_fixed_point, png_get_y_offset_inches_fixed, (png_const_structrp png_ptr, png_const_inforp info_ptr)) #endif # ifdef PNG_pHYs_SUPPORTED PNG_EXPORT(198, png_uint_32, png_get_pHYs_dpi, (png_const_structrp png_ptr, png_const_inforp info_ptr, png_uint_32 *res_x, png_uint_32 *res_y, int *unit_type)); # endif /* PNG_pHYs_SUPPORTED */ #endif /* PNG_INCH_CONVERSIONS_SUPPORTED */ /* Added in libpng-1.4.0 */ #ifdef PNG_IO_STATE_SUPPORTED PNG_EXPORT(199, png_uint_32, png_get_io_state, (png_const_structrp png_ptr)); /* Removed from libpng 1.6; use png_get_io_chunk_type. */ PNG_REMOVED(200, png_const_bytep, png_get_io_chunk_name, (png_structrp png_ptr), PNG_DEPRECATED) PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type, (png_const_structrp png_ptr)); /* The flags returned by png_get_io_state() are the following: */ # define PNG_IO_NONE 0x0000 /* no I/O at this moment */ # define PNG_IO_READING 0x0001 /* currently reading */ # define PNG_IO_WRITING 0x0002 /* currently writing */ # define PNG_IO_SIGNATURE 0x0010 /* currently at the file signature */ # define PNG_IO_CHUNK_HDR 0x0020 /* currently at the chunk header */ # define PNG_IO_CHUNK_DATA 0x0040 /* currently at the chunk data */ # define PNG_IO_CHUNK_CRC 0x0080 /* currently at the chunk crc */ # define PNG_IO_MASK_OP 0x000f /* current operation: reading/writing */ # define PNG_IO_MASK_LOC 0x00f0 /* current location: sig/hdr/data/crc */ #endif /* ?PNG_IO_STATE_SUPPORTED */ /* Interlace support. The following macros are always defined so that if * libpng interlace handling is turned off the macros may be used to handle * interlaced images within the application. */ #define PNG_INTERLACE_ADAM7_PASSES 7 /* Two macros to return the first row and first column of the original, * full, image which appears in a given pass. 'pass' is in the range 0 * to 6 and the result is in the range 0 to 7. */ #define PNG_PASS_START_ROW(pass) (((1&~(pass))<<(3-((pass)>>1)))&7) #define PNG_PASS_START_COL(pass) (((1& (pass))<<(3-(((pass)+1)>>1)))&7) /* A macro to return the offset between pixels in the output row for a pair of * pixels in the input - effectively the inverse of the 'COL_SHIFT' macro that * follows. Note that ROW_OFFSET is the offset from one row to the next whereas * COL_OFFSET is from one column to the next, within a row. */ #define PNG_PASS_ROW_OFFSET(pass) ((pass)>2?(8>>(((pass)-1)>>1)):8) #define PNG_PASS_COL_OFFSET(pass) (1<<((7-(pass))>>1)) /* Two macros to help evaluate the number of rows or columns in each * pass. This is expressed as a shift - effectively log2 of the number or * rows or columns in each 8x8 tile of the original image. */ #define PNG_PASS_ROW_SHIFT(pass) ((pass)>2?(8-(pass))>>1:3) #define PNG_PASS_COL_SHIFT(pass) ((pass)>1?(7-(pass))>>1:3) /* Hence two macros to determine the number of rows or columns in a given * pass of an image given its height or width. In fact these macros may * return non-zero even though the sub-image is empty, because the other * dimension may be empty for a small image. */ #define PNG_PASS_ROWS(height, pass) (((height)+(((1<>PNG_PASS_ROW_SHIFT(pass)) #define PNG_PASS_COLS(width, pass) (((width)+(((1<>PNG_PASS_COL_SHIFT(pass)) /* For the reader row callbacks (both progressive and sequential) it is * necessary to find the row in the output image given a row in an interlaced * image, so two more macros: */ #define PNG_ROW_FROM_PASS_ROW(y_in, pass) \ (((y_in)<>(((7-(off))-(pass))<<2)) & 0xF) | \ ((0x01145AF0>>(((7-(off))-(pass))<<2)) & 0xF0)) #define PNG_ROW_IN_INTERLACE_PASS(y, pass) \ ((PNG_PASS_MASK(pass,0) >> ((y)&7)) & 1) #define PNG_COL_IN_INTERLACE_PASS(x, pass) \ ((PNG_PASS_MASK(pass,1) >> ((x)&7)) & 1) #ifdef PNG_READ_COMPOSITE_NODIV_SUPPORTED /* With these routines we avoid an integer divide, which will be slower on * most machines. However, it does take more operations than the corresponding * divide method, so it may be slower on a few RISC systems. There are two * shifts (by 8 or 16 bits) and an addition, versus a single integer divide. * * Note that the rounding factors are NOT supposed to be the same! 128 and * 32768 are correct for the NODIV code; 127 and 32767 are correct for the * standard method. * * [Optimized code by Greg Roelofs and Mark Adler...blame us for bugs. :-) ] */ /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ # define png_composite(composite, fg, alpha, bg) \ { png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ * (png_uint_16)(alpha) \ + (png_uint_16)(bg)*(png_uint_16)(255 \ - (png_uint_16)(alpha)) + 128); \ (composite) = (png_byte)((temp + (temp >> 8)) >> 8); } # define png_composite_16(composite, fg, alpha, bg) \ { png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ * (png_uint_32)(alpha) \ + (png_uint_32)(bg)*(65535 \ - (png_uint_32)(alpha)) + 32768); \ (composite) = (png_uint_16)((temp + (temp >> 16)) >> 16); } #else /* Standard method using integer division */ # define png_composite(composite, fg, alpha, bg) \ (composite) = (png_byte)(((png_uint_16)(fg) * (png_uint_16)(alpha) + \ (png_uint_16)(bg) * (png_uint_16)(255 - (png_uint_16)(alpha)) + \ 127) / 255) # define png_composite_16(composite, fg, alpha, bg) \ (composite) = (png_uint_16)(((png_uint_32)(fg) * (png_uint_32)(alpha) + \ (png_uint_32)(bg)*(png_uint_32)(65535 - (png_uint_32)(alpha)) + \ 32767) / 65535) #endif /* PNG_READ_COMPOSITE_NODIV_SUPPORTED */ #ifdef PNG_READ_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(201, png_uint_32, png_get_uint_32, (png_const_bytep buf)); PNG_EXPORT(202, png_uint_16, png_get_uint_16, (png_const_bytep buf)); PNG_EXPORT(203, png_int_32, png_get_int_32, (png_const_bytep buf)); #endif PNG_EXPORT(204, png_uint_32, png_get_uint_31, (png_const_structrp png_ptr, png_const_bytep buf)); /* No png_get_int_16 -- may be added if there's a real need for it. */ /* Place a 32-bit number into a buffer in PNG byte order (big-endian). */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(205, void, png_save_uint_32, (png_bytep buf, png_uint_32 i)); #endif #ifdef PNG_SAVE_INT_32_SUPPORTED PNG_EXPORT(206, void, png_save_int_32, (png_bytep buf, png_int_32 i)); #endif /* Place a 16-bit number into a buffer in PNG byte order. * The parameter is declared unsigned int, not png_uint_16, * just to avoid potential problems on pre-ANSI C compilers. */ #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); /* No png_save_int_16 -- may be added if there's a real need for it. */ #endif #ifdef PNG_USE_READ_MACROS /* Inline macros to do direct reads of bytes from the input buffer. * The png_get_int_32() routine assumes we are using two's complement * format for negative values, which is almost certainly true. */ # define PNG_get_uint_32(buf) \ (((png_uint_32)(*(buf)) << 24) + \ ((png_uint_32)(*((buf) + 1)) << 16) + \ ((png_uint_32)(*((buf) + 2)) << 8) + \ ((png_uint_32)(*((buf) + 3)))) /* From libpng-1.4.0 until 1.4.4, the png_get_uint_16 macro (but not the * function) incorrectly returned a value of type png_uint_32. */ # define PNG_get_uint_16(buf) \ ((png_uint_16) \ (((unsigned int)(*(buf)) << 8) + \ ((unsigned int)(*((buf) + 1))))) # define PNG_get_int_32(buf) \ ((png_int_32)((*(buf) & 0x80) \ ? -((png_int_32)((png_get_uint_32(buf) ^ 0xffffffffL) + 1)) \ : (png_int_32)png_get_uint_32(buf))) /* If PNG_PREFIX is defined the same thing as below happens in pnglibconf.h, * but defining a macro name prefixed with PNG_PREFIX. */ # ifndef PNG_PREFIX # define png_get_uint_32(buf) PNG_get_uint_32(buf) # define png_get_uint_16(buf) PNG_get_uint_16(buf) # define png_get_int_32(buf) PNG_get_int_32(buf) # endif #else # ifdef PNG_PREFIX /* No macros; revert to the (redefined) function */ # define PNG_get_uint_32 (png_get_uint_32) # define PNG_get_uint_16 (png_get_uint_16) # define PNG_get_int_32 (png_get_int_32) # endif #endif /******************************************************************************* * SIMPLIFIED API ******************************************************************************* * * Please read the documentation in libpng-manual.txt (TODO: write said * documentation) if you don't understand what follows. * * The simplified API hides the details of both libpng and the PNG file format * itself. It allows PNG files to be read into a very limited number of * in-memory bitmap formats or to be written from the same formats. If these * formats do not accomodate your needs then you can, and should, use the more * sophisticated APIs above - these support a wide variety of in-memory formats * and a wide variety of sophisticated transformations to those formats as well * as a wide variety of APIs to manipulate ancillary information. * * To read a PNG file using the simplified API: * * 1) Declare a 'png_image' structure (see below) on the stack and set the * version field to PNG_IMAGE_VERSION. * 2) Call the appropriate png_image_begin_read... function. * 3) Set the png_image 'format' member to the required sample format. * 4) Allocate a buffer for the image and, if required, the color-map. * 5) Call png_image_finish_read to read the image and, if required, the * color-map into your buffers. * * There are no restrictions on the format of the PNG input itself; all valid * color types, bit depths, and interlace methods are acceptable, and the * input image is transformed as necessary to the requested in-memory format * during the png_image_finish_read() step. The only caveat is that if you * request a color-mapped image from a PNG that is full-color or makes * complex use of an alpha channel the transformation is extremely lossy and the * result may look terrible. * * To write a PNG file using the simplified API: * * 1) Declare a 'png_image' structure on the stack and memset() it to all zero. * 2) Initialize the members of the structure that describe the image, setting * the 'format' member to the format of the image samples. * 3) Call the appropriate png_image_write... function with a pointer to the * image and, if necessary, the color-map to write the PNG data. * * png_image is a structure that describes the in-memory format of an image * when it is being read or defines the in-memory format of an image that you * need to write: */ #define PNG_IMAGE_VERSION 1 typedef struct png_control *png_controlp; typedef struct { png_controlp opaque; /* Initialize to NULL, free with png_image_free */ png_uint_32 version; /* Set to PNG_IMAGE_VERSION */ png_uint_32 width; /* Image width in pixels (columns) */ png_uint_32 height; /* Image height in pixels (rows) */ png_uint_32 format; /* Image format as defined below */ png_uint_32 flags; /* A bit mask containing informational flags */ png_uint_32 colormap_entries; /* Number of entries in the color-map */ /* In the event of an error or warning the following field will be set to a * non-zero value and the 'message' field will contain a '\0' terminated * string with the libpng error or warning message. If both warnings and * an error were encountered, only the error is recorded. If there * are multiple warnings, only the first one is recorded. * * The upper 30 bits of this value are reserved, the low two bits contain * a value as follows: */ # define PNG_IMAGE_WARNING 1 # define PNG_IMAGE_ERROR 2 /* * The result is a two bit code such that a value more than 1 indicates * a failure in the API just called: * * 0 - no warning or error * 1 - warning * 2 - error * 3 - error preceded by warning */ # define PNG_IMAGE_FAILED(png_cntrl) ((((png_cntrl).warning_or_error)&0x03)>1) png_uint_32 warning_or_error; char message[64]; } png_image, *png_imagep; /* The samples of the image have one to four channels whose components have * original values in the range 0 to 1.0: * * 1: A single gray or luminance channel (G). * 2: A gray/luminance channel and an alpha channel (GA). * 3: Three red, green, blue color channels (RGB). * 4: Three color channels and an alpha channel (RGBA). * * The components are encoded in one of two ways: * * a) As a small integer, value 0..255, contained in a single byte. For the * alpha channel the original value is simply value/255. For the color or * luminance channels the value is encoded according to the sRGB specification * and matches the 8-bit format expected by typical display devices. * * The color/gray channels are not scaled (pre-multiplied) by the alpha * channel and are suitable for passing to color management software. * * b) As a value in the range 0..65535, contained in a 2-byte integer. All * channels can be converted to the original value by dividing by 65535; all * channels are linear. Color channels use the RGB encoding (RGB end-points) of * the sRGB specification. This encoding is identified by the * PNG_FORMAT_FLAG_LINEAR flag below. * * When the simplified API needs to convert between sRGB and linear colorspaces, * the actual sRGB transfer curve defined in the sRGB specification (see the * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2 * approximation used elsewhere in libpng. * * When an alpha channel is present it is expected to denote pixel coverage * of the color or luminance channels and is returned as an associated alpha * channel: the color/gray channels are scaled (pre-multiplied) by the alpha * value. * * The samples are either contained directly in the image data, between 1 and 8 * bytes per pixel according to the encoding, or are held in a color-map indexed * by bytes in the image data. In the case of a color-map the color-map entries * are individual samples, encoded as above, and the image data has one byte per * pixel to select the relevant sample from the color-map. */ /* PNG_FORMAT_* * * #defines to be used in png_image::format. Each #define identifies a * particular layout of sample data and, if present, alpha values. There are * separate defines for each of the two component encodings. * * A format is built up using single bit flag values. All combinations are * valid. Formats can be built up from the flag values or you can use one of * the predefined values below. When testing formats always use the FORMAT_FLAG * macros to test for individual features - future versions of the library may * add new flags. * * When reading or writing color-mapped images the format should be set to the * format of the entries in the color-map then png_image_{read,write}_colormap * called to read or write the color-map and set the format correctly for the * image data. Do not set the PNG_FORMAT_FLAG_COLORMAP bit directly! * * NOTE: libpng can be built with particular features disabled, if you see * compiler errors because the definition of one of the following flags has been * compiled out it is because libpng does not have the required support. It is * possible, however, for the libpng configuration to enable the format on just * read or just write; in that case you may see an error at run time. You can * guard against this by checking for the definition of the appropriate * "_SUPPORTED" macro, one of: * * PNG_SIMPLIFIED_{READ,WRITE}_{BGR,AFIRST}_SUPPORTED */ #define PNG_FORMAT_FLAG_ALPHA 0x01U /* format with an alpha channel */ #define PNG_FORMAT_FLAG_COLOR 0x02U /* color format: otherwise grayscale */ #define PNG_FORMAT_FLAG_LINEAR 0x04U /* 2 byte channels else 1 byte */ #define PNG_FORMAT_FLAG_COLORMAP 0x08U /* image data is color-mapped */ #ifdef PNG_FORMAT_BGR_SUPPORTED # define PNG_FORMAT_FLAG_BGR 0x10U /* BGR colors, else order is RGB */ #endif #ifdef PNG_FORMAT_AFIRST_SUPPORTED # define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */ #endif /* Commonly used formats have predefined macros. * * First the single byte (sRGB) formats: */ #define PNG_FORMAT_GRAY 0 #define PNG_FORMAT_GA PNG_FORMAT_FLAG_ALPHA #define PNG_FORMAT_AG (PNG_FORMAT_GA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_RGB PNG_FORMAT_FLAG_COLOR #define PNG_FORMAT_BGR (PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_BGR) #define PNG_FORMAT_RGBA (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ARGB (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_AFIRST) #define PNG_FORMAT_BGRA (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_ABGR (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_AFIRST) /* Then the linear 2-byte formats. When naming these "Y" is used to * indicate a luminance (gray) channel. */ #define PNG_FORMAT_LINEAR_Y PNG_FORMAT_FLAG_LINEAR #define PNG_FORMAT_LINEAR_Y_ALPHA (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_ALPHA) #define PNG_FORMAT_LINEAR_RGB (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR) #define PNG_FORMAT_LINEAR_RGB_ALPHA \ (PNG_FORMAT_FLAG_LINEAR|PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA) /* With color-mapped formats the image data is one byte for each pixel, the byte * is an index into the color-map which is formatted as above. To obtain a * color-mapped format it is sufficient just to add the PNG_FOMAT_FLAG_COLORMAP * to one of the above definitions, or you can use one of the definitions below. */ #define PNG_FORMAT_RGB_COLORMAP (PNG_FORMAT_RGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGR_COLORMAP (PNG_FORMAT_BGR|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_RGBA_COLORMAP (PNG_FORMAT_RGBA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ARGB_COLORMAP (PNG_FORMAT_ARGB|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_BGRA_COLORMAP (PNG_FORMAT_BGRA|PNG_FORMAT_FLAG_COLORMAP) #define PNG_FORMAT_ABGR_COLORMAP (PNG_FORMAT_ABGR|PNG_FORMAT_FLAG_COLORMAP) /* PNG_IMAGE macros * * These are convenience macros to derive information from a png_image * structure. The PNG_IMAGE_SAMPLE_ macros return values appropriate to the * actual image sample values - either the entries in the color-map or the * pixels in the image. The PNG_IMAGE_PIXEL_ macros return corresponding values * for the pixels and will always return 1 for color-mapped formats. The * remaining macros return information about the rows in the image and the * complete image. * * NOTE: All the macros that take a png_image::format parameter are compile time * constants if the format parameter is, itself, a constant. Therefore these * macros can be used in array declarations and case labels where required. * Similarly the macros are also pre-processor constants (sizeof is not used) so * they can be used in #if tests. * * First the information about the samples. */ #define PNG_IMAGE_SAMPLE_CHANNELS(fmt)\ (((fmt)&(PNG_FORMAT_FLAG_COLOR|PNG_FORMAT_FLAG_ALPHA))+1) /* Return the total number of channels in a given format: 1..4 */ #define PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)\ ((((fmt) & PNG_FORMAT_FLAG_LINEAR) >> 2)+1) /* Return the size in bytes of a single component of a pixel or color-map * entry (as appropriate) in the image: 1 or 2. */ #define PNG_IMAGE_SAMPLE_SIZE(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * PNG_IMAGE_SAMPLE_COMPONENT_SIZE(fmt)) /* This is the size of the sample data for one sample. If the image is * color-mapped it is the size of one color-map entry (and image pixels are * one byte in size), otherwise it is the size of one image pixel. */ #define PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(fmt)\ (PNG_IMAGE_SAMPLE_CHANNELS(fmt) * 256) /* The maximum size of the color-map required by the format expressed in a * count of components. This can be used to compile-time allocate a * color-map: * * png_uint_16 colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(linear_fmt)]; * * png_byte colormap[PNG_IMAGE_MAXIMUM_COLORMAP_COMPONENTS(sRGB_fmt)]; * * Alternatively use the PNG_IMAGE_COLORMAP_SIZE macro below to use the * information from one of the png_image_begin_read_ APIs and dynamically * allocate the required memory. */ /* Corresponding information about the pixels */ #define PNG_IMAGE_PIXEL_(test,fmt)\ (((fmt)&PNG_FORMAT_FLAG_COLORMAP)?1:test(fmt)) #define PNG_IMAGE_PIXEL_CHANNELS(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_CHANNELS,fmt) /* The number of separate channels (components) in a pixel; 1 for a * color-mapped image. */ #define PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)\ PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_COMPONENT_SIZE,fmt) /* The size, in bytes, of each component in a pixel; 1 for a color-mapped * image. */ #define PNG_IMAGE_PIXEL_SIZE(fmt) PNG_IMAGE_PIXEL_(PNG_IMAGE_SAMPLE_SIZE,fmt) /* The size, in bytes, of a complete pixel; 1 for a color-mapped image. */ /* Information about the whole row, or whole image */ #define PNG_IMAGE_ROW_STRIDE(image)\ (PNG_IMAGE_PIXEL_CHANNELS((image).format) * (image).width) /* Return the total number of components in a single row of the image; this * is the minimum 'row stride', the minimum count of components between each * row. For a color-mapped image this is the minimum number of bytes in a * row. */ #define PNG_IMAGE_BUFFER_SIZE(image, row_stride)\ (PNG_IMAGE_PIXEL_COMPONENT_SIZE((image).format)*(image).height*(row_stride)) /* Return the size, in bytes, of an image buffer given a png_image and a row * stride - the number of components to leave space for in each row. */ #define PNG_IMAGE_SIZE(image)\ PNG_IMAGE_BUFFER_SIZE(image, PNG_IMAGE_ROW_STRIDE(image)) /* Return the size, in bytes, of the image in memory given just a png_image; * the row stride is the minimum stride required for the image. */ #define PNG_IMAGE_COLORMAP_SIZE(image)\ (PNG_IMAGE_SAMPLE_SIZE((image).format) * (image).colormap_entries) /* Return the size, in bytes, of the color-map of this image. If the image * format is not a color-map format this will return a size sufficient for * 256 entries in the given format; check PNG_FORMAT_FLAG_COLORMAP if * you don't want to allocate a color-map in this case. */ /* PNG_IMAGE_FLAG_* * * Flags containing additional information about the image are held in the * 'flags' field of png_image. */ #define PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB 0x01 /* This indicates the the RGB values of the in-memory bitmap do not * correspond to the red, green and blue end-points defined by sRGB. */ #define PNG_IMAGE_FLAG_FAST 0x02 /* On write emphasise speed over compression; the resultant PNG file will be * larger but will be produced significantly faster, particular for large * images. Do not use this option for images which will be distributed, only * used it when producing intermediate files that will be read back in * repeatedly. For a typical 24-bit image the option will double the read * speed at the cost of increasing the image size by 25%, however for many * more compressible images the PNG file can be 10 times larger with only a * slight speed gain. */ #define PNG_IMAGE_FLAG_16BIT_sRGB 0x04 /* On read if the image is a 16-bit per component image and there is no gAMA * or sRGB chunk assume that the components are sRGB encoded. Notice that * images output by the simplified API always have gamma information; setting * this flag only affects the interpretation of 16-bit images from an * external source. It is recommended that the application expose this flag * to the user; the user can normally easily recognize the difference between * linear and sRGB encoding. This flag has no effect on write - the data * passed to the write APIs must have the correct encoding (as defined * above.) * * If the flag is not set (the default) input 16-bit per component data is * assumed to be linear. * * NOTE: the flag can only be set after the png_image_begin_read_ call, * because that call initializes the 'flags' field. */ #ifdef PNG_SIMPLIFIED_READ_SUPPORTED /* READ APIs * --------- * * The png_image passed to the read APIs must have been initialized by setting * the png_controlp field 'opaque' to NULL (or, safer, memset the whole thing.) */ #ifdef PNG_STDIO_SUPPORTED PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image, const char *file_name)); /* The named file is opened for read and the image header is filled in * from the PNG header in the file. */ PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image, FILE* file)); /* The PNG header is read from the stdio FILE object. */ #endif /* PNG_STDIO_SUPPORTED */ PNG_EXPORT(236, int, png_image_begin_read_from_memory, (png_imagep image, png_const_voidp memory, png_size_t size)); /* The PNG header is read from the given memory buffer. */ PNG_EXPORT(237, int, png_image_finish_read, (png_imagep image, png_const_colorp background, void *buffer, png_int_32 row_stride, void *colormap)); /* Finish reading the image into the supplied buffer and clean up the * png_image structure. * * row_stride is the step, in byte or 2-byte units as appropriate, * between adjacent rows. A positive stride indicates that the top-most row * is first in the buffer - the normal top-down arrangement. A negative * stride indicates that the bottom-most row is first in the buffer. * * background need only be supplied if an alpha channel must be removed from * a png_byte format and the removal is to be done by compositing on a solid * color; otherwise it may be NULL and any composition will be done directly * onto the buffer. The value is an sRGB color to use for the background, * for grayscale output the green channel is used. * * background must be supplied when an alpha channel must be removed from a * single byte color-mapped output format, in other words if: * * 1) The original format from png_image_begin_read_from_* had * PNG_FORMAT_FLAG_ALPHA set. * 2) The format set by the application does not. * 3) The format set by the application has PNG_FORMAT_FLAG_COLORMAP set and * PNG_FORMAT_FLAG_LINEAR *not* set. * * For linear output removing the alpha channel is always done by compositing * on black and background is ignored. * * colormap must be supplied when PNG_FORMAT_FLAG_COLORMAP is set. It must * be at least the size (in bytes) returned by PNG_IMAGE_COLORMAP_SIZE. * image->colormap_entries will be updated to the actual number of entries * written to the colormap; this may be less than the original value. */ PNG_EXPORT(238, void, png_image_free, (png_imagep image)); /* Free any data allocated by libpng in image->opaque, setting the pointer to * NULL. May be called at any time after the structure is initialized. */ #endif /* PNG_SIMPLIFIED_READ_SUPPORTED */ #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED #ifdef PNG_STDIO_SUPPORTED /* WRITE APIS * ---------- * For write you must initialize a png_image structure to describe the image to * be written. To do this use memset to set the whole structure to 0 then * initialize fields describing your image. * * version: must be set to PNG_IMAGE_VERSION * opaque: must be initialized to NULL * width: image width in pixels * height: image height in rows * format: the format of the data (image and color-map) you wish to write * flags: set to 0 unless one of the defined flags applies; set * PNG_IMAGE_FLAG_COLORSPACE_NOT_sRGB for color format images where the RGB * values do not correspond to the colors in sRGB. * colormap_entries: set to the number of entries in the color-map (0 to 256) */ PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image, const char *file, int convert_to_8bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the named file. */ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file, int convert_to_8_bit, const void *buffer, png_int_32 row_stride, const void *colormap)); /* Write the image to the given (FILE*). */ /* With both write APIs if image is in one of the linear formats with 16-bit * data then setting convert_to_8_bit will cause the output to be an 8-bit PNG * gamma encoded according to the sRGB specification, otherwise a 16-bit linear * encoded PNG file is written. * * With color-mapped data formats the colormap parameter point to a color-map * with at least image->colormap_entries encoded in the specified format. If * the format is linear the written PNG color-map will be converted to sRGB * regardless of the convert_to_8_bit flag. * * With all APIs row_stride is handled as in the read APIs - it is the spacing * from one row to the next in component sized units (1 or 2 bytes) and if * negative indicates a bottom-up row layout in the buffer. * * Note that the write API does not support interlacing or sub-8-bit pixels. */ #endif /* PNG_STDIO_SUPPORTED */ #endif /* PNG_SIMPLIFIED_WRITE_SUPPORTED */ /******************************************************************************* * END OF SIMPLIFIED API ******************************************************************************/ #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED PNG_EXPORT(242, void, png_set_check_for_invalid_index, (png_structrp png_ptr, int allowed)); # ifdef PNG_GET_PALETTE_MAX_SUPPORTED PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr, png_const_infop info_ptr)); # endif #endif /* CHECK_FOR_INVALID_INDEX */ /******************************************************************************* * IMPLEMENTATION OPTIONS ******************************************************************************* * * Support for arbitrary implementation-specific optimizations. The API allows * particular options to be turned on or off. 'Option' is the number of the * option and 'onoff' is 0 (off) or non-0 (on). The value returned is given * by the PNG_OPTION_ defines below. * * HARDWARE: normally hardware capabilites, such as the Intel SSE instructions, * are detected at run time, however sometimes it may be impossible * to do this in user mode, in which case it is necessary to discover * the capabilities in an OS specific way. Such capabilities are * listed here when libpng has support for them and must be turned * ON by the application if present. * * SOFTWARE: sometimes software optimizations actually result in performance * decrease on some architectures or systems, or with some sets of * PNG images. 'Software' options allow such optimizations to be * selected at run time. */ #ifdef PNG_SET_OPTION_SUPPORTED #ifdef PNG_ARM_NEON_API_SUPPORTED # define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */ #endif #define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */ #define PNG_OPTION_NEXT 4 /* Next option - numbers must be even */ /* Return values: NOTE: there are four values and 'off' is *not* zero */ #define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ #define PNG_OPTION_INVALID 1 /* Option number out of range */ #define PNG_OPTION_OFF 2 #define PNG_OPTION_ON 3 PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, int onoff)); #endif /******************************************************************************* * END OF HARDWARE OPTIONS ******************************************************************************/ /* Maintainer: Put new public prototypes here ^, in libpng.3, and project * defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt */ /* The last ordinal number (this is the *last* one already used; the next * one to use is one more than this.) Maintainer, remember to add an entry to * scripts/symbols.def as well. */ #ifdef PNG_EXPORT_LAST_ORDINAL PNG_EXPORT_LAST_ORDINAL(244); #endif #ifdef __cplusplus } #endif #endif /* PNG_VERSION_INFO_ONLY */ /* Do not put anything past this line */ #endif /* PNG_H */ ================================================ FILE: Libraries/Core/iOS/Headers/png/pngconf.h ================================================ /* pngconf.h - machine configurable file for libpng * * libpng version 1.6.10 - March 6, 2014 * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h * */ /* Any machine specific code is near the front of this file, so if you * are configuring libpng for a machine, you may want to read the section * starting here down to where it starts to typedef png_color, png_text, * and png_info. */ #ifndef PNGCONF_H #define PNGCONF_H /* To do: Do all of this in scripts/pnglibconf.dfa */ #ifdef PNG_SAFE_LIMITS_SUPPORTED # ifdef PNG_USER_WIDTH_MAX # undef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 1000000L # endif # ifdef PNG_USER_HEIGHT_MAX # undef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 1000000L # endif # ifdef PNG_USER_CHUNK_MALLOC_MAX # undef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 4000000L # endif # ifdef PNG_USER_CHUNK_CACHE_MAX # undef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 128 # endif #endif #ifndef PNG_BUILDING_SYMBOL_TABLE /* else includes may cause problems */ /* From libpng 1.6.0 libpng requires an ANSI X3.159-1989 ("ISOC90") compliant C * compiler for correct compilation. The following header files are required by * the standard. If your compiler doesn't provide these header files, or they * do not match the standard, you will need to provide/improve them. */ #include #include /* Library header files. These header files are all defined by ISOC90; libpng * expects conformant implementations, however, an ISOC90 conformant system need * not provide these header files if the functionality cannot be implemented. * In this case it will be necessary to disable the relevant parts of libpng in * the build of pnglibconf.h. * * Prior to 1.6.0 string.h was included here; the API changes in 1.6.0 to not * include this unnecessary header file. */ #ifdef PNG_STDIO_SUPPORTED /* Required for the definition of FILE: */ # include #endif #ifdef PNG_SETJMP_SUPPORTED /* Required for the definition of jmp_buf and the declaration of longjmp: */ # include #endif #ifdef PNG_CONVERT_tIME_SUPPORTED /* Required for struct tm: */ # include #endif #endif /* PNG_BUILDING_SYMBOL_TABLE */ /* Prior to 1.6.0 it was possible to turn off 'const' in declarations using * PNG_NO_CONST; this is no longer supported except for data declarations which * apparently still cause problems in 2011 on some compilers. */ #define PNG_CONST const /* backward compatibility only */ /* This controls optimization of the reading of 16 and 32 bit values * from PNG files. It can be set on a per-app-file basis - it * just changes whether a macro is used when the function is called. * The library builder sets the default; if read functions are not * built into the library the macro implementation is forced on. */ #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED # define PNG_USE_READ_MACROS #endif #if !defined(PNG_NO_USE_READ_MACROS) && !defined(PNG_USE_READ_MACROS) # if PNG_DEFAULT_READ_MACROS # define PNG_USE_READ_MACROS # endif #endif /* COMPILER SPECIFIC OPTIONS. * * These options are provided so that a variety of difficult compilers * can be used. Some are fixed at build time (e.g. PNG_API_RULE * below) but still have compiler specific implementations, others * may be changed on a per-file basis when compiling against libpng. */ /* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect * against legacy (pre ISOC90) compilers that did not understand function * prototypes. It is not required for modern C compilers. */ #ifndef PNGARG # define PNGARG(arglist) arglist #endif /* Function calling conventions. * ============================= * Normally it is not necessary to specify to the compiler how to call * a function - it just does it - however on x86 systems derived from * Microsoft and Borland C compilers ('IBM PC', 'DOS', 'Windows' systems * and some others) there are multiple ways to call a function and the * default can be changed on the compiler command line. For this reason * libpng specifies the calling convention of every exported function and * every function called via a user supplied function pointer. This is * done in this file by defining the following macros: * * PNGAPI Calling convention for exported functions. * PNGCBAPI Calling convention for user provided (callback) functions. * PNGCAPI Calling convention used by the ANSI-C library (required * for longjmp callbacks and sometimes used internally to * specify the calling convention for zlib). * * These macros should never be overridden. If it is necessary to * change calling convention in a private build this can be done * by setting PNG_API_RULE (which defaults to 0) to one of the values * below to select the correct 'API' variants. * * PNG_API_RULE=0 Use PNGCAPI - the 'C' calling convention - throughout. * This is correct in every known environment. * PNG_API_RULE=1 Use the operating system convention for PNGAPI and * the 'C' calling convention (from PNGCAPI) for * callbacks (PNGCBAPI). This is no longer required * in any known environment - if it has to be used * please post an explanation of the problem to the * libpng mailing list. * * These cases only differ if the operating system does not use the C * calling convention, at present this just means the above cases * (x86 DOS/Windows sytems) and, even then, this does not apply to * Cygwin running on those systems. * * Note that the value must be defined in pnglibconf.h so that what * the application uses to call the library matches the conventions * set when building the library. */ /* Symbol export * ============= * When building a shared library it is almost always necessary to tell * the compiler which symbols to export. The png.h macro 'PNG_EXPORT' * is used to mark the symbols. On some systems these symbols can be * extracted at link time and need no special processing by the compiler, * on other systems the symbols are flagged by the compiler and just * the declaration requires a special tag applied (unfortunately) in a * compiler dependent way. Some systems can do either. * * A small number of older systems also require a symbol from a DLL to * be flagged to the program that calls it. This is a problem because * we do not know in the header file included by application code that * the symbol will come from a shared library, as opposed to a statically * linked one. For this reason the application must tell us by setting * the magic flag PNG_USE_DLL to turn on the special processing before * it includes png.h. * * Four additional macros are used to make this happen: * * PNG_IMPEXP The magic (if any) to cause a symbol to be exported from * the build or imported if PNG_USE_DLL is set - compiler * and system specific. * * PNG_EXPORT_TYPE(type) A macro that pre or appends PNG_IMPEXP to * 'type', compiler specific. * * PNG_DLL_EXPORT Set to the magic to use during a libpng build to * make a symbol exported from the DLL. Not used in the * public header files; see pngpriv.h for how it is used * in the libpng build. * * PNG_DLL_IMPORT Set to the magic to force the libpng symbols to come * from a DLL - used to define PNG_IMPEXP when * PNG_USE_DLL is set. */ /* System specific discovery. * ========================== * This code is used at build time to find PNG_IMPEXP, the API settings * and PNG_EXPORT_TYPE(), it may also set a macro to indicate the DLL * import processing is possible. On Windows systems it also sets * compiler-specific macros to the values required to change the calling * conventions of the various functions. */ #if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\ defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) /* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or * MinGW on any architecture currently supported by Windows. Also includes * Watcom builds but these need special treatment because they are not * compatible with GCC or Visual C because of different calling conventions. */ # if PNG_API_RULE == 2 /* If this line results in an error, either because __watcall is not * understood or because of a redefine just below you cannot use *this* * build of the library with the compiler you are using. *This* build was * build using Watcom and applications must also be built using Watcom! */ # define PNGCAPI __watcall # endif # if defined(__GNUC__) || (defined(_MSC_VER) && (_MSC_VER >= 800)) # define PNGCAPI __cdecl # if PNG_API_RULE == 1 /* If this line results in an error __stdcall is not understood and * PNG_API_RULE should not have been set to '1'. */ # define PNGAPI __stdcall # endif # else /* An older compiler, or one not detected (erroneously) above, * if necessary override on the command line to get the correct * variants for the compiler. */ # ifndef PNGCAPI # define PNGCAPI _cdecl # endif # if PNG_API_RULE == 1 && !defined(PNGAPI) # define PNGAPI _stdcall # endif # endif /* compiler/api */ /* NOTE: PNGCBAPI always defaults to PNGCAPI. */ # if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD) # error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed" # endif # if (defined(_MSC_VER) && _MSC_VER < 800) ||\ (defined(__BORLANDC__) && __BORLANDC__ < 0x500) /* older Borland and MSC * compilers used '__export' and required this to be after * the type. */ # ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) type PNG_IMPEXP # endif # define PNG_DLL_EXPORT __export # else /* newer compiler */ # define PNG_DLL_EXPORT __declspec(dllexport) # ifndef PNG_DLL_IMPORT # define PNG_DLL_IMPORT __declspec(dllimport) # endif # endif /* compiler */ #else /* !Windows */ # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) # define PNGAPI _System # else /* !Windows/x86 && !OS/2 */ /* Use the defaults, or define PNG*API on the command line (but * this will have to be done for every compile!) */ # endif /* other system, !OS/2 */ #endif /* !Windows/x86 */ /* Now do all the defaulting . */ #ifndef PNGCAPI # define PNGCAPI #endif #ifndef PNGCBAPI # define PNGCBAPI PNGCAPI #endif #ifndef PNGAPI # define PNGAPI PNGCAPI #endif /* PNG_IMPEXP may be set on the compilation system command line or (if not set) * then in an internal header file when building the library, otherwise (when * using the library) it is set here. */ #ifndef PNG_IMPEXP # if defined(PNG_USE_DLL) && defined(PNG_DLL_IMPORT) /* This forces use of a DLL, disallowing static linking */ # define PNG_IMPEXP PNG_DLL_IMPORT # endif # ifndef PNG_IMPEXP # define PNG_IMPEXP # endif #endif /* In 1.5.2 the definition of PNG_FUNCTION has been changed to always treat * 'attributes' as a storage class - the attributes go at the start of the * function definition, and attributes are always appended regardless of the * compiler. This considerably simplifies these macros but may cause problems * if any compilers both need function attributes and fail to handle them as * a storage class (this is unlikely.) */ #ifndef PNG_FUNCTION # define PNG_FUNCTION(type, name, args, attributes) attributes type name args #endif #ifndef PNG_EXPORT_TYPE # define PNG_EXPORT_TYPE(type) PNG_IMPEXP type #endif /* The ordinal value is only relevant when preprocessing png.h for symbol * table entries, so we discard it here. See the .dfn files in the * scripts directory. */ #ifndef PNG_EXPORTA # define PNG_EXPORTA(ordinal, type, name, args, attributes)\ PNG_FUNCTION(PNG_EXPORT_TYPE(type),(PNGAPI name),PNGARG(args), \ extern attributes) #endif /* ANSI-C (C90) does not permit a macro to be invoked with an empty argument, * so make something non-empty to satisfy the requirement: */ #define PNG_EMPTY /*empty list*/ #define PNG_EXPORT(ordinal, type, name, args)\ PNG_EXPORTA(ordinal, type, name, args, PNG_EMPTY) /* Use PNG_REMOVED to comment out a removed interface. */ #ifndef PNG_REMOVED # define PNG_REMOVED(ordinal, type, name, args, attributes) #endif #ifndef PNG_CALLBACK # define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args) #endif /* Support for compiler specific function attributes. These are used * so that where compiler support is available incorrect use of API * functions in png.h will generate compiler warnings. * * Added at libpng-1.2.41. */ #ifndef PNG_NO_PEDANTIC_WARNINGS # ifndef PNG_PEDANTIC_WARNINGS_SUPPORTED # define PNG_PEDANTIC_WARNINGS_SUPPORTED # endif #endif #ifdef PNG_PEDANTIC_WARNINGS_SUPPORTED /* Support for compiler specific function attributes. These are used * so that where compiler support is available, incorrect use of API * functions in png.h will generate compiler warnings. Added at libpng * version 1.2.41. Disabling these removes the warnings but may also produce * less efficient code. */ # if defined(__clang__) /* Clang defines both __clang__ and __GNUC__. Check __clang__ first. */ # if !defined(PNG_USE_RESULT) && __has_attribute(__warn_unused_result__) # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # if !defined(PNG_NORETURN) && __has_attribute(__noreturn__) # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if !defined(PNG_ALLOCATED) && __has_attribute(__malloc__) # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # if !defined(PNG_DEPRECATED) && __has_attribute(__deprecated__) # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # if !defined(PNG_PRIVATE) # ifdef __has_extension # if __has_extension(attribute_unavailable_with_message) # define PNG_PRIVATE __attribute__((__unavailable__(\ "This function is not exported by libpng."))) # endif # endif # endif # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # elif defined(__GNUC__) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT __attribute__((__warn_unused_result__)) # endif # ifndef PNG_NORETURN # define PNG_NORETURN __attribute__((__noreturn__)) # endif # if __GNUC__ >= 3 # ifndef PNG_ALLOCATED # define PNG_ALLOCATED __attribute__((__malloc__)) # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __attribute__((__deprecated__)) # endif # ifndef PNG_PRIVATE # if 0 /* Doesn't work so we use deprecated instead*/ # define PNG_PRIVATE \ __attribute__((warning("This function is not exported by libpng."))) # else # define PNG_PRIVATE \ __attribute__((__deprecated__)) # endif # endif # if ((__GNUC__ > 3) || !defined(__GNUC_MINOR__) || (__GNUC_MINOR__ >= 1)) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif /* __GNUC__.__GNUC_MINOR__ > 3.0 */ # endif /* __GNUC__ >= 3 */ # elif defined(_MSC_VER) && (_MSC_VER >= 1300) # ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* not supported */ # endif # ifndef PNG_NORETURN # define PNG_NORETURN __declspec(noreturn) # endif # ifndef PNG_ALLOCATED # if (_MSC_VER >= 1400) # define PNG_ALLOCATED __declspec(restrict) # endif # endif # ifndef PNG_DEPRECATED # define PNG_DEPRECATED __declspec(deprecated) # endif # ifndef PNG_PRIVATE # define PNG_PRIVATE __declspec(deprecated) # endif # ifndef PNG_RESTRICT # if (_MSC_VER >= 1400) # define PNG_RESTRICT __restrict # endif # endif # elif defined(__WATCOMC__) # ifndef PNG_RESTRICT # define PNG_RESTRICT __restrict # endif # endif #endif /* PNG_PEDANTIC_WARNINGS */ #ifndef PNG_DEPRECATED # define PNG_DEPRECATED /* Use of this function is deprecated */ #endif #ifndef PNG_USE_RESULT # define PNG_USE_RESULT /* The result of this function must be checked */ #endif #ifndef PNG_NORETURN # define PNG_NORETURN /* This function does not return */ #endif #ifndef PNG_ALLOCATED # define PNG_ALLOCATED /* The result of the function is new memory */ #endif #ifndef PNG_PRIVATE # define PNG_PRIVATE /* This is a private libpng function */ #endif #ifndef PNG_RESTRICT # define PNG_RESTRICT /* The C99 "restrict" feature */ #endif #ifndef PNG_FP_EXPORT /* A floating point API. */ # ifdef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No floating point APIs */ # define PNG_FP_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_FIXED_EXPORT /* A fixed point API. */ # ifdef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ PNG_EXPORT(ordinal, type, name, args); # else /* No fixed point APIs */ # define PNG_FIXED_EXPORT(ordinal, type, name, args) # endif #endif #ifndef PNG_BUILDING_SYMBOL_TABLE /* Some typedefs to get us started. These should be safe on most of the common * platforms. * * png_uint_32 and png_int_32 may, currently, be larger than required to hold a * 32-bit value however this is not normally advisable. * * png_uint_16 and png_int_16 should always be two bytes in size - this is * verified at library build time. * * png_byte must always be one byte in size. * * The checks below use constants from limits.h, as defined by the ISOC90 * standard. */ #if CHAR_BIT == 8 && UCHAR_MAX == 255 typedef unsigned char png_byte; #else # error "libpng requires 8 bit bytes" #endif #if INT_MIN == -32768 && INT_MAX == 32767 typedef int png_int_16; #elif SHRT_MIN == -32768 && SHRT_MAX == 32767 typedef short png_int_16; #else # error "libpng requires a signed 16 bit type" #endif #if UINT_MAX == 65535 typedef unsigned int png_uint_16; #elif USHRT_MAX == 65535 typedef unsigned short png_uint_16; #else # error "libpng requires an unsigned 16 bit type" #endif #if INT_MIN < -2147483646 && INT_MAX > 2147483646 typedef int png_int_32; #elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646 typedef long int png_int_32; #else # error "libpng requires a signed 32 bit (or more) type" #endif #if UINT_MAX > 4294967294 typedef unsigned int png_uint_32; #elif ULONG_MAX > 4294967294 typedef unsigned long int png_uint_32; #else # error "libpng requires an unsigned 32 bit (or more) type" #endif /* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however, * requires an ISOC90 compiler and relies on consistent behavior of sizeof. */ typedef size_t png_size_t; typedef ptrdiff_t png_ptrdiff_t; /* libpng needs to know the maximum value of 'size_t' and this controls the * definition of png_alloc_size_t, below. This maximum value of size_t limits * but does not control the maximum allocations the library makes - there is * direct application control of this through png_set_user_limits(). */ #ifndef PNG_SMALL_SIZE_T /* Compiler specific tests for systems where size_t is known to be less than * 32 bits (some of these systems may no longer work because of the lack of * 'far' support; see above.) */ # if (defined(__TURBOC__) && !defined(__FLAT__)) ||\ (defined(_MSC_VER) && defined(MAXSEG_64K)) # define PNG_SMALL_SIZE_T # endif #endif /* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to * png_alloc_size_t are not necessary; in fact, it is recommended not to use * them at all so that the compiler can complain when something turns out to be * problematic. * * Casts in the other direction (from png_alloc_size_t to png_size_t or * png_uint_32) should be explicitly applied; however, we do not expect to * encounter practical situations that require such conversions. * * PNG_SMALL_SIZE_T must be defined if the maximum value of size_t is less than * 4294967295 - i.e. less than the maximum value of png_uint_32. */ #ifdef PNG_SMALL_SIZE_T typedef png_uint_32 png_alloc_size_t; #else typedef png_size_t png_alloc_size_t; #endif /* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler * implementations of Intel CPU specific support of user-mode segmented address * spaces, where 16-bit pointers address more than 65536 bytes of memory using * separate 'segment' registers. The implementation requires two different * types of pointer (only one of which includes the segment value.) * * If required this support is available in version 1.2 of libpng and may be * available in versions through 1.5, although the correctness of the code has * not been verified recently. */ /* Typedef for floating-point numbers that are converted to fixed-point with a * multiple of 100,000, e.g., gamma */ typedef png_int_32 png_fixed_point; /* Add typedefs for pointers */ typedef void * png_voidp; typedef const void * png_const_voidp; typedef png_byte * png_bytep; typedef const png_byte * png_const_bytep; typedef png_uint_32 * png_uint_32p; typedef const png_uint_32 * png_const_uint_32p; typedef png_int_32 * png_int_32p; typedef const png_int_32 * png_const_int_32p; typedef png_uint_16 * png_uint_16p; typedef const png_uint_16 * png_const_uint_16p; typedef png_int_16 * png_int_16p; typedef const png_int_16 * png_const_int_16p; typedef char * png_charp; typedef const char * png_const_charp; typedef png_fixed_point * png_fixed_point_p; typedef const png_fixed_point * png_const_fixed_point_p; typedef png_size_t * png_size_tp; typedef const png_size_t * png_const_size_tp; #ifdef PNG_STDIO_SUPPORTED typedef FILE * png_FILE_p; #endif #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * png_doublep; typedef const double * png_const_doublep; #endif /* Pointers to pointers; i.e. arrays */ typedef png_byte * * png_bytepp; typedef png_uint_32 * * png_uint_32pp; typedef png_int_32 * * png_int_32pp; typedef png_uint_16 * * png_uint_16pp; typedef png_int_16 * * png_int_16pp; typedef const char * * png_const_charpp; typedef char * * png_charpp; typedef png_fixed_point * * png_fixed_point_pp; #ifdef PNG_FLOATING_POINT_SUPPORTED typedef double * * png_doublepp; #endif /* Pointers to pointers to pointers; i.e., pointer to array */ typedef char * * * png_charppp; #endif /* PNG_BUILDING_SYMBOL_TABLE */ #endif /* PNGCONF_H */ ================================================ FILE: Libraries/Core/iOS/Headers/png/pngdebug.h ================================================ /* pngdebug.h - Debugging macros for libpng, also used in pngtest.c * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.8 [December 19, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* Define PNG_DEBUG at compile time for debugging information. Higher * numbers for PNG_DEBUG mean more debugging information. This has * only been added since version 0.95 so it is not implemented throughout * libpng yet, but more support will be added as needed. * * png_debug[1-2]?(level, message ,arg{0-2}) * Expands to a statement (either a simple expression or a compound * do..while(0) statement) that outputs a message with parameter * substitution if PNG_DEBUG is defined to 2 or more. If PNG_DEBUG * is undefined, 0 or 1 every png_debug expands to a simple expression * (actually ((void)0)). * * level: level of detail of message, starting at 0. A level 'n' * message is preceded by 'n' 3-space indentations (not implemented * on Microsoft compilers unless PNG_DEBUG_FILE is also * defined, to allow debug DLL compilation with no standard IO). * message: a printf(3) style text string. A trailing '\n' is added * to the message. * arg: 0 to 2 arguments for printf(3) style substitution in message. */ #ifndef PNGDEBUG_H #define PNGDEBUG_H /* These settings control the formatting of messages in png.c and pngerror.c */ /* Moved to pngdebug.h at 1.5.0 */ # ifndef PNG_LITERAL_SHARP # define PNG_LITERAL_SHARP 0x23 # endif # ifndef PNG_LITERAL_LEFT_SQUARE_BRACKET # define PNG_LITERAL_LEFT_SQUARE_BRACKET 0x5b # endif # ifndef PNG_LITERAL_RIGHT_SQUARE_BRACKET # define PNG_LITERAL_RIGHT_SQUARE_BRACKET 0x5d # endif # ifndef PNG_STRING_NEWLINE # define PNG_STRING_NEWLINE "\n" # endif #ifdef PNG_DEBUG # if (PNG_DEBUG > 0) # if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) # include # if (PNG_DEBUG > 1) # ifndef _DEBUG # define _DEBUG # endif # ifndef png_debug # define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) # endif # endif # else /* PNG_DEBUG_FILE || !_MSC_VER */ # ifndef PNG_STDIO_SUPPORTED # include /* not included yet */ # endif # ifndef PNG_DEBUG_FILE # define PNG_DEBUG_FILE stderr # endif /* PNG_DEBUG_FILE */ # if (PNG_DEBUG > 1) # ifdef __STDC__ # ifndef png_debug # define png_debug(l,m) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : "")))); \ } while (0) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1); \ } while (0) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ do { \ int num_tabs=l; \ fprintf(PNG_DEBUG_FILE,"%s" m PNG_STRING_NEWLINE,(num_tabs==1 ? " " : \ (num_tabs==2 ? " " : (num_tabs>2 ? " " : ""))),p1,p2);\ } while (0) # endif # else /* __STDC __ */ # ifndef png_debug # define png_debug(l,m) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format); \ } while (0) # endif # ifndef png_debug1 # define png_debug1(l,m,p1) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format,p1); \ } while (0) # endif # ifndef png_debug2 # define png_debug2(l,m,p1,p2) \ do { \ int num_tabs=l; \ char format[256]; \ snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ m,PNG_STRING_NEWLINE); \ fprintf(PNG_DEBUG_FILE,format,p1,p2); \ } while (0) # endif # endif /* __STDC __ */ # endif /* (PNG_DEBUG > 1) */ # endif /* _MSC_VER */ # endif /* (PNG_DEBUG > 0) */ #endif /* PNG_DEBUG */ #ifndef png_debug # define png_debug(l, m) ((void)0) #endif #ifndef png_debug1 # define png_debug1(l, m, p1) ((void)0) #endif #ifndef png_debug2 # define png_debug2(l, m, p1, p2) ((void)0) #endif #endif /* PNGDEBUG_H */ ================================================ FILE: Libraries/Core/iOS/Headers/png/pnginfo.h ================================================ /* pnginfo.h - header file for PNG reference library * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.1 [March 28, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* png_info is a structure that holds the information in a PNG file so * that the application can find out the characteristics of the image. * If you are reading the file, this structure will tell you what is * in the PNG file. If you are writing the file, fill in the information * you want to put into the PNG file, using png_set_*() functions, then * call png_write_info(). * * The names chosen should be very close to the PNG specification, so * consult that document for information about the meaning of each field. * * With libpng < 0.95, it was only possible to directly set and read the * the values in the png_info_struct, which meant that the contents and * order of the values had to remain fixed. With libpng 0.95 and later, * however, there are now functions that abstract the contents of * png_info_struct from the application, so this makes it easier to use * libpng with dynamic libraries, and even makes it possible to use * libraries that don't have all of the libpng ancillary chunk-handing * functionality. In libpng-1.5.0 this was moved into a separate private * file that is not visible to applications. * * The following members may have allocated storage attached that should be * cleaned up before the structure is discarded: palette, trans, text, * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile, * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these * are automatically freed when the info structure is deallocated, if they were * allocated internally by libpng. This behavior can be changed by means * of the png_data_freer() function. * * More allocation details: all the chunk-reading functions that * change these members go through the corresponding png_set_* * functions. A function to clear these members is available: see * png_free_data(). The png_set_* functions do not depend on being * able to point info structure members to any of the storage they are * passed (they make their own copies), EXCEPT that the png_set_text * functions use the same storage passed to them in the text_ptr or * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns * functions do not make their own copies. */ #ifndef PNGINFO_H #define PNGINFO_H struct png_info_def { /* The following are necessary for every PNG file */ png_uint_32 width; /* width of image in pixels (from IHDR) */ png_uint_32 height; /* height of image in pixels (from IHDR) */ png_uint_32 valid; /* valid chunk data (see PNG_INFO_ below) */ png_size_t rowbytes; /* bytes needed to hold an untransformed row */ png_colorp palette; /* array of color values (valid & PNG_INFO_PLTE) */ png_uint_16 num_palette; /* number of color entries in "palette" (PLTE) */ png_uint_16 num_trans; /* number of transparent palette color (tRNS) */ png_byte bit_depth; /* 1, 2, 4, 8, or 16 bits/channel (from IHDR) */ png_byte color_type; /* see PNG_COLOR_TYPE_ below (from IHDR) */ /* The following three should have been named *_method not *_type */ png_byte compression_type; /* must be PNG_COMPRESSION_TYPE_BASE (IHDR) */ png_byte filter_type; /* must be PNG_FILTER_TYPE_BASE (from IHDR) */ png_byte interlace_type; /* One of PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ /* The following are set by png_set_IHDR, called from the application on * write, but the are never actually used by the write code. */ png_byte channels; /* number of data channels per pixel (1, 2, 3, 4) */ png_byte pixel_depth; /* number of bits per pixel */ png_byte spare_byte; /* to align the data, and for future use */ #ifdef PNG_READ_SUPPORTED /* This is never set during write */ png_byte signature[8]; /* magic bytes read by libpng from start of file */ #endif /* The rest of the data is optional. If you are reading, check the * valid field to see if the information in these are valid. If you * are writing, set the valid field to those chunks you want written, * and initialize the appropriate fields below. */ #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) /* png_colorspace only contains 'flags' if neither GAMMA or COLORSPACE are * defined. When COLORSPACE is switched on all the colorspace-defining * chunks should be enabled, when GAMMA is switched on all the gamma-defining * chunks should be enabled. If this is not done it becomes possible to read * inconsistent PNG files and assign a probably incorrect interpretation to * the information. (In other words, by carefully choosing which chunks to * recognize the system configuration can select an interpretation for PNG * files containing ambiguous data and this will result in inconsistent * behavior between different libpng builds!) */ png_colorspace colorspace; #endif #ifdef PNG_iCCP_SUPPORTED /* iCCP chunk data. */ png_charp iccp_name; /* profile name */ png_bytep iccp_profile; /* International Color Consortium profile data */ png_uint_32 iccp_proflen; /* ICC profile data length */ #endif #ifdef PNG_TEXT_SUPPORTED /* The tEXt, and zTXt chunks contain human-readable textual data in * uncompressed, compressed, and optionally compressed forms, respectively. * The data in "text" is an array of pointers to uncompressed, * null-terminated C strings. Each chunk has a keyword that describes the * textual data contained in that chunk. Keywords are not required to be * unique, and the text string may be empty. Any number of text chunks may * be in an image. */ int num_text; /* number of comments read or comments to write */ int max_text; /* current size of text array */ png_textp text; /* array of comments read or comments to write */ #endif /* PNG_TEXT_SUPPORTED */ #ifdef PNG_tIME_SUPPORTED /* The tIME chunk holds the last time the displayed image data was * modified. See the png_time struct for the contents of this struct. */ png_time mod_time; #endif #ifdef PNG_sBIT_SUPPORTED /* The sBIT chunk specifies the number of significant high-order bits * in the pixel data. Values are in the range [1, bit_depth], and are * only specified for the channels in the pixel data. The contents of * the low-order bits is not specified. Data is valid if * (valid & PNG_INFO_sBIT) is non-zero. */ png_color_8 sig_bit; /* significant bits in color channels */ #endif #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_EXPAND_SUPPORTED) || \ defined(PNG_READ_BACKGROUND_SUPPORTED) /* The tRNS chunk supplies transparency data for paletted images and * other image types that don't need a full alpha channel. There are * "num_trans" transparency values for a paletted image, stored in the * same order as the palette colors, starting from index 0. Values * for the data are in the range [0, 255], ranging from fully transparent * to fully opaque, respectively. For non-paletted images, there is a * single color specified that should be treated as fully transparent. * Data is valid if (valid & PNG_INFO_tRNS) is non-zero. */ png_bytep trans_alpha; /* alpha values for paletted image */ png_color_16 trans_color; /* transparent color for non-palette image */ #endif #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) /* The bKGD chunk gives the suggested image background color if the * display program does not have its own background color and the image * is needs to composited onto a background before display. The colors * in "background" are normally in the same color space/depth as the * pixel data. Data is valid if (valid & PNG_INFO_bKGD) is non-zero. */ png_color_16 background; #endif #ifdef PNG_oFFs_SUPPORTED /* The oFFs chunk gives the offset in "offset_unit_type" units rightwards * and downwards from the top-left corner of the display, page, or other * application-specific co-ordinate space. See the PNG_OFFSET_ defines * below for the unit types. Valid if (valid & PNG_INFO_oFFs) non-zero. */ png_int_32 x_offset; /* x offset on page */ png_int_32 y_offset; /* y offset on page */ png_byte offset_unit_type; /* offset units type */ #endif #ifdef PNG_pHYs_SUPPORTED /* The pHYs chunk gives the physical pixel density of the image for * display or printing in "phys_unit_type" units (see PNG_RESOLUTION_ * defines below). Data is valid if (valid & PNG_INFO_pHYs) is non-zero. */ png_uint_32 x_pixels_per_unit; /* horizontal pixel density */ png_uint_32 y_pixels_per_unit; /* vertical pixel density */ png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */ #endif #ifdef PNG_hIST_SUPPORTED /* The hIST chunk contains the relative frequency or importance of the * various palette entries, so that a viewer can intelligently select a * reduced-color palette, if required. Data is an array of "num_palette" * values in the range [0,65535]. Data valid if (valid & PNG_INFO_hIST) * is non-zero. */ png_uint_16p hist; #endif #ifdef PNG_pCAL_SUPPORTED /* The pCAL chunk describes a transformation between the stored pixel * values and original physical data values used to create the image. * The integer range [0, 2^bit_depth - 1] maps to the floating-point * range given by [pcal_X0, pcal_X1], and are further transformed by a * (possibly non-linear) transformation function given by "pcal_type" * and "pcal_params" into "pcal_units". Please see the PNG_EQUATION_ * defines below, and the PNG-Group's PNG extensions document for a * complete description of the transformations and how they should be * implemented, and for a description of the ASCII parameter strings. * Data values are valid if (valid & PNG_INFO_pCAL) non-zero. */ png_charp pcal_purpose; /* pCAL chunk description string */ png_int_32 pcal_X0; /* minimum value */ png_int_32 pcal_X1; /* maximum value */ png_charp pcal_units; /* Latin-1 string giving physical units */ png_charpp pcal_params; /* ASCII strings containing parameter values */ png_byte pcal_type; /* equation type (see PNG_EQUATION_ below) */ png_byte pcal_nparams; /* number of parameters given in pcal_params */ #endif /* New members added in libpng-1.0.6 */ png_uint_32 free_me; /* flags items libpng is responsible for freeing */ #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED /* Storage for unknown chunks that the library doesn't recognize. */ png_unknown_chunkp unknown_chunks; /* The type of this field is limited by the type of * png_struct::user_chunk_cache_max, else overflow can occur. */ int unknown_chunks_num; #endif #ifdef PNG_sPLT_SUPPORTED /* Data on sPLT chunks (there may be more than one). */ png_sPLT_tp splt_palettes; int splt_palettes_num; /* Match type returned by png_get API */ #endif #ifdef PNG_sCAL_SUPPORTED /* The sCAL chunk describes the actual physical dimensions of the * subject matter of the graphic. The chunk contains a unit specification * a byte value, and two ASCII strings representing floating-point * values. The values are width and height corresponsing to one pixel * in the image. Data values are valid if (valid & PNG_INFO_sCAL) is * non-zero. */ png_byte scal_unit; /* unit of physical scale */ png_charp scal_s_width; /* string containing height */ png_charp scal_s_height; /* string containing width */ #endif #ifdef PNG_INFO_IMAGE_SUPPORTED /* Memory has been allocated if (valid & PNG_ALLOCATED_INFO_ROWS) non-zero */ /* Data valid if (valid & PNG_INFO_IDAT) non-zero */ png_bytepp row_pointers; /* the image bits */ #endif }; #endif /* PNGINFO_H */ ================================================ FILE: Libraries/Core/iOS/Headers/png/pnglibconf.h ================================================ /* libpng 1.6.10 STANDARD API DEFINITION */ /* pnglibconf.h - library build configuration */ /* Libpng version 1.6.10 - March 6, 2014 */ /* Copyright (c) 1998-2013 Glenn Randers-Pehrson */ /* This code is released under the libpng license. */ /* For conditions of distribution and use, see the disclaimer */ /* and license in png.h */ /* pnglibconf.h */ /* Machine generated file: DO NOT EDIT */ /* Derived from: scripts/pnglibconf.dfa */ #ifndef PNGLCONF_H #define PNGLCONF_H /* options */ #define PNG_16BIT_SUPPORTED #define PNG_ALIGNED_MEMORY_SUPPORTED /*#undef PNG_ARM_NEON_API_SUPPORTED*/ /*#undef PNG_ARM_NEON_CHECK_SUPPORTED*/ #define PNG_BENIGN_ERRORS_SUPPORTED #define PNG_BENIGN_READ_ERRORS_SUPPORTED /*#undef PNG_BENIGN_WRITE_ERRORS_SUPPORTED*/ #define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED #define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_COLORSPACE_SUPPORTED #define PNG_CONSOLE_IO_SUPPORTED #define PNG_CONVERT_tIME_SUPPORTED #define PNG_EASY_ACCESS_SUPPORTED /*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ #define PNG_ERROR_TEXT_SUPPORTED #define PNG_FIXED_POINT_SUPPORTED #define PNG_FLOATING_ARITHMETIC_SUPPORTED #define PNG_FLOATING_POINT_SUPPORTED #define PNG_FORMAT_AFIRST_SUPPORTED #define PNG_FORMAT_BGR_SUPPORTED #define PNG_GAMMA_SUPPORTED #define PNG_GET_PALETTE_MAX_SUPPORTED #define PNG_HANDLE_AS_UNKNOWN_SUPPORTED #define PNG_INCH_CONVERSIONS_SUPPORTED #define PNG_INFO_IMAGE_SUPPORTED #define PNG_IO_STATE_SUPPORTED #define PNG_MNG_FEATURES_SUPPORTED #define PNG_POINTER_INDEXING_SUPPORTED #define PNG_PROGRESSIVE_READ_SUPPORTED #define PNG_READ_16BIT_SUPPORTED #define PNG_READ_ALPHA_MODE_SUPPORTED #define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED #define PNG_READ_BACKGROUND_SUPPORTED #define PNG_READ_BGR_SUPPORTED #define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_READ_COMPOSITE_NODIV_SUPPORTED #define PNG_READ_COMPRESSED_TEXT_SUPPORTED #define PNG_READ_EXPAND_16_SUPPORTED #define PNG_READ_EXPAND_SUPPORTED #define PNG_READ_FILLER_SUPPORTED #define PNG_READ_GAMMA_SUPPORTED #define PNG_READ_GET_PALETTE_MAX_SUPPORTED #define PNG_READ_GRAY_TO_RGB_SUPPORTED #define PNG_READ_INTERLACING_SUPPORTED #define PNG_READ_INT_FUNCTIONS_SUPPORTED #define PNG_READ_INVERT_ALPHA_SUPPORTED #define PNG_READ_INVERT_SUPPORTED #define PNG_READ_OPT_PLTE_SUPPORTED #define PNG_READ_PACKSWAP_SUPPORTED #define PNG_READ_PACK_SUPPORTED #define PNG_READ_QUANTIZE_SUPPORTED #define PNG_READ_RGB_TO_GRAY_SUPPORTED #define PNG_READ_SCALE_16_TO_8_SUPPORTED #define PNG_READ_SHIFT_SUPPORTED #define PNG_READ_STRIP_16_TO_8_SUPPORTED #define PNG_READ_STRIP_ALPHA_SUPPORTED #define PNG_READ_SUPPORTED #define PNG_READ_SWAP_ALPHA_SUPPORTED #define PNG_READ_SWAP_SUPPORTED #define PNG_READ_TEXT_SUPPORTED #define PNG_READ_TRANSFORMS_SUPPORTED #define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED #define PNG_READ_USER_CHUNKS_SUPPORTED #define PNG_READ_USER_TRANSFORM_SUPPORTED #define PNG_READ_bKGD_SUPPORTED #define PNG_READ_cHRM_SUPPORTED #define PNG_READ_gAMA_SUPPORTED #define PNG_READ_hIST_SUPPORTED #define PNG_READ_iCCP_SUPPORTED #define PNG_READ_iTXt_SUPPORTED #define PNG_READ_oFFs_SUPPORTED #define PNG_READ_pCAL_SUPPORTED #define PNG_READ_pHYs_SUPPORTED #define PNG_READ_sBIT_SUPPORTED #define PNG_READ_sCAL_SUPPORTED #define PNG_READ_sPLT_SUPPORTED #define PNG_READ_sRGB_SUPPORTED #define PNG_READ_tEXt_SUPPORTED #define PNG_READ_tIME_SUPPORTED #define PNG_READ_tRNS_SUPPORTED #define PNG_READ_zTXt_SUPPORTED /*#undef PNG_SAFE_LIMITS_SUPPORTED*/ #define PNG_SAVE_INT_32_SUPPORTED #define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SEQUENTIAL_READ_SUPPORTED #define PNG_SETJMP_SUPPORTED #define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED #define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED #define PNG_SET_OPTION_SUPPORTED #define PNG_SET_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SET_USER_LIMITS_SUPPORTED #define PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED #define PNG_SIMPLIFIED_READ_BGR_SUPPORTED #define PNG_SIMPLIFIED_READ_SUPPORTED #define PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED #define PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED #define PNG_SIMPLIFIED_WRITE_SUPPORTED #define PNG_STDIO_SUPPORTED #define PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_TEXT_SUPPORTED #define PNG_TIME_RFC1123_SUPPORTED #define PNG_UNKNOWN_CHUNKS_SUPPORTED #define PNG_USER_CHUNKS_SUPPORTED #define PNG_USER_LIMITS_SUPPORTED #define PNG_USER_MEM_SUPPORTED #define PNG_USER_TRANSFORM_INFO_SUPPORTED #define PNG_USER_TRANSFORM_PTR_SUPPORTED #define PNG_WARNINGS_SUPPORTED #define PNG_WRITE_16BIT_SUPPORTED #define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED #define PNG_WRITE_BGR_SUPPORTED #define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED #define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED #define PNG_WRITE_FILLER_SUPPORTED #define PNG_WRITE_FILTER_SUPPORTED #define PNG_WRITE_FLUSH_SUPPORTED #define PNG_WRITE_GET_PALETTE_MAX_SUPPORTED #define PNG_WRITE_INTERLACING_SUPPORTED #define PNG_WRITE_INT_FUNCTIONS_SUPPORTED #define PNG_WRITE_INVERT_ALPHA_SUPPORTED #define PNG_WRITE_INVERT_SUPPORTED #define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED #define PNG_WRITE_PACKSWAP_SUPPORTED #define PNG_WRITE_PACK_SUPPORTED #define PNG_WRITE_SHIFT_SUPPORTED #define PNG_WRITE_SUPPORTED #define PNG_WRITE_SWAP_ALPHA_SUPPORTED #define PNG_WRITE_SWAP_SUPPORTED #define PNG_WRITE_TEXT_SUPPORTED #define PNG_WRITE_TRANSFORMS_SUPPORTED #define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_WRITE_USER_TRANSFORM_SUPPORTED #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED #define PNG_WRITE_bKGD_SUPPORTED #define PNG_WRITE_cHRM_SUPPORTED #define PNG_WRITE_gAMA_SUPPORTED #define PNG_WRITE_hIST_SUPPORTED #define PNG_WRITE_iCCP_SUPPORTED #define PNG_WRITE_iTXt_SUPPORTED #define PNG_WRITE_oFFs_SUPPORTED #define PNG_WRITE_pCAL_SUPPORTED #define PNG_WRITE_pHYs_SUPPORTED #define PNG_WRITE_sBIT_SUPPORTED #define PNG_WRITE_sCAL_SUPPORTED #define PNG_WRITE_sPLT_SUPPORTED #define PNG_WRITE_sRGB_SUPPORTED #define PNG_WRITE_tEXt_SUPPORTED #define PNG_WRITE_tIME_SUPPORTED #define PNG_WRITE_tRNS_SUPPORTED #define PNG_WRITE_zTXt_SUPPORTED #define PNG_bKGD_SUPPORTED #define PNG_cHRM_SUPPORTED #define PNG_gAMA_SUPPORTED #define PNG_hIST_SUPPORTED #define PNG_iCCP_SUPPORTED #define PNG_iTXt_SUPPORTED #define PNG_oFFs_SUPPORTED #define PNG_pCAL_SUPPORTED #define PNG_pHYs_SUPPORTED #define PNG_sBIT_SUPPORTED #define PNG_sCAL_SUPPORTED #define PNG_sPLT_SUPPORTED #define PNG_sRGB_SUPPORTED #define PNG_tEXt_SUPPORTED #define PNG_tIME_SUPPORTED #define PNG_tRNS_SUPPORTED #define PNG_zTXt_SUPPORTED /* end of options */ /* settings */ #define PNG_API_RULE 0 #define PNG_CALLOC_SUPPORTED #define PNG_COST_SHIFT 3 #define PNG_DEFAULT_READ_MACROS 1 #define PNG_GAMMA_THRESHOLD_FIXED 5000 #define PNG_IDAT_READ_SIZE PNG_ZBUF_SIZE #define PNG_INFLATE_BUF_SIZE 1024 #define PNG_MAX_GAMMA_8 11 #define PNG_QUANTIZE_BLUE_BITS 5 #define PNG_QUANTIZE_GREEN_BITS 5 #define PNG_QUANTIZE_RED_BITS 5 #define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1) #define PNG_TEXT_Z_DEFAULT_STRATEGY 0 #define PNG_WEIGHT_SHIFT 8 #define PNG_ZBUF_SIZE 8192 #define PNG_ZLIB_VERNUM 0 /* unknown */ #define PNG_Z_DEFAULT_COMPRESSION (-1) #define PNG_Z_DEFAULT_NOFILTER_STRATEGY 0 #define PNG_Z_DEFAULT_STRATEGY 1 #define PNG_sCAL_PRECISION 5 #define PNG_sRGB_PROFILE_CHECKS 2 /* end of settings */ #endif /* PNGLCONF_H */ ================================================ FILE: Libraries/Core/iOS/Headers/png/pngpriv.h ================================================ /* pngpriv.h - private declarations for use inside libpng * * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2014 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.10 [March 6, 2014] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* The symbols declared in this file (including the functions declared * as extern) are PRIVATE. They are not part of the libpng public * interface, and are not recommended for use by regular applications. * Some of them may become public in the future; others may stay private, * change in an incompatible way, or even disappear. * Although the libpng users are not forbidden to include this header, * they should be well aware of the issues that may arise from doing so. */ #ifndef PNGPRIV_H #define PNGPRIV_H /* Feature Test Macros. The following are defined here to ensure that correctly * implemented libraries reveal the APIs libpng needs to build and hide those * that are not needed and potentially damaging to the compilation. * * Feature Test Macros must be defined before any system header is included (see * POSIX 1003.1 2.8.2 "POSIX Symbols." * * These macros only have an effect if the operating system supports either * POSIX 1003.1 or C99, or both. On other operating systems (particularly * Windows/Visual Studio) there is no effect; the OS specific tests below are * still required (as of 2011-05-02.) */ #define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */ #ifndef PNG_VERSION_INFO_ONLY /* Standard library headers not required by png.h: */ # include # include #endif #define PNGLIB_BUILD /*libpng is being built, not used*/ /* If HAVE_CONFIG_H is defined during the build then the build system must * provide an appropriate "config.h" file on the include path. The header file * must provide definitions as required below (search for "HAVE_CONFIG_H"); * see configure.ac for more details of the requirements. The macro * "PNG_NO_CONFIG_H" is provided for maintainers to test for dependencies on * 'configure'; define this macro to prevent the configure build including the * configure generated config.h. Libpng is expected to compile without *any* * special build system support on a reasonably ANSI-C compliant system. */ #if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) # include /* Pick up the definition of 'restrict' from config.h if it was read: */ # define PNG_RESTRICT restrict #endif /* To support symbol prefixing it is necessary to know *before* including png.h * whether the fixed point (and maybe other) APIs are exported, because if they * are not internal definitions may be required. This is handled below just * before png.h is included, but load the configuration now if it is available. */ #ifndef PNGLCONF_H # include "pnglibconf.h" #endif /* Local renames may change non-exported API functions from png.h */ #if defined(PNG_PREFIX) && !defined(PNGPREFIX_H) # include "pngprefix.h" #endif #ifdef PNG_USER_CONFIG # include "pngusr.h" /* These should have been defined in pngusr.h */ # ifndef PNG_USER_PRIVATEBUILD # define PNG_USER_PRIVATEBUILD "Custom libpng build" # endif # ifndef PNG_USER_DLLFNAME_POSTFIX # define PNG_USER_DLLFNAME_POSTFIX "Cb" # endif #endif /* Compile time options. * ===================== * In a multi-arch build the compiler may compile the code several times for the * same object module, producing different binaries for different architectures. * When this happens configure-time setting of the target host options cannot be * done and this interferes with the handling of the ARM NEON optimizations, and * possibly other similar optimizations. Put additional tests here; in general * this is needed when the same option can be changed at both compile time and * run time depending on the target OS (i.e. iOS vs Android.) * * NOTE: symbol prefixing does not pass $(CFLAGS) to the preprocessor, because * this is not possible with certain compilers (Oracle SUN OS CC), as a result * it is necessary to ensure that all extern functions that *might* be used * regardless of $(CFLAGS) get declared in this file. The test on __ARM_NEON__ * below is one example of this behavior because it is controlled by the * presence or not of -mfpu=neon on the GCC command line, it is possible to do * this in $(CC), e.g. "CC=gcc -mfpu=neon", but people who build libpng rarely * do this. */ #ifndef PNG_ARM_NEON_OPT /* ARM NEON optimizations are being controlled by the compiler settings, * typically the target FPU. If the FPU has been set to NEON (-mfpu=neon * with GCC) then the compiler will define __ARM_NEON__ and we can rely * unconditionally on NEON instructions not crashing, otherwise we must * disable use of NEON instructions. * * NOTE: at present these optimizations depend on 'ALIGNED_MEMORY', so they * can only be turned on automatically if that is supported too. If * PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail * to compile with an appropriate #error if ALIGNED_MEMORY has been turned * off. */ # if defined(__ARM_NEON__) && defined(PNG_ALIGNED_MEMORY_SUPPORTED) # define PNG_ARM_NEON_OPT 2 # else # define PNG_ARM_NEON_OPT 0 # endif #endif #if PNG_ARM_NEON_OPT > 0 /* NEON optimizations are to be at least considered by libpng, so enable the * callbacks to do this. */ # define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon /* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used * if possible - if __ARM_NEON__ is set and the compiler version is not known * to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can * be: * * 1 The intrinsics code (the default with __ARM_NEON__) * 2 The hand coded assembler (the default without __ARM_NEON__) * * It is possible to set PNG_ARM_NEON_IMPLEMENTATION in CPPFLAGS, however * this is *NOT* supported and may cease to work even after a minor revision * to libpng. It *is* valid to do this for testing purposes, e.g. speed * testing or a new compiler, but the results should be communicated to the * libpng implementation list for incorporation in the next minor release. */ # ifndef PNG_ARM_NEON_IMPLEMENTATION # ifdef __ARM_NEON__ # if defined(__clang__) /* At present it is unknown by the libpng developers which versions * of clang support the intrinsics, however some or perhaps all * versions do not work with the assembler so this may be * irrelevant, so just use the default (do nothing here.) */ # elif defined(__GNUC__) /* GCC 4.5.4 NEON support is known to be broken. 4.6.3 is known to * work, so if this *is* GCC, or G++, look for a version >4.5 */ # if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) # define PNG_ARM_NEON_IMPLEMENTATION 2 # endif /* no GNUC support */ # endif /* __GNUC__ */ # else /* !defined __ARM_NEON__ */ /* The 'intrinsics' code simply won't compile without this -mfpu=neon: */ # define PNG_ARM_NEON_IMPLEMENTATION 2 # endif /* __ARM_NEON__ */ # endif /* !defined PNG_ARM_NEON_IMPLEMENTATION */ # ifndef PNG_ARM_NEON_IMPLEMENTATION /* Use the intrinsics code by default. */ # define PNG_ARM_NEON_IMPLEMENTATION 1 # endif #endif /* PNG_ARM_NEON_OPT > 0 */ /* Is this a build of a DLL where compilation of the object modules requires * different preprocessor settings to those required for a simple library? If * so PNG_BUILD_DLL must be set. * * If libpng is used inside a DLL but that DLL does not export the libpng APIs * PNG_BUILD_DLL must not be set. To avoid the code below kicking in build a * static library of libpng then link the DLL against that. */ #ifndef PNG_BUILD_DLL # ifdef DLL_EXPORT /* This is set by libtool when files are compiled for a DLL; libtool * always compiles twice, even on systems where it isn't necessary. Set * PNG_BUILD_DLL in case it is necessary: */ # define PNG_BUILD_DLL # else # ifdef _WINDLL /* This is set by the Microsoft Visual Studio IDE in projects that * build a DLL. It can't easily be removed from those projects (it * isn't visible in the Visual Studio UI) so it is a fairly reliable * indication that PNG_IMPEXP needs to be set to the DLL export * attributes. */ # define PNG_BUILD_DLL # else # ifdef __DLL__ /* This is set by the Borland C system when compiling for a DLL * (as above.) */ # define PNG_BUILD_DLL # else /* Add additional compiler cases here. */ # endif # endif # endif #endif /* Setting PNG_BUILD_DLL if required */ /* See pngconf.h for more details: the builder of the library may set this on * the command line to the right thing for the specific compilation system or it * may be automagically set above (at present we know of no system where it does * need to be set on the command line.) * * PNG_IMPEXP must be set here when building the library to prevent pngconf.h * setting it to the "import" setting for a DLL build. */ #ifndef PNG_IMPEXP # ifdef PNG_BUILD_DLL # define PNG_IMPEXP PNG_DLL_EXPORT # else /* Not building a DLL, or the DLL doesn't require specific export * definitions. */ # define PNG_IMPEXP # endif #endif /* No warnings for private or deprecated functions in the build: */ #ifndef PNG_DEPRECATED # define PNG_DEPRECATED #endif #ifndef PNG_PRIVATE # define PNG_PRIVATE #endif /* Symbol preprocessing support. * * To enable listing global, but internal, symbols the following macros should * always be used to declare an extern data or function object in this file. */ #ifndef PNG_INTERNAL_DATA # define PNG_INTERNAL_DATA(type, name, array) extern type name array #endif #ifndef PNG_INTERNAL_FUNCTION # define PNG_INTERNAL_FUNCTION(type, name, args, attributes)\ extern PNG_FUNCTION(type, name, args, PNG_EMPTY attributes) #endif #ifndef PNG_INTERNAL_CALLBACK # define PNG_INTERNAL_CALLBACK(type, name, args, attributes)\ extern PNG_FUNCTION(type, (PNGCBAPI name), args, PNG_EMPTY attributes) #endif /* If floating or fixed point APIs are disabled they may still be compiled * internally. To handle this make sure they are declared as the appropriate * internal extern function (otherwise the symbol prefixing stuff won't work and * the functions will be used without definitions.) * * NOTE: although all the API functions are declared here they are not all * actually built! Because the declarations are still made it is necessary to * fake out types that they depend on. */ #ifndef PNG_FP_EXPORT # ifndef PNG_FLOATING_POINT_SUPPORTED # define PNG_FP_EXPORT(ordinal, type, name, args)\ PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); # ifndef PNG_VERSION_INFO_ONLY typedef struct png_incomplete png_double; typedef png_double* png_doublep; typedef const png_double* png_const_doublep; typedef png_double** png_doublepp; # endif # endif #endif #ifndef PNG_FIXED_EXPORT # ifndef PNG_FIXED_POINT_SUPPORTED # define PNG_FIXED_EXPORT(ordinal, type, name, args)\ PNG_INTERNAL_FUNCTION(type, name, args, PNG_EMPTY); # endif #endif #include "png.h" /* pngconf.h does not set PNG_DLL_EXPORT unless it is required, so: */ #ifndef PNG_DLL_EXPORT # define PNG_DLL_EXPORT #endif /* SECURITY and SAFETY: * * By default libpng is built without any internal limits on image size, * individual heap (png_malloc) allocations or the total amount of memory used. * If PNG_SAFE_LIMITS_SUPPORTED is defined, however, the limits below are used * (unless individually overridden). These limits are believed to be fairly * safe, but builders of secure systems should verify the values against the * real system capabilities. */ #ifdef PNG_SAFE_LIMITS_SUPPORTED /* 'safe' limits */ # ifndef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 1000000 # endif # ifndef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 1000000 # endif # ifndef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 128 # endif # ifndef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 8000000 # endif #else /* values for no limits */ # ifndef PNG_USER_WIDTH_MAX # define PNG_USER_WIDTH_MAX 0x7fffffff # endif # ifndef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 0x7fffffff # endif # ifndef PNG_USER_CHUNK_CACHE_MAX # define PNG_USER_CHUNK_CACHE_MAX 0 # endif # ifndef PNG_USER_CHUNK_MALLOC_MAX # define PNG_USER_CHUNK_MALLOC_MAX 0 # endif #endif /* Moved to pngpriv.h at libpng-1.5.0 */ /* NOTE: some of these may have been used in external applications as * these definitions were exposed in pngconf.h prior to 1.5. */ /* If you are running on a machine where you cannot allocate more * than 64K of memory at once, uncomment this. While libpng will not * normally need that much memory in a chunk (unless you load up a very * large file), zlib needs to know how big of a chunk it can use, and * libpng thus makes sure to check any memory allocation to verify it * will fit into memory. * * zlib provides 'MAXSEG_64K' which, if defined, indicates the * same limit and pngconf.h (already included) sets the limit * if certain operating systems are detected. */ #if defined(MAXSEG_64K) && !defined(PNG_MAX_MALLOC_64K) # define PNG_MAX_MALLOC_64K #endif #ifndef PNG_UNUSED /* Unused formal parameter warnings are silenced using the following macro * which is expected to have no bad effects on performance (optimizing * compilers will probably remove it entirely). Note that if you replace * it with something other than whitespace, you must include the terminating * semicolon. */ # define PNG_UNUSED(param) (void)param; #endif /* Just a little check that someone hasn't tried to define something * contradictory. */ #if (PNG_ZBUF_SIZE > 65536L) && defined(PNG_MAX_MALLOC_64K) # undef PNG_ZBUF_SIZE # define PNG_ZBUF_SIZE 65536L #endif /* If warnings or errors are turned off the code is disabled or redirected here. * From 1.5.4 functions have been added to allow very limited formatting of * error and warning messages - this code will also be disabled here. */ #ifdef PNG_WARNINGS_SUPPORTED # define PNG_WARNING_PARAMETERS(p) png_warning_parameters p; #else # define png_warning_parameter(p,number,string) ((void)0) # define png_warning_parameter_unsigned(p,number,format,value) ((void)0) # define png_warning_parameter_signed(p,number,format,value) ((void)0) # define png_formatted_warning(pp,p,message) ((void)(pp)) # define PNG_WARNING_PARAMETERS(p) #endif #ifndef PNG_ERROR_TEXT_SUPPORTED # define png_fixed_error(s1,s2) png_err(s1) #endif /* C allows up-casts from (void*) to any pointer and (const void*) to any * pointer to a const object. C++ regards this as a type error and requires an * explicit, static, cast and provides the static_cast<> rune to ensure that * const is not cast away. */ #ifdef __cplusplus # define png_voidcast(type, value) static_cast(value) # define png_constcast(type, value) const_cast(value) # define png_aligncast(type, value) \ static_cast(static_cast(value)) # define png_aligncastconst(type, value) \ static_cast(static_cast(value)) #else # define png_voidcast(type, value) (value) # define png_constcast(type, value) ((type)(value)) # define png_aligncast(type, value) ((void*)(value)) # define png_aligncastconst(type, value) ((const void*)(value)) #endif /* __cplusplus */ /* Some fixed point APIs are still required even if not exported because * they get used by the corresponding floating point APIs. This magic * deals with this: */ #ifdef PNG_FIXED_POINT_SUPPORTED # define PNGFAPI PNGAPI #else # define PNGFAPI /* PRIVATE */ #endif #ifndef PNG_VERSION_INFO_ONLY /* Other defines specific to compilers can go here. Try to keep * them inside an appropriate ifdef/endif pair for portability. */ #if defined(PNG_FLOATING_POINT_SUPPORTED) ||\ defined(PNG_FLOATING_ARITHMETIC_SUPPORTED) /* png.c requires the following ANSI-C constants if the conversion of * floating point to ASCII is implemented therein: * * DBL_DIG Maximum number of decimal digits (can be set to any constant) * DBL_MIN Smallest normalized fp number (can be set to an arbitrary value) * DBL_MAX Maximum floating point number (can be set to an arbitrary value) */ # include # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \ defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC) /* We need to check that hasn't already been included earlier * as it seems it doesn't agree with , yet we should really use * if possible. */ # if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__) # include # endif # else # include # endif # if defined(_AMIGA) && defined(__SASC) && defined(_M68881) /* Amiga SAS/C: We must include builtin FPU functions when compiling using * MATH=68881 */ # include # endif #endif /* This provides the non-ANSI (far) memory allocation routines. */ #if defined(__TURBOC__) && defined(__MSDOS__) # include # include #endif #if defined(WIN32) || defined(_Windows) || defined(_WINDOWS) || \ defined(_WIN32) || defined(__WIN32__) # include /* defines _WINDOWS_ macro */ #endif #endif /* PNG_VERSION_INFO_ONLY */ /* Moved here around 1.5.0beta36 from pngconf.h */ /* Users may want to use these so they are not private. Any library * functions that are passed far data must be model-independent. */ /* Memory model/platform independent fns */ #ifndef PNG_ABORT # ifdef _WINDOWS_ # define PNG_ABORT() ExitProcess(0) # else # define PNG_ABORT() abort() # endif #endif /* These macros may need to be architecture dependent. */ #define PNG_ALIGN_NONE 0 /* do not use data alignment */ #define PNG_ALIGN_ALWAYS 1 /* assume unaligned accesses are OK */ #ifdef offsetof # define PNG_ALIGN_OFFSET 2 /* use offsetof to determine alignment */ #else # define PNG_ALIGN_OFFSET -1 /* prevent the use of this */ #endif #define PNG_ALIGN_SIZE 3 /* use sizeof to determine alignment */ #ifndef PNG_ALIGN_TYPE /* Default to using aligned access optimizations and requiring alignment to a * multiple of the data type size. Override in a compiler specific fashion * if necessary by inserting tests here: */ # define PNG_ALIGN_TYPE PNG_ALIGN_SIZE #endif #if PNG_ALIGN_TYPE == PNG_ALIGN_SIZE /* This is used because in some compiler implementations non-aligned * structure members are supported, so the offsetof approach below fails. * Set PNG_ALIGN_SIZE=0 for compiler combinations where unaligned access * is good for performance. Do not do this unless you have tested the result * and understand it. */ # define png_alignof(type) (sizeof (type)) #else # if PNG_ALIGN_TYPE == PNG_ALIGN_OFFSET # define png_alignof(type) offsetof(struct{char c; type t;}, t) # else # if PNG_ALIGN_TYPE == PNG_ALIGN_ALWAYS # define png_alignof(type) (1) # endif /* Else leave png_alignof undefined to prevent use thereof */ # endif #endif /* This implicitly assumes alignment is always to a power of 2. */ #ifdef png_alignof # define png_isaligned(ptr, type)\ ((((const char*)ptr-(const char*)0) & (png_alignof(type)-1)) == 0) #else # define png_isaligned(ptr, type) 0 #endif /* End of memory model/platform independent support */ /* End of 1.5.0beta36 move from pngconf.h */ /* CONSTANTS and UTILITY MACROS * These are used internally by libpng and not exposed in the API */ /* Various modes of operation. Note that after an init, mode is set to * zero automatically when the structure is created. Three of these * are defined in png.h because they need to be visible to applications * that call png_set_unknown_chunk(). */ /* #define PNG_HAVE_IHDR 0x01 (defined in png.h) */ /* #define PNG_HAVE_PLTE 0x02 (defined in png.h) */ #define PNG_HAVE_IDAT 0x04 /* #define PNG_AFTER_IDAT 0x08 (defined in png.h) */ #define PNG_HAVE_IEND 0x10 /* 0x20 (unused) */ /* 0x40 (unused) */ /* 0x80 (unused) */ #define PNG_HAVE_CHUNK_HEADER 0x100 #define PNG_WROTE_tIME 0x200 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400 #define PNG_BACKGROUND_IS_GRAY 0x800 #define PNG_HAVE_PNG_SIGNATURE 0x1000 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ /* 0x4000 (unused) */ #define PNG_IS_READ_STRUCT 0x8000 /* Else is a write struct */ /* Flags for the transformations the PNG library does on the image data */ #define PNG_BGR 0x0001 #define PNG_INTERLACE 0x0002 #define PNG_PACK 0x0004 #define PNG_SHIFT 0x0008 #define PNG_SWAP_BYTES 0x0010 #define PNG_INVERT_MONO 0x0020 #define PNG_QUANTIZE 0x0040 #define PNG_COMPOSE 0x0080 /* Was PNG_BACKGROUND */ #define PNG_BACKGROUND_EXPAND 0x0100 #define PNG_EXPAND_16 0x0200 /* Added to libpng 1.5.2 */ #define PNG_16_TO_8 0x0400 /* Becomes 'chop' in 1.5.4 */ #define PNG_RGBA 0x0800 #define PNG_EXPAND 0x1000 #define PNG_GAMMA 0x2000 #define PNG_GRAY_TO_RGB 0x4000 #define PNG_FILLER 0x8000 #define PNG_PACKSWAP 0x10000 #define PNG_SWAP_ALPHA 0x20000 #define PNG_STRIP_ALPHA 0x40000 #define PNG_INVERT_ALPHA 0x80000 #define PNG_USER_TRANSFORM 0x100000 #define PNG_RGB_TO_GRAY_ERR 0x200000 #define PNG_RGB_TO_GRAY_WARN 0x400000 #define PNG_RGB_TO_GRAY 0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */ #define PNG_ENCODE_ALPHA 0x800000 /* Added to libpng-1.5.4 */ #define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */ #define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */ #define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */ /* 0x8000000 unused */ /* 0x10000000 unused */ /* 0x20000000 unused */ /* 0x40000000 unused */ /* Flags for png_create_struct */ #define PNG_STRUCT_PNG 0x0001 #define PNG_STRUCT_INFO 0x0002 /* Scaling factor for filter heuristic weighting calculations */ #define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) #define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) /* Flags for the png_ptr->flags rather than declaring a byte for each one */ #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 #define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002 /* Added to libpng-1.6.0 */ /* 0x0004 unused */ #define PNG_FLAG_ZSTREAM_ENDED 0x0008 /* Added to libpng-1.6.0 */ /* 0x0010 unused */ /* 0x0020 unused */ #define PNG_FLAG_ROW_INIT 0x0040 #define PNG_FLAG_FILLER_AFTER 0x0080 #define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 #define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 #define PNG_FLAG_CRC_CRITICAL_USE 0x0400 #define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 #define PNG_FLAG_ASSUME_sRGB 0x1000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_OPTIMIZE_ALPHA 0x2000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_DETECT_UNINITIALIZED 0x4000 /* Added to libpng-1.5.4 */ /* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000 */ /* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000 */ #define PNG_FLAG_LIBRARY_MISMATCH 0x20000 #define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000 #define PNG_FLAG_STRIP_ERROR_TEXT 0x80000 #define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000 /* Added to libpng-1.4.0 */ #define PNG_FLAG_APP_WARNINGS_WARN 0x200000 /* Added to libpng-1.6.0 */ #define PNG_FLAG_APP_ERRORS_WARN 0x400000 /* Added to libpng-1.6.0 */ /* 0x800000 unused */ /* 0x1000000 unused */ /* 0x2000000 unused */ /* 0x4000000 unused */ /* 0x8000000 unused */ /* 0x10000000 unused */ /* 0x20000000 unused */ /* 0x40000000 unused */ #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ PNG_FLAG_CRC_ANCILLARY_NOWARN) #define PNG_FLAG_CRC_CRITICAL_MASK (PNG_FLAG_CRC_CRITICAL_USE | \ PNG_FLAG_CRC_CRITICAL_IGNORE) #define PNG_FLAG_CRC_MASK (PNG_FLAG_CRC_ANCILLARY_MASK | \ PNG_FLAG_CRC_CRITICAL_MASK) /* Save typing and make code easier to understand */ #define PNG_COLOR_DIST(c1, c2) (abs((int)((c1).red) - (int)((c2).red)) + \ abs((int)((c1).green) - (int)((c2).green)) + \ abs((int)((c1).blue) - (int)((c2).blue))) /* Added to libpng-1.6.0: scale a 16-bit value in the range 0..65535 to 0..255 * by dividing by 257 *with rounding*. This macro is exact for the given range. * See the discourse in pngrtran.c png_do_scale_16_to_8. The values in the * macro were established by experiment (modifying the added value). The macro * has a second variant that takes a value already scaled by 255 and divides by * 65535 - this has a maximum error of .502. Over the range 0..65535*65535 it * only gives off-by-one errors and only for 0.5% (1 in 200) of the values. */ #define PNG_DIV65535(v24) (((v24) + 32895) >> 16) #define PNG_DIV257(v16) PNG_DIV65535((png_uint_32)(v16) * 255) /* Added to libpng-1.2.6 JB */ #define PNG_ROWBYTES(pixel_bits, width) \ ((pixel_bits) >= 8 ? \ ((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \ (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) ) /* PNG_OUT_OF_RANGE returns true if value is outside the range * ideal-delta..ideal+delta. Each argument is evaluated twice. * "ideal" and "delta" should be constants, normally simple * integers, "value" a variable. Added to libpng-1.2.6 JB */ #define PNG_OUT_OF_RANGE(value, ideal, delta) \ ( (value) < (ideal)-(delta) || (value) > (ideal)+(delta) ) /* Conversions between fixed and floating point, only defined if * required (to make sure the code doesn't accidentally use float * when it is supposedly disabled.) */ #ifdef PNG_FLOATING_POINT_SUPPORTED /* The floating point conversion can't overflow, though it can and * does lose accuracy relative to the original fixed point value. * In practice this doesn't matter because png_fixed_point only * stores numbers with very low precision. The png_ptr and s * arguments are unused by default but are there in case error * checking becomes a requirement. */ #define png_float(png_ptr, fixed, s) (.00001 * (fixed)) /* The fixed point conversion performs range checking and evaluates * its argument multiple times, so must be used with care. The * range checking uses the PNG specification values for a signed * 32 bit fixed point value except that the values are deliberately * rounded-to-zero to an integral value - 21474 (21474.83 is roughly * (2^31-1) * 100000). 's' is a string that describes the value being * converted. * * NOTE: this macro will raise a png_error if the range check fails, * therefore it is normally only appropriate to use this on values * that come from API calls or other sources where an out of range * error indicates a programming error, not a data error! * * NOTE: by default this is off - the macro is not used - because the * function call saves a lot of code. */ #ifdef PNG_FIXED_POINT_MACRO_SUPPORTED #define png_fixed(png_ptr, fp, s) ((fp) <= 21474 && (fp) >= -21474 ?\ ((png_fixed_point)(100000 * (fp))) : (png_fixed_error(png_ptr, s),0)) #endif /* else the corresponding function is defined below, inside the scope of the * cplusplus test. */ #endif /* Constants for known chunk types. If you need to add a chunk, define the name * here. For historical reasons these constants have the form png_; i.e. * the prefix is lower case. Please use decimal values as the parameters to * match the ISO PNG specification and to avoid relying on the C locale * interpretation of character values. * * Prior to 1.5.6 these constants were strings, as of 1.5.6 png_uint_32 values * are computed and a new macro (PNG_STRING_FROM_CHUNK) added to allow a string * to be generated if required. * * PNG_32b correctly produces a value shifted by up to 24 bits, even on * architectures where (int) is only 16 bits. */ #define PNG_32b(b,s) ((png_uint_32)(b) << (s)) #define PNG_U32(b1,b2,b3,b4) \ (PNG_32b(b1,24) | PNG_32b(b2,16) | PNG_32b(b3,8) | PNG_32b(b4,0)) /* Constants for known chunk types. * * MAINTAINERS: If you need to add a chunk, define the name here. * For historical reasons these constants have the form png_; i.e. * the prefix is lower case. Please use decimal values as the parameters to * match the ISO PNG specification and to avoid relying on the C locale * interpretation of character values. Please keep the list sorted. * * Notice that PNG_U32 is used to define a 32-bit value for the 4 byte chunk * type. In fact the specification does not express chunk types this way, * however using a 32-bit value means that the chunk type can be read from the * stream using exactly the same code as used for a 32-bit unsigned value and * can be examined far more efficiently (using one arithmetic compare). * * Prior to 1.5.6 the chunk type constants were expressed as C strings. The * libpng API still uses strings for 'unknown' chunks and a macro, * PNG_STRING_FROM_CHUNK, allows a string to be generated if required. Notice * that for portable code numeric values must still be used; the string "IHDR" * is not portable and neither is PNG_U32('I', 'H', 'D', 'R'). * * In 1.7.0 the definitions will be made public in png.h to avoid having to * duplicate the same definitions in application code. */ #define png_IDAT PNG_U32( 73, 68, 65, 84) #define png_IEND PNG_U32( 73, 69, 78, 68) #define png_IHDR PNG_U32( 73, 72, 68, 82) #define png_PLTE PNG_U32( 80, 76, 84, 69) #define png_bKGD PNG_U32( 98, 75, 71, 68) #define png_cHRM PNG_U32( 99, 72, 82, 77) #define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */ #define png_gAMA PNG_U32(103, 65, 77, 65) #define png_gIFg PNG_U32(103, 73, 70, 103) #define png_gIFt PNG_U32(103, 73, 70, 116) /* deprecated */ #define png_gIFx PNG_U32(103, 73, 70, 120) #define png_hIST PNG_U32(104, 73, 83, 84) #define png_iCCP PNG_U32(105, 67, 67, 80) #define png_iTXt PNG_U32(105, 84, 88, 116) #define png_oFFs PNG_U32(111, 70, 70, 115) #define png_pCAL PNG_U32(112, 67, 65, 76) #define png_pHYs PNG_U32(112, 72, 89, 115) #define png_sBIT PNG_U32(115, 66, 73, 84) #define png_sCAL PNG_U32(115, 67, 65, 76) #define png_sPLT PNG_U32(115, 80, 76, 84) #define png_sRGB PNG_U32(115, 82, 71, 66) #define png_sTER PNG_U32(115, 84, 69, 82) #define png_tEXt PNG_U32(116, 69, 88, 116) #define png_tIME PNG_U32(116, 73, 77, 69) #define png_tRNS PNG_U32(116, 82, 78, 83) #define png_zTXt PNG_U32(122, 84, 88, 116) /* The following will work on (signed char*) strings, whereas the get_uint_32 * macro will fail on top-bit-set values because of the sign extension. */ #define PNG_CHUNK_FROM_STRING(s)\ PNG_U32(0xff&(s)[0], 0xff&(s)[1], 0xff&(s)[2], 0xff&(s)[3]) /* This uses (char), not (png_byte) to avoid warnings on systems where (char) is * signed and the argument is a (char[]) This macro will fail miserably on * systems where (char) is more than 8 bits. */ #define PNG_STRING_FROM_CHUNK(s,c)\ (void)(((char*)(s))[0]=(char)((c)>>24), ((char*)(s))[1]=(char)((c)>>16),\ ((char*)(s))[2]=(char)((c)>>8), ((char*)(s))[3]=(char)((c))) /* Do the same but terminate with a null character. */ #define PNG_CSTRING_FROM_CHUNK(s,c)\ (void)(PNG_STRING_FROM_CHUNK(s,c), ((char*)(s))[4] = 0) /* Test on flag values as defined in the spec (section 5.4): */ #define PNG_CHUNK_ANCILLARY(c) (1 & ((c) >> 29)) #define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c)) #define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21)) #define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13)) #define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5)) /* Gamma values (new at libpng-1.5.4): */ #define PNG_GAMMA_MAC_OLD 151724 /* Assume '1.8' is really 2.2/1.45! */ #define PNG_GAMMA_MAC_INVERSE 65909 #define PNG_GAMMA_sRGB_INVERSE 45455 /* Almost everything below is C specific; the #defines above can be used in * non-C code (so long as it is C-preprocessed) the rest of this stuff cannot. */ #ifndef PNG_VERSION_INFO_ONLY #include "pngstruct.h" #include "pnginfo.h" /* Validate the include paths - the include path used to generate pnglibconf.h * must match that used in the build, or we must be using pnglibconf.h.prebuilt: */ #if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM # error ZLIB_VERNUM != PNG_ZLIB_VERNUM \ "-I (include path) error: see the notes in pngpriv.h" /* This means that when pnglibconf.h was built the copy of zlib.h that it * used is not the same as the one being used here. Because the build of * libpng makes decisions to use inflateInit2 and inflateReset2 based on the * zlib version number and because this affects handling of certain broken * PNG files the -I directives must match. * * The most likely explanation is that you passed a -I in CFLAGS, this will * not work; all the preprocessor directories and in particular all the -I * directives must be in CPPFLAGS. */ #endif /* This is used for 16 bit gamma tables -- only the top level pointers are * const; this could be changed: */ typedef const png_uint_16p * png_const_uint_16pp; /* Added to libpng-1.5.7: sRGB conversion tables */ #if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) #ifdef PNG_SIMPLIFIED_READ_SUPPORTED PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_table, [256]); /* Convert from an sRGB encoded value 0..255 to a 16-bit linear value, * 0..65535. This table gives the closest 16-bit answers (no errors). */ #endif PNG_INTERNAL_DATA(const png_uint_16, png_sRGB_base, [512]); PNG_INTERNAL_DATA(const png_byte, png_sRGB_delta, [512]); #define PNG_sRGB_FROM_LINEAR(linear) ((png_byte)((png_sRGB_base[(linear)>>15] +\ ((((linear)&0x7fff)*png_sRGB_delta[(linear)>>15])>>12)) >> 8)) /* Given a value 'linear' in the range 0..255*65535 calculate the 8-bit sRGB * encoded value with maximum error 0.646365. Note that the input is not a * 16-bit value; it has been multiplied by 255! */ #endif /* PNG_SIMPLIFIED_READ/WRITE */ /* Inhibit C++ name-mangling for libpng functions but not for system calls. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* Internal functions; these are not exported from a DLL however because they * are used within several of the C source files they have to be C extern. * * All of these functions must be declared with PNG_INTERNAL_FUNCTION. */ /* Zlib support */ #define PNG_UNEXPECTED_ZLIB_RETURN (-7) PNG_INTERNAL_FUNCTION(void, png_zstream_error,(png_structrp png_ptr, int ret), PNG_EMPTY); /* Used by the zlib handling functions to ensure that z_stream::msg is always * set before they return. */ #ifdef PNG_WRITE_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_free_buffer_list,(png_structrp png_ptr, png_compression_bufferp *list),PNG_EMPTY); /* Free the buffer list used by the compressed write code. */ #endif #if defined(PNG_FLOATING_POINT_SUPPORTED) && \ !defined(PNG_FIXED_POINT_MACRO_SUPPORTED) && \ (defined(PNG_gAMA_SUPPORTED) || defined(PNG_cHRM_SUPPORTED) || \ defined(PNG_sCAL_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED)) || \ (defined(PNG_sCAL_SUPPORTED) && \ defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)) PNG_INTERNAL_FUNCTION(png_fixed_point,png_fixed,(png_const_structrp png_ptr, double fp, png_const_charp text),PNG_EMPTY); #endif /* Check the user version string for compatibility, returns false if the version * numbers aren't compatible. */ PNG_INTERNAL_FUNCTION(int,png_user_version_check,(png_structrp png_ptr, png_const_charp user_png_ver),PNG_EMPTY); /* Internal base allocator - no messages, NULL on failure to allocate. This * does, however, call the application provided allocator and that could call * png_error (although that would be a bug in the application implementation.) */ PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_base,(png_const_structrp png_ptr, png_alloc_size_t size),PNG_ALLOCATED); #if defined(PNG_TEXT_SUPPORTED) || defined(PNG_sPLT_SUPPORTED) ||\ defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) /* Internal array allocator, outputs no error or warning messages on failure, * just returns NULL. */ PNG_INTERNAL_FUNCTION(png_voidp,png_malloc_array,(png_const_structrp png_ptr, int nelements, size_t element_size),PNG_ALLOCATED); /* The same but an existing array is extended by add_elements. This function * also memsets the new elements to 0 and copies the old elements. The old * array is not freed or altered. */ PNG_INTERNAL_FUNCTION(png_voidp,png_realloc_array,(png_const_structrp png_ptr, png_const_voidp array, int old_elements, int add_elements, size_t element_size),PNG_ALLOCATED); #endif /* text, sPLT or unknown chunks */ /* Magic to create a struct when there is no struct to call the user supplied * memory allocators. Because error handling has not been set up the memory * handlers can't safely call png_error, but this is an obscure and undocumented * restriction so libpng has to assume that the 'free' handler, at least, might * call png_error. */ PNG_INTERNAL_FUNCTION(png_structp,png_create_png_struct, (png_const_charp user_png_ver, png_voidp error_ptr, png_error_ptr error_fn, png_error_ptr warn_fn, png_voidp mem_ptr, png_malloc_ptr malloc_fn, png_free_ptr free_fn),PNG_ALLOCATED); /* Free memory from internal libpng struct */ PNG_INTERNAL_FUNCTION(void,png_destroy_png_struct,(png_structrp png_ptr), PNG_EMPTY); /* Free an allocated jmp_buf (always succeeds) */ PNG_INTERNAL_FUNCTION(void,png_free_jmpbuf,(png_structrp png_ptr),PNG_EMPTY); /* Function to allocate memory for zlib. PNGAPI is disallowed. */ PNG_INTERNAL_FUNCTION(voidpf,png_zalloc,(voidpf png_ptr, uInt items, uInt size), PNG_ALLOCATED); /* Function to free memory for zlib. PNGAPI is disallowed. */ PNG_INTERNAL_FUNCTION(void,png_zfree,(voidpf png_ptr, voidpf ptr),PNG_EMPTY); /* Next four functions are used internally as callbacks. PNGCBAPI is required * but not PNG_EXPORT. PNGAPI added at libpng version 1.2.3, changed to * PNGCBAPI at 1.5.0 */ PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_read_data,(png_structp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_push_fill_buffer,(png_structp png_ptr, png_bytep buffer, png_size_t length),PNG_EMPTY); #endif PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_write_data,(png_structp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); #ifdef PNG_WRITE_FLUSH_SUPPORTED # ifdef PNG_STDIO_SUPPORTED PNG_INTERNAL_FUNCTION(void PNGCBAPI,png_default_flush,(png_structp png_ptr), PNG_EMPTY); # endif #endif /* Reset the CRC variable */ PNG_INTERNAL_FUNCTION(void,png_reset_crc,(png_structrp png_ptr),PNG_EMPTY); /* Write the "data" buffer to whatever output you are using */ PNG_INTERNAL_FUNCTION(void,png_write_data,(png_structrp png_ptr, png_const_bytep data, png_size_t length),PNG_EMPTY); /* Read and check the PNG file signature */ PNG_INTERNAL_FUNCTION(void,png_read_sig,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); /* Read the chunk header (length + type name) */ PNG_INTERNAL_FUNCTION(png_uint_32,png_read_chunk_header,(png_structrp png_ptr), PNG_EMPTY); /* Read data from whatever input you are using into the "data" buffer */ PNG_INTERNAL_FUNCTION(void,png_read_data,(png_structrp png_ptr, png_bytep data, png_size_t length),PNG_EMPTY); /* Read bytes into buf, and update png_ptr->crc */ PNG_INTERNAL_FUNCTION(void,png_crc_read,(png_structrp png_ptr, png_bytep buf, png_uint_32 length),PNG_EMPTY); /* Read "skip" bytes, read the file crc, and (optionally) verify png_ptr->crc */ PNG_INTERNAL_FUNCTION(int,png_crc_finish,(png_structrp png_ptr, png_uint_32 skip),PNG_EMPTY); /* Read the CRC from the file and compare it to the libpng calculated CRC */ PNG_INTERNAL_FUNCTION(int,png_crc_error,(png_structrp png_ptr),PNG_EMPTY); /* Calculate the CRC over a section of data. Note that we are only * passing a maximum of 64K on systems that have this as a memory limit, * since this is the maximum buffer size we can specify. */ PNG_INTERNAL_FUNCTION(void,png_calculate_crc,(png_structrp png_ptr, png_const_bytep ptr, png_size_t length),PNG_EMPTY); #ifdef PNG_WRITE_FLUSH_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_flush,(png_structrp png_ptr),PNG_EMPTY); #endif /* Write various chunks */ /* Write the IHDR chunk, and update the png_struct with the necessary * information. */ PNG_INTERNAL_FUNCTION(void,png_write_IHDR,(png_structrp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int compression_method, int filter_method, int interlace_method),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_write_PLTE,(png_structrp png_ptr, png_const_colorp palette, png_uint_32 num_pal),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_compress_IDAT,(png_structrp png_ptr, png_const_bytep row_data, png_alloc_size_t row_data_length, int flush), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_write_IEND,(png_structrp png_ptr),PNG_EMPTY); #ifdef PNG_WRITE_gAMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_gAMA_fixed,(png_structrp png_ptr, png_fixed_point file_gamma),PNG_EMPTY); #endif #ifdef PNG_WRITE_sBIT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sBIT,(png_structrp png_ptr, png_const_color_8p sbit, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_cHRM_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr, const png_xy *xy), PNG_EMPTY); /* The xy value must have been previously validated */ #endif #ifdef PNG_WRITE_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr, int intent),PNG_EMPTY); #endif #ifdef PNG_WRITE_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr, png_const_charp name, png_const_bytep profile), PNG_EMPTY); /* The profile must have been previously validated for correctness, the * length comes from the first four bytes. Only the base, deflate, * compression is supported. */ #endif #ifdef PNG_WRITE_sPLT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sPLT,(png_structrp png_ptr, png_const_sPLT_tp palette),PNG_EMPTY); #endif #ifdef PNG_WRITE_tRNS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tRNS,(png_structrp png_ptr, png_const_bytep trans, png_const_color_16p values, int number, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_bKGD_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_bKGD,(png_structrp png_ptr, png_const_color_16p values, int color_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_hIST_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_hIST,(png_structrp png_ptr, png_const_uint_16p hist, int num_hist),PNG_EMPTY); #endif /* Chunks that have keywords */ #ifdef PNG_WRITE_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len),PNG_EMPTY); #endif #ifdef PNG_WRITE_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp key, png_const_charp text, png_size_t text_len, int compression),PNG_EMPTY); #endif #ifdef PNG_WRITE_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_iTXt,(png_structrp png_ptr, int compression, png_const_charp key, png_const_charp lang, png_const_charp lang_key, png_const_charp text),PNG_EMPTY); #endif #ifdef PNG_TEXT_SUPPORTED /* Added at version 1.0.14 and 1.2.4 */ PNG_INTERNAL_FUNCTION(int,png_set_text_2,(png_const_structrp png_ptr, png_inforp info_ptr, png_const_textp text_ptr, int num_text),PNG_EMPTY); #endif #ifdef PNG_WRITE_oFFs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_oFFs,(png_structrp png_ptr, png_int_32 x_offset, png_int_32 y_offset, int unit_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_pCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_pCAL,(png_structrp png_ptr, png_charp purpose, png_int_32 X0, png_int_32 X1, int type, int nparams, png_const_charp units, png_charpp params),PNG_EMPTY); #endif #ifdef PNG_WRITE_pHYs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_pHYs,(png_structrp png_ptr, png_uint_32 x_pixels_per_unit, png_uint_32 y_pixels_per_unit, int unit_type),PNG_EMPTY); #endif #ifdef PNG_WRITE_tIME_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_tIME,(png_structrp png_ptr, png_const_timep mod_time),PNG_EMPTY); #endif #ifdef PNG_WRITE_sCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sCAL_s,(png_structrp png_ptr, int unit, png_const_charp width, png_const_charp height),PNG_EMPTY); #endif /* Called when finished processing a row of data */ PNG_INTERNAL_FUNCTION(void,png_write_finish_row,(png_structrp png_ptr), PNG_EMPTY); /* Internal use only. Called before first row of data */ PNG_INTERNAL_FUNCTION(void,png_write_start_row,(png_structrp png_ptr), PNG_EMPTY); /* Combine a row of data, dealing with alpha, etc. if requested. 'row' is an * array of png_ptr->width pixels. If the image is not interlaced or this * is the final pass this just does a memcpy, otherwise the "display" flag * is used to determine whether to copy pixels that are not in the current pass. * * Because 'png_do_read_interlace' (below) replicates pixels this allows this * function to achieve the documented 'blocky' appearance during interlaced read * if display is 1 and the 'sparkle' appearance, where existing pixels in 'row' * are not changed if they are not in the current pass, when display is 0. * * 'display' must be 0 or 1, otherwise the memcpy will be done regardless. * * The API always reads from the png_struct row buffer and always assumes that * it is full width (png_do_read_interlace has already been called.) * * This function is only ever used to write to row buffers provided by the * caller of the relevant libpng API and the row must have already been * transformed by the read transformations. * * The PNG_USE_COMPILE_TIME_MASKS option causes generation of pre-computed * bitmasks for use within the code, otherwise runtime generated masks are used. * The default is compile time masks. */ #ifndef PNG_USE_COMPILE_TIME_MASKS # define PNG_USE_COMPILE_TIME_MASKS 1 #endif PNG_INTERNAL_FUNCTION(void,png_combine_row,(png_const_structrp png_ptr, png_bytep row, int display),PNG_EMPTY); #ifdef PNG_READ_INTERLACING_SUPPORTED /* Expand an interlaced row: the 'row_info' describes the pass data that has * been read in and must correspond to the pixels in 'row', the pixels are * expanded (moved apart) in 'row' to match the final layout, when doing this * the pixels are *replicated* to the intervening space. This is essential for * the correct operation of png_combine_row, above. */ PNG_INTERNAL_FUNCTION(void,png_do_read_interlace,(png_row_infop row_info, png_bytep row, int pass, png_uint_32 transformations),PNG_EMPTY); #endif /* GRR TO DO (2.0 or whenever): simplify other internal calling interfaces */ #ifdef PNG_WRITE_INTERLACING_SUPPORTED /* Grab pixels out of a row for an interlaced pass */ PNG_INTERNAL_FUNCTION(void,png_do_write_interlace,(png_row_infop row_info, png_bytep row, int pass),PNG_EMPTY); #endif /* Unfilter a row: check the filter value before calling this, there is no point * calling it for PNG_FILTER_VALUE_NONE. */ PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); /* Choose the best filter to use and filter the row data */ PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #ifdef PNG_SEQUENTIAL_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_read_IDAT_data,(png_structrp png_ptr, png_bytep output, png_alloc_size_t avail_out),PNG_EMPTY); /* Read 'avail_out' bytes of data from the IDAT stream. If the output buffer * is NULL the function checks, instead, for the end of the stream. In this * case a benign error will be issued if the stream end is not found or if * extra data has to be consumed. */ PNG_INTERNAL_FUNCTION(void,png_read_finish_IDAT,(png_structrp png_ptr), PNG_EMPTY); /* This cleans up when the IDAT LZ stream does not end when the last image * byte is read; there is still some pending input. */ PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr), PNG_EMPTY); /* Finish a row while reading, dealing with interlacing passes, etc. */ #endif /* PNG_SEQUENTIAL_READ_SUPPORTED */ /* Initialize the row buffers, etc. */ PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY); #ifdef PNG_READ_TRANSFORMS_SUPPORTED /* Optional call to update the users info structure */ PNG_INTERNAL_FUNCTION(void,png_read_transform_info,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); #endif /* Shared transform functions, defined in pngtran.c */ #if defined(PNG_WRITE_FILLER_SUPPORTED) || \ defined(PNG_READ_STRIP_ALPHA_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_strip_channel,(png_row_infop row_info, png_bytep row, int at_start),PNG_EMPTY); #endif #ifdef PNG_16BIT_SUPPORTED #if defined(PNG_READ_SWAP_SUPPORTED) || defined(PNG_WRITE_SWAP_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_swap,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #endif #if defined(PNG_READ_PACKSWAP_SUPPORTED) || \ defined(PNG_WRITE_PACKSWAP_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_packswap,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #if defined(PNG_READ_INVERT_SUPPORTED) || defined(PNG_WRITE_INVERT_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_invert,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif #if defined(PNG_READ_BGR_SUPPORTED) || defined(PNG_WRITE_BGR_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_bgr,(png_row_infop row_info, png_bytep row),PNG_EMPTY); #endif /* The following decodes the appropriate chunks, and does error correction, * then calls the appropriate callback for the chunk if it is valid. */ /* Decode the IHDR chunk */ PNG_INTERNAL_FUNCTION(void,png_handle_IHDR,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_PLTE,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_IEND,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #ifdef PNG_READ_bKGD_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_bKGD,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_cHRM_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_gAMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_hIST_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_hIST,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_iCCP,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif /* PNG_READ_iCCP_SUPPORTED */ #ifdef PNG_READ_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_iTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_oFFs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_oFFs,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_pCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_pCAL,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_pHYs_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_pHYs,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sBIT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sBIT,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sCAL_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sCAL,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_sPLT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sPLT,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif /* PNG_READ_sPLT_SUPPORTED */ #ifdef PNG_READ_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_sRGB,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tEXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tIME_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tIME,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_tRNS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_tRNS,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif #ifdef PNG_READ_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_zTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY); /* This is the function that gets called for unknown chunks. The 'keep' * argument is either non-zero for a known chunk that has been set to be * handled as unknown or zero for an unknown chunk. By default the function * just skips the chunk or errors out if it is critical. */ #if defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) ||\ defined(PNG_HANDLE_AS_UNKNOWN_SUPPORTED) PNG_INTERNAL_FUNCTION(int,png_chunk_unknown_handling, (png_const_structrp png_ptr, png_uint_32 chunk_name),PNG_EMPTY); /* Exactly as the API png_handle_as_unknown() except that the argument is a * 32-bit chunk name, not a string. */ #endif /* READ_UNKNOWN_CHUNKS || HANDLE_AS_UNKNOWN */ /* Handle the transformations for reading and writing */ #ifdef PNG_READ_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_do_read_transformations,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #ifdef PNG_WRITE_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_do_write_transformations,(png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #ifdef PNG_READ_TRANSFORMS_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_init_read_transformations,(png_structrp png_ptr), PNG_EMPTY); #endif #ifdef PNG_PROGRESSIVE_READ_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_read_chunk,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_sig,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_check_crc,(png_structrp png_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_crc_skip,(png_structrp png_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_crc_finish,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_save_buffer,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_restore_buffer,(png_structrp png_ptr, png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_IDAT,(png_structrp png_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_process_IDAT_data,(png_structrp png_ptr, png_bytep buffer, png_size_t buffer_length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_process_row,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_handle_unknown,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_info,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_have_row,(png_structrp png_ptr, png_bytep row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_end,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_process_some_data,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_push_finish_row,(png_structrp png_ptr), PNG_EMPTY); # ifdef PNG_READ_tEXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_tEXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_tEXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif # ifdef PNG_READ_zTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_zTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_zTXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif # ifdef PNG_READ_iTXt_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_push_handle_iTXt,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_push_read_iTXt,(png_structrp png_ptr, png_inforp info_ptr),PNG_EMPTY); # endif #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ /* Added at libpng version 1.6.0 */ #ifdef PNG_GAMMA_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_colorspace_set_gamma,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_fixed_point gAMA), PNG_EMPTY); /* Set the colorspace gamma with a value provided by the application or by * the gAMA chunk on read. The value will override anything set by an ICC * profile. */ PNG_INTERNAL_FUNCTION(void,png_colorspace_sync_info,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); /* Synchronize the info 'valid' flags with the colorspace */ PNG_INTERNAL_FUNCTION(void,png_colorspace_sync,(png_const_structrp png_ptr, png_inforp info_ptr), PNG_EMPTY); /* Copy the png_struct colorspace to the info_struct and call the above to * synchronize the flags. Checks for NULL info_ptr and does nothing. */ #endif /* Added at libpng version 1.4.0 */ #ifdef PNG_COLORSPACE_SUPPORTED /* These internal functions are for maintaining the colorspace structure within * a png_info or png_struct (or, indeed, both). */ PNG_INTERNAL_FUNCTION(int,png_colorspace_set_chromaticities, (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_xy *xy, int preferred), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_colorspace_set_endpoints, (png_const_structrp png_ptr, png_colorspacerp colorspace, const png_XYZ *XYZ, int preferred), PNG_EMPTY); #ifdef PNG_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(int,png_colorspace_set_sRGB,(png_const_structrp png_ptr, png_colorspacerp colorspace, int intent), PNG_EMPTY); /* This does set the colorspace gAMA and cHRM values too, but doesn't set the * flags to write them, if it returns false there was a problem and an error * message has already been output (but the colorspace may still need to be * synced to record the invalid flag). */ #endif /* sRGB */ #ifdef PNG_iCCP_SUPPORTED PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile, int color_type), PNG_EMPTY); /* The 'name' is used for information only */ /* Routines for checking parts of an ICC profile. */ PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile /* first 132 bytes only */, int color_type), PNG_EMPTY); PNG_INTERNAL_FUNCTION(int,png_icc_check_tag_table,(png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_charp name, png_uint_32 profile_length, png_const_bytep profile /* header plus whole tag table */), PNG_EMPTY); #ifdef PNG_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_icc_set_sRGB,( png_const_structrp png_ptr, png_colorspacerp colorspace, png_const_bytep profile, uLong adler), PNG_EMPTY); /* 'adler' is the Adler32 checksum of the uncompressed profile data. It may * be zero to indicate that it is not available. It is used, if provided, * as a fast check on the profile when checking to see if it is sRGB. */ #endif #endif /* iCCP */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_colorspace_set_rgb_coefficients, (png_structrp png_ptr), PNG_EMPTY); /* Set the rgb_to_gray coefficients from the colorspace Y values */ #endif /* READ_RGB_TO_GRAY */ #endif /* COLORSPACE */ /* Added at libpng version 1.4.0 */ PNG_INTERNAL_FUNCTION(void,png_check_IHDR,(png_const_structrp png_ptr, png_uint_32 width, png_uint_32 height, int bit_depth, int color_type, int interlace_type, int compression_type, int filter_type),PNG_EMPTY); /* Added at libpng version 1.5.10 */ #if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_do_check_palette_indexes, (png_structrp png_ptr, png_row_infop row_info),PNG_EMPTY); #endif #if defined(PNG_FLOATING_POINT_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED) PNG_INTERNAL_FUNCTION(void,png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN); #endif /* Puts 'string' into 'buffer' at buffer[pos], taking care never to overwrite * the end. Always leaves the buffer nul terminated. Never errors out (and * there is no error code.) */ PNG_INTERNAL_FUNCTION(size_t,png_safecat,(png_charp buffer, size_t bufsize, size_t pos, png_const_charp string),PNG_EMPTY); /* Various internal functions to handle formatted warning messages, currently * only implemented for warnings. */ #if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_TIME_RFC1123_SUPPORTED) /* Utility to dump an unsigned value into a buffer, given a start pointer and * and end pointer (which should point just *beyond* the end of the buffer!) * Returns the pointer to the start of the formatted string. This utility only * does unsigned values. */ PNG_INTERNAL_FUNCTION(png_charp,png_format_number,(png_const_charp start, png_charp end, int format, png_alloc_size_t number),PNG_EMPTY); /* Convenience macro that takes an array: */ #define PNG_FORMAT_NUMBER(buffer,format,number) \ png_format_number(buffer, buffer + (sizeof buffer), format, number) /* Suggested size for a number buffer (enough for 64 bits and a sign!) */ #define PNG_NUMBER_BUFFER_SIZE 24 /* These are the integer formats currently supported, the name is formed from * the standard printf(3) format string. */ #define PNG_NUMBER_FORMAT_u 1 /* chose unsigned API! */ #define PNG_NUMBER_FORMAT_02u 2 #define PNG_NUMBER_FORMAT_d 1 /* chose signed API! */ #define PNG_NUMBER_FORMAT_02d 2 #define PNG_NUMBER_FORMAT_x 3 #define PNG_NUMBER_FORMAT_02x 4 #define PNG_NUMBER_FORMAT_fixed 5 /* choose the signed API */ #endif #ifdef PNG_WARNINGS_SUPPORTED /* New defines and members adding in libpng-1.5.4 */ # define PNG_WARNING_PARAMETER_SIZE 32 # define PNG_WARNING_PARAMETER_COUNT 8 /* Maximum 9; see pngerror.c */ /* An l-value of this type has to be passed to the APIs below to cache the * values of the parameters to a formatted warning message. */ typedef char png_warning_parameters[PNG_WARNING_PARAMETER_COUNT][ PNG_WARNING_PARAMETER_SIZE]; PNG_INTERNAL_FUNCTION(void,png_warning_parameter,(png_warning_parameters p, int number, png_const_charp string),PNG_EMPTY); /* Parameters are limited in size to PNG_WARNING_PARAMETER_SIZE characters, * including the trailing '\0'. */ PNG_INTERNAL_FUNCTION(void,png_warning_parameter_unsigned, (png_warning_parameters p, int number, int format, png_alloc_size_t value), PNG_EMPTY); /* Use png_alloc_size_t because it is an unsigned type as big as any we * need to output. Use the following for a signed value. */ PNG_INTERNAL_FUNCTION(void,png_warning_parameter_signed, (png_warning_parameters p, int number, int format, png_int_32 value), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_formatted_warning,(png_const_structrp png_ptr, png_warning_parameters p, png_const_charp message),PNG_EMPTY); /* 'message' follows the X/Open approach of using @1, @2 to insert * parameters previously supplied using the above functions. Errors in * specifying the parameters will simply result in garbage substitutions. */ #endif #ifdef PNG_BENIGN_ERRORS_SUPPORTED /* Application errors (new in 1.6); use these functions (declared below) for * errors in the parameters or order of API function calls on read. The * 'warning' should be used for an error that can be handled completely; the * 'error' for one which can be handled safely but which may lose application * information or settings. * * By default these both result in a png_error call prior to release, while in a * released version the 'warning' is just a warning. However if the application * explicitly disables benign errors (explicitly permitting the code to lose * information) they both turn into warnings. * * If benign errors aren't supported they end up as the corresponding base call * (png_warning or png_error.) */ PNG_INTERNAL_FUNCTION(void,png_app_warning,(png_const_structrp png_ptr, png_const_charp message),PNG_EMPTY); /* The application provided invalid parameters to an API function or called * an API function at the wrong time, libpng can completely recover. */ PNG_INTERNAL_FUNCTION(void,png_app_error,(png_const_structrp png_ptr, png_const_charp message),PNG_EMPTY); /* As above but libpng will ignore the call, or attempt some other partial * recovery from the error. */ #else # define png_app_warning(pp,s) png_warning(pp,s) # define png_app_error(pp,s) png_error(pp,s) #endif PNG_INTERNAL_FUNCTION(void,png_chunk_report,(png_const_structrp png_ptr, png_const_charp message, int error),PNG_EMPTY); /* Report a recoverable issue in chunk data. On read this is used to report * a problem found while reading a particular chunk and the * png_chunk_benign_error or png_chunk_warning function is used as * appropriate. On write this is used to report an error that comes from * data set via an application call to a png_set_ API and png_app_error or * png_app_warning is used as appropriate. * * The 'error' parameter must have one of the following values: */ #define PNG_CHUNK_WARNING 0 /* never an error */ #define PNG_CHUNK_WRITE_ERROR 1 /* an error only on write */ #define PNG_CHUNK_ERROR 2 /* always an error */ /* ASCII to FP interfaces, currently only implemented if sCAL * support is required. */ #if defined(PNG_sCAL_SUPPORTED) /* MAX_DIGITS is actually the maximum number of characters in an sCAL * width or height, derived from the precision (number of significant * digits - a build time settable option) and assumptions about the * maximum ridiculous exponent. */ #define PNG_sCAL_MAX_DIGITS (PNG_sCAL_PRECISION+1/*.*/+1/*E*/+10/*exponent*/) #ifdef PNG_FLOATING_POINT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_ascii_from_fp,(png_const_structrp png_ptr, png_charp ascii, png_size_t size, double fp, unsigned int precision), PNG_EMPTY); #endif /* FLOATING_POINT */ #ifdef PNG_FIXED_POINT_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_ascii_from_fixed,(png_const_structrp png_ptr, png_charp ascii, png_size_t size, png_fixed_point fp),PNG_EMPTY); #endif /* FIXED_POINT */ #endif /* sCAL */ #if defined(PNG_sCAL_SUPPORTED) || defined(PNG_pCAL_SUPPORTED) /* An internal API to validate the format of a floating point number. * The result is the index of the next character. If the number is * not valid it will be the index of a character in the supposed number. * * The format of a number is defined in the PNG extensions specification * and this API is strictly conformant to that spec, not anyone elses! * * The format as a regular expression is: * * [+-]?[0-9]+.?([Ee][+-]?[0-9]+)? * * or: * * [+-]?.[0-9]+(.[0-9]+)?([Ee][+-]?[0-9]+)? * * The complexity is that either integer or fraction must be present and the * fraction is permitted to have no digits only if the integer is present. * * NOTE: The dangling E problem. * There is a PNG valid floating point number in the following: * * PNG floating point numbers are not greedy. * * Working this out requires *TWO* character lookahead (because of the * sign), the parser does not do this - it will fail at the 'r' - this * doesn't matter for PNG sCAL chunk values, but it requires more care * if the value were ever to be embedded in something more complex. Use * ANSI-C strtod if you need the lookahead. */ /* State table for the parser. */ #define PNG_FP_INTEGER 0 /* before or in integer */ #define PNG_FP_FRACTION 1 /* before or in fraction */ #define PNG_FP_EXPONENT 2 /* before or in exponent */ #define PNG_FP_STATE 3 /* mask for the above */ #define PNG_FP_SAW_SIGN 4 /* Saw +/- in current state */ #define PNG_FP_SAW_DIGIT 8 /* Saw a digit in current state */ #define PNG_FP_SAW_DOT 16 /* Saw a dot in current state */ #define PNG_FP_SAW_E 32 /* Saw an E (or e) in current state */ #define PNG_FP_SAW_ANY 60 /* Saw any of the above 4 */ /* These three values don't affect the parser. They are set but not used. */ #define PNG_FP_WAS_VALID 64 /* Preceding substring is a valid fp number */ #define PNG_FP_NEGATIVE 128 /* A negative number, including "-0" */ #define PNG_FP_NONZERO 256 /* A non-zero value */ #define PNG_FP_STICKY 448 /* The above three flags */ /* This is available for the caller to store in 'state' if required. Do not * call the parser after setting it (the parser sometimes clears it.) */ #define PNG_FP_INVALID 512 /* Available for callers as a distinct value */ /* Result codes for the parser (boolean - true meants ok, false means * not ok yet.) */ #define PNG_FP_MAYBE 0 /* The number may be valid in the future */ #define PNG_FP_OK 1 /* The number is valid */ /* Tests on the sticky non-zero and negative flags. To pass these checks * the state must also indicate that the whole number is valid - this is * achieved by testing PNG_FP_SAW_DIGIT (see the implementation for why this * is equivalent to PNG_FP_OK above.) */ #define PNG_FP_NZ_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NEGATIVE | PNG_FP_NONZERO) /* NZ_MASK: the string is valid and a non-zero negative value */ #define PNG_FP_Z_MASK (PNG_FP_SAW_DIGIT | PNG_FP_NONZERO) /* Z MASK: the string is valid and a non-zero value. */ /* PNG_FP_SAW_DIGIT: the string is valid. */ #define PNG_FP_IS_ZERO(state) (((state) & PNG_FP_Z_MASK) == PNG_FP_SAW_DIGIT) #define PNG_FP_IS_POSITIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_Z_MASK) #define PNG_FP_IS_NEGATIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_NZ_MASK) /* The actual parser. This can be called repeatedly. It updates * the index into the string and the state variable (which must * be initialized to 0). It returns a result code, as above. There * is no point calling the parser any more if it fails to advance to * the end of the string - it is stuck on an invalid character (or * terminated by '\0'). * * Note that the pointer will consume an E or even an E+ and then leave * a 'maybe' state even though a preceding integer.fraction is valid. * The PNG_FP_WAS_VALID flag indicates that a preceding substring was * a valid number. It's possible to recover from this by calling * the parser again (from the start, with state 0) but with a string * that omits the last character (i.e. set the size to the index of * the problem character.) This has not been tested within libpng. */ PNG_INTERNAL_FUNCTION(int,png_check_fp_number,(png_const_charp string, png_size_t size, int *statep, png_size_tp whereami),PNG_EMPTY); /* This is the same but it checks a complete string and returns true * only if it just contains a floating point number. As of 1.5.4 this * function also returns the state at the end of parsing the number if * it was valid (otherwise it returns 0.) This can be used for testing * for negative or zero values using the sticky flag. */ PNG_INTERNAL_FUNCTION(int,png_check_fp_string,(png_const_charp string, png_size_t size),PNG_EMPTY); #endif /* pCAL || sCAL */ #if defined(PNG_GAMMA_SUPPORTED) ||\ defined(PNG_INCH_CONVERSIONS_SUPPORTED) || defined(PNG_READ_pHYs_SUPPORTED) /* Added at libpng version 1.5.0 */ /* This is a utility to provide a*times/div (rounded) and indicate * if there is an overflow. The result is a boolean - false (0) * for overflow, true (1) if no overflow, in which case *res * holds the result. */ PNG_INTERNAL_FUNCTION(int,png_muldiv,(png_fixed_point_p res, png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY); #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED) /* Same deal, but issue a warning on overflow and return 0. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_muldiv_warn, (png_const_structrp png_ptr, png_fixed_point a, png_int_32 multiplied_by, png_int_32 divided_by),PNG_EMPTY); #endif #ifdef PNG_GAMMA_SUPPORTED /* Calculate a reciprocal - used for gamma values. This returns * 0 if the argument is 0 in order to maintain an undefined value; * there are no warnings. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal,(png_fixed_point a), PNG_EMPTY); #ifdef PNG_READ_GAMMA_SUPPORTED /* The same but gives a reciprocal of the product of two fixed point * values. Accuracy is suitable for gamma calculations but this is * not exact - use png_muldiv for that. Only required at present on read. */ PNG_INTERNAL_FUNCTION(png_fixed_point,png_reciprocal2,(png_fixed_point a, png_fixed_point b),PNG_EMPTY); #endif /* Return true if the gamma value is significantly different from 1.0 */ PNG_INTERNAL_FUNCTION(int,png_gamma_significant,(png_fixed_point gamma_value), PNG_EMPTY); #endif #ifdef PNG_READ_GAMMA_SUPPORTED /* Internal fixed point gamma correction. These APIs are called as * required to convert single values - they don't need to be fast, * they are not used when processing image pixel values. * * While the input is an 'unsigned' value it must actually be the * correct bit value - 0..255 or 0..65535 as required. */ PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_correct,(png_structrp png_ptr, unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(png_uint_16,png_gamma_16bit_correct,(unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(png_byte,png_gamma_8bit_correct,(unsigned int value, png_fixed_point gamma_value),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_destroy_gamma_table,(png_structrp png_ptr), PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_build_gamma_table,(png_structrp png_ptr, int bit_depth),PNG_EMPTY); #endif /* SIMPLIFIED READ/WRITE SUPPORT */ #if defined(PNG_SIMPLIFIED_READ_SUPPORTED) ||\ defined(PNG_SIMPLIFIED_WRITE_SUPPORTED) /* The internal structure that png_image::opaque points to. */ typedef struct png_control { png_structp png_ptr; png_infop info_ptr; png_voidp error_buf; /* Always a jmp_buf at present. */ png_const_bytep memory; /* Memory buffer. */ png_size_t size; /* Size of the memory buffer. */ unsigned int for_write :1; /* Otherwise it is a read structure */ unsigned int owned_file :1; /* We own the file in io_ptr */ } png_control; /* Return the pointer to the jmp_buf from a png_control: necessary because C * does not reveal the type of the elements of jmp_buf. */ #ifdef __cplusplus # define png_control_jmp_buf(pc) (((jmp_buf*)((pc)->error_buf))[0]) #else # define png_control_jmp_buf(pc) ((pc)->error_buf) #endif /* Utility to safely execute a piece of libpng code catching and logging any * errors that might occur. Returns true on success, false on failure (either * of the function or as a result of a png_error.) */ PNG_INTERNAL_CALLBACK(void,png_safe_error,(png_structp png_ptr, png_const_charp error_message),PNG_NORETURN); #ifdef PNG_WARNINGS_SUPPORTED PNG_INTERNAL_CALLBACK(void,png_safe_warning,(png_structp png_ptr, png_const_charp warning_message),PNG_EMPTY); #else # define png_safe_warning 0/*dummy argument*/ #endif PNG_INTERNAL_FUNCTION(int,png_safe_execute,(png_imagep image, int (*function)(png_voidp), png_voidp arg),PNG_EMPTY); /* Utility to log an error; this also cleans up the png_image; the function * always returns 0 (false). */ PNG_INTERNAL_FUNCTION(int,png_image_error,(png_imagep image, png_const_charp error_message),PNG_EMPTY); #ifndef PNG_SIMPLIFIED_READ_SUPPORTED /* png_image_free is used by the write code but not exported */ PNG_INTERNAL_FUNCTION(void, png_image_free, (png_imagep image), PNG_EMPTY); #endif /* !SIMPLIFIED_READ */ #endif /* SIMPLIFIED READ/WRITE */ /* These are initialization functions for hardware specific PNG filter * optimizations; list these here then select the appropriate one at compile * time using the macro PNG_FILTER_OPTIMIZATIONS. If the macro is not defined * the generic code is used. */ #ifdef PNG_FILTER_OPTIMIZATIONS PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); /* Just declare the optimization that will be used */ #else /* List *all* the possible optimizations here - this branch is required if * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing. */ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon, (png_structp png_ptr, unsigned int bpp), PNG_EMPTY); #endif /* Maintainer: Put new private prototypes here ^ */ #include "pngdebug.h" #ifdef __cplusplus } #endif #endif /* PNG_VERSION_INFO_ONLY */ #endif /* PNGPRIV_H */ ================================================ FILE: Libraries/Core/iOS/Headers/png/pngstruct.h ================================================ /* pngstruct.h - header file for PNG reference library * * Copyright (c) 1998-2013 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Last changed in libpng 1.6.1 [March 28, 2013] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h */ /* The structure that holds the information to read and write PNG files. * The only people who need to care about what is inside of this are the * people who will be modifying the library for their own special needs. * It should NOT be accessed directly by an application. */ #ifndef PNGSTRUCT_H #define PNGSTRUCT_H /* zlib.h defines the structure z_stream, an instance of which is included * in this structure and is required for decompressing the LZ compressed * data in PNG files. */ #ifndef ZLIB_CONST /* We must ensure that zlib uses 'const' in declarations. */ # define ZLIB_CONST #endif #include "zlib.h" #ifdef const /* zlib.h sometimes #defines const to nothing, undo this. */ # undef const #endif /* zlib.h has mediocre z_const use before 1.2.6, this stuff is for compatibility * with older builds. */ #if ZLIB_VERNUM < 0x1260 # define PNGZ_MSG_CAST(s) png_constcast(char*,s) # define PNGZ_INPUT_CAST(b) png_constcast(png_bytep,b) #else # define PNGZ_MSG_CAST(s) (s) # define PNGZ_INPUT_CAST(b) (b) #endif /* zlib.h declares a magic type 'uInt' that limits the amount of data that zlib * can handle at once. This type need be no larger than 16 bits (so maximum of * 65535), this define allows us to discover how big it is, but limited by the * maximuum for png_size_t. The value can be overriden in a library build * (pngusr.h, or set it in CPPFLAGS) and it works to set it to a considerably * lower value (e.g. 255 works). A lower value may help memory usage (slightly) * and may even improve performance on some systems (and degrade it on others.) */ #ifndef ZLIB_IO_MAX # define ZLIB_IO_MAX ((uInt)-1) #endif #ifdef PNG_WRITE_SUPPORTED /* The type of a compression buffer list used by the write code. */ typedef struct png_compression_buffer { struct png_compression_buffer *next; png_byte output[1]; /* actually zbuf_size */ } png_compression_buffer, *png_compression_bufferp; #define PNG_COMPRESSION_BUFFER_SIZE(pp)\ (offsetof(png_compression_buffer, output) + (pp)->zbuffer_size) #endif /* Colorspace support; structures used in png_struct, png_info and in internal * functions to hold and communicate information about the color space. * * PNG_COLORSPACE_SUPPORTED is only required if the application will perform * colorspace corrections, otherwise all the colorspace information can be * skipped and the size of libpng can be reduced (significantly) by compiling * out the colorspace support. */ #ifdef PNG_COLORSPACE_SUPPORTED /* The chromaticities of the red, green and blue colorants and the chromaticity * of the corresponding white point (i.e. of rgb(1.0,1.0,1.0)). */ typedef struct png_xy { png_fixed_point redx, redy; png_fixed_point greenx, greeny; png_fixed_point bluex, bluey; png_fixed_point whitex, whitey; } png_xy; /* The same data as above but encoded as CIE XYZ values. When this data comes * from chromaticities the sum of the Y values is assumed to be 1.0 */ typedef struct png_XYZ { png_fixed_point red_X, red_Y, red_Z; png_fixed_point green_X, green_Y, green_Z; png_fixed_point blue_X, blue_Y, blue_Z; } png_XYZ; #endif /* COLORSPACE */ #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) /* A colorspace is all the above plus, potentially, profile information, * however at present libpng does not use the profile internally so it is only * stored in the png_info struct (if iCCP is supported.) The rendering intent * is retained here and is checked. * * The file gamma encoding information is also stored here and gamma correction * is done by libpng, whereas color correction must currently be done by the * application. */ typedef struct png_colorspace { #ifdef PNG_GAMMA_SUPPORTED png_fixed_point gamma; /* File gamma */ #endif #ifdef PNG_COLORSPACE_SUPPORTED png_xy end_points_xy; /* End points as chromaticities */ png_XYZ end_points_XYZ; /* End points as CIE XYZ colorant values */ png_uint_16 rendering_intent; /* Rendering intent of a profile */ #endif /* Flags are always defined to simplify the code. */ png_uint_16 flags; /* As defined below */ } png_colorspace, * PNG_RESTRICT png_colorspacerp; typedef const png_colorspace * PNG_RESTRICT png_const_colorspacerp; /* General flags for the 'flags' field */ #define PNG_COLORSPACE_HAVE_GAMMA 0x0001 #define PNG_COLORSPACE_HAVE_ENDPOINTS 0x0002 #define PNG_COLORSPACE_HAVE_INTENT 0x0004 #define PNG_COLORSPACE_FROM_gAMA 0x0008 #define PNG_COLORSPACE_FROM_cHRM 0x0010 #define PNG_COLORSPACE_FROM_sRGB 0x0020 #define PNG_COLORSPACE_ENDPOINTS_MATCH_sRGB 0x0040 #define PNG_COLORSPACE_MATCHES_sRGB 0x0080 /* exact match on profile */ #define PNG_COLORSPACE_INVALID 0x8000 #define PNG_COLORSPACE_CANCEL(flags) (0xffff ^ (flags)) #endif /* COLORSPACE || GAMMA */ struct png_struct_def { #ifdef PNG_SETJMP_SUPPORTED jmp_buf jmp_buf_local; /* New name in 1.6.0 for jmp_buf in png_struct */ png_longjmp_ptr longjmp_fn;/* setjmp non-local goto function. */ jmp_buf *jmp_buf_ptr; /* passed to longjmp_fn */ size_t jmp_buf_size; /* size of the above, if allocated */ #endif png_error_ptr error_fn; /* function for printing errors and aborting */ #ifdef PNG_WARNINGS_SUPPORTED png_error_ptr warning_fn; /* function for printing warnings */ #endif png_voidp error_ptr; /* user supplied struct for error functions */ png_rw_ptr write_data_fn; /* function for writing output data */ png_rw_ptr read_data_fn; /* function for reading input data */ png_voidp io_ptr; /* ptr to application struct for I/O functions */ #ifdef PNG_READ_USER_TRANSFORM_SUPPORTED png_user_transform_ptr read_user_transform_fn; /* user read transform */ #endif #ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED png_user_transform_ptr write_user_transform_fn; /* user write transform */ #endif /* These were added in libpng-1.0.2 */ #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) png_voidp user_transform_ptr; /* user supplied struct for user transform */ png_byte user_transform_depth; /* bit depth of user transformed pixels */ png_byte user_transform_channels; /* channels in user transformed pixels */ #endif #endif png_uint_32 mode; /* tells us where we are in the PNG file */ png_uint_32 flags; /* flags indicating various things to libpng */ png_uint_32 transformations; /* which transformations to perform */ png_uint_32 zowner; /* ID (chunk type) of zstream owner, 0 if none */ z_stream zstream; /* decompression structure */ #ifdef PNG_WRITE_SUPPORTED png_compression_bufferp zbuffer_list; /* Created on demand during write */ uInt zbuffer_size; /* size of the actual buffer */ int zlib_level; /* holds zlib compression level */ int zlib_method; /* holds zlib compression method */ int zlib_window_bits; /* holds zlib compression window bits */ int zlib_mem_level; /* holds zlib compression memory level */ int zlib_strategy; /* holds zlib compression strategy */ #endif /* Added at libpng 1.5.4 */ #ifdef PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED int zlib_text_level; /* holds zlib compression level */ int zlib_text_method; /* holds zlib compression method */ int zlib_text_window_bits; /* holds zlib compression window bits */ int zlib_text_mem_level; /* holds zlib compression memory level */ int zlib_text_strategy; /* holds zlib compression strategy */ #endif /* End of material added at libpng 1.5.4 */ /* Added at libpng 1.6.0 */ #ifdef PNG_WRITE_SUPPORTED int zlib_set_level; /* Actual values set into the zstream on write */ int zlib_set_method; int zlib_set_window_bits; int zlib_set_mem_level; int zlib_set_strategy; #endif png_uint_32 width; /* width of image in pixels */ png_uint_32 height; /* height of image in pixels */ png_uint_32 num_rows; /* number of rows in current pass */ png_uint_32 usr_width; /* width of row at start of write */ png_size_t rowbytes; /* size of row in bytes */ png_uint_32 iwidth; /* width of current interlaced row in pixels */ png_uint_32 row_number; /* current row in interlace pass */ png_uint_32 chunk_name; /* PNG_CHUNK() id of current chunk */ png_bytep prev_row; /* buffer to save previous (unfiltered) row. * This is a pointer into big_prev_row */ png_bytep row_buf; /* buffer to save current (unfiltered) row. * This is a pointer into big_row_buf */ #ifdef PNG_WRITE_SUPPORTED png_bytep sub_row; /* buffer to save "sub" row when filtering */ png_bytep up_row; /* buffer to save "up" row when filtering */ png_bytep avg_row; /* buffer to save "avg" row when filtering */ png_bytep paeth_row; /* buffer to save "Paeth" row when filtering */ #endif png_size_t info_rowbytes; /* Added in 1.5.4: cache of updated row bytes */ png_uint_32 idat_size; /* current IDAT size for read */ png_uint_32 crc; /* current chunk CRC value */ png_colorp palette; /* palette from the input file */ png_uint_16 num_palette; /* number of color entries in palette */ /* Added at libpng-1.5.10 */ #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED int num_palette_max; /* maximum palette index found in IDAT */ #endif png_uint_16 num_trans; /* number of transparency values */ png_byte compression; /* file compression type (always 0) */ png_byte filter; /* file filter type (always 0) */ png_byte interlaced; /* PNG_INTERLACE_NONE, PNG_INTERLACE_ADAM7 */ png_byte pass; /* current interlace pass (0 - 6) */ png_byte do_filter; /* row filter flags (see PNG_FILTER_ below ) */ png_byte color_type; /* color type of file */ png_byte bit_depth; /* bit depth of file */ png_byte usr_bit_depth; /* bit depth of users row: write only */ png_byte pixel_depth; /* number of bits per pixel */ png_byte channels; /* number of channels in file */ #ifdef PNG_WRITE_SUPPORTED png_byte usr_channels; /* channels at start of write: write only */ #endif png_byte sig_bytes; /* magic bytes read/written from start of file */ png_byte maximum_pixel_depth; /* pixel depth used for the row buffers */ png_byte transformed_pixel_depth; /* pixel depth after read/write transforms */ #if defined(PNG_READ_FILLER_SUPPORTED) || defined(PNG_WRITE_FILLER_SUPPORTED) png_uint_16 filler; /* filler bytes for pixel expansion */ #endif #if defined(PNG_bKGD_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) ||\ defined(PNG_READ_ALPHA_MODE_SUPPORTED) png_byte background_gamma_type; png_fixed_point background_gamma; png_color_16 background; /* background color in screen gamma space */ #ifdef PNG_READ_GAMMA_SUPPORTED png_color_16 background_1; /* background normalized to gamma 1.0 */ #endif #endif /* PNG_bKGD_SUPPORTED */ #ifdef PNG_WRITE_FLUSH_SUPPORTED png_flush_ptr output_flush_fn; /* Function for flushing output */ png_uint_32 flush_dist; /* how many rows apart to flush, 0 - no flush */ png_uint_32 flush_rows; /* number of rows written since last flush */ #endif #ifdef PNG_READ_GAMMA_SUPPORTED int gamma_shift; /* number of "insignificant" bits in 16-bit gamma */ png_fixed_point screen_gamma; /* screen gamma value (display_exponent) */ png_bytep gamma_table; /* gamma table for 8-bit depth files */ png_uint_16pp gamma_16_table; /* gamma table for 16-bit depth files */ #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ defined(PNG_READ_ALPHA_MODE_SUPPORTED) || \ defined(PNG_READ_RGB_TO_GRAY_SUPPORTED) png_bytep gamma_from_1; /* converts from 1.0 to screen */ png_bytep gamma_to_1; /* converts from file to 1.0 */ png_uint_16pp gamma_16_from_1; /* converts from 1.0 to screen */ png_uint_16pp gamma_16_to_1; /* converts from file to 1.0 */ #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ #endif #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_sBIT_SUPPORTED) png_color_8 sig_bit; /* significant bits in each available channel */ #endif #if defined(PNG_READ_SHIFT_SUPPORTED) || defined(PNG_WRITE_SHIFT_SUPPORTED) png_color_8 shift; /* shift for significant bit tranformation */ #endif #if defined(PNG_tRNS_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) \ || defined(PNG_READ_EXPAND_SUPPORTED) || defined(PNG_READ_BACKGROUND_SUPPORTED) png_bytep trans_alpha; /* alpha values for paletted files */ png_color_16 trans_color; /* transparent color for non-paletted files */ #endif png_read_status_ptr read_row_fn; /* called after each row is decoded */ png_write_status_ptr write_row_fn; /* called after each row is encoded */ #ifdef PNG_PROGRESSIVE_READ_SUPPORTED png_progressive_info_ptr info_fn; /* called after header data fully read */ png_progressive_row_ptr row_fn; /* called after a prog. row is decoded */ png_progressive_end_ptr end_fn; /* called after image is complete */ png_bytep save_buffer_ptr; /* current location in save_buffer */ png_bytep save_buffer; /* buffer for previously read data */ png_bytep current_buffer_ptr; /* current location in current_buffer */ png_bytep current_buffer; /* buffer for recently used data */ png_uint_32 push_length; /* size of current input chunk */ png_uint_32 skip_length; /* bytes to skip in input data */ png_size_t save_buffer_size; /* amount of data now in save_buffer */ png_size_t save_buffer_max; /* total size of save_buffer */ png_size_t buffer_size; /* total amount of available input data */ png_size_t current_buffer_size; /* amount of data now in current_buffer */ int process_mode; /* what push library is currently doing */ int cur_palette; /* current push library palette index */ #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) /* For the Borland special 64K segment handler */ png_bytepp offset_table_ptr; png_bytep offset_table; png_uint_16 offset_table_number; png_uint_16 offset_table_count; png_uint_16 offset_table_count_free; #endif #ifdef PNG_READ_QUANTIZE_SUPPORTED png_bytep palette_lookup; /* lookup table for quantizing */ png_bytep quantize_index; /* index translation for palette files */ #endif #ifdef PNG_WRITE_WEIGHTED_FILTER_SUPPORTED png_byte heuristic_method; /* heuristic for row filter selection */ png_byte num_prev_filters; /* number of weights for previous rows */ png_bytep prev_filters; /* filter type(s) of previous row(s) */ png_uint_16p filter_weights; /* weight(s) for previous line(s) */ png_uint_16p inv_filter_weights; /* 1/weight(s) for previous line(s) */ png_uint_16p filter_costs; /* relative filter calculation cost */ png_uint_16p inv_filter_costs; /* 1/relative filter calculation cost */ #endif /* Options */ #ifdef PNG_SET_OPTION_SUPPORTED png_byte options; /* On/off state (up to 4 options) */ #endif #if PNG_LIBPNG_VER < 10700 /* To do: remove this from libpng-1.7 */ #ifdef PNG_TIME_RFC1123_SUPPORTED char time_buffer[29]; /* String to hold RFC 1123 time text */ #endif #endif /* New members added in libpng-1.0.6 */ png_uint_32 free_me; /* flags items libpng is responsible for freeing */ #ifdef PNG_USER_CHUNKS_SUPPORTED png_voidp user_chunk_ptr; #ifdef PNG_READ_USER_CHUNKS_SUPPORTED png_user_chunk_ptr read_user_chunk_fn; /* user read chunk handler */ #endif #endif #ifdef PNG_SET_UNKNOWN_CHUNKS_SUPPORTED int unknown_default; /* As PNG_HANDLE_* */ unsigned int num_chunk_list; /* Number of entries in the list */ png_bytep chunk_list; /* List of png_byte[5]; the textual chunk name * followed by a PNG_HANDLE_* byte */ #endif /* New members added in libpng-1.0.3 */ #ifdef PNG_READ_RGB_TO_GRAY_SUPPORTED png_byte rgb_to_gray_status; /* Added in libpng 1.5.5 to record setting of coefficients: */ png_byte rgb_to_gray_coefficients_set; /* These were changed from png_byte in libpng-1.0.6 */ png_uint_16 rgb_to_gray_red_coeff; png_uint_16 rgb_to_gray_green_coeff; /* deleted in 1.5.5: rgb_to_gray_blue_coeff; */ #endif /* New member added in libpng-1.0.4 (renamed in 1.0.9) */ #if defined(PNG_MNG_FEATURES_SUPPORTED) /* Changed from png_byte to png_uint_32 at version 1.2.0 */ png_uint_32 mng_features_permitted; #endif /* New member added in libpng-1.0.9, ifdef'ed out in 1.0.12, enabled in 1.2.0 */ #ifdef PNG_MNG_FEATURES_SUPPORTED png_byte filter_type; #endif /* New members added in libpng-1.2.0 */ /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ #ifdef PNG_USER_MEM_SUPPORTED png_voidp mem_ptr; /* user supplied struct for mem functions */ png_malloc_ptr malloc_fn; /* function for allocating memory */ png_free_ptr free_fn; /* function for freeing memory */ #endif /* New member added in libpng-1.0.13 and 1.2.0 */ png_bytep big_row_buf; /* buffer to save current (unfiltered) row */ #ifdef PNG_READ_QUANTIZE_SUPPORTED /* The following three members were added at version 1.0.14 and 1.2.4 */ png_bytep quantize_sort; /* working sort array */ png_bytep index_to_palette; /* where the original index currently is in the palette */ png_bytep palette_to_index; /* which original index points to this palette color */ #endif /* New members added in libpng-1.0.16 and 1.2.6 */ png_byte compression_type; #ifdef PNG_USER_LIMITS_SUPPORTED png_uint_32 user_width_max; png_uint_32 user_height_max; /* Added in libpng-1.4.0: Total number of sPLT, text, and unknown * chunks that can be stored (0 means unlimited). */ png_uint_32 user_chunk_cache_max; /* Total memory that a zTXt, sPLT, iTXt, iCCP, or unknown chunk * can occupy when decompressed. 0 means unlimited. */ png_alloc_size_t user_chunk_malloc_max; #endif /* New member added in libpng-1.0.25 and 1.2.17 */ #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED /* Temporary storage for unknown chunk that the library doesn't recognize, * used while reading the chunk. */ png_unknown_chunk unknown_chunk; #endif /* New member added in libpng-1.2.26 */ png_size_t old_big_row_buf_size; #ifdef PNG_READ_SUPPORTED /* New member added in libpng-1.2.30 */ png_bytep read_buffer; /* buffer for reading chunk data */ png_alloc_size_t read_buffer_size; /* current size of the buffer */ #endif #ifdef PNG_SEQUENTIAL_READ_SUPPORTED uInt IDAT_read_size; /* limit on read buffer size for IDAT */ #endif #ifdef PNG_IO_STATE_SUPPORTED /* New member added in libpng-1.4.0 */ png_uint_32 io_state; #endif /* New member added in libpng-1.5.6 */ png_bytep big_prev_row; /* New member added in libpng-1.5.7 */ void (*read_filter[PNG_FILTER_VALUE_LAST-1])(png_row_infop row_info, png_bytep row, png_const_bytep prev_row); #ifdef PNG_READ_SUPPORTED #if defined(PNG_COLORSPACE_SUPPORTED) || defined(PNG_GAMMA_SUPPORTED) png_colorspace colorspace; #endif #endif }; #endif /* PNGSTRUCT_H */ ================================================ FILE: Libraries/Core/iOS/Headers/rapidxml/rapidxml.hpp ================================================ #ifndef RAPIDXML_HPP_INCLUDED #define RAPIDXML_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml.hpp This file contains rapidxml parser and DOM implementation // If standard library is disabled, user must provide implementations of required functions and typedefs #if !defined(RAPIDXML_NO_STDLIB) #include // For std::size_t #include // For assert #include // For placement new #endif // On MSVC, disable "conditional expression is constant" warning (level 4). // This warning is almost impossible to avoid with certain types of templated code #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable:4127) // Conditional expression is constant #endif /////////////////////////////////////////////////////////////////////////// // RAPIDXML_PARSE_ERROR #if defined(RAPIDXML_NO_EXCEPTIONS) #define RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); } namespace rapidxml { //! When exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, //! this function is called to notify user about the error. //! It must be defined by the user. //!

//! This function cannot return. If it does, the results are undefined. //!

//! A very simple definition might look like that: //!
    //! void %rapidxml::%parse_error_handler(const char *what, void *where)
    //! {
    //!     std::cout << "Parse error: " << what << "\n";
    //!     std::abort();
    //! }
    //! 
//! \param what Human readable description of the error. //! \param where Pointer to character data where error was detected. void parse_error_handler(const char *what, void *where); } #else #include // For std::exception #define RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where) namespace rapidxml { //! Parse error exception. //! This exception is thrown by the parser when an error occurs. //! Use what() function to get human-readable error message. //! Use where() function to get a pointer to position within source text where error was detected. //!

//! If throwing exceptions by the parser is undesirable, //! it can be disabled by defining RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included. //! This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception. //! This function must be defined by the user. //!

//! This class derives from std::exception class. class parse_error: public std::exception { public: //! Constructs parse error parse_error(const char *what, void *where) : m_what(what) , m_where(where) { } //! Gets human readable description of error. //! \return Pointer to null terminated description of the error. virtual const char *what() const throw() { return m_what; } //! Gets pointer to character data where error happened. //! Ch should be the same as char type of xml_document that produced the error. //! \return Pointer to location within the parsed string where error occured. template Ch *where() const { return reinterpret_cast(m_where); } private: const char *m_what; void *m_where; }; } #endif /////////////////////////////////////////////////////////////////////////// // Pool sizes #ifndef RAPIDXML_STATIC_POOL_SIZE // Size of static memory block of memory_pool. // Define RAPIDXML_STATIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. // No dynamic memory allocations are performed by memory_pool until static memory is exhausted. #define RAPIDXML_STATIC_POOL_SIZE (64 * 1024) #endif #ifndef RAPIDXML_DYNAMIC_POOL_SIZE // Size of dynamic memory block of memory_pool. // Define RAPIDXML_DYNAMIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value. // After the static block is exhausted, dynamic blocks with approximately this size are allocated by memory_pool. #define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024) #endif #ifndef RAPIDXML_ALIGNMENT // Memory allocation alignment. // Define RAPIDXML_ALIGNMENT before including rapidxml.hpp if you want to override the default value, which is the size of pointer. // All memory allocations for nodes, attributes and strings will be aligned to this value. // This must be a power of 2 and at least 1, otherwise memory_pool will not work. #define RAPIDXML_ALIGNMENT sizeof(void *) #endif namespace rapidxml { // Forward declarations template class xml_node; template class xml_attribute; template class xml_document; //! Enumeration listing all node types produced by the parser. //! Use xml_node::type() function to query node type. enum node_type { node_document, //!< A document node. Name and value are empty. node_element, //!< An element node. Name contains element name. Value contains text of first data node. node_data, //!< A data node. Name is empty. Value contains data text. node_cdata, //!< A CDATA node. Name is empty. Value contains data text. node_comment, //!< A comment node. Name is empty. Value contains comment text. node_declaration, //!< A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes. node_doctype, //!< A DOCTYPE node. Name is empty. Value contains DOCTYPE text. node_pi //!< A PI node. Name contains target. Value contains instructions. }; /////////////////////////////////////////////////////////////////////// // Parsing flags //! Parse flag instructing the parser to not create data nodes. //! Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_data_nodes = 0x1; //! Parse flag instructing the parser to not use text of first data node as a value of parent element. //! Can be combined with other flags by use of | operator. //! Note that child data nodes of element node take precendence over its value when printing. //! That is, if element has one or more child data nodes and a value, the value will be ignored. //! Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements. //!

//! See xml_document::parse() function. const int parse_no_element_values = 0x2; //! Parse flag instructing the parser to not place zero terminators after strings in the source text. //! By default zero terminators are placed, modifying source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_string_terminators = 0x4; //! Parse flag instructing the parser to not translate entities in the source text. //! By default entities are translated, modifying source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_entity_translation = 0x8; //! Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters. //! By default, UTF-8 handling is enabled. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_no_utf8 = 0x10; //! Parse flag instructing the parser to create XML declaration node. //! By default, declaration node is not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_declaration_node = 0x20; //! Parse flag instructing the parser to create comments nodes. //! By default, comment nodes are not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_comment_nodes = 0x40; //! Parse flag instructing the parser to create DOCTYPE node. //! By default, doctype node is not created. //! Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_doctype_node = 0x80; //! Parse flag instructing the parser to create PI nodes. //! By default, PI nodes are not created. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_pi_nodes = 0x100; //! Parse flag instructing the parser to validate closing tag names. //! If not set, name inside closing tag is irrelevant to the parser. //! By default, closing tags are not validated. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_validate_closing_tags = 0x200; //! Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes. //! By default, whitespace is not trimmed. //! This flag does not cause the parser to modify source text. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_trim_whitespace = 0x400; //! Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character. //! Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag. //! By default, whitespace is not normalized. //! If this flag is specified, source text will be modified. //! Can be combined with other flags by use of | operator. //!

//! See xml_document::parse() function. const int parse_normalize_whitespace = 0x800; // Compound flags //! Parse flags which represent default behaviour of the parser. //! This is always equal to 0, so that all other flags can be simply ored together. //! Normally there is no need to inconveniently disable flags by anding with their negated (~) values. //! This also means that meaning of each flag is a negation of the default setting. //! For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is enabled by default, //! and using the flag will disable it. //!

//! See xml_document::parse() function. const int parse_default = 0; //! A combination of parse flags that forbids any modifications of the source text. //! This also results in faster parsing. However, note that the following will occur: //!
    //!
  • names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends
  • //!
  • entities will not be translated
  • //!
  • whitespace will not be normalized
  • //!
//! See xml_document::parse() function. const int parse_non_destructive = parse_no_string_terminators | parse_no_entity_translation; //! A combination of parse flags resulting in fastest possible parsing, without sacrificing important data. //!

//! See xml_document::parse() function. const int parse_fastest = parse_non_destructive | parse_no_data_nodes; //! A combination of parse flags resulting in largest amount of data being extracted. //! This usually results in slowest parsing. //!

//! See xml_document::parse() function. const int parse_full = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags; /////////////////////////////////////////////////////////////////////// // Internals //! \cond internal namespace internal { // Struct that contains lookup tables for the parser // It must be a template to allow correct linking (because it has static data members, which are defined in a header file). template struct lookup_tables { static const unsigned char lookup_whitespace[256]; // Whitespace table static const unsigned char lookup_node_name[256]; // Node name table static const unsigned char lookup_text[256]; // Text table static const unsigned char lookup_text_pure_no_ws[256]; // Text table static const unsigned char lookup_text_pure_with_ws[256]; // Text table static const unsigned char lookup_attribute_name[256]; // Attribute name table static const unsigned char lookup_attribute_data_1[256]; // Attribute data table with single quote static const unsigned char lookup_attribute_data_1_pure[256]; // Attribute data table with single quote static const unsigned char lookup_attribute_data_2[256]; // Attribute data table with double quotes static const unsigned char lookup_attribute_data_2_pure[256]; // Attribute data table with double quotes static const unsigned char lookup_digits[256]; // Digits static const unsigned char lookup_upcase[256]; // To uppercase conversion table for ASCII characters }; // Find length of the string template inline std::size_t measure(const Ch *p) { const Ch *tmp = p; while (*tmp) ++tmp; return tmp - p; } // Compare strings for equality template inline bool compare(const Ch *p1, std::size_t size1, const Ch *p2, std::size_t size2, bool case_sensitive) { if (size1 != size2) return false; if (case_sensitive) { for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) if (*p1 != *p2) return false; } else { for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2) if (lookup_tables<0>::lookup_upcase[static_cast(*p1)] != lookup_tables<0>::lookup_upcase[static_cast(*p2)]) return false; } return true; } } //! \endcond /////////////////////////////////////////////////////////////////////// // Memory pool //! This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation. //! In most cases, you will not need to use this class directly. //! However, if you need to create nodes manually or modify names/values of nodes, //! you are encouraged to use memory_pool of relevant xml_document to allocate the memory. //! Not only is this faster than allocating them by using new operator, //! but also their lifetime will be tied to the lifetime of document, //! possibly simplyfing memory management. //!

//! Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. //! You can also call allocate_string() function to allocate strings. //! Such strings can then be used as names or values of nodes without worrying about their lifetime. //! Note that there is no free() function -- all allocations are freed at once when clear() function is called, //! or when the pool is destroyed. //!

//! It is also possible to create a standalone memory_pool, and use it //! to allocate nodes, whose lifetime will not be tied to any document. //!

//! Pool maintains RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. //! Until static memory is exhausted, no dynamic memory allocations are done. //! When static memory is exhausted, pool allocates additional blocks of memory of size RAPIDXML_DYNAMIC_POOL_SIZE each, //! by using global new[] and delete[] operators. //! This behaviour can be changed by setting custom allocation routines. //! Use set_allocator() function to set them. //!

//! Allocations for nodes, attributes and strings are aligned at RAPIDXML_ALIGNMENT bytes. //! This value defaults to the size of pointer on target architecture. //!

//! To obtain absolutely top performance from the parser, //! it is important that all nodes are allocated from a single, contiguous block of memory. //! Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably. //! If required, you can tweak RAPIDXML_STATIC_POOL_SIZE, RAPIDXML_DYNAMIC_POOL_SIZE and RAPIDXML_ALIGNMENT //! to obtain best wasted memory to performance compromise. //! To do it, define their values before rapidxml.hpp file is included. //! \param Ch Character type of created nodes. template class memory_pool { public: //! \cond internal typedef void *(rapidxml_alloc_func)(std::size_t); // Type of user-defined function used to allocate memory typedef void (free_func)(void *); // Type of user-defined function used to free memory //! \endcond //! Constructs empty pool with default allocator functions. memory_pool() : m_rapidxml_alloc_func(0) , m_free_func(0) { init(); } //! Destroys pool and frees all the memory. //! This causes memory occupied by nodes allocated by the pool to be freed. //! Nodes allocated from the pool are no longer valid. ~memory_pool() { clear(); } //! Allocates a new node from the pool, and optionally assigns name and value to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param type Type of node to create. //! \param name Name to assign to the node, or 0 to assign no name. //! \param value Value to assign to the node, or 0 to assign no value. //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. //! \return Pointer to allocated node. This pointer will never be NULL. xml_node *allocate_node(node_type type, const Ch *name = 0, const Ch *value = 0, std::size_t name_size = 0, std::size_t value_size = 0) { void *memory = allocate_aligned(sizeof(xml_node)); xml_node *node = new(memory) xml_node(type); if (name) { if (name_size > 0) node->name(name, name_size); else node->name(name); } if (value) { if (value_size > 0) node->value(value, value_size); else node->value(value); } return node; } //! Allocates a new attribute from the pool, and optionally assigns name and value to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param name Name to assign to the attribute, or 0 to assign no name. //! \param value Value to assign to the attribute, or 0 to assign no value. //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string. //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string. //! \return Pointer to allocated attribute. This pointer will never be NULL. xml_attribute *allocate_attribute(const Ch *name = 0, const Ch *value = 0, std::size_t name_size = 0, std::size_t value_size = 0) { void *memory = allocate_aligned(sizeof(xml_attribute)); xml_attribute *attribute = new(memory) xml_attribute; if (name) { if (name_size > 0) attribute->name(name, name_size); else attribute->name(name); } if (value) { if (value_size > 0) attribute->value(value, value_size); else attribute->value(value); } return attribute; } //! Allocates a char array of given size from the pool, and optionally copies a given string to it. //! If the allocation request cannot be accomodated, this function will throw std::bad_alloc. //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function //! will call rapidxml::parse_error_handler() function. //! \param source String to initialize the allocated memory with, or 0 to not initialize it. //! \param size Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated. //! \return Pointer to allocated char array. This pointer will never be NULL. Ch *allocate_string(const Ch *source = 0, std::size_t size = 0) { assert(source || size); // Either source or size (or both) must be specified if (size == 0) size = internal::measure(source) + 1; Ch *result = static_cast(allocate_aligned(size * sizeof(Ch))); if (source) for (std::size_t i = 0; i < size; ++i) result[i] = source[i]; return result; } //! Clones an xml_node and its hierarchy of child nodes and attributes. //! Nodes and attributes are allocated from this memory pool. //! Names and values are not cloned, they are shared between the clone and the source. //! Result node can be optionally specified as a second parameter, //! in which case its contents will be replaced with cloned source node. //! This is useful when you want to clone entire document. //! \param source Node to clone. //! \param result Node to put results in, or 0 to automatically allocate result node //! \return Pointer to cloned node. This pointer will never be NULL. xml_node *clone_node(const xml_node *source, xml_node *result = 0) { // Prepare result node if (result) { result->remove_all_attributes(); result->remove_all_nodes(); result->type(source->type()); } else result = allocate_node(source->type()); // Clone name and value result->name(source->name(), source->name_size()); result->value(source->value(), source->value_size()); // Clone child nodes and attributes for (xml_node *child = source->first_node(); child; child = child->next_sibling()) result->append_node(clone_node(child)); for (xml_attribute *attr = source->first_attribute(); attr; attr = attr->next_attribute()) result->append_attribute(allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size())); return result; } //! Clears the pool. //! This causes memory occupied by nodes allocated by the pool to be freed. //! Any nodes or strings allocated from the pool will no longer be valid. void clear() { while (m_begin != m_static_memory) { char *previous_begin = reinterpret_cast
(align(m_begin))->previous_begin; if (m_free_func) m_free_func(m_begin); else delete[] m_begin; m_begin = previous_begin; } init(); } //! Sets or resets the user-defined memory allocation functions for the pool. //! This can only be called when no memory is allocated from the pool yet, otherwise results are undefined. //! Allocation function must not return invalid pointer on failure. It should either throw, //! stop the program, or use longjmp() function to pass control to other place of program. //! If it returns invalid pointer, results are undefined. //!

//! User defined allocation functions must have the following forms: //!
//!
void *allocate(std::size_t size); //!
void free(void *pointer); //!

//! \param af Allocation function, or 0 to restore default function //! \param ff Free function, or 0 to restore default function void set_allocator(rapidxml_alloc_func *af, free_func *ff) { assert(m_begin == m_static_memory && m_ptr == align(m_begin)); // Verify that no memory is allocated yet m_rapidxml_alloc_func = af; m_free_func = ff; } private: struct header { char *previous_begin; }; void init() { m_begin = m_static_memory; m_ptr = align(m_begin); m_end = m_static_memory + sizeof(m_static_memory); } char *align(char *ptr) { std::size_t alignment = ((RAPIDXML_ALIGNMENT - (std::size_t(ptr) & (RAPIDXML_ALIGNMENT - 1))) & (RAPIDXML_ALIGNMENT - 1)); return ptr + alignment; } char *allocate_raw(std::size_t size) { // Allocate void *memory; if (m_rapidxml_alloc_func) // Allocate memory using either user-specified allocation function or global operator new[] { memory = m_rapidxml_alloc_func(size); assert(memory); // Allocator is not allowed to return 0, on failure it must either throw, stop the program or use longjmp } else { memory = new char[size]; #ifdef RAPIDXML_NO_EXCEPTIONS if (!memory) // If exceptions are disabled, verify memory allocation, because new will not be able to throw bad_alloc RAPIDXML_PARSE_ERROR("out of memory", 0); #endif } return static_cast(memory); } void *allocate_aligned(std::size_t size) { // Calculate aligned pointer char *result = align(m_ptr); // If not enough memory left in current pool, allocate a new pool if (result + size > m_end) { // Calculate required pool size (may be bigger than RAPIDXML_DYNAMIC_POOL_SIZE) std::size_t pool_size = RAPIDXML_DYNAMIC_POOL_SIZE; if (pool_size < size) pool_size = size; // Allocate std::size_t alloc_size = sizeof(header) + (2 * RAPIDXML_ALIGNMENT - 2) + pool_size; // 2 alignments required in worst case: one for header, one for actual allocation char *raw_memory = allocate_raw(alloc_size); // Setup new pool in allocated memory char *pool = align(raw_memory); header *new_header = reinterpret_cast
(pool); new_header->previous_begin = m_begin; m_begin = raw_memory; m_ptr = pool + sizeof(header); m_end = raw_memory + alloc_size; // Calculate aligned pointer again using new pool result = align(m_ptr); } // Update pool and return aligned pointer m_ptr = result + size; return result; } char *m_begin; // Start of raw memory making up current pool char *m_ptr; // First free byte in current pool char *m_end; // One past last available byte in current pool char m_static_memory[RAPIDXML_STATIC_POOL_SIZE]; // Static raw memory rapidxml_alloc_func *m_rapidxml_alloc_func; // Allocator function, or 0 if default is to be used free_func *m_free_func; // Free function, or 0 if default is to be used }; /////////////////////////////////////////////////////////////////////////// // XML base //! Base class for xml_node and xml_attribute implementing common functions: //! name(), name_size(), value(), value_size() and parent(). //! \param Ch Character type to use template class xml_base { public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction // Construct a base with empty name, value and parent xml_base() : m_name(0) , m_value(0) , m_parent(0) { } /////////////////////////////////////////////////////////////////////////// // Node data access //! Gets name of the node. //! Interpretation of name depends on type of node. //! Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. //!

//! Use name_size() function to determine length of the name. //! \return Name of node, or empty string if node has no name. Ch *name() const { return m_name ? m_name : nullstr(); } //! Gets size of node name, not including terminator character. //! This function works correctly irrespective of whether name is or is not zero terminated. //! \return Size of node name, in characters. std::size_t name_size() const { return m_name ? m_name_size : 0; } //! Gets value of node. //! Interpretation of value depends on type of node. //! Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse. //!

//! Use value_size() function to determine length of the value. //! \return Value of node, or empty string if node has no value. Ch *value() const { return m_value ? m_value : nullstr(); } //! Gets size of node value, not including terminator character. //! This function works correctly irrespective of whether value is or is not zero terminated. //! \return Size of node value, in characters. std::size_t value_size() const { return m_value ? m_value_size : 0; } /////////////////////////////////////////////////////////////////////////// // Node modification //! Sets name of node to a non zero-terminated string. //! See \ref ownership_of_strings. //!

//! Note that node does not own its name or value, it only stores a pointer to it. //! It will not delete or otherwise free the pointer on destruction. //! It is reponsibility of the user to properly manage lifetime of the string. //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - //! on destruction of the document the string will be automatically freed. //!

//! Size of name must be specified separately, because name does not have to be zero terminated. //! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated). //! \param name Name of node to set. Does not have to be zero terminated. //! \param size Size of name, in characters. This does not include zero terminator, if one is present. void name(const Ch *name, std::size_t size) { m_name = const_cast(name); m_name_size = size; } //! Sets name of node to a zero-terminated string. //! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t). //! \param name Name of node to set. Must be zero terminated. void name(const Ch *name) { this->name(name, internal::measure(name)); } //! Sets value of node to a non zero-terminated string. //! See \ref ownership_of_strings. //!

//! Note that node does not own its name or value, it only stores a pointer to it. //! It will not delete or otherwise free the pointer on destruction. //! It is reponsibility of the user to properly manage lifetime of the string. //! The easiest way to achieve it is to use memory_pool of the document to allocate the string - //! on destruction of the document the string will be automatically freed. //!

//! Size of value must be specified separately, because it does not have to be zero terminated. //! Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated). //!

//! If an element has a child node of type node_data, it will take precedence over element value when printing. //! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser. //! \param value value of node to set. Does not have to be zero terminated. //! \param size Size of value, in characters. This does not include zero terminator, if one is present. void value(const Ch *value, std::size_t size) { m_value = const_cast(value); m_value_size = size; } //! Sets value of node to a zero-terminated string. //! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t). //! \param value Vame of node to set. Must be zero terminated. void value(const Ch *value) { this->value(value, internal::measure(value)); } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets node parent. //! \return Pointer to parent node, or 0 if there is no parent. xml_node *parent() const { return m_parent; } protected: // Return empty string static Ch *nullstr() { static Ch zero = Ch('\0'); return &zero; } Ch *m_name; // Name of node, or 0 if no name Ch *m_value; // Value of node, or 0 if no value std::size_t m_name_size; // Length of node name, or undefined of no name std::size_t m_value_size; // Length of node value, or undefined if no value xml_node *m_parent; // Pointer to parent node, or 0 if none }; //! Class representing attribute node of XML document. //! Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base). //! Note that after parse, both name and value of attribute will point to interior of source text used for parsing. //! Thus, this text must persist in memory for the lifetime of attribute. //! \param Ch Character type to use. template class xml_attribute: public xml_base { friend class xml_node; public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction //! Constructs an empty attribute with the specified type. //! Consider using memory_pool of appropriate xml_document if allocating attributes manually. xml_attribute() { } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets document of which attribute is a child. //! \return Pointer to document that contains this attribute, or 0 if there is no parent document. xml_document *document() const { if (xml_node *node = this->parent()) { while (node->parent()) node = node->parent(); return node->type() == node_document ? static_cast *>(node) : 0; } else return 0; } //! Gets previous attribute, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return this->m_parent ? m_prev_attribute : 0; } //! Gets next attribute, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *next_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return this->m_parent ? m_next_attribute : 0; } private: xml_attribute *m_prev_attribute; // Pointer to previous sibling of attribute, or 0 if none; only valid if parent is non-zero xml_attribute *m_next_attribute; // Pointer to next sibling of attribute, or 0 if none; only valid if parent is non-zero }; /////////////////////////////////////////////////////////////////////////// // XML node //! Class representing a node of XML document. //! Each node may have associated name and value strings, which are available through name() and value() functions. //! Interpretation of name and value depends on type of the node. //! Type of node can be determined by using type() function. //!

//! Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. //! Thus, this text must persist in the memory for the lifetime of node. //! \param Ch Character type to use. template class xml_node: public xml_base { public: /////////////////////////////////////////////////////////////////////////// // Construction & destruction //! Constructs an empty node with the specified type. //! Consider using memory_pool of appropriate document to allocate nodes manually. //! \param type Type of node to construct. xml_node(node_type type) : m_type(type) , m_first_node(0) , m_first_attribute(0) { } /////////////////////////////////////////////////////////////////////////// // Node data access //! Gets type of node. //! \return Type of node. node_type type() const { return m_type; } /////////////////////////////////////////////////////////////////////////// // Related nodes access //! Gets document of which node is a child. //! \return Pointer to document that contains this node, or 0 if there is no parent document. xml_document *document() const { xml_node *node = const_cast *>(this); while (node->parent()) node = node->parent(); return node->type() == node_document ? static_cast *>(node) : 0; } //! Gets first child node, optionally matching node name. //! \param name Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found child, or 0 if not found. xml_node *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *child = m_first_node; child; child = child->next_sibling()) if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) return child; return 0; } else return m_first_node; } //! Gets last child node, optionally matching node name. //! Behaviour is undefined if node has no children. //! Use first_node() to test if node has children. //! \param name Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found child, or 0 if not found. xml_node *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(m_first_node); // Cannot query for last child if node has no children if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *child = m_last_node; child; child = child->previous_sibling()) if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive)) return child; return 0; } else return m_last_node; } //! Gets previous sibling node, optionally matching node name. //! Behaviour is undefined if node has no parent. //! Use parent() to test if node has a parent. //! \param name Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found sibling, or 0 if not found. xml_node *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(this->m_parent); // Cannot query for siblings if node has no parent if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling) if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) return sibling; return 0; } else return m_prev_sibling; } //! Gets next sibling node, optionally matching node name. //! Behaviour is undefined if node has no parent. //! Use parent() to test if node has a parent. //! \param name Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found sibling, or 0 if not found. xml_node *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { assert(this->m_parent); // Cannot query for siblings if node has no parent if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_node *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling) if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive)) return sibling; return 0; } else return m_next_sibling; } //! Gets first attribute of node, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return m_first_attribute; } //! Gets last attribute of node, optionally matching attribute name. //! \param name Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters //! \return Pointer to found attribute, or 0 if not found. xml_attribute *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const { if (name) { if (name_size == 0) name_size = internal::measure(name); for (xml_attribute *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute) if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive)) return attribute; return 0; } else return m_first_attribute ? m_last_attribute : 0; } /////////////////////////////////////////////////////////////////////////// // Node modification //! Sets type of node. //! \param type Type of node to set. void type(node_type type) { m_type = type; } /////////////////////////////////////////////////////////////////////////// // Node manipulation //! Prepends a new child node. //! The prepended child becomes the first child, and all existing children are moved one position back. //! \param child Node to prepend. void prepend_node(xml_node *child) { assert(child && !child->parent() && child->type() != node_document); if (first_node()) { child->m_next_sibling = m_first_node; m_first_node->m_prev_sibling = child; } else { child->m_next_sibling = 0; m_last_node = child; } m_first_node = child; child->m_parent = this; child->m_prev_sibling = 0; } //! Appends a new child node. //! The appended child becomes the last child. //! \param child Node to append. void append_node(xml_node *child) { assert(child && !child->parent() && child->type() != node_document); if (first_node()) { child->m_prev_sibling = m_last_node; m_last_node->m_next_sibling = child; } else { child->m_prev_sibling = 0; m_first_node = child; } m_last_node = child; child->m_parent = this; child->m_next_sibling = 0; } //! Inserts a new child node at specified place inside the node. //! All children after and including the specified node are moved one position back. //! \param where Place where to insert the child, or 0 to insert at the back. //! \param child Node to insert. void insert_node(xml_node *where, xml_node *child) { assert(!where || where->parent() == this); assert(child && !child->parent() && child->type() != node_document); if (where == m_first_node) prepend_node(child); else if (where == 0) append_node(child); else { child->m_prev_sibling = where->m_prev_sibling; child->m_next_sibling = where; where->m_prev_sibling->m_next_sibling = child; where->m_prev_sibling = child; child->m_parent = this; } } //! Removes first child node. //! If node has no children, behaviour is undefined. //! Use first_node() to test if node has children. void remove_first_node() { assert(first_node()); xml_node *child = m_first_node; m_first_node = child->m_next_sibling; if (child->m_next_sibling) child->m_next_sibling->m_prev_sibling = 0; else m_last_node = 0; child->m_parent = 0; } //! Removes last child of the node. //! If node has no children, behaviour is undefined. //! Use first_node() to test if node has children. void remove_last_node() { assert(first_node()); xml_node *child = m_last_node; if (child->m_prev_sibling) { m_last_node = child->m_prev_sibling; child->m_prev_sibling->m_next_sibling = 0; } else m_first_node = 0; child->m_parent = 0; } //! Removes specified child from the node // \param where Pointer to child to be removed. void remove_node(xml_node *where) { assert(where && where->parent() == this); assert(first_node()); if (where == m_first_node) remove_first_node(); else if (where == m_last_node) remove_last_node(); else { where->m_prev_sibling->m_next_sibling = where->m_next_sibling; where->m_next_sibling->m_prev_sibling = where->m_prev_sibling; where->m_parent = 0; } } //! Removes all child nodes (but not attributes). void remove_all_nodes() { for (xml_node *node = first_node(); node; node = node->m_next_sibling) node->m_parent = 0; m_first_node = 0; } //! Prepends a new attribute to the node. //! \param attribute Attribute to prepend. void prepend_attribute(xml_attribute *attribute) { assert(attribute && !attribute->parent()); if (first_attribute()) { attribute->m_next_attribute = m_first_attribute; m_first_attribute->m_prev_attribute = attribute; } else { attribute->m_next_attribute = 0; m_last_attribute = attribute; } m_first_attribute = attribute; attribute->m_parent = this; attribute->m_prev_attribute = 0; } //! Appends a new attribute to the node. //! \param attribute Attribute to append. void append_attribute(xml_attribute *attribute) { assert(attribute && !attribute->parent()); if (first_attribute()) { attribute->m_prev_attribute = m_last_attribute; m_last_attribute->m_next_attribute = attribute; } else { attribute->m_prev_attribute = 0; m_first_attribute = attribute; } m_last_attribute = attribute; attribute->m_parent = this; attribute->m_next_attribute = 0; } //! Inserts a new attribute at specified place inside the node. //! All attributes after and including the specified attribute are moved one position back. //! \param where Place where to insert the attribute, or 0 to insert at the back. //! \param attribute Attribute to insert. void insert_attribute(xml_attribute *where, xml_attribute *attribute) { assert(!where || where->parent() == this); assert(attribute && !attribute->parent()); if (where == m_first_attribute) prepend_attribute(attribute); else if (where == 0) append_attribute(attribute); else { attribute->m_prev_attribute = where->m_prev_attribute; attribute->m_next_attribute = where; where->m_prev_attribute->m_next_attribute = attribute; where->m_prev_attribute = attribute; attribute->m_parent = this; } } //! Removes first attribute of the node. //! If node has no attributes, behaviour is undefined. //! Use first_attribute() to test if node has attributes. void remove_first_attribute() { assert(first_attribute()); xml_attribute *attribute = m_first_attribute; if (attribute->m_next_attribute) { attribute->m_next_attribute->m_prev_attribute = 0; } else m_last_attribute = 0; attribute->m_parent = 0; m_first_attribute = attribute->m_next_attribute; } //! Removes last attribute of the node. //! If node has no attributes, behaviour is undefined. //! Use first_attribute() to test if node has attributes. void remove_last_attribute() { assert(first_attribute()); xml_attribute *attribute = m_last_attribute; if (attribute->m_prev_attribute) { attribute->m_prev_attribute->m_next_attribute = 0; m_last_attribute = attribute->m_prev_attribute; } else m_first_attribute = 0; attribute->m_parent = 0; } //! Removes specified attribute from node. //! \param where Pointer to attribute to be removed. void remove_attribute(xml_attribute *where) { assert(first_attribute() && where->parent() == this); if (where == m_first_attribute) remove_first_attribute(); else if (where == m_last_attribute) remove_last_attribute(); else { where->m_prev_attribute->m_next_attribute = where->m_next_attribute; where->m_next_attribute->m_prev_attribute = where->m_prev_attribute; where->m_parent = 0; } } //! Removes all attributes of node. void remove_all_attributes() { for (xml_attribute *attribute = first_attribute(); attribute; attribute = attribute->m_next_attribute) attribute->m_parent = 0; m_first_attribute = 0; } private: /////////////////////////////////////////////////////////////////////////// // Restrictions // No copying xml_node(const xml_node &); void operator =(const xml_node &); /////////////////////////////////////////////////////////////////////////// // Data members // Note that some of the pointers below have UNDEFINED values if certain other pointers are 0. // This is required for maximum performance, as it allows the parser to omit initialization of // unneded/redundant values. // // The rules are as follows: // 1. first_node and first_attribute contain valid pointers, or 0 if node has no children/attributes respectively // 2. last_node and last_attribute are valid only if node has at least one child/attribute respectively, otherwise they contain garbage // 3. prev_sibling and next_sibling are valid only if node has a parent, otherwise they contain garbage node_type m_type; // Type of node; always valid xml_node *m_first_node; // Pointer to first child node, or 0 if none; always valid xml_node *m_last_node; // Pointer to last child node, or 0 if none; this value is only valid if m_first_node is non-zero xml_attribute *m_first_attribute; // Pointer to first attribute of node, or 0 if none; always valid xml_attribute *m_last_attribute; // Pointer to last attribute of node, or 0 if none; this value is only valid if m_first_attribute is non-zero xml_node *m_prev_sibling; // Pointer to previous sibling of node, or 0 if none; this value is only valid if m_parent is non-zero xml_node *m_next_sibling; // Pointer to next sibling of node, or 0 if none; this value is only valid if m_parent is non-zero }; /////////////////////////////////////////////////////////////////////////// // XML document //! This class represents root of the DOM hierarchy. //! It is also an xml_node and a memory_pool through public inheritance. //! Use parse() function to build a DOM tree from a zero-terminated XML text string. //! parse() function allocates memory for nodes and attributes by using functions of xml_document, //! which are inherited from memory_pool. //! To access root node of the document, use the document itself, as if it was an xml_node. //! \param Ch Character type to use. template class xml_document: public xml_node, public memory_pool { public: //! Constructs empty XML document xml_document() : xml_node(node_document) { } //! Parses zero-terminated XML string according to given flags. //! Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used. //! The string must persist for the lifetime of the document. //! In case of error, rapidxml::parse_error exception will be thrown. //!

//! If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning. //! Make sure that data is zero-terminated. //!

//! Document can be parsed into multiple times. //! Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool. //! \param text XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser. template void parse(Ch *text) { assert(text); // Remove current contents this->remove_all_nodes(); this->remove_all_attributes(); // Parse BOM, if any parse_bom(text); // Parse children while (1) { // Skip whitespace before node skip(text); if (*text == 0) break; // Parse and append new child if (*text == Ch('<')) { ++text; // Skip '<' if (xml_node *node = parse_node(text)) this->append_node(node); } else RAPIDXML_PARSE_ERROR("expected <", text); } } //! Clears the document by deleting all nodes and clearing the memory pool. //! All nodes owned by document pool are destroyed. void clear() { this->remove_all_nodes(); this->remove_all_attributes(); memory_pool::clear(); } private: /////////////////////////////////////////////////////////////////////// // Internal character utility functions // Detect whitespace character struct whitespace_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_whitespace[static_cast(ch)]; } }; // Detect node name character struct node_name_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_node_name[static_cast(ch)]; } }; // Detect attribute name character struct attribute_name_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_attribute_name[static_cast(ch)]; } }; // Detect text character (PCDATA) struct text_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text[static_cast(ch)]; } }; // Detect text character (PCDATA) that does not require processing struct text_pure_no_ws_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text_pure_no_ws[static_cast(ch)]; } }; // Detect text character (PCDATA) that does not require processing struct text_pure_with_ws_pred { static unsigned char test(Ch ch) { return internal::lookup_tables<0>::lookup_text_pure_with_ws[static_cast(ch)]; } }; // Detect attribute value character template struct attribute_value_pred { static unsigned char test(Ch ch) { if (Quote == Ch('\'')) return internal::lookup_tables<0>::lookup_attribute_data_1[static_cast(ch)]; if (Quote == Ch('\"')) return internal::lookup_tables<0>::lookup_attribute_data_2[static_cast(ch)]; return 0; // Should never be executed, to avoid warnings on Comeau } }; // Detect attribute value character template struct attribute_value_pure_pred { static unsigned char test(Ch ch) { if (Quote == Ch('\'')) return internal::lookup_tables<0>::lookup_attribute_data_1_pure[static_cast(ch)]; if (Quote == Ch('\"')) return internal::lookup_tables<0>::lookup_attribute_data_2_pure[static_cast(ch)]; return 0; // Should never be executed, to avoid warnings on Comeau } }; // Insert coded character, using UTF8 or 8-bit ASCII template static void insert_coded_character(Ch *&text, unsigned long code) { if (Flags & parse_no_utf8) { // Insert 8-bit ASCII character // Todo: possibly verify that code is less than 256 and use replacement char otherwise? text[0] = static_cast(code); text += 1; } else { // Insert UTF8 sequence if (code < 0x80) // 1 byte sequence { text[0] = static_cast(code); text += 1; } else if (code < 0x800) // 2 byte sequence { text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xC0); text += 2; } else if (code < 0x10000) // 3 byte sequence { text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xE0); text += 3; } else if (code < 0x110000) // 4 byte sequence { text[3] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[2] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[1] = static_cast((code | 0x80) & 0xBF); code >>= 6; text[0] = static_cast(code | 0xF0); text += 4; } else // Invalid, only codes up to 0x10FFFF are allowed in Unicode { RAPIDXML_PARSE_ERROR("invalid numeric character entity", text); } } } // Skip characters until predicate evaluates to true template static void skip(Ch *&text) { Ch *tmp = text; while (StopPred::test(*tmp)) ++tmp; text = tmp; } // Skip characters until predicate evaluates to true while doing the following: // - replacing XML character entity references with proper characters (' & " < > &#...;) // - condensing whitespace sequences to single space character template static Ch *skip_and_expand_character_refs(Ch *&text) { // If entity translation, whitespace condense and whitespace trimming is disabled, use plain skip if (Flags & parse_no_entity_translation && !(Flags & parse_normalize_whitespace) && !(Flags & parse_trim_whitespace)) { skip(text); return text; } // Use simple skip until first modification is detected skip(text); // Use translation skip Ch *src = text; Ch *dest = src; while (StopPred::test(*src)) { // If entity translation is enabled if (!(Flags & parse_no_entity_translation)) { // Test if replacement is needed if (src[0] == Ch('&')) { switch (src[1]) { // & ' case Ch('a'): if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';')) { *dest = Ch('&'); ++dest; src += 5; continue; } if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';')) { *dest = Ch('\''); ++dest; src += 6; continue; } break; // " case Ch('q'): if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';')) { *dest = Ch('"'); ++dest; src += 6; continue; } break; // > case Ch('g'): if (src[2] == Ch('t') && src[3] == Ch(';')) { *dest = Ch('>'); ++dest; src += 4; continue; } break; // < case Ch('l'): if (src[2] == Ch('t') && src[3] == Ch(';')) { *dest = Ch('<'); ++dest; src += 4; continue; } break; // &#...; - assumes ASCII case Ch('#'): if (src[2] == Ch('x')) { unsigned long code = 0; src += 3; // Skip &#x while (1) { unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; if (digit == 0xFF) break; code = code * 16 + digit; ++src; } insert_coded_character(dest, code); // Put character in output } else { unsigned long code = 0; src += 2; // Skip &# while (1) { unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast(*src)]; if (digit == 0xFF) break; code = code * 10 + digit; ++src; } insert_coded_character(dest, code); // Put character in output } if (*src == Ch(';')) ++src; else RAPIDXML_PARSE_ERROR("expected ;", src); continue; // Something else default: // Ignore, just copy '&' verbatim break; } } } // If whitespace condensing is enabled if (Flags & parse_normalize_whitespace) { // Test if condensing is needed if (whitespace_pred::test(*src)) { *dest = Ch(' '); ++dest; // Put single space in dest ++src; // Skip first whitespace char // Skip remaining whitespace chars while (whitespace_pred::test(*src)) ++src; continue; } } // No replacement, only copy character *dest++ = *src++; } // Return new end text = src; return dest; } /////////////////////////////////////////////////////////////////////// // Internal parsing functions // Parse BOM, if any template void parse_bom(Ch *&text) { // UTF-8? if (static_cast(text[0]) == 0xEF && static_cast(text[1]) == 0xBB && static_cast(text[2]) == 0xBF) { text += 3; // Skup utf-8 bom } } // Parse XML declaration ( xml_node *parse_xml_declaration(Ch *&text) { // If parsing of declaration is disabled if (!(Flags & parse_declaration_node)) { // Skip until end of declaration while (text[0] != Ch('?') || text[1] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 2; // Skip '?>' return 0; } // Create declaration xml_node *declaration = this->allocate_node(node_declaration); // Skip whitespace before attributes or ?> skip(text); // Parse declaration attributes parse_node_attributes(text, declaration); // Skip ?> if (text[0] != Ch('?') || text[1] != Ch('>')) RAPIDXML_PARSE_ERROR("expected ?>", text); text += 2; return declaration; } // Parse XML comment (' return 0; // Do not produce comment node } // Remember value start Ch *value = text; // Skip until end of comment while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Create comment node xml_node *comment = this->allocate_node(node_comment); comment->value(value, text - value); // Place zero terminator after comment value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 3; // Skip '-->' return comment; } // Parse DOCTYPE template xml_node *parse_doctype(Ch *&text) { // Remember value start Ch *value = text; // Skip to > while (*text != Ch('>')) { // Determine character type switch (*text) { // If '[' encountered, scan for matching ending ']' using naive algorithm with depth // This works for all W3C test files except for 2 most wicked case Ch('['): { ++text; // Skip '[' int depth = 1; while (depth > 0) { switch (*text) { case Ch('['): ++depth; break; case Ch(']'): --depth; break; case 0: RAPIDXML_PARSE_ERROR("unexpected end of data", text); } ++text; } break; } // Error on end of text case Ch('\0'): RAPIDXML_PARSE_ERROR("unexpected end of data", text); // Other character, skip it default: ++text; } } // If DOCTYPE nodes enabled if (Flags & parse_doctype_node) { // Create a new doctype node xml_node *doctype = this->allocate_node(node_doctype); doctype->value(value, text - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 1; // skip '>' return doctype; } else { text += 1; // skip '>' return 0; } } // Parse PI template xml_node *parse_pi(Ch *&text) { // If creation of PI nodes is enabled if (Flags & parse_pi_nodes) { // Create pi node xml_node *pi = this->allocate_node(node_pi); // Extract PI target name Ch *name = text; skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected PI target", text); pi->name(name, text - name); // Skip whitespace between pi target and pi skip(text); // Remember start of pi Ch *value = text; // Skip to '?>' while (text[0] != Ch('?') || text[1] != Ch('>')) { if (*text == Ch('\0')) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Set pi value (verbatim, no entity expansion or whitespace normalization) pi->value(value, text - value); // Place zero terminator after name and value if (!(Flags & parse_no_string_terminators)) { pi->name()[pi->name_size()] = Ch('\0'); pi->value()[pi->value_size()] = Ch('\0'); } text += 2; // Skip '?>' return pi; } else { // Skip to '?>' while (text[0] != Ch('?') || text[1] != Ch('>')) { if (*text == Ch('\0')) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 2; // Skip '?>' return 0; } } // Parse and append data // Return character that ends data. // This is necessary because this character might have been overwritten by a terminating 0 template Ch parse_and_append_data(xml_node *node, Ch *&text, Ch *contents_start) { // Backup to contents start if whitespace trimming is disabled if (!(Flags & parse_trim_whitespace)) text = contents_start; // Skip until end of data Ch *value = text, *end; if (Flags & parse_normalize_whitespace) end = skip_and_expand_character_refs(text); else end = skip_and_expand_character_refs(text); // Trim trailing whitespace if flag is set; leading was already trimmed by whitespace skip after > if (Flags & parse_trim_whitespace) { if (Flags & parse_normalize_whitespace) { // Whitespace is already condensed to single space characters by skipping function, so just trim 1 char off the end if (*(end - 1) == Ch(' ')) --end; } else { // Backup until non-whitespace character is found while (whitespace_pred::test(*(end - 1))) --end; } } // If characters are still left between end and value (this test is only necessary if normalization is enabled) // Create new data node if (!(Flags & parse_no_data_nodes)) { xml_node *data = this->allocate_node(node_data); data->value(value, end - value); node->append_node(data); } // Add data to parent node if no data exists yet if (!(Flags & parse_no_element_values)) if (*node->value() == Ch('\0')) node->value(value, end - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) { Ch ch = *text; *end = Ch('\0'); return ch; // Return character that ends data; this is required because zero terminator overwritten it } // Return character that ends data return *text; } // Parse CDATA template xml_node *parse_cdata(Ch *&text) { // If CDATA is disabled if (Flags & parse_no_data_nodes) { // Skip until end of cdata while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } text += 3; // Skip ]]> return 0; // Do not produce CDATA node } // Skip until end of cdata Ch *value = text; while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>')) { if (!text[0]) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } // Create new cdata node xml_node *cdata = this->allocate_node(node_cdata); cdata->value(value, text - value); // Place zero terminator after value if (!(Flags & parse_no_string_terminators)) *text = Ch('\0'); text += 3; // Skip ]]> return cdata; } // Parse element node template xml_node *parse_element(Ch *&text) { // Create element node xml_node *element = this->allocate_node(node_element); // Extract element name Ch *name = text; skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected element name", text); element->name(name, text - name); // Skip whitespace between element name and attributes or > skip(text); // Parse attributes, if any parse_node_attributes(text, element); // Determine ending type if (*text == Ch('>')) { ++text; parse_node_contents(text, element); } else if (*text == Ch('/')) { ++text; if (*text != Ch('>')) RAPIDXML_PARSE_ERROR("expected >", text); ++text; } else RAPIDXML_PARSE_ERROR("expected >", text); // Place zero terminator after name if (!(Flags & parse_no_string_terminators)) element->name()[element->name_size()] = Ch('\0'); // Return parsed element return element; } // Determine node type, and parse it template xml_node *parse_node(Ch *&text) { // Parse proper node type switch (text[0]) { // <... default: // Parse and append element node return parse_element(text); // (text); } else { // Parse PI return parse_pi(text); } // (text); } break; // (text); } break; // (text); } } // switch // Attempt to skip other, unrecognized node types starting with ')) { if (*text == 0) RAPIDXML_PARSE_ERROR("unexpected end of data", text); ++text; } ++text; // Skip '>' return 0; // No node recognized } } // Parse contents of the node - children, data etc. template void parse_node_contents(Ch *&text, xml_node *node) { // For all children and text while (1) { // Skip whitespace between > and node contents Ch *contents_start = text; // Store start of node contents before whitespace is skipped skip(text); Ch next_char = *text; // After data nodes, instead of continuing the loop, control jumps here. // This is because zero termination inside parse_and_append_data() function // would wreak havoc with the above code. // Also, skipping whitespace after data nodes is unnecessary. after_data_node: // Determine what comes next: node closing, child node, data node, or 0? switch (next_char) { // Node closing or child node case Ch('<'): if (text[1] == Ch('/')) { // Node closing text += 2; // Skip '(text); if (!internal::compare(node->name(), node->name_size(), closing_name, text - closing_name, true)) RAPIDXML_PARSE_ERROR("invalid closing tag name", text); } else { // No validation, just skip name skip(text); } // Skip remaining whitespace after node name skip(text); if (*text != Ch('>')) RAPIDXML_PARSE_ERROR("expected >", text); ++text; // Skip '>' return; // Node closed, finished parsing contents } else { // Child node ++text; // Skip '<' if (xml_node *child = parse_node(text)) node->append_node(child); } break; // End of data - error case Ch('\0'): RAPIDXML_PARSE_ERROR("unexpected end of data", text); // Data node default: next_char = parse_and_append_data(node, text, contents_start); goto after_data_node; // Bypass regular processing after data nodes } } } // Parse XML attributes of the node template void parse_node_attributes(Ch *&text, xml_node *node) { // For all attributes while (attribute_name_pred::test(*text)) { // Extract attribute name Ch *name = text; ++text; // Skip first character of attribute name skip(text); if (text == name) RAPIDXML_PARSE_ERROR("expected attribute name", name); // Create new attribute xml_attribute *attribute = this->allocate_attribute(); attribute->name(name, text - name); node->append_attribute(attribute); // Skip whitespace after attribute name skip(text); // Skip = if (*text != Ch('=')) RAPIDXML_PARSE_ERROR("expected =", text); ++text; // Add terminating zero after name if (!(Flags & parse_no_string_terminators)) attribute->name()[attribute->name_size()] = 0; // Skip whitespace after = skip(text); // Skip quote and remember if it was ' or " Ch quote = *text; if (quote != Ch('\'') && quote != Ch('"')) RAPIDXML_PARSE_ERROR("expected ' or \"", text); ++text; // Extract attribute value and expand char refs in it Ch *value = text, *end; const int AttFlags = Flags & ~parse_normalize_whitespace; // No whitespace normalization in attributes if (quote == Ch('\'')) end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text); else end = skip_and_expand_character_refs, attribute_value_pure_pred, AttFlags>(text); // Set attribute value attribute->value(value, end - value); // Make sure that end quote is present if (*text != quote) RAPIDXML_PARSE_ERROR("expected ' or \"", text); ++text; // Skip quote // Add terminating zero after value if (!(Flags & parse_no_string_terminators)) attribute->value()[attribute->value_size()] = 0; // Skip whitespace after attribute value skip(text); } } }; //! \cond internal namespace internal { // Whitespace (space \n \r \t) template const unsigned char lookup_tables::lookup_whitespace[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, // 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 5 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 7 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // B 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // C 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // D 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // E 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // F }; // Node name (anything but space \n \r \t / > ? \0) template const unsigned char lookup_tables::lookup_node_name[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) (anything but < \0) template const unsigned char lookup_tables::lookup_text[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) that does not require processing when ws normalization is disabled // (anything but < \0 &) template const unsigned char lookup_tables::lookup_text_pure_no_ws[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Text (i.e. PCDATA) that does not require processing when ws normalizationis is enabled // (anything but < \0 & space \n \r \t) template const unsigned char lookup_tables::lookup_text_pure_with_ws[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute name (anything but space \n \r \t / < > = ? ! \0) template const unsigned char lookup_tables::lookup_attribute_name[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with single quote (anything but ' \0) template const unsigned char lookup_tables::lookup_attribute_data_1[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with single quote that does not require processing (anything but ' \0 &) template const unsigned char lookup_tables::lookup_attribute_data_1_pure[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with double quote (anything but " \0) template const unsigned char lookup_tables::lookup_attribute_data_2[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Attribute data with double quote that does not require processing (anything but " \0 &) template const unsigned char lookup_tables::lookup_attribute_data_2_pure[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 0 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 1 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 2 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 3 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 4 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 5 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 6 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 7 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 8 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 9 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // A 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // B 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // C 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // D 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // E 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 // F }; // Digits (dec and hex, 255 denotes end of numeric character reference) template const unsigned char lookup_tables::lookup_digits[256] = { // 0 1 2 3 4 5 6 7 8 9 A B C D E F 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 0 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 1 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 2 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,255,255,255,255,255,255, // 3 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 4 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 5 255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255, // 6 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 7 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 8 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // 9 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // A 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // B 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // C 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // D 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, // E 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255 // F }; // Upper case conversion template const unsigned char lookup_tables::lookup_upcase[256] = { // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A B C D E F 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, // 0 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, // 1 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, // 2 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, // 3 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 4 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, // 5 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, // 6 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127, // 7 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, // 8 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, // 9 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, // A 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, // B 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, // C 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, // D 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, // E 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 // F }; } //! \endcond } // Undefine internal macros #undef RAPIDXML_PARSE_ERROR // On MSVC, restore warnings state #ifdef _MSC_VER #pragma warning(pop) #endif #endif ================================================ FILE: Libraries/Core/iOS/Headers/rapidxml/rapidxml_iterators.hpp ================================================ #ifndef RAPIDXML_ITERATORS_HPP_INCLUDED #define RAPIDXML_ITERATORS_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_iterators.hpp This file contains rapidxml iterators #include "rapidxml.hpp" namespace rapidxml { //! Iterator of child nodes of xml_node template class node_iterator { public: typedef typename xml_node value_type; typedef typename xml_node &reference; typedef typename xml_node *pointer; typedef std::ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; node_iterator() : m_node(0) { } node_iterator(xml_node *node) : m_node(node->first_node()) { } reference operator *() const { assert(m_node); return *m_node; } pointer operator->() const { assert(m_node); return m_node; } node_iterator& operator++() { assert(m_node); m_node = m_node->next_sibling(); return *this; } node_iterator operator++(int) { node_iterator tmp = *this; ++this; return tmp; } node_iterator& operator--() { assert(m_node && m_node->previous_sibling()); m_node = m_node->previous_sibling(); return *this; } node_iterator operator--(int) { node_iterator tmp = *this; ++this; return tmp; } bool operator ==(const node_iterator &rhs) { return m_node == rhs.m_node; } bool operator !=(const node_iterator &rhs) { return m_node != rhs.m_node; } private: xml_node *m_node; }; //! Iterator of child attributes of xml_node template class attribute_iterator { public: typedef typename xml_attribute value_type; typedef typename xml_attribute &reference; typedef typename xml_attribute *pointer; typedef std::ptrdiff_t difference_type; typedef std::bidirectional_iterator_tag iterator_category; attribute_iterator() : m_attribute(0) { } attribute_iterator(xml_node *node) : m_attribute(node->first_attribute()) { } reference operator *() const { assert(m_attribute); return *m_attribute; } pointer operator->() const { assert(m_attribute); return m_attribute; } attribute_iterator& operator++() { assert(m_attribute); m_attribute = m_attribute->next_attribute(); return *this; } attribute_iterator operator++(int) { attribute_iterator tmp = *this; ++this; return tmp; } attribute_iterator& operator--() { assert(m_attribute && m_attribute->previous_attribute()); m_attribute = m_attribute->previous_attribute(); return *this; } attribute_iterator operator--(int) { attribute_iterator tmp = *this; ++this; return tmp; } bool operator ==(const attribute_iterator &rhs) { return m_attribute == rhs.m_attribute; } bool operator !=(const attribute_iterator &rhs) { return m_attribute != rhs.m_attribute; } private: xml_attribute *m_attribute; }; } #endif ================================================ FILE: Libraries/Core/iOS/Headers/rapidxml/rapidxml_print.hpp ================================================ #ifndef RAPIDXML_PRINT_HPP_INCLUDED #define RAPIDXML_PRINT_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_print.hpp This file contains rapidxml printer implementation #include "rapidxml.hpp" // Only include streams if not disabled #ifndef RAPIDXML_NO_STREAMS #include #include #endif namespace rapidxml { /////////////////////////////////////////////////////////////////////// // Printing flags const int print_no_indenting = 0x1; //!< Printer flag instructing the printer to suppress indenting of XML. See print() function. /////////////////////////////////////////////////////////////////////// // Internal //! \cond internal namespace internal { /////////////////////////////////////////////////////////////////////////// // Function declarations template inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out); template inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out); template inline OutIt fill_chars(OutIt out, int n, Ch ch); template inline bool find_char(const Ch *begin, const Ch *end); template inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_attributes(OutIt out, const xml_node *node, int flags); template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent); template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent); /////////////////////////////////////////////////////////////////////////// // Internal character operations // Copy characters from given range to given output iterator template inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out) { while (begin != end) *out++ = *begin++; return out; } // Copy characters from given range to given output iterator and expand // characters into references (< > ' " &) template inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out) { while (begin != end) { if (*begin == noexpand) { *out++ = *begin; // No expansion, copy character } else { switch (*begin) { case Ch('<'): *out++ = Ch('&'); *out++ = Ch('l'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('>'): *out++ = Ch('&'); *out++ = Ch('g'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('\''): *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('p'); *out++ = Ch('o'); *out++ = Ch('s'); *out++ = Ch(';'); break; case Ch('"'): *out++ = Ch('&'); *out++ = Ch('q'); *out++ = Ch('u'); *out++ = Ch('o'); *out++ = Ch('t'); *out++ = Ch(';'); break; case Ch('&'): *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('m'); *out++ = Ch('p'); *out++ = Ch(';'); break; default: *out++ = *begin; // No expansion, copy character } } ++begin; // Step to next character } return out; } // Fill given output iterator with repetitions of the same character template inline OutIt fill_chars(OutIt out, int n, Ch ch) { for (int i = 0; i < n; ++i) *out++ = ch; return out; } // Find character template inline bool find_char(const Ch *begin, const Ch *end) { while (begin != end) if (*begin++ == ch) return true; return false; } /////////////////////////////////////////////////////////////////////////// // Internal printing operations // Print node template inline OutIt print_node(OutIt out, const xml_node *node, int flags, int indent) { // Print proper node type switch (node->type()) { // Document case node_document: out = print_children(out, node, flags, indent); break; // Element case node_element: out = print_element_node(out, node, flags, indent); break; // Data case node_data: out = print_data_node(out, node, flags, indent); break; // CDATA case node_cdata: out = print_cdata_node(out, node, flags, indent); break; // Declaration case node_declaration: out = print_declaration_node(out, node, flags, indent); break; // Comment case node_comment: out = print_comment_node(out, node, flags, indent); break; // Doctype case node_doctype: out = print_doctype_node(out, node, flags, indent); break; // Pi case node_pi: out = print_pi_node(out, node, flags, indent); break; // Unknown default: assert(0); break; } // If indenting not disabled, add line break after node if (!(flags & print_no_indenting)) *out = Ch('\n'), ++out; // Return modified iterator return out; } // Print children of the node template inline OutIt print_children(OutIt out, const xml_node *node, int flags, int indent) { for (xml_node *child = node->first_node(); child; child = child->next_sibling()) out = print_node(out, child, flags, indent); return out; } // Print attributes of the node template inline OutIt print_attributes(OutIt out, const xml_node *node, int flags) { for (xml_attribute *attribute = node->first_attribute(); attribute; attribute = attribute->next_attribute()) { if (attribute->name() && attribute->value()) { // Print attribute name *out = Ch(' '), ++out; out = copy_chars(attribute->name(), attribute->name() + attribute->name_size(), out); *out = Ch('='), ++out; // Print attribute value using appropriate quote type if (find_char(attribute->value(), attribute->value() + attribute->value_size())) { *out = Ch('\''), ++out; out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('"'), out); *out = Ch('\''), ++out; } else { *out = Ch('"'), ++out; out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('\''), out); *out = Ch('"'), ++out; } } } return out; } // Print data node template inline OutIt print_data_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_data); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); return out; } // Print data node template inline OutIt print_cdata_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_cdata); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'); ++out; *out = Ch('!'); ++out; *out = Ch('['); ++out; *out = Ch('C'); ++out; *out = Ch('D'); ++out; *out = Ch('A'); ++out; *out = Ch('T'); ++out; *out = Ch('A'); ++out; *out = Ch('['); ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch(']'); ++out; *out = Ch(']'); ++out; *out = Ch('>'); ++out; return out; } // Print element node template inline OutIt print_element_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_element); // Print element name and attributes, if any if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); out = print_attributes(out, node, flags); // If node is childless if (node->value_size() == 0 && !node->first_node()) { // Print childless node tag ending *out = Ch('/'), ++out; *out = Ch('>'), ++out; } else { // Print normal node tag ending *out = Ch('>'), ++out; // Test if node contains a single data node only (and no other nodes) xml_node *child = node->first_node(); if (!child) { // If node has no children, only print its value without indenting out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out); } else if (child->next_sibling() == 0 && child->type() == node_data) { // If node has a sole data child, only print its value without indenting out = copy_and_expand_chars(child->value(), child->value() + child->value_size(), Ch(0), out); } else { // Print all children with full indenting if (!(flags & print_no_indenting)) *out = Ch('\n'), ++out; out = print_children(out, node, flags, indent + 1); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); } // Print node end *out = Ch('<'), ++out; *out = Ch('/'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); *out = Ch('>'), ++out; } return out; } // Print declaration node template inline OutIt print_declaration_node(OutIt out, const xml_node *node, int flags, int indent) { // Print declaration start if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('?'), ++out; *out = Ch('x'), ++out; *out = Ch('m'), ++out; *out = Ch('l'), ++out; // Print attributes out = print_attributes(out, node, flags); // Print declaration end *out = Ch('?'), ++out; *out = Ch('>'), ++out; return out; } // Print comment node template inline OutIt print_comment_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_comment); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('!'), ++out; *out = Ch('-'), ++out; *out = Ch('-'), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('-'), ++out; *out = Ch('-'), ++out; *out = Ch('>'), ++out; return out; } // Print doctype node template inline OutIt print_doctype_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_doctype); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('!'), ++out; *out = Ch('D'), ++out; *out = Ch('O'), ++out; *out = Ch('C'), ++out; *out = Ch('T'), ++out; *out = Ch('Y'), ++out; *out = Ch('P'), ++out; *out = Ch('E'), ++out; *out = Ch(' '), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('>'), ++out; return out; } // Print pi node template inline OutIt print_pi_node(OutIt out, const xml_node *node, int flags, int indent) { assert(node->type() == node_pi); if (!(flags & print_no_indenting)) out = fill_chars(out, indent, Ch('\t')); *out = Ch('<'), ++out; *out = Ch('?'), ++out; out = copy_chars(node->name(), node->name() + node->name_size(), out); *out = Ch(' '), ++out; out = copy_chars(node->value(), node->value() + node->value_size(), out); *out = Ch('?'), ++out; *out = Ch('>'), ++out; return out; } } //! \endcond /////////////////////////////////////////////////////////////////////////// // Printing //! Prints XML to given output iterator. //! \param out Output iterator to print to. //! \param node Node to be printed. Pass xml_document to print entire document. //! \param flags Flags controlling how XML is printed. //! \return Output iterator pointing to position immediately after last character of printed text. template inline OutIt print(OutIt out, const xml_node &node, int flags = 0) { return internal::print_node(out, &node, flags, 0); } #ifndef RAPIDXML_NO_STREAMS //! Prints XML to given output stream. //! \param out Output stream to print to. //! \param node Node to be printed. Pass xml_document to print entire document. //! \param flags Flags controlling how XML is printed. //! \return Output stream. template inline std::basic_ostream &print(std::basic_ostream &out, const xml_node &node, int flags = 0) { print(std::ostream_iterator(out), node, flags); return out; } //! Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process. //! \param out Output stream to print to. //! \param node Node to be printed. //! \return Output stream. template inline std::basic_ostream &operator <<(std::basic_ostream &out, const xml_node &node) { return print(out, node); } #endif } #endif ================================================ FILE: Libraries/Core/iOS/Headers/rapidxml/rapidxml_utils.hpp ================================================ #ifndef RAPIDXML_UTILS_HPP_INCLUDED #define RAPIDXML_UTILS_HPP_INCLUDED // Copyright (C) 2006, 2009 Marcin Kalicinski // Version 1.13 // Revision $DateTime: 2009/05/13 01:46:17 $ //! \file rapidxml_utils.hpp This file contains high-level rapidxml utilities that can be useful //! in certain simple scenarios. They should probably not be used if maximizing performance is the main objective. #include "rapidxml.hpp" #include #include #include #include namespace rapidxml { //! Represents data loaded from a file template class file { public: //! Loads file into the memory. Data will be automatically destroyed by the destructor. //! \param filename Filename to load. file(const char *filename) { using namespace std; // Open stream basic_ifstream stream(filename, ios::binary); if (!stream) throw runtime_error(string("cannot open file ") + filename); stream.unsetf(ios::skipws); // Determine stream size stream.seekg(0, ios::end); size_t size = stream.tellg(); stream.seekg(0); // Load data and add terminating 0 m_data.resize(size + 1); stream.read(&m_data.front(), static_cast(size)); m_data[size] = 0; } //! Loads file into the memory. Data will be automatically destroyed by the destructor //! \param stream Stream to load from file(std::basic_istream &stream) { using namespace std; // Load data and add terminating 0 stream.unsetf(ios::skipws); m_data.assign(istreambuf_iterator(stream), istreambuf_iterator()); if (stream.fail() || stream.bad()) throw runtime_error("error reading stream"); m_data.push_back(0); } //! Gets file data. //! \return Pointer to data of file. Ch *data() { return &m_data.front(); } //! Gets file data. //! \return Pointer to data of file. const Ch *data() const { return &m_data.front(); } //! Gets file data size. //! \return Size of file data, in characters. std::size_t size() const { return m_data.size(); } private: std::vector m_data; // File data }; //! Counts children of node. Time complexity is O(n). //! \return Number of children of node template inline std::size_t count_children(xml_node *node) { xml_node *child = node->first_node(); std::size_t count = 0; while (child) { ++count; child = child->next_sibling(); } return count; } //! Counts attributes of node. Time complexity is O(n). //! \return Number of attributes of node template inline std::size_t count_attributes(xml_node *node) { xml_attribute *attr = node->first_attribute(); std::size_t count = 0; while (attr) { ++count; attr = attr->next_attribute(); } return count; } } #endif ================================================ FILE: Libraries/Core/iOS/Libs/libCSBase.a ================================================ [File too large to display: 11.7 MB] ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/attenuationmode.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkAttenuationMode CkAttenuationMode */ /** @{ */ #pragma once #include "ck/platform.h" /** Indicates how volume on 3D sounds is attenuated with distance. */ typedef enum { /** No attenuation; volume is 1.0 when closer than the far distance, and far volume outside of that. */ kCkAttenuationMode_None = 0, /** Linear attenuation of volume between near distance and far distance. */ kCkAttenuationMode_Linear, /** Attenuation proportional to the reciprocal of the distance. */ kCkAttenuationMode_InvDistance, /** Attenuation proportional to the square of the reciprocal of the distance. This is a good choice for realistically simulating point sound sources. */ kCkAttenuationMode_InvDistanceSquared, } CkAttenuationMode; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/bank.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkBank CkBank */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" /** A bank of memory-resident sounds. */ class CkBank { public: /** Returns true when an asynchronously loaded bank has finished loading. */ virtual bool isLoaded() const = 0; /** Returns true if an asynchronously loaded bank had an error during loading. */ virtual bool isFailed() const = 0; /** Returns the name of the bank. */ virtual const char* getName() const = 0; /** Returns the number of sounds in the bank. */ virtual int getNumSounds() const = 0; /** Returns the name of a sound in this bank. The name will be 31 characters or less. */ virtual const char* getSoundName(int index) const = 0; //////////////////////////////////////// /** Loads a bank. This will return NULL if the bank cannot be loaded. If the bank file is embedded in a larger file, specify the offset and length of the embedded data; otherwise, leave them both as 0. */ static CkBank* newBank(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0); /** Loads a bank asynchronously. This will return NULL if the bank cannot be loaded. When loading a bank asynchronously, you should also check isFailed() after loading to make sure no errors occurred. If the bank file is embedded in a larger file, specify the offset and length of the embedded data; otherwise, leave them both as 0. */ static CkBank* newBankAsync(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0); /** Loads a bank from a memory buffer. The buffer should contain entire bank file; you are responsible for freeing the memory after the bank is deleted. This will return NULL if the bank cannot be loaded. */ static CkBank* newBankFromMemory(void*, int bytes); /** Finds a loaded bank by name; returns NULL if not found. */ static CkBank* find(const char* bankName); /** Destroys the bank. */ virtual void destroy() = 0; protected: CkBank() {} virtual ~CkBank() {} private: CkBank(const CkBank&); CkBank& operator=(const CkBank&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/ck.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup Ck Ck */ /** @{ */ #pragma once #include "ck/config.h" #include "ck/pathtype.h" #ifdef __cplusplus extern "C" { #endif /** Initializes Cricket Audio. Returns nonzero if successful. */ int CkInit(CkConfig*); /** Updates Cricket Audio. Should be called once per frame. */ void CkUpdate(); /** Shuts down Cricket Audio. */ void CkShutdown(); /** Suspends Cricket Audio; typically used when an app is made inactive. */ void CkSuspend(); /** Resumes Cricket Audio; typically used when an app is made active after having been inactive. */ void CkResume(); /** Returns a rough estimate of the load on the audio processing thread. This is the fraction of the interval between audio callbacks that was actually spent rendering audio; it will range between 0 and 1. */ float CkGetRenderLoad(); /** Returns the value of the clip flag. The clip flag is set to true whenever the final audio output "clips", i.e. exceeds the maximum value. */ bool CkGetClipFlag(); /** Resets the value of the clip flag to false. The clip flag is set to true whenever the final audio output "clips", i.e. exceeds the maximum value. */ void CkResetClipFlag(); /** Sets the maximum rate at which volumes change on playing sounds, in ms per full volume scale. Default value is 40 ms. */ void CkSetVolumeRampTime(float ms); /** Gets the maximum rate at which volumes change on playing sounds, in ms per full volume scale. */ float CkGetVolumeRampTime(); /** Default value of volume ramp time. */ extern const float Ck_volumeRampTimeMsDefault; /** Lock the audio processing thread to prevent it from processing any API calls. The lock should be held only for a short time. This is useful to ensure that certain calls are processed together. For example, if you want to play multiple sounds together exactly in sync, call CkLockAudio(), call play() on each sound, then call CkUnlockAudio(). */ void CkLockAudio(); /** Unlock the audio processing thread after a call to CkLockAudio(). */ void CkUnlockAudio(); /** Start capturing the final audio output to a file. The filename must end with ".wav" (for a Microsoft WAVE file) or ".raw" (for a headerless file containing 32-bit floating-point interleaved stereo samples). */ void CkStartCapture(const char* path, CkPathType pathType); /** Stop capturing audio output. */ void CkStopCapture(); #ifdef __cplusplus } // extern "C" #endif /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/config.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkConfig CkConfig */ /** @{ */ #pragma once #include "ck/platform.h" #if CK_PLATFORM_ANDROID # include #endif //////////////////////////////////////// /** Memory allocation function */ typedef void* (*CkAllocFunc)(int bytes); /** Memory deallocation function */ typedef void (*CkFreeFunc)(void*); /** Log message types */ typedef enum { /** Flag to enable INFO log messages */ kCkLog_Info = (1 << 0), /** Flag to enable WARNING log messages */ kCkLog_Warning = (1 << 1), /** Flag to enable ERROR log messages */ kCkLog_Error = (1 << 2), /** Flag to disable all log messages */ kCkLog_None = 0, /** Flag to enable all log messages */ kCkLog_All = (kCkLog_Info | kCkLog_Warning | kCkLog_Error) } CkLogType; /** Log message function */ typedef void (*CkLogFunc)(CkLogType, const char* msg); /** Sample types used for internal DSP pipeline */ typedef enum { /** Force floating-point samples */ kCkSampleType_Float, /** Force fixed-point samples */ kCkSampleType_Fixed, /** Use the default, based on the processor type */ kCkSampleType_Default } CkSampleType; //////////////////////////////////////// /** Configuration options */ struct _CkConfig { #ifdef __cplusplus # if CK_PLATFORM_ANDROID /** Constructor to be used from JNI functions. @param env A JNI environment pointer @param context An android.content.Context object from Java (typically an android.app.Activity or android.app.Service) */ _CkConfig(JNIEnv* env, jobject context); /** This constructor should be used when there is no valid JNIEnv* pointer; for example, from android_main() in a native activity using the android_native_app_glue library. See the code in src/samples/hellocricket/android-ndk-native for an example. @param vm A Java VM pointer @param context An android.content.Context object from Java (typically an android.app.Activity or android.app.Service) */ _CkConfig(JavaVM* vm, jobject context); # else _CkConfig(); # endif #endif // __cplusplus #if CK_PLATFORM_ANDROID /** The JNIEnv pointer. @par Only available on Android. */ JNIEnv* jni; /** The JavaVM pointer. @par Only available on Android. */ JavaVM* vm; /** A Java reference to your app's Context object (typically an Activity or Service). @par Only available on Android. */ jobject context; /** If true, always use Java AudioTrack for output of final mix, instead of OpenSL ES. This should usually be set to false, unless you are debugging specific issues related to low-level audio output. Default is false (use Java AudioTrack only when OpenSL ES is not available, i.e. Android versions prior to 2.3). @par Only available on Android. */ bool useJavaAudio; /** If true, software support for Ogg Vorbis stream sounds is enabled. If false, stream sounds will use the native Android decoder, which will not support all of the features available to sounds decoded in software. Default is true (Ogg Vorbis streams are decoded in software). @par Only available on Android. */ bool enableOggVorbis; #endif #if CK_PLATFORM_IOS || CK_PLATFORM_TVOS /** If true, hardware-assisted decoding is enabled for decoding compressed streams when available. See Apple's "Multimedia Programming Guide" for a list of codecs for which hardware support is available. Note that streams that use the hardware decoder take slightly longer (~300ms) to initialize, and our tests have shown a negligible effect on CPU usage, so the default value is false. @par Only available on iOS. */ bool enableHardwareDecoding; #endif /** Memory allocation function. Default is NULL (system new will be used). The allocator must be thread-safe. */ CkAllocFunc allocFunc; /** Memory deallocation function. Default is NULL (system delete will be used). The allocator must be thread-safe. */ CkFreeFunc freeFunc; /** Bitmask for which types of messages are logged. Default is kCkLog_All (all messages logged). */ unsigned int logMask; /** Function to handle log messages. Default is NULL (printf or equivalent will be used). */ CkLogFunc logFunc; /** Audio processing frame duration, in ms. Shorter times result in lower latency, but require more CPU. Default is 5 ms. */ float audioUpdateMs; /** Size of buffer for stream sounds, in ms. Larger buffers require more memory, but are less likely to skip due to slow file reads. Default is 500 ms. */ float streamBufferMs; /** Interval between file reads for stream sounds, in ms. Shorter times will allow for smaller stream buffer sizes, but require more CPU. This value should be set to significantly less than streamBufferMs, or your buffers will always underrun! Default is 100 ms. */ float streamFileUpdateMs; /** Initial size of the audio task buffer. If you see a "Reallocating audio task buffer" warning, consider increasing this from its default value of 500 to avoid additional memory allocations at runtime. */ int maxAudioTasks; /** Maximum render load. When the value of CkGetRenderLoad() exceeds this value, some sounds will not be rendered, to keep the CPU usage down. Default is 0.8. */ float maxRenderLoad; /** Sample type to be used internally for processing. The default is kCkSampleType_Default, which means that fixed-point samples are used on Android armv5 and armv6 devices, which may lack hardware support for floating-point operations, and that floating-point samples are used on all other devices. */ CkSampleType sampleType; }; typedef struct _CkConfig CkConfig; /** Default value of CkConfig.audioUpdateMs */ extern const float CkConfig_audioUpdateMsDefault; /** Default value of CkConfig.streamBufferMs */ extern const float CkConfig_streamBufferMsDefault; /** Default value of CkConfig.streamFileUpdateMs */ extern const float CkConfig_streamFileUpdateMsDefault; /** Default value of CkConfig.maxAudioTasks */ extern const int CkConfig_maxAudioTasksDefault; /** Default value of CkConfig.maxRenderLoad */ extern const float CkConfig_maxRenderLoadDefault; //////////////////////////////////////// #ifdef __OBJC__ /** If you are using Objective-C, call CkConfigInit() to initialize the CkConfig struct to its default values. (If you are using C++, the CkConfig struct is initialized by its constructor.) */ #ifdef __cplusplus extern "C" #endif void CkConfigInit(CkConfig*); #endif /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/customfile.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkCustomFile CkCustomFile */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" /** Custom file base class. If you want to override the low-level details of how files are read (for example, to read files over a network, or to decrypt encrypted files as they are read), create a subclass and register a handler with CkSetCustomFileHandler(). This will work for bank files, and for .cks and Ogg Vorbis streams, but not for other stream types such as MP3, AAC, etc. */ class CkCustomFile { public: virtual ~CkCustomFile() {} /** Returns true if the file was successfully opened. */ virtual bool isValid() const = 0; /** Read from the file. Returns number of bytes actually read. */ virtual int read(void* buf, int bytes) = 0; /** Returns the size of the file. */ virtual int getSize() const = 0; /** Sets the read position in the file. */ virtual void setPos(int pos) = 0; /** Returns the read position in the file. */ virtual int getPos() const = 0; }; /** Factory function for opening files using a CkCustomFile instance. The function should return CkCustomFile instance, or NULL to open the file with the default handler. */ typedef CkCustomFile* (*CkCustomFileFunc)(const char* path, void* data); /** Set the file handler. Set it to NULL to use the default handler. */ void CkSetCustomFileHandler(CkCustomFileFunc, void* data); /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/customstream.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkCustomStream CkCustomStream */ /** @{ */ #pragma once #include "ck/platform.h" /** Base class for custom streams. To create a custom stream sound (for example, for playing back audio in a proprietary file format), create a subclass, then register a factory function with CkSound::setCustomStreamHandler(). */ class CkCustomStream { public: virtual ~CkCustomStream() {} /** Initializes the stream (open data files, read file headers, etc). This is called from the file streaming thread, not the main thread, so synchronous file reading calls will not block audio or application logic. */ virtual void init() = 0; /** Returns whether the stream has failed in a way that renders it unusable; for example, if an audio file could not be found. */ virtual bool isFailed() const = 0; /** Returns the number of channels; should be either 1 or 2. */ virtual int getChannels() const = 0; /** Returns the sample rate of the audio. */ virtual int getSampleRate() const = 0; /** Returns the total duration of the sound, in sample frames. */ virtual int getLength() const = 0; /** Reads audio into the buffer; returns the number of sample frames actually read. The audio data should be 16-bit signed PCM. */ virtual int read(short* buf, int frames) = 0; /** Sets the current play position, in sample frames. */ virtual void setPlayPosition(int frame) = 0; /** Returns the current play position, in sample frames. */ virtual int getPlayPosition() const = 0; }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/effect.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffect CkEffect */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/effecttype.h" #include class CkEffectProcessor; /** An audio effect. */ class CkEffect { public: /** Set an effect parameter. Parameter IDs are found in ck/effectparam.h. */ virtual void setParam(int paramId, float value) = 0; /** Reset the state of this effect. */ virtual void reset() = 0; /** Set whether this effect is bypassed. A bypassed effect is not applied to the audio. */ virtual void setBypassed(bool) = 0; /** Gets whether this effect is bypassed. A bypassed effect is not applied to the audio. */ virtual bool isBypassed() const = 0; /** Sets the wet/dry ratio for this effect The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the ffect. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual void setWetDryRatio(float) = 0; /** Gets the wet/dry ratio for this effect. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the effect. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual float getWetDryRatio() const = 0; /** Create a built-in effect. Effect types are found in ck/effecttype.h. */ static CkEffect* newEffect(CkEffectType); /** Factory function for creating effect processors for custom effects. */ typedef CkEffectProcessor* (*CustomEffectFunc)(void* arg); /** Register a custom effect. To unregister an effect, pass in NULL for the CustomEffectFunc. */ static void registerCustomEffect(int id, CustomEffectFunc); /** Create a custom effect. A factory function must have been previously registered with the given id, or this will return NULL. */ static CkEffect* newCustomEffect(int id, void* arg = NULL); /** Destroy the effect. */ virtual void destroy() = 0; protected: CkEffect() {} virtual ~CkEffect() {} private: CkEffect(const CkEffect&); CkEffect& operator=(const CkEffect&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/effectbus.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectBus CkEffectBus */ /** @{ */ #pragma once #include "ck/platform.h" class CkEffect; /** Manages a set of audio effects applied to sounds. */ class CkEffectBus { public: /** Add an effect to this bus. An effect can only be on one bus at a time. */ virtual void addEffect(CkEffect*) = 0; /** Remove an effect from this bus. */ virtual void removeEffect(CkEffect*) = 0; /** Remove all effects from this bus. */ virtual void removeAllEffects() = 0; /** Set the bus to which this bus's output is sent. If NULL (the default), the audio from this bus is mixed into the final output. */ virtual void setOutputBus(CkEffectBus*) = 0; /** Get the bus to which this bus's output is sent. If NULL (the default), the audio from this bus is mixed into the final output. */ virtual CkEffectBus* getOutputBus() = 0; /** Reset the state of all the effects on this bus. */ virtual void reset() = 0; /** Set whether this bus is bypassed. A bypassed effect is not applied to the audio. */ virtual void setBypassed(bool) = 0; /** Gets whether this bus is bypassed. Effects in a bypassed bus are not applied to the audio. */ virtual bool isBypassed() const = 0; /** Sets the wet/dry ratio for this bus. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the bus. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual void setWetDryRatio(float) = 0; /** Gets the wet/dry ratio for this bus. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the bus. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual float getWetDryRatio() const = 0; //////////////////////////////////////// /** Create a new effect bus. */ static CkEffectBus* newEffectBus(); /** Get the global effect bus. Effects on this bus are applied to the final audio before it is output. */ static CkEffectBus* getGlobalEffectBus(); /** Destroy this effect bus. */ virtual void destroy() = 0; protected: CkEffectBus() {} virtual ~CkEffectBus() {} private: CkEffectBus(const CkEffectBus&); CkEffectBus& operator=(const CkEffectBus&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/effectparam.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectParam CkEffectParam */ /** @{ */ #pragma once #include "ck/platform.h" /** Parameters for the Biquad Filter effect */ enum { /** Type of filter; should be one of the kCkBiquadFilterParam_FilterType values. */ kCkBiquadFilterParam_FilterType, /** Center frequency of the filter. */ kCkBiquadFilterParam_Freq, /** Q of the filter. */ kCkBiquadFilterParam_Q, /** Gain in dB (for Peak, LowShelf, and HighShelf filter types) */ kCkBiquadFilterParam_Gain, }; /** Filter types, used for the kCkBiquadFilterParam_FilterType param. */ enum { /** Low pass filter blocks high frequencies. */ kCkBiquadFilterParam_FilterType_LowPass, /** High pass filter blocks low frequencies. */ kCkBiquadFilterParam_FilterType_HighPass, /** Band pass filter blocks frequencies above and below the center frequency. */ kCkBiquadFilterParam_FilterType_BandPass, /** Notch filter blocks a narrow band of frequencies. */ kCkBiquadFilterParam_FilterType_Notch, /** Peak filter boosts a narrow band of frequencies. */ kCkBiquadFilterParam_FilterType_Peak, /** Low shelf filter boosts low frequencies. */ kCkBiquadFilterParam_FilterType_LowShelf, /** High shelf filter boosts high frequencies. */ kCkBiquadFilterParam_FilterType_HighShelf }; //////////////////////////////////////// /** Parameters for the Bit Crusher effect */ enum { /** Number of bits of resolution to keep in the input samples, in [1..24]. */ kCkBitCrusherParam_BitResolution, /** Milliseconds to hold each sample value. Higher values result in more reduction in the effective sample rate. Values around 1 ms provide a reasonable effect. */ kCkBitCrusherParam_HoldMs, }; //////////////////////////////////////// /** Parameters for the Ring Mod effect */ enum { /** Frequency (Hz) of the modulating signal. Values around 500 Hz are typical. */ kCkRingModParam_Freq, }; //////////////////////////////////////// /** Parameters for the Distortion effect */ enum { /** Scale factor for input; larger values cause a more pronounced effect. */ kCkDistortionParam_Drive, /** Offset for input. */ kCkDistortionParam_Offset, }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/effectprocessor.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectProcessor CkEffectProcessor */ /** @{ */ #pragma once #include "ck/platform.h" /** Performs audio processing for effects. To implement your own custom audio effects, create a subclass, then register a factory function that creates an instance of it with CkEffect::registerCustomEffect(). */ class CkEffectProcessor { public: virtual ~CkEffectProcessor() {} /** Set an effect parameter. Note that this should not be called directly; it is called by CkEffect::setParam(). */ virtual void setParam(int paramId, float value) = 0; /** Reset this effect's state. */ virtual void reset() = 0; /** If true, the effect is processed in-place; the input and output will be the same buffer. If false, input and output will be separate buffers. */ virtual bool isInPlace() const = 0; /** Process audio. The buffer contains interleaved stereo data; each sample is a signed 8.24 fixed-point value. If isInPlace() returns true, inBuf and outBuf will be pointers to the same buffer. It is OK to modify the data in inBuf, even if the effect is not in-place. (Remember that because the data is stereo, the number of samples is 2*frames.) @par This will only be called on older Android armv5 or armv6 devices, or if CkConfig.sampleType is set to kCkSampleType_Fixed. If you are not supporting those devices, you may leave this with its default implementation, which passes the audio through unchanged. */ virtual void process(int* inBuf, int* outBuf, int frames); /** Process audio. The buffer contains interleaved stereo data; each sample is a 32-bit floating-point value. If isInPlace() returns true, inBuf and outBuf will be pointers to the same buffer. It is OK to modify the data in inBuf, even if the effect is not in-place. (Remember that because the data is stereo, the number of samples is 2*frames.) */ virtual void process(float* inBuf, float* outBuf, int frames) = 0; /** Get the sample rate of the audio data. This value may be different on different devices, but will not change during app execution. */ static int getSampleRate(); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/effecttype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectType CkEffectType */ /** @{ */ #pragma once #include "ck/platform.h" /** Types of built-in effects available */ typedef enum { /** Biquadratic filter. See kCkBiquadFilterParam values for parameter IDs. */ kCkEffectType_BiquadFilter, /** Bit Crusher effect reduces bit resolution and/or bit rate, producing a retro low-fi 8-bit sound. See kCkBitCrusherParam values for parameter IDs. */ kCkEffectType_BitCrusher, /** Ring Mod effect modulates the audio by a sine wave. See kCkRingModParam values for parameter IDs. */ kCkEffectType_RingMod, /** Distortion effect. See kCkDistortionParam values for parameter IDs. */ kCkEffectType_Distortion, } CkEffectType; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/mixer.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkMixer CkMixer */ /** @{ */ #pragma once #include "ck/platform.h" #include /** A mixer represents a hierarchical grouping of sounds for controlling volumes. */ class CkMixer { public: /** Set the name of the mixer. The name should be 31 characters or less. */ virtual void setName(const char*) = 0; /** Get the name of the mixer. */ virtual const char* getName() const = 0; /** Set the volume of this mixer. (The actual volume used during mixing will also depend on ancestors.) */ virtual void setVolume(float) = 0; /** Get the volume of this mixer. (The actual volume used during mixing will also depend on ancestors.) */ virtual float getVolume() const = 0; /** Get the volume used for mixing (affected by ancestors). */ virtual float getMixedVolume() const = 0; /** Set whether this mixer is paused. A sound will be paused if the sound, its mixer, or any of its mixer's ancestors are paused. */ virtual void setPaused(bool) = 0; /** Get whether this mixer is paused. A sound will be paused if the sound, its mixer, or any of its mixer's ancestors are paused. */ virtual bool isPaused() const = 0; /** Returns true if this mixer, or any of its ancestors, is paused. */ virtual bool getMixedPauseState() const = 0; /** Set the parent of the mixer. Setting to NULL sets the master mixer as the parent. */ virtual void setParent(CkMixer*) = 0; /** Get the parent of the mixer. */ virtual CkMixer* getParent() = 0; /** Returns the master mixer, which is the root of the mixer hierarchy. */ static CkMixer* getMaster(); /** Creates a new mixer. */ static CkMixer* newMixer(const char* name, CkMixer* parent = NULL); /** Finds a mixer by name; returns NULL if not found. */ static CkMixer* find(const char* name); /** Destroys the mixer. */ virtual void destroy() = 0; protected: CkMixer() {} virtual ~CkMixer() {} private: CkMixer(const CkMixer&); CkMixer& operator=(const CkMixer&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/pathtype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkPathType CkPathType */ /** @{ */ #pragma once #include "ck/platform.h" /** Indicates how a file path should be interpreted. */ typedef enum { /** A full path to a file on the file system. */ kCkPathType_FileSystem = 0, #if CK_PLATFORM_ANDROID /** A path to an asset in the .apk. Assets are read-only. @par Only available on Android. */ kCkPathType_Asset, /** A path relative to the private files directory. @par Only available on Android. */ kCkPathType_PrivateFiles, /** A path relative to the external storage directory. @par Only available on Android. */ kCkPathType_ExternalStorage, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS /** A path relative to the application's resource directory. On iOS, the resource directory is the application bundle, and is read-only. On OS X, the resource directory is the directory containing the executable. @par Only available on iOS and OS X. */ kCkPathType_Resource, #endif #if CK_PLATFORM_WP8 /** A path relative to the local app data store. @par Only available on Windows Phone 8. */ kCkPathType_LocalDir, /** A path relative to the folder containing your app's package files. Files in your Visual Studio project with the "Content" property set to true will be installed here. This folder is read-only. @par Only available on Windows Phone 8. */ kCkPathType_InstallationDir, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS || CK_PLATFORM_WIN || CK_PLATFORM_LINUX /** A path relative to the directory used for temporary files. @par Only available on iOS, OS X, Windows, and Linux. */ kCkPathType_Temp, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_WIN || CK_PLATFORM_LINUX /** A path relative to the application's documents directory. On iOS, this is the app's Documents directory. On OS X and Windows, this is the user's Documents directory. On Linux, this is the user's home directory. @par Only available on iOS, OS X, Windows, and Linux. */ kCkPathType_Documents, #endif #if CK_PLATFORM_WIN || CK_PLATFORM_LINUX || CK_PLATFORM_OSX /** A path relative to the executable's directory. (On OS X, this is the same as kCkPathType_Resource.) @par Only available on Windows, Linux, and OS X. */ kCkPathType_ExeDir, #endif /** The default path type for reading files. */ #if CK_PLATFORM_ANDROID kCkPathType_ReadDefault = kCkPathType_Asset, #elif CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS kCkPathType_ReadDefault = kCkPathType_Resource, #elif CK_PLATFORM_WIN || CK_PLATFORM_LINUX kCkPathType_ReadDefault = kCkPathType_ExeDir, #elif CK_PLATFORM_WP8 kCkPathType_ReadDefault = kCkPathType_InstallationDir, #endif /** The default path type for writing files. */ #if CK_PLATFORM_ANDROID kCkPathType_WriteDefault = kCkPathType_PrivateFiles, #elif CK_PLATFORM_IOS || CK_PLATFORM_OSX kCkPathType_WriteDefault = kCkPathType_Documents, #elif CK_PLATFORM_TVOS kCkPathType_WriteDefault = kCkPathType_Temp, #elif CK_PLATFORM_WIN || CK_PLATFORM_LINUX kCkPathType_WriteDefault = kCkPathType_ExeDir, #elif CK_PLATFORM_WP8 kCkPathType_WriteDefault = kCkPathType_LocalDir, #endif /** The default path type. */ kCkPathType_Default = kCkPathType_ReadDefault } CkPathType; /** @} */ ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/platform.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ #pragma once // software platform #undef CK_PLATFORM_IOS #undef CK_PLATFORM_TVOS #undef CK_PLATFORM_ANDROID #undef CK_PLATFORM_OSX #undef CK_PLATFORM_WIN #undef CK_PLATFORM_WP8 #undef CK_PLATFORM_LINUX #ifdef __APPLE__ # include # if TARGET_OS_IPHONE # if TARGET_OS_IOS # define CK_PLATFORM_IOS 1 # elif TARGET_OS_TV # define CK_PLATFORM_TVOS 1 # endif # else # define CK_PLATFORM_OSX 1 # endif #elif defined(__ANDROID__) # define CK_PLATFORM_ANDROID 1 #elif defined(__linux__) # define CK_PLATFORM_LINUX 1 #elif defined(_WIN64) || defined(_WIN32) # if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP # define CK_PLATFORM_WP8 1 # else # define CK_PLATFORM_WIN 1 # endif #endif #if CK_PLATFORM_OSX && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060) # error "OS X 10.6 required!" #endif #if !CK_PLATFORM_IOS && !CK_PLATFORM_ANDROID && !CK_PLATFORM_OSX && !CK_PLATFORM_WIN && !CK_PLATFORM_WP8 && !CK_PLATFORM_LINUX && !CK_PLATFORM_TVOS # error "Unsupported platform!" #endif ================================================ FILE: Libraries/CricketAudio/Android/Headers/ck/sound.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkSound CkSound */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" #include "ck/attenuationmode.h" #include class CkBank; class CkMixer; class CkEffectBus; class CkCustomStream; /** A sound (either memory-resident or streamed). */ class CkSound { public: /** Sets the mixer to which this sound is assigned. Setting NULL will assign it to the master mixer. */ virtual void setMixer(CkMixer*) = 0; /** Gets the mixer to which this sound is assigned. */ virtual CkMixer* getMixer() = 0; /** Returns true if the sound is ready. Bank sounds are ready immediately after creation; stream sounds may not be. */ virtual bool isReady() const = 0; /** Returns true if an error occurred while creating the sound. */ virtual bool isFailed() const = 0; /** Play the sound. */ virtual void play() = 0; /** Stop the sound. */ virtual void stop() = 0; /** Gets whether the sound is playing. */ virtual bool isPlaying() const = 0; /** Sets whether the sound is paused. Note that even if false, the sound will be paused if its mixer or any of its mixer's ancestors are paused.*/ virtual void setPaused(bool) = 0; /** Gets whether the sound is paused. Note that even if false, the sound will be paused if its mixer or any of its mixer's ancestors are paused.*/ virtual bool isPaused() const = 0; /** Returns true if the sound is pauses, its mixer is paused, or any of its mixer's ancestors are paused. */ virtual bool getMixedPauseState() const = 0; /** Set the loop start and end. Default is to loop over all sample frames. EndFrame is defined as one frame after the last frame of the loop. Setting endFrame = -1 is equivalent to setting it to getLength(). @par Android note: This has no effect for streams in formats other than .cks or Ogg Vorbis. */ virtual void setLoop(int startFrame, int endFrame) = 0; /** Get the loop start and end. Default is to loop over all sample frames. EndFrame is defined as one frame after the last frame of the loop. Setting endFrame = -1 is equivalent to setting it to getLength(). @par Android note: This has no effect for streams in formats other than .cks or Ogg Vorbis. */ virtual void getLoop(int& startFrame, int& endFrame) const = 0; /** Sets the number of times the sound should loop. 0 means no looping (play once and then stop). 1 means it will play twice; 2 means it will play 3 times; etc. -1 means it will loop indefinitely until the sound is stopped or releaseLoop() is called. */ virtual void setLoopCount(int) = 0; /** Gets the number of times the sound should loop. 0 means no looping (play once and then stop). 1 means it will play twice; 2 means it will play 3 times; etc. -1 means it will loop indefinitely until the sound is stopped or releaseLoop() is called. */ virtual int getLoopCount() const = 0; /** Gets the number of the current loop. For example, returns 0 if this is the first time playing through this sample; returns 1 if it is on its second loop through the sample; etc. */ virtual int getCurrentLoop() const = 0; /** Makes the current loop the last. This is useful when you don't know in advance how many times you will want to loop; set the loop count to -1, and call releaseLoop() when you want it to stop looping and play to the end. */ virtual void releaseLoop() = 0; /** Returns true if releaseLoop() has been called after the last call to play(). */ virtual bool isLoopReleased() const = 0; /** Set the play position in the sound, in sample frames. This can be called before playing, to start from an offset into the sound; or during playback, to jump to a new location. */ virtual void setPlayPosition(int) = 0; /** Set the play position in the sound, in milliseconds. This can be called before playing, to start from an offset into the sound; or during playback, to jump to a new location. */ virtual void setPlayPositionMs(float) = 0; /** Get the current play position in the sound, in sample frames. */ virtual int getPlayPosition() const = 0; /** Get the current play position in the sound, in milliseconds. */ virtual float getPlayPositionMs() const = 0; /** Sets the volume of this sound. The volume can range from 0 to 1. The default value is 1. Note that the actual volume used for mixing will also depend on the volume of the mixer to which this sound is assigned. */ virtual void setVolume(float) = 0; /** Gets the volume of this sound. The volume can range from 0 to 1. The default value is 1. Note that the actual volume used for mixing will also depend on the volume of the mixer to which this sound is assigned. */ virtual float getVolume() const = 0; /** Gets the volume value used for mixing. This is the product of the volume set with setVolume() and the mixed volume value of the mixer to which the sound is assigned. */ virtual float getMixedVolume() const = 0; /** Sets the pan. The pan can range from -1 (left) to +1 (right). The default is 0 (center). */ virtual void setPan(float) = 0; /** Gets the pan. The pan can range from -1 (left) to +1 (right). The default is 0 (center). */ virtual float getPan() const = 0; /** Sets the pan matrix explicitly. The pan matrix determines how the left and right channels of an input are weighted during mixing. Usually it is set by setPan(), but you can use setPanMatrix() if you need more control. For a mono input, the left channel of the output is the input scaled by ll, and the right channel of the output is the input scaled by rr. The off-diagonal lr and rl terms are ignored. For a stereo input, the left channel of the output is the left channel of the input scaled by ll plus the right channel of the input scaled by lr. The right channel of the output is the left channel of the input scaled by rl plus the right channel of the input scaled by rr. */ virtual void setPanMatrix(float ll, float lr, float rl, float rr) = 0; /** Gets the pan matrix. The pan matrix determines how the left and right channels of an input are weighted during mixing. Usually it is set by setPan(), but you can use setPanMatrix() if you need more control. For a mono input, the left channel of the output is the input scaled by ll, and the right channel of the output is the input scaled by rr. The off-diagonal lr and rl terms are ignored. For a stereo input, the left channel of the output is the left channel of the input scaled by ll plus the right channel of the input scaled by lr. The right channel of the output is the left channel of the input scaled by rl plus the right channel of the input scaled by rr. */ virtual void getPanMatrix(float& ll, float& lr, float& rl, float& rr) const = 0; /** Sets the pitch shift value, in half-steps. This also changes the playback speed of the sound. Positive values mean higher pitch (and faster playback); lower values mean lower pitch (and slower playback). The default value is 0. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setPitchShift(float halfSteps) = 0; /** Gets the pitch shift value, in half-steps. Positive values mean higher pitch (and faster playback); lower values mean lower pitch (and slower playback). The default value is 0. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual float getPitchShift() const = 0; /** Sets the playback speed. Values greater than 1 mean faster playback; values less than 1 mean slower playback. The default value is 1. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setSpeed(float) = 0; /** Gets the playback speed. Values greater than 1 mean faster playback; values less than 1 mean slower playback. The default value is 1. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual float getSpeed() const = 0; /** Sets the sound to be played when this sound finishes playing. The next sound will play immediately, with no gaps. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setNextSound(CkSound*) = 0; /** Gets the sound to be played when this sound finishes playing. The next sound will play immediately, with no gaps. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual CkSound* getNextSound() const = 0; /** Gets the total duration of the sound, in sample frames. Stream sounds will return -1 if they are not ready or if the length is unknown. */ virtual int getLength() const = 0; /** Gets the total duration of the sound, in milliseconds. Stream sounds will return -1 if they are not ready or if the length is unknown. */ virtual float getLengthMs() const = 0; /** Gets the sample rate of the sound, in Hz. Stream sounds will return -1 if they are not ready. */ virtual int getSampleRate() const = 0; /** Gets the number of channels in the sound (1 for mono, 2 for stereo). Stream sounds will return -1 if they are not ready. */ virtual int getChannels() const = 0; /** Sets the effect bus to which this sound's audio is sent to be processed, or NULL for dry output (no effects). @par Android note: Effects cannot be applied to streams in formats other than .cks or Ogg Vorbis. */ virtual void setEffectBus(CkEffectBus*) = 0; /** Gets the effect bus to which this sound's audio is sent to be processed, or NULL for dry output (no effects). @par Android note: Effects cannot be applied to streams in formats other than .cks or Ogg Vorbis. */ virtual CkEffectBus* getEffectBus() = 0; /** Sets whether 3D positioning is enabled. If enabled, pan will be determined by the sound and listener positions, ignoring the value set by setPan(). Volume will be attenuated based on the sound and listener positions and the attenuation settings. */ virtual void set3dEnabled(bool) = 0; /** Gets whether 3D positioning is enabled. If enabled, pan will be determined by the sound and listener positions, ignoring the value set by setPan(). Volume will be attenuated based on the sound and listener positions and the attenuation settings. */ virtual bool is3dEnabled() const = 0; /** Gets whether a 3D sound is virtual. If, due to distance attenuation, a 3D sound's volume becomes near enough to 0 to be inaudible, it becomes "virtual". A virtual sound is effectively paused and is not processed until it would become audible again; this reduces the amount of audio processing required. */ virtual bool isVirtual() const = 0; /** Sets the position of the sound emitter in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. */ virtual void set3dPosition(float x, float y, float z) = 0; /** Gets the position of the sound emitter in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. */ virtual void get3dPosition(float& x, float& y, float& z) const = 0; /** Sets the velocity of the sound emitter in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ virtual void set3dVelocity(float vx, float vy, float vz) = 0; /** Gets the velocity of the sound emitter in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ virtual void get3dVelocity(float& vx, float& vy, float& vz) const = 0; /** Sets the listener position and rotation in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. @param eyeX,eyeY,eyeZ The listener's position @param lookAtX,lookAtY,lookAtZ The listener's look-at point @param upX,upY,upZ The listener's up vector */ static void set3dListenerPosition(float eyeX, float eyeY, float eyeZ, float lookAtX, float lookAtY, float lookAtZ, float upX, float upY, float upZ); /** Gets the listener position and rotation in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. @param eyeX,eyeY,eyeZ The listener's position @param lookAtX,lookAtY,lookAtZ The listener's look-at point @param upX,upY,upZ The listener's up vector */ static void get3dListenerPosition(float& eyeX, float& eyeY, float& eyeZ, float& lookAtX, float& lookAtY, float& lookAtZ, float& upX, float& upY, float& upZ); /** Sets the listener velocity in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ static void set3dListenerVelocity(float vx, float vy, float vz); /** Gets the listener velocity in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ static void get3dListenerVelocity(float& vx, float& vy, float& vz); /** Sets parameters used for 3D volume attenuation. @param mode The attenuation mode (default is kCkAttenuationMode_InvDistanceSquared) @param nearDist The near distance; sounds closer than this distance will not be attenuated (default is 1.0) @param farDist The far distance; sounds further than this will be at the far volume (default is 100.0) @param farVol The far volume; sounds further than farDist will be at this volume (default is 0.0) */ static void set3dAttenuation(CkAttenuationMode mode, float nearDist, float farDist, float farVol); /** Gets parameters used for 3D volume attenuation. @param mode The attenuation mode @param nearDist The near distance; sounds closer than this distance will not be attenuated. @param farDist The far distance; sounds further than this will be at the far volume. @param farVol The far volume; sounds further than farDist will be at this volume. */ static void get3dAttenuation(CkAttenuationMode& mode, float& nearDist, float& farDist, float& farVol); /** Sets the speed of sound. This is used for doppler shift calculations when 3D positioning is enabled. If no doppler shift is desired, this can be set to 0 (which is the default value). You may want to use the predefined constants for the speed of sound (such as k_soundSpeed_MetersPerSecond); use the constant that corresponds to the unit system you are using for your velocity and position values. You can also exaggerate the doppler effect by using a smaller value. */ static void set3dSoundSpeed(float); /** Gets the speed of sound. This is used for doppler shift calculations when 3D positioning is enabled. */ static float get3dSoundSpeed(); /** The speed of sound in dry air at 20 degrees C, in centimeters per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_CentimetersPerSecond; /** The speed of sound in dry air at 20 degrees C, in meters per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_MetersPerSecond; /** The speed of sound in dry air at 20 degrees C, in inches per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_InchesPerSecond; /** The speed of sound in dry air at 20 degrees C, in feet per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_FeetPerSecond; //////////////////////////////////////// // bank sounds /** Creates a sound from a bank by index. This will return NULL if the index is invalid. */ static CkSound* newBankSound(CkBank*, int index); /** Creates a sound from a bank by name. If bank is NULL, all loaded banks are searched for the first matching sound. This will return NULL if no sound with that name can be found. */ static CkSound* newBankSound(CkBank*, const char* name); //////////////////////////////////////// // streams /** Creates a stream from a file path. This will return NULL if the file could not be opened. If a non-NULL value is returned, you should also check isFailed() to find out if any errors occurred during initialization. If the stream file is embedded in a larger file, specify the offset and length of the embedded data in bytes, and provide a string ending with a file extension that indicates the file format of the embedded file (for example, ".mp3" or "music.mp3"). Otherwise, leave the offset, length, and extension as 0. */ static CkSound* newStreamSound(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0, const char* extension = NULL); /** Factory function for creating custom streams. The function should return a CkCustomStream instance, or NULL to create a stream with the default handler. */ typedef CkCustomStream* (*CustomStreamFunc)(const char* path, void* data); /** Set the stream handler. Set it to NULL to use the default handler. */ static void setCustomStreamHandler(CustomStreamFunc, void* data); #if CK_PLATFORM_IOS /** Creates a stream from a URL for an asset in the iTunes library. The URL should be determined using an MPMediaQuery object; see the "iPod Library Access Programming Guide" document in the iOS Developer Library. Note that this will only work for music files without DRM; for files with DRM, the URL will be returned as nil. @par Only available on iOS version 4.3 or later; will return NULL on earlier iOS versions. */ static CkSound* newAssetStreamSound(const char* url); #endif /** Destroys the sound. */ virtual void destroy() = 0; protected: CkSound() {} virtual ~CkSound() {} private: CkSound(const CkSound&); CkSound& operator=(const CkSound&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/attenuationmode.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkAttenuationMode CkAttenuationMode */ /** @{ */ #pragma once #include "ck/platform.h" /** Indicates how volume on 3D sounds is attenuated with distance. */ typedef enum { /** No attenuation; volume is 1.0 when closer than the far distance, and far volume outside of that. */ kCkAttenuationMode_None = 0, /** Linear attenuation of volume between near distance and far distance. */ kCkAttenuationMode_Linear, /** Attenuation proportional to the reciprocal of the distance. */ kCkAttenuationMode_InvDistance, /** Attenuation proportional to the square of the reciprocal of the distance. This is a good choice for realistically simulating point sound sources. */ kCkAttenuationMode_InvDistanceSquared, } CkAttenuationMode; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/bank.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkBank CkBank */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" /** A bank of memory-resident sounds. */ class CkBank { public: /** Returns true when an asynchronously loaded bank has finished loading. */ virtual bool isLoaded() const = 0; /** Returns true if an asynchronously loaded bank had an error during loading. */ virtual bool isFailed() const = 0; /** Returns the name of the bank. */ virtual const char* getName() const = 0; /** Returns the number of sounds in the bank. */ virtual int getNumSounds() const = 0; /** Returns the name of a sound in this bank. The name will be 31 characters or less. */ virtual const char* getSoundName(int index) const = 0; //////////////////////////////////////// /** Loads a bank. This will return NULL if the bank cannot be loaded. If the bank file is embedded in a larger file, specify the offset and length of the embedded data; otherwise, leave them both as 0. */ static CkBank* newBank(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0); /** Loads a bank asynchronously. This will return NULL if the bank cannot be loaded. When loading a bank asynchronously, you should also check isFailed() after loading to make sure no errors occurred. If the bank file is embedded in a larger file, specify the offset and length of the embedded data; otherwise, leave them both as 0. */ static CkBank* newBankAsync(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0); /** Loads a bank from a memory buffer. The buffer should contain entire bank file; you are responsible for freeing the memory after the bank is deleted. This will return NULL if the bank cannot be loaded. */ static CkBank* newBankFromMemory(void*, int bytes); /** Finds a loaded bank by name; returns NULL if not found. */ static CkBank* find(const char* bankName); /** Destroys the bank. */ virtual void destroy() = 0; protected: CkBank() {} virtual ~CkBank() {} private: CkBank(const CkBank&); CkBank& operator=(const CkBank&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/ck.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup Ck Ck */ /** @{ */ #pragma once #include "ck/config.h" #include "ck/pathtype.h" #ifdef __cplusplus extern "C" { #endif /** Initializes Cricket Audio. Returns nonzero if successful. */ int CkInit(CkConfig*); /** Updates Cricket Audio. Should be called once per frame. */ void CkUpdate(); /** Shuts down Cricket Audio. */ void CkShutdown(); /** Suspends Cricket Audio; typically used when an app is made inactive. */ void CkSuspend(); /** Resumes Cricket Audio; typically used when an app is made active after having been inactive. */ void CkResume(); /** Returns a rough estimate of the load on the audio processing thread. This is the fraction of the interval between audio callbacks that was actually spent rendering audio; it will range between 0 and 1. */ float CkGetRenderLoad(); /** Returns the value of the clip flag. The clip flag is set to true whenever the final audio output "clips", i.e. exceeds the maximum value. */ bool CkGetClipFlag(); /** Resets the value of the clip flag to false. The clip flag is set to true whenever the final audio output "clips", i.e. exceeds the maximum value. */ void CkResetClipFlag(); /** Sets the maximum rate at which volumes change on playing sounds, in ms per full volume scale. Default value is 40 ms. */ void CkSetVolumeRampTime(float ms); /** Gets the maximum rate at which volumes change on playing sounds, in ms per full volume scale. */ float CkGetVolumeRampTime(); /** Default value of volume ramp time. */ extern const float Ck_volumeRampTimeMsDefault; /** Lock the audio processing thread to prevent it from processing any API calls. The lock should be held only for a short time. This is useful to ensure that certain calls are processed together. For example, if you want to play multiple sounds together exactly in sync, call CkLockAudio(), call play() on each sound, then call CkUnlockAudio(). */ void CkLockAudio(); /** Unlock the audio processing thread after a call to CkLockAudio(). */ void CkUnlockAudio(); /** Start capturing the final audio output to a file. The filename must end with ".wav" (for a Microsoft WAVE file) or ".raw" (for a headerless file containing 32-bit floating-point interleaved stereo samples). */ void CkStartCapture(const char* path, CkPathType pathType); /** Stop capturing audio output. */ void CkStopCapture(); #ifdef __cplusplus } // extern "C" #endif /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/config.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkConfig CkConfig */ /** @{ */ #pragma once #include "ck/platform.h" #if CK_PLATFORM_ANDROID # include #endif //////////////////////////////////////// /** Memory allocation function */ typedef void* (*CkAllocFunc)(int bytes); /** Memory deallocation function */ typedef void (*CkFreeFunc)(void*); /** Log message types */ typedef enum { /** Flag to enable INFO log messages */ kCkLog_Info = (1 << 0), /** Flag to enable WARNING log messages */ kCkLog_Warning = (1 << 1), /** Flag to enable ERROR log messages */ kCkLog_Error = (1 << 2), /** Flag to disable all log messages */ kCkLog_None = 0, /** Flag to enable all log messages */ kCkLog_All = (kCkLog_Info | kCkLog_Warning | kCkLog_Error) } CkLogType; /** Log message function */ typedef void (*CkLogFunc)(CkLogType, const char* msg); /** Sample types used for internal DSP pipeline */ typedef enum { /** Force floating-point samples */ kCkSampleType_Float, /** Force fixed-point samples */ kCkSampleType_Fixed, /** Use the default, based on the processor type */ kCkSampleType_Default } CkSampleType; //////////////////////////////////////// /** Configuration options */ struct _CkConfig { #ifdef __cplusplus # if CK_PLATFORM_ANDROID /** Constructor to be used from JNI functions. @param env A JNI environment pointer @param context An android.content.Context object from Java (typically an android.app.Activity or android.app.Service) */ _CkConfig(JNIEnv* env, jobject context); /** This constructor should be used when there is no valid JNIEnv* pointer; for example, from android_main() in a native activity using the android_native_app_glue library. See the code in src/samples/hellocricket/android-ndk-native for an example. @param vm A Java VM pointer @param context An android.content.Context object from Java (typically an android.app.Activity or android.app.Service) */ _CkConfig(JavaVM* vm, jobject context); # else _CkConfig(); # endif #endif // __cplusplus #if CK_PLATFORM_ANDROID /** The JNIEnv pointer. @par Only available on Android. */ JNIEnv* jni; /** The JavaVM pointer. @par Only available on Android. */ JavaVM* vm; /** A Java reference to your app's Context object (typically an Activity or Service). @par Only available on Android. */ jobject context; /** If true, always use Java AudioTrack for output of final mix, instead of OpenSL ES. This should usually be set to false, unless you are debugging specific issues related to low-level audio output. Default is false (use Java AudioTrack only when OpenSL ES is not available, i.e. Android versions prior to 2.3). @par Only available on Android. */ bool useJavaAudio; /** If true, software support for Ogg Vorbis stream sounds is enabled. If false, stream sounds will use the native Android decoder, which will not support all of the features available to sounds decoded in software. Default is true (Ogg Vorbis streams are decoded in software). @par Only available on Android. */ bool enableOggVorbis; #endif #if CK_PLATFORM_IOS || CK_PLATFORM_TVOS /** If true, hardware-assisted decoding is enabled for decoding compressed streams when available. See Apple's "Multimedia Programming Guide" for a list of codecs for which hardware support is available. Note that streams that use the hardware decoder take slightly longer (~300ms) to initialize, and our tests have shown a negligible effect on CPU usage, so the default value is false. @par Only available on iOS. */ bool enableHardwareDecoding; #endif /** Memory allocation function. Default is NULL (system new will be used). The allocator must be thread-safe. */ CkAllocFunc allocFunc; /** Memory deallocation function. Default is NULL (system delete will be used). The allocator must be thread-safe. */ CkFreeFunc freeFunc; /** Bitmask for which types of messages are logged. Default is kCkLog_All (all messages logged). */ unsigned int logMask; /** Function to handle log messages. Default is NULL (printf or equivalent will be used). */ CkLogFunc logFunc; /** Audio processing frame duration, in ms. Shorter times result in lower latency, but require more CPU. Default is 5 ms. */ float audioUpdateMs; /** Size of buffer for stream sounds, in ms. Larger buffers require more memory, but are less likely to skip due to slow file reads. Default is 500 ms. */ float streamBufferMs; /** Interval between file reads for stream sounds, in ms. Shorter times will allow for smaller stream buffer sizes, but require more CPU. This value should be set to significantly less than streamBufferMs, or your buffers will always underrun! Default is 100 ms. */ float streamFileUpdateMs; /** Initial size of the audio task buffer. If you see a "Reallocating audio task buffer" warning, consider increasing this from its default value of 500 to avoid additional memory allocations at runtime. */ int maxAudioTasks; /** Maximum render load. When the value of CkGetRenderLoad() exceeds this value, some sounds will not be rendered, to keep the CPU usage down. Default is 0.8. */ float maxRenderLoad; /** Sample type to be used internally for processing. The default is kCkSampleType_Default, which means that fixed-point samples are used on Android armv5 and armv6 devices, which may lack hardware support for floating-point operations, and that floating-point samples are used on all other devices. */ CkSampleType sampleType; }; typedef struct _CkConfig CkConfig; /** Default value of CkConfig.audioUpdateMs */ extern const float CkConfig_audioUpdateMsDefault; /** Default value of CkConfig.streamBufferMs */ extern const float CkConfig_streamBufferMsDefault; /** Default value of CkConfig.streamFileUpdateMs */ extern const float CkConfig_streamFileUpdateMsDefault; /** Default value of CkConfig.maxAudioTasks */ extern const int CkConfig_maxAudioTasksDefault; /** Default value of CkConfig.maxRenderLoad */ extern const float CkConfig_maxRenderLoadDefault; //////////////////////////////////////// #ifdef __OBJC__ /** If you are using Objective-C, call CkConfigInit() to initialize the CkConfig struct to its default values. (If you are using C++, the CkConfig struct is initialized by its constructor.) */ #ifdef __cplusplus extern "C" #endif void CkConfigInit(CkConfig*); #endif /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/customfile.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkCustomFile CkCustomFile */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" /** Custom file base class. If you want to override the low-level details of how files are read (for example, to read files over a network, or to decrypt encrypted files as they are read), create a subclass and register a handler with CkSetCustomFileHandler(). This will work for bank files, and for .cks and Ogg Vorbis streams, but not for other stream types such as MP3, AAC, etc. */ class CkCustomFile { public: virtual ~CkCustomFile() {} /** Returns true if the file was successfully opened. */ virtual bool isValid() const = 0; /** Read from the file. Returns number of bytes actually read. */ virtual int read(void* buf, int bytes) = 0; /** Returns the size of the file. */ virtual int getSize() const = 0; /** Sets the read position in the file. */ virtual void setPos(int pos) = 0; /** Returns the read position in the file. */ virtual int getPos() const = 0; }; /** Factory function for opening files using a CkCustomFile instance. The function should return CkCustomFile instance, or NULL to open the file with the default handler. */ typedef CkCustomFile* (*CkCustomFileFunc)(const char* path, void* data); /** Set the file handler. Set it to NULL to use the default handler. */ void CkSetCustomFileHandler(CkCustomFileFunc, void* data); /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/customstream.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkCustomStream CkCustomStream */ /** @{ */ #pragma once #include "ck/platform.h" /** Base class for custom streams. To create a custom stream sound (for example, for playing back audio in a proprietary file format), create a subclass, then register a factory function with CkSound::setCustomStreamHandler(). */ class CkCustomStream { public: virtual ~CkCustomStream() {} /** Initializes the stream (open data files, read file headers, etc). This is called from the file streaming thread, not the main thread, so synchronous file reading calls will not block audio or application logic. */ virtual void init() = 0; /** Returns whether the stream has failed in a way that renders it unusable; for example, if an audio file could not be found. */ virtual bool isFailed() const = 0; /** Returns the number of channels; should be either 1 or 2. */ virtual int getChannels() const = 0; /** Returns the sample rate of the audio. */ virtual int getSampleRate() const = 0; /** Returns the total duration of the sound, in sample frames. */ virtual int getLength() const = 0; /** Reads audio into the buffer; returns the number of sample frames actually read. The audio data should be 16-bit signed PCM. */ virtual int read(short* buf, int frames) = 0; /** Sets the current play position, in sample frames. */ virtual void setPlayPosition(int frame) = 0; /** Returns the current play position, in sample frames. */ virtual int getPlayPosition() const = 0; }; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/effect.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffect CkEffect */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/effecttype.h" #include class CkEffectProcessor; /** An audio effect. */ class CkEffect { public: /** Set an effect parameter. Parameter IDs are found in ck/effectparam.h. */ virtual void setParam(int paramId, float value) = 0; /** Reset the state of this effect. */ virtual void reset() = 0; /** Set whether this effect is bypassed. A bypassed effect is not applied to the audio. */ virtual void setBypassed(bool) = 0; /** Gets whether this effect is bypassed. A bypassed effect is not applied to the audio. */ virtual bool isBypassed() const = 0; /** Sets the wet/dry ratio for this effect The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the ffect. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual void setWetDryRatio(float) = 0; /** Gets the wet/dry ratio for this effect. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the effect. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual float getWetDryRatio() const = 0; /** Create a built-in effect. Effect types are found in ck/effecttype.h. */ static CkEffect* newEffect(CkEffectType); /** Factory function for creating effect processors for custom effects. */ typedef CkEffectProcessor* (*CustomEffectFunc)(void* arg); /** Register a custom effect. To unregister an effect, pass in NULL for the CustomEffectFunc. */ static void registerCustomEffect(int id, CustomEffectFunc); /** Create a custom effect. A factory function must have been previously registered with the given id, or this will return NULL. */ static CkEffect* newCustomEffect(int id, void* arg = NULL); /** Destroy the effect. */ virtual void destroy() = 0; protected: CkEffect() {} virtual ~CkEffect() {} private: CkEffect(const CkEffect&); CkEffect& operator=(const CkEffect&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/effectbus.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectBus CkEffectBus */ /** @{ */ #pragma once #include "ck/platform.h" class CkEffect; /** Manages a set of audio effects applied to sounds. */ class CkEffectBus { public: /** Add an effect to this bus. An effect can only be on one bus at a time. */ virtual void addEffect(CkEffect*) = 0; /** Remove an effect from this bus. */ virtual void removeEffect(CkEffect*) = 0; /** Remove all effects from this bus. */ virtual void removeAllEffects() = 0; /** Set the bus to which this bus's output is sent. If NULL (the default), the audio from this bus is mixed into the final output. */ virtual void setOutputBus(CkEffectBus*) = 0; /** Get the bus to which this bus's output is sent. If NULL (the default), the audio from this bus is mixed into the final output. */ virtual CkEffectBus* getOutputBus() = 0; /** Reset the state of all the effects on this bus. */ virtual void reset() = 0; /** Set whether this bus is bypassed. A bypassed effect is not applied to the audio. */ virtual void setBypassed(bool) = 0; /** Gets whether this bus is bypassed. Effects in a bypassed bus are not applied to the audio. */ virtual bool isBypassed() const = 0; /** Sets the wet/dry ratio for this bus. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the bus. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual void setWetDryRatio(float) = 0; /** Gets the wet/dry ratio for this bus. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the bus. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual float getWetDryRatio() const = 0; //////////////////////////////////////// /** Create a new effect bus. */ static CkEffectBus* newEffectBus(); /** Get the global effect bus. Effects on this bus are applied to the final audio before it is output. */ static CkEffectBus* getGlobalEffectBus(); /** Destroy this effect bus. */ virtual void destroy() = 0; protected: CkEffectBus() {} virtual ~CkEffectBus() {} private: CkEffectBus(const CkEffectBus&); CkEffectBus& operator=(const CkEffectBus&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/effectparam.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectParam CkEffectParam */ /** @{ */ #pragma once #include "ck/platform.h" /** Parameters for the Biquad Filter effect */ enum { /** Type of filter; should be one of the kCkBiquadFilterParam_FilterType values. */ kCkBiquadFilterParam_FilterType, /** Center frequency of the filter. */ kCkBiquadFilterParam_Freq, /** Q of the filter. */ kCkBiquadFilterParam_Q, /** Gain in dB (for Peak, LowShelf, and HighShelf filter types) */ kCkBiquadFilterParam_Gain, }; /** Filter types, used for the kCkBiquadFilterParam_FilterType param. */ enum { /** Low pass filter blocks high frequencies. */ kCkBiquadFilterParam_FilterType_LowPass, /** High pass filter blocks low frequencies. */ kCkBiquadFilterParam_FilterType_HighPass, /** Band pass filter blocks frequencies above and below the center frequency. */ kCkBiquadFilterParam_FilterType_BandPass, /** Notch filter blocks a narrow band of frequencies. */ kCkBiquadFilterParam_FilterType_Notch, /** Peak filter boosts a narrow band of frequencies. */ kCkBiquadFilterParam_FilterType_Peak, /** Low shelf filter boosts low frequencies. */ kCkBiquadFilterParam_FilterType_LowShelf, /** High shelf filter boosts high frequencies. */ kCkBiquadFilterParam_FilterType_HighShelf }; //////////////////////////////////////// /** Parameters for the Bit Crusher effect */ enum { /** Number of bits of resolution to keep in the input samples, in [1..24]. */ kCkBitCrusherParam_BitResolution, /** Milliseconds to hold each sample value. Higher values result in more reduction in the effective sample rate. Values around 1 ms provide a reasonable effect. */ kCkBitCrusherParam_HoldMs, }; //////////////////////////////////////// /** Parameters for the Ring Mod effect */ enum { /** Frequency (Hz) of the modulating signal. Values around 500 Hz are typical. */ kCkRingModParam_Freq, }; //////////////////////////////////////// /** Parameters for the Distortion effect */ enum { /** Scale factor for input; larger values cause a more pronounced effect. */ kCkDistortionParam_Drive, /** Offset for input. */ kCkDistortionParam_Offset, }; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/effectprocessor.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectProcessor CkEffectProcessor */ /** @{ */ #pragma once #include "ck/platform.h" /** Performs audio processing for effects. To implement your own custom audio effects, create a subclass, then register a factory function that creates an instance of it with CkEffect::registerCustomEffect(). */ class CkEffectProcessor { public: virtual ~CkEffectProcessor() {} /** Set an effect parameter. Note that this should not be called directly; it is called by CkEffect::setParam(). */ virtual void setParam(int paramId, float value) = 0; /** Reset this effect's state. */ virtual void reset() = 0; /** If true, the effect is processed in-place; the input and output will be the same buffer. If false, input and output will be separate buffers. */ virtual bool isInPlace() const = 0; /** Process audio. The buffer contains interleaved stereo data; each sample is a signed 8.24 fixed-point value. If isInPlace() returns true, inBuf and outBuf will be pointers to the same buffer. It is OK to modify the data in inBuf, even if the effect is not in-place. (Remember that because the data is stereo, the number of samples is 2*frames.) @par This will only be called on older Android armv5 or armv6 devices, or if CkConfig.sampleType is set to kCkSampleType_Fixed. If you are not supporting those devices, you may leave this with its default implementation, which passes the audio through unchanged. */ virtual void process(int* inBuf, int* outBuf, int frames); /** Process audio. The buffer contains interleaved stereo data; each sample is a 32-bit floating-point value. If isInPlace() returns true, inBuf and outBuf will be pointers to the same buffer. It is OK to modify the data in inBuf, even if the effect is not in-place. (Remember that because the data is stereo, the number of samples is 2*frames.) */ virtual void process(float* inBuf, float* outBuf, int frames) = 0; /** Get the sample rate of the audio data. This value may be different on different devices, but will not change during app execution. */ static int getSampleRate(); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/effecttype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectType CkEffectType */ /** @{ */ #pragma once #include "ck/platform.h" /** Types of built-in effects available */ typedef enum { /** Biquadratic filter. See kCkBiquadFilterParam values for parameter IDs. */ kCkEffectType_BiquadFilter, /** Bit Crusher effect reduces bit resolution and/or bit rate, producing a retro low-fi 8-bit sound. See kCkBitCrusherParam values for parameter IDs. */ kCkEffectType_BitCrusher, /** Ring Mod effect modulates the audio by a sine wave. See kCkRingModParam values for parameter IDs. */ kCkEffectType_RingMod, /** Distortion effect. See kCkDistortionParam values for parameter IDs. */ kCkEffectType_Distortion, } CkEffectType; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/mixer.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkMixer CkMixer */ /** @{ */ #pragma once #include "ck/platform.h" #include /** A mixer represents a hierarchical grouping of sounds for controlling volumes. */ class CkMixer { public: /** Set the name of the mixer. The name should be 31 characters or less. */ virtual void setName(const char*) = 0; /** Get the name of the mixer. */ virtual const char* getName() const = 0; /** Set the volume of this mixer. (The actual volume used during mixing will also depend on ancestors.) */ virtual void setVolume(float) = 0; /** Get the volume of this mixer. (The actual volume used during mixing will also depend on ancestors.) */ virtual float getVolume() const = 0; /** Get the volume used for mixing (affected by ancestors). */ virtual float getMixedVolume() const = 0; /** Set whether this mixer is paused. A sound will be paused if the sound, its mixer, or any of its mixer's ancestors are paused. */ virtual void setPaused(bool) = 0; /** Get whether this mixer is paused. A sound will be paused if the sound, its mixer, or any of its mixer's ancestors are paused. */ virtual bool isPaused() const = 0; /** Returns true if this mixer, or any of its ancestors, is paused. */ virtual bool getMixedPauseState() const = 0; /** Set the parent of the mixer. Setting to NULL sets the master mixer as the parent. */ virtual void setParent(CkMixer*) = 0; /** Get the parent of the mixer. */ virtual CkMixer* getParent() = 0; /** Returns the master mixer, which is the root of the mixer hierarchy. */ static CkMixer* getMaster(); /** Creates a new mixer. */ static CkMixer* newMixer(const char* name, CkMixer* parent = NULL); /** Finds a mixer by name; returns NULL if not found. */ static CkMixer* find(const char* name); /** Destroys the mixer. */ virtual void destroy() = 0; protected: CkMixer() {} virtual ~CkMixer() {} private: CkMixer(const CkMixer&); CkMixer& operator=(const CkMixer&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/pathtype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkPathType CkPathType */ /** @{ */ #pragma once #include "ck/platform.h" /** Indicates how a file path should be interpreted. */ typedef enum { /** A full path to a file on the file system. */ kCkPathType_FileSystem = 0, #if CK_PLATFORM_ANDROID /** A path to an asset in the .apk. Assets are read-only. @par Only available on Android. */ kCkPathType_Asset, /** A path relative to the private files directory. @par Only available on Android. */ kCkPathType_PrivateFiles, /** A path relative to the external storage directory. @par Only available on Android. */ kCkPathType_ExternalStorage, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS /** A path relative to the application's resource directory. On iOS, the resource directory is the application bundle, and is read-only. On OS X, the resource directory is the directory containing the executable. @par Only available on iOS and OS X. */ kCkPathType_Resource, #endif #if CK_PLATFORM_WP8 /** A path relative to the local app data store. @par Only available on Windows Phone 8. */ kCkPathType_LocalDir, /** A path relative to the folder containing your app's package files. Files in your Visual Studio project with the "Content" property set to true will be installed here. This folder is read-only. @par Only available on Windows Phone 8. */ kCkPathType_InstallationDir, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS || CK_PLATFORM_WIN || CK_PLATFORM_LINUX /** A path relative to the directory used for temporary files. @par Only available on iOS, OS X, Windows, and Linux. */ kCkPathType_Temp, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_WIN || CK_PLATFORM_LINUX /** A path relative to the application's documents directory. On iOS, this is the app's Documents directory. On OS X and Windows, this is the user's Documents directory. On Linux, this is the user's home directory. @par Only available on iOS, OS X, Windows, and Linux. */ kCkPathType_Documents, #endif #if CK_PLATFORM_WIN || CK_PLATFORM_LINUX || CK_PLATFORM_OSX /** A path relative to the executable's directory. (On OS X, this is the same as kCkPathType_Resource.) @par Only available on Windows, Linux, and OS X. */ kCkPathType_ExeDir, #endif /** The default path type for reading files. */ #if CK_PLATFORM_ANDROID kCkPathType_ReadDefault = kCkPathType_Asset, #elif CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS kCkPathType_ReadDefault = kCkPathType_Resource, #elif CK_PLATFORM_WIN || CK_PLATFORM_LINUX kCkPathType_ReadDefault = kCkPathType_ExeDir, #elif CK_PLATFORM_WP8 kCkPathType_ReadDefault = kCkPathType_InstallationDir, #endif /** The default path type for writing files. */ #if CK_PLATFORM_ANDROID kCkPathType_WriteDefault = kCkPathType_PrivateFiles, #elif CK_PLATFORM_IOS || CK_PLATFORM_OSX kCkPathType_WriteDefault = kCkPathType_Documents, #elif CK_PLATFORM_TVOS kCkPathType_WriteDefault = kCkPathType_Temp, #elif CK_PLATFORM_WIN || CK_PLATFORM_LINUX kCkPathType_WriteDefault = kCkPathType_ExeDir, #elif CK_PLATFORM_WP8 kCkPathType_WriteDefault = kCkPathType_LocalDir, #endif /** The default path type. */ kCkPathType_Default = kCkPathType_ReadDefault } CkPathType; /** @} */ ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/platform.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ #pragma once // software platform #undef CK_PLATFORM_IOS #undef CK_PLATFORM_TVOS #undef CK_PLATFORM_ANDROID #undef CK_PLATFORM_OSX #undef CK_PLATFORM_WIN #undef CK_PLATFORM_WP8 #undef CK_PLATFORM_LINUX #ifdef __APPLE__ # include # if TARGET_OS_IPHONE # if TARGET_OS_IOS # define CK_PLATFORM_IOS 1 # elif TARGET_OS_TV # define CK_PLATFORM_TVOS 1 # endif # else # define CK_PLATFORM_OSX 1 # endif #elif defined(__ANDROID__) # define CK_PLATFORM_ANDROID 1 #elif defined(__linux__) # define CK_PLATFORM_LINUX 1 #elif defined(_WIN64) || defined(_WIN32) # if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP # define CK_PLATFORM_WP8 1 # else # define CK_PLATFORM_WIN 1 # endif #endif #if CK_PLATFORM_OSX && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060) # error "OS X 10.6 required!" #endif #if !CK_PLATFORM_IOS && !CK_PLATFORM_ANDROID && !CK_PLATFORM_OSX && !CK_PLATFORM_WIN && !CK_PLATFORM_WP8 && !CK_PLATFORM_LINUX && !CK_PLATFORM_TVOS # error "Unsupported platform!" #endif ================================================ FILE: Libraries/CricketAudio/RPi/Headers/ck/sound.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkSound CkSound */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" #include "ck/attenuationmode.h" #include class CkBank; class CkMixer; class CkEffectBus; class CkCustomStream; /** A sound (either memory-resident or streamed). */ class CkSound { public: /** Sets the mixer to which this sound is assigned. Setting NULL will assign it to the master mixer. */ virtual void setMixer(CkMixer*) = 0; /** Gets the mixer to which this sound is assigned. */ virtual CkMixer* getMixer() = 0; /** Returns true if the sound is ready. Bank sounds are ready immediately after creation; stream sounds may not be. */ virtual bool isReady() const = 0; /** Returns true if an error occurred while creating the sound. */ virtual bool isFailed() const = 0; /** Play the sound. */ virtual void play() = 0; /** Stop the sound. */ virtual void stop() = 0; /** Gets whether the sound is playing. */ virtual bool isPlaying() const = 0; /** Sets whether the sound is paused. Note that even if false, the sound will be paused if its mixer or any of its mixer's ancestors are paused.*/ virtual void setPaused(bool) = 0; /** Gets whether the sound is paused. Note that even if false, the sound will be paused if its mixer or any of its mixer's ancestors are paused.*/ virtual bool isPaused() const = 0; /** Returns true if the sound is pauses, its mixer is paused, or any of its mixer's ancestors are paused. */ virtual bool getMixedPauseState() const = 0; /** Set the loop start and end. Default is to loop over all sample frames. EndFrame is defined as one frame after the last frame of the loop. Setting endFrame = -1 is equivalent to setting it to getLength(). @par Android note: This has no effect for streams in formats other than .cks or Ogg Vorbis. */ virtual void setLoop(int startFrame, int endFrame) = 0; /** Get the loop start and end. Default is to loop over all sample frames. EndFrame is defined as one frame after the last frame of the loop. Setting endFrame = -1 is equivalent to setting it to getLength(). @par Android note: This has no effect for streams in formats other than .cks or Ogg Vorbis. */ virtual void getLoop(int& startFrame, int& endFrame) const = 0; /** Sets the number of times the sound should loop. 0 means no looping (play once and then stop). 1 means it will play twice; 2 means it will play 3 times; etc. -1 means it will loop indefinitely until the sound is stopped or releaseLoop() is called. */ virtual void setLoopCount(int) = 0; /** Gets the number of times the sound should loop. 0 means no looping (play once and then stop). 1 means it will play twice; 2 means it will play 3 times; etc. -1 means it will loop indefinitely until the sound is stopped or releaseLoop() is called. */ virtual int getLoopCount() const = 0; /** Gets the number of the current loop. For example, returns 0 if this is the first time playing through this sample; returns 1 if it is on its second loop through the sample; etc. */ virtual int getCurrentLoop() const = 0; /** Makes the current loop the last. This is useful when you don't know in advance how many times you will want to loop; set the loop count to -1, and call releaseLoop() when you want it to stop looping and play to the end. */ virtual void releaseLoop() = 0; /** Returns true if releaseLoop() has been called after the last call to play(). */ virtual bool isLoopReleased() const = 0; /** Set the play position in the sound, in sample frames. This can be called before playing, to start from an offset into the sound; or during playback, to jump to a new location. */ virtual void setPlayPosition(int) = 0; /** Set the play position in the sound, in milliseconds. This can be called before playing, to start from an offset into the sound; or during playback, to jump to a new location. */ virtual void setPlayPositionMs(float) = 0; /** Get the current play position in the sound, in sample frames. */ virtual int getPlayPosition() const = 0; /** Get the current play position in the sound, in milliseconds. */ virtual float getPlayPositionMs() const = 0; /** Sets the volume of this sound. The volume can range from 0 to 1. The default value is 1. Note that the actual volume used for mixing will also depend on the volume of the mixer to which this sound is assigned. */ virtual void setVolume(float) = 0; /** Gets the volume of this sound. The volume can range from 0 to 1. The default value is 1. Note that the actual volume used for mixing will also depend on the volume of the mixer to which this sound is assigned. */ virtual float getVolume() const = 0; /** Gets the volume value used for mixing. This is the product of the volume set with setVolume() and the mixed volume value of the mixer to which the sound is assigned. */ virtual float getMixedVolume() const = 0; /** Sets the pan. The pan can range from -1 (left) to +1 (right). The default is 0 (center). */ virtual void setPan(float) = 0; /** Gets the pan. The pan can range from -1 (left) to +1 (right). The default is 0 (center). */ virtual float getPan() const = 0; /** Sets the pan matrix explicitly. The pan matrix determines how the left and right channels of an input are weighted during mixing. Usually it is set by setPan(), but you can use setPanMatrix() if you need more control. For a mono input, the left channel of the output is the input scaled by ll, and the right channel of the output is the input scaled by rr. The off-diagonal lr and rl terms are ignored. For a stereo input, the left channel of the output is the left channel of the input scaled by ll plus the right channel of the input scaled by lr. The right channel of the output is the left channel of the input scaled by rl plus the right channel of the input scaled by rr. */ virtual void setPanMatrix(float ll, float lr, float rl, float rr) = 0; /** Gets the pan matrix. The pan matrix determines how the left and right channels of an input are weighted during mixing. Usually it is set by setPan(), but you can use setPanMatrix() if you need more control. For a mono input, the left channel of the output is the input scaled by ll, and the right channel of the output is the input scaled by rr. The off-diagonal lr and rl terms are ignored. For a stereo input, the left channel of the output is the left channel of the input scaled by ll plus the right channel of the input scaled by lr. The right channel of the output is the left channel of the input scaled by rl plus the right channel of the input scaled by rr. */ virtual void getPanMatrix(float& ll, float& lr, float& rl, float& rr) const = 0; /** Sets the pitch shift value, in half-steps. This also changes the playback speed of the sound. Positive values mean higher pitch (and faster playback); lower values mean lower pitch (and slower playback). The default value is 0. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setPitchShift(float halfSteps) = 0; /** Gets the pitch shift value, in half-steps. Positive values mean higher pitch (and faster playback); lower values mean lower pitch (and slower playback). The default value is 0. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual float getPitchShift() const = 0; /** Sets the playback speed. Values greater than 1 mean faster playback; values less than 1 mean slower playback. The default value is 1. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setSpeed(float) = 0; /** Gets the playback speed. Values greater than 1 mean faster playback; values less than 1 mean slower playback. The default value is 1. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual float getSpeed() const = 0; /** Sets the sound to be played when this sound finishes playing. The next sound will play immediately, with no gaps. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setNextSound(CkSound*) = 0; /** Gets the sound to be played when this sound finishes playing. The next sound will play immediately, with no gaps. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual CkSound* getNextSound() const = 0; /** Gets the total duration of the sound, in sample frames. Stream sounds will return -1 if they are not ready or if the length is unknown. */ virtual int getLength() const = 0; /** Gets the total duration of the sound, in milliseconds. Stream sounds will return -1 if they are not ready or if the length is unknown. */ virtual float getLengthMs() const = 0; /** Gets the sample rate of the sound, in Hz. Stream sounds will return -1 if they are not ready. */ virtual int getSampleRate() const = 0; /** Gets the number of channels in the sound (1 for mono, 2 for stereo). Stream sounds will return -1 if they are not ready. */ virtual int getChannels() const = 0; /** Sets the effect bus to which this sound's audio is sent to be processed, or NULL for dry output (no effects). @par Android note: Effects cannot be applied to streams in formats other than .cks or Ogg Vorbis. */ virtual void setEffectBus(CkEffectBus*) = 0; /** Gets the effect bus to which this sound's audio is sent to be processed, or NULL for dry output (no effects). @par Android note: Effects cannot be applied to streams in formats other than .cks or Ogg Vorbis. */ virtual CkEffectBus* getEffectBus() = 0; /** Sets whether 3D positioning is enabled. If enabled, pan will be determined by the sound and listener positions, ignoring the value set by setPan(). Volume will be attenuated based on the sound and listener positions and the attenuation settings. */ virtual void set3dEnabled(bool) = 0; /** Gets whether 3D positioning is enabled. If enabled, pan will be determined by the sound and listener positions, ignoring the value set by setPan(). Volume will be attenuated based on the sound and listener positions and the attenuation settings. */ virtual bool is3dEnabled() const = 0; /** Gets whether a 3D sound is virtual. If, due to distance attenuation, a 3D sound's volume becomes near enough to 0 to be inaudible, it becomes "virtual". A virtual sound is effectively paused and is not processed until it would become audible again; this reduces the amount of audio processing required. */ virtual bool isVirtual() const = 0; /** Sets the position of the sound emitter in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. */ virtual void set3dPosition(float x, float y, float z) = 0; /** Gets the position of the sound emitter in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. */ virtual void get3dPosition(float& x, float& y, float& z) const = 0; /** Sets the velocity of the sound emitter in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ virtual void set3dVelocity(float vx, float vy, float vz) = 0; /** Gets the velocity of the sound emitter in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ virtual void get3dVelocity(float& vx, float& vy, float& vz) const = 0; /** Sets the listener position and rotation in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. @param eyeX,eyeY,eyeZ The listener's position @param lookAtX,lookAtY,lookAtZ The listener's look-at point @param upX,upY,upZ The listener's up vector */ static void set3dListenerPosition(float eyeX, float eyeY, float eyeZ, float lookAtX, float lookAtY, float lookAtZ, float upX, float upY, float upZ); /** Gets the listener position and rotation in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. @param eyeX,eyeY,eyeZ The listener's position @param lookAtX,lookAtY,lookAtZ The listener's look-at point @param upX,upY,upZ The listener's up vector */ static void get3dListenerPosition(float& eyeX, float& eyeY, float& eyeZ, float& lookAtX, float& lookAtY, float& lookAtZ, float& upX, float& upY, float& upZ); /** Sets the listener velocity in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ static void set3dListenerVelocity(float vx, float vy, float vz); /** Gets the listener velocity in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ static void get3dListenerVelocity(float& vx, float& vy, float& vz); /** Sets parameters used for 3D volume attenuation. @param mode The attenuation mode (default is kCkAttenuationMode_InvDistanceSquared) @param nearDist The near distance; sounds closer than this distance will not be attenuated (default is 1.0) @param farDist The far distance; sounds further than this will be at the far volume (default is 100.0) @param farVol The far volume; sounds further than farDist will be at this volume (default is 0.0) */ static void set3dAttenuation(CkAttenuationMode mode, float nearDist, float farDist, float farVol); /** Gets parameters used for 3D volume attenuation. @param mode The attenuation mode @param nearDist The near distance; sounds closer than this distance will not be attenuated. @param farDist The far distance; sounds further than this will be at the far volume. @param farVol The far volume; sounds further than farDist will be at this volume. */ static void get3dAttenuation(CkAttenuationMode& mode, float& nearDist, float& farDist, float& farVol); /** Sets the speed of sound. This is used for doppler shift calculations when 3D positioning is enabled. If no doppler shift is desired, this can be set to 0 (which is the default value). You may want to use the predefined constants for the speed of sound (such as k_soundSpeed_MetersPerSecond); use the constant that corresponds to the unit system you are using for your velocity and position values. You can also exaggerate the doppler effect by using a smaller value. */ static void set3dSoundSpeed(float); /** Gets the speed of sound. This is used for doppler shift calculations when 3D positioning is enabled. */ static float get3dSoundSpeed(); /** The speed of sound in dry air at 20 degrees C, in centimeters per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_CentimetersPerSecond; /** The speed of sound in dry air at 20 degrees C, in meters per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_MetersPerSecond; /** The speed of sound in dry air at 20 degrees C, in inches per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_InchesPerSecond; /** The speed of sound in dry air at 20 degrees C, in feet per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_FeetPerSecond; //////////////////////////////////////// // bank sounds /** Creates a sound from a bank by index. This will return NULL if the index is invalid. */ static CkSound* newBankSound(CkBank*, int index); /** Creates a sound from a bank by name. If bank is NULL, all loaded banks are searched for the first matching sound. This will return NULL if no sound with that name can be found. */ static CkSound* newBankSound(CkBank*, const char* name); //////////////////////////////////////// // streams /** Creates a stream from a file path. This will return NULL if the file could not be opened. If a non-NULL value is returned, you should also check isFailed() to find out if any errors occurred during initialization. If the stream file is embedded in a larger file, specify the offset and length of the embedded data in bytes, and provide a string ending with a file extension that indicates the file format of the embedded file (for example, ".mp3" or "music.mp3"). Otherwise, leave the offset, length, and extension as 0. */ static CkSound* newStreamSound(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0, const char* extension = NULL); /** Factory function for creating custom streams. The function should return a CkCustomStream instance, or NULL to create a stream with the default handler. */ typedef CkCustomStream* (*CustomStreamFunc)(const char* path, void* data); /** Set the stream handler. Set it to NULL to use the default handler. */ static void setCustomStreamHandler(CustomStreamFunc, void* data); #if CK_PLATFORM_IOS /** Creates a stream from a URL for an asset in the iTunes library. The URL should be determined using an MPMediaQuery object; see the "iPod Library Access Programming Guide" document in the iOS Developer Library. Note that this will only work for music files without DRM; for files with DRM, the URL will be returned as nil. @par Only available on iOS version 4.3 or later; will return NULL on earlier iOS versions. */ static CkSound* newAssetStreamSound(const char* url); #endif /** Destroys the sound. */ virtual void destroy() = 0; protected: CkSound() {} virtual ~CkSound() {} private: CkSound(const CkSound&); CkSound& operator=(const CkSound&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/attenuationmode.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkAttenuationMode CkAttenuationMode */ /** @{ */ #pragma once #include "ck/platform.h" /** Indicates how volume on 3D sounds is attenuated with distance. */ typedef enum { /** No attenuation; volume is 1.0 when closer than the far distance, and far volume outside of that. */ kCkAttenuationMode_None = 0, /** Linear attenuation of volume between near distance and far distance. */ kCkAttenuationMode_Linear, /** Attenuation proportional to the reciprocal of the distance. */ kCkAttenuationMode_InvDistance, /** Attenuation proportional to the square of the reciprocal of the distance. This is a good choice for realistically simulating point sound sources. */ kCkAttenuationMode_InvDistanceSquared, } CkAttenuationMode; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/bank.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkBank CkBank */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" /** A bank of memory-resident sounds. */ class CkBank { public: /** Returns true when an asynchronously loaded bank has finished loading. */ virtual bool isLoaded() const = 0; /** Returns true if an asynchronously loaded bank had an error during loading. */ virtual bool isFailed() const = 0; /** Returns the name of the bank. */ virtual const char* getName() const = 0; /** Returns the number of sounds in the bank. */ virtual int getNumSounds() const = 0; /** Returns the name of a sound in this bank. The name will be 31 characters or less. */ virtual const char* getSoundName(int index) const = 0; //////////////////////////////////////// /** Loads a bank. This will return NULL if the bank cannot be loaded. If the bank file is embedded in a larger file, specify the offset and length of the embedded data; otherwise, leave them both as 0. */ static CkBank* newBank(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0); /** Loads a bank asynchronously. This will return NULL if the bank cannot be loaded. When loading a bank asynchronously, you should also check isFailed() after loading to make sure no errors occurred. If the bank file is embedded in a larger file, specify the offset and length of the embedded data; otherwise, leave them both as 0. */ static CkBank* newBankAsync(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0); /** Loads a bank from a memory buffer. The buffer should contain entire bank file; you are responsible for freeing the memory after the bank is deleted. This will return NULL if the bank cannot be loaded. */ static CkBank* newBankFromMemory(void*, int bytes); /** Finds a loaded bank by name; returns NULL if not found. */ static CkBank* find(const char* bankName); /** Destroys the bank. */ virtual void destroy() = 0; protected: CkBank() {} virtual ~CkBank() {} private: CkBank(const CkBank&); CkBank& operator=(const CkBank&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/ck.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup Ck Ck */ /** @{ */ #pragma once #include "ck/config.h" #include "ck/pathtype.h" #ifdef __cplusplus extern "C" { #endif /** Initializes Cricket Audio. Returns nonzero if successful. */ int CkInit(CkConfig*); /** Updates Cricket Audio. Should be called once per frame. */ void CkUpdate(); /** Shuts down Cricket Audio. */ void CkShutdown(); /** Suspends Cricket Audio; typically used when an app is made inactive. */ void CkSuspend(); /** Resumes Cricket Audio; typically used when an app is made active after having been inactive. */ void CkResume(); /** Returns a rough estimate of the load on the audio processing thread. This is the fraction of the interval between audio callbacks that was actually spent rendering audio; it will range between 0 and 1. */ float CkGetRenderLoad(); /** Returns the value of the clip flag. The clip flag is set to true whenever the final audio output "clips", i.e. exceeds the maximum value. */ bool CkGetClipFlag(); /** Resets the value of the clip flag to false. The clip flag is set to true whenever the final audio output "clips", i.e. exceeds the maximum value. */ void CkResetClipFlag(); /** Sets the maximum rate at which volumes change on playing sounds, in ms per full volume scale. Default value is 40 ms. */ void CkSetVolumeRampTime(float ms); /** Gets the maximum rate at which volumes change on playing sounds, in ms per full volume scale. */ float CkGetVolumeRampTime(); /** Default value of volume ramp time. */ extern const float Ck_volumeRampTimeMsDefault; /** Lock the audio processing thread to prevent it from processing any API calls. The lock should be held only for a short time. This is useful to ensure that certain calls are processed together. For example, if you want to play multiple sounds together exactly in sync, call CkLockAudio(), call play() on each sound, then call CkUnlockAudio(). */ void CkLockAudio(); /** Unlock the audio processing thread after a call to CkLockAudio(). */ void CkUnlockAudio(); /** Start capturing the final audio output to a file. The filename must end with ".wav" (for a Microsoft WAVE file) or ".raw" (for a headerless file containing 32-bit floating-point interleaved stereo samples). */ void CkStartCapture(const char* path, CkPathType pathType); /** Stop capturing audio output. */ void CkStopCapture(); #ifdef __cplusplus } // extern "C" #endif /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/config.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkConfig CkConfig */ /** @{ */ #pragma once #include "ck/platform.h" #if CK_PLATFORM_ANDROID # include #endif //////////////////////////////////////// /** Memory allocation function */ typedef void* (*CkAllocFunc)(int bytes); /** Memory deallocation function */ typedef void (*CkFreeFunc)(void*); /** Log message types */ typedef enum { /** Flag to enable INFO log messages */ kCkLog_Info = (1 << 0), /** Flag to enable WARNING log messages */ kCkLog_Warning = (1 << 1), /** Flag to enable ERROR log messages */ kCkLog_Error = (1 << 2), /** Flag to disable all log messages */ kCkLog_None = 0, /** Flag to enable all log messages */ kCkLog_All = (kCkLog_Info | kCkLog_Warning | kCkLog_Error) } CkLogType; /** Log message function */ typedef void (*CkLogFunc)(CkLogType, const char* msg); /** Sample types used for internal DSP pipeline */ typedef enum { /** Force floating-point samples */ kCkSampleType_Float, /** Force fixed-point samples */ kCkSampleType_Fixed, /** Use the default, based on the processor type */ kCkSampleType_Default } CkSampleType; //////////////////////////////////////// /** Configuration options */ struct _CkConfig { #ifdef __cplusplus # if CK_PLATFORM_ANDROID /** Constructor to be used from JNI functions. @param env A JNI environment pointer @param context An android.content.Context object from Java (typically an android.app.Activity or android.app.Service) */ _CkConfig(JNIEnv* env, jobject context); /** This constructor should be used when there is no valid JNIEnv* pointer; for example, from android_main() in a native activity using the android_native_app_glue library. See the code in src/samples/hellocricket/android-ndk-native for an example. @param vm A Java VM pointer @param context An android.content.Context object from Java (typically an android.app.Activity or android.app.Service) */ _CkConfig(JavaVM* vm, jobject context); # else _CkConfig(); # endif #endif // __cplusplus #if CK_PLATFORM_ANDROID /** The JNIEnv pointer. @par Only available on Android. */ JNIEnv* jni; /** The JavaVM pointer. @par Only available on Android. */ JavaVM* vm; /** A Java reference to your app's Context object (typically an Activity or Service). @par Only available on Android. */ jobject context; /** If true, always use Java AudioTrack for output of final mix, instead of OpenSL ES. This should usually be set to false, unless you are debugging specific issues related to low-level audio output. Default is false (use Java AudioTrack only when OpenSL ES is not available, i.e. Android versions prior to 2.3). @par Only available on Android. */ bool useJavaAudio; /** If true, software support for Ogg Vorbis stream sounds is enabled. If false, stream sounds will use the native Android decoder, which will not support all of the features available to sounds decoded in software. Default is true (Ogg Vorbis streams are decoded in software). @par Only available on Android. */ bool enableOggVorbis; #endif #if CK_PLATFORM_IOS || CK_PLATFORM_TVOS /** If true, hardware-assisted decoding is enabled for decoding compressed streams when available. See Apple's "Multimedia Programming Guide" for a list of codecs for which hardware support is available. Note that streams that use the hardware decoder take slightly longer (~300ms) to initialize, and our tests have shown a negligible effect on CPU usage, so the default value is false. @par Only available on iOS. */ bool enableHardwareDecoding; #endif /** Memory allocation function. Default is NULL (system new will be used). The allocator must be thread-safe. */ CkAllocFunc allocFunc; /** Memory deallocation function. Default is NULL (system delete will be used). The allocator must be thread-safe. */ CkFreeFunc freeFunc; /** Bitmask for which types of messages are logged. Default is kCkLog_All (all messages logged). */ unsigned int logMask; /** Function to handle log messages. Default is NULL (printf or equivalent will be used). */ CkLogFunc logFunc; /** Audio processing frame duration, in ms. Shorter times result in lower latency, but require more CPU. Default is 5 ms. */ float audioUpdateMs; /** Size of buffer for stream sounds, in ms. Larger buffers require more memory, but are less likely to skip due to slow file reads. Default is 500 ms. */ float streamBufferMs; /** Interval between file reads for stream sounds, in ms. Shorter times will allow for smaller stream buffer sizes, but require more CPU. This value should be set to significantly less than streamBufferMs, or your buffers will always underrun! Default is 100 ms. */ float streamFileUpdateMs; /** Initial size of the audio task buffer. If you see a "Reallocating audio task buffer" warning, consider increasing this from its default value of 500 to avoid additional memory allocations at runtime. */ int maxAudioTasks; /** Maximum render load. When the value of CkGetRenderLoad() exceeds this value, some sounds will not be rendered, to keep the CPU usage down. Default is 0.8. */ float maxRenderLoad; /** Sample type to be used internally for processing. The default is kCkSampleType_Default, which means that fixed-point samples are used on Android armv5 and armv6 devices, which may lack hardware support for floating-point operations, and that floating-point samples are used on all other devices. */ CkSampleType sampleType; }; typedef struct _CkConfig CkConfig; /** Default value of CkConfig.audioUpdateMs */ extern const float CkConfig_audioUpdateMsDefault; /** Default value of CkConfig.streamBufferMs */ extern const float CkConfig_streamBufferMsDefault; /** Default value of CkConfig.streamFileUpdateMs */ extern const float CkConfig_streamFileUpdateMsDefault; /** Default value of CkConfig.maxAudioTasks */ extern const int CkConfig_maxAudioTasksDefault; /** Default value of CkConfig.maxRenderLoad */ extern const float CkConfig_maxRenderLoadDefault; //////////////////////////////////////// #ifdef __OBJC__ /** If you are using Objective-C, call CkConfigInit() to initialize the CkConfig struct to its default values. (If you are using C++, the CkConfig struct is initialized by its constructor.) */ #ifdef __cplusplus extern "C" #endif void CkConfigInit(CkConfig*); #endif /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/customfile.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkCustomFile CkCustomFile */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" /** Custom file base class. If you want to override the low-level details of how files are read (for example, to read files over a network, or to decrypt encrypted files as they are read), create a subclass and register a handler with CkSetCustomFileHandler(). This will work for bank files, and for .cks and Ogg Vorbis streams, but not for other stream types such as MP3, AAC, etc. */ class CkCustomFile { public: virtual ~CkCustomFile() {} /** Returns true if the file was successfully opened. */ virtual bool isValid() const = 0; /** Read from the file. Returns number of bytes actually read. */ virtual int read(void* buf, int bytes) = 0; /** Returns the size of the file. */ virtual int getSize() const = 0; /** Sets the read position in the file. */ virtual void setPos(int pos) = 0; /** Returns the read position in the file. */ virtual int getPos() const = 0; }; /** Factory function for opening files using a CkCustomFile instance. The function should return CkCustomFile instance, or NULL to open the file with the default handler. */ typedef CkCustomFile* (*CkCustomFileFunc)(const char* path, void* data); /** Set the file handler. Set it to NULL to use the default handler. */ void CkSetCustomFileHandler(CkCustomFileFunc, void* data); /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/customstream.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkCustomStream CkCustomStream */ /** @{ */ #pragma once #include "ck/platform.h" /** Base class for custom streams. To create a custom stream sound (for example, for playing back audio in a proprietary file format), create a subclass, then register a factory function with CkSound::setCustomStreamHandler(). */ class CkCustomStream { public: virtual ~CkCustomStream() {} /** Initializes the stream (open data files, read file headers, etc). This is called from the file streaming thread, not the main thread, so synchronous file reading calls will not block audio or application logic. */ virtual void init() = 0; /** Returns whether the stream has failed in a way that renders it unusable; for example, if an audio file could not be found. */ virtual bool isFailed() const = 0; /** Returns the number of channels; should be either 1 or 2. */ virtual int getChannels() const = 0; /** Returns the sample rate of the audio. */ virtual int getSampleRate() const = 0; /** Returns the total duration of the sound, in sample frames. */ virtual int getLength() const = 0; /** Reads audio into the buffer; returns the number of sample frames actually read. The audio data should be 16-bit signed PCM. */ virtual int read(short* buf, int frames) = 0; /** Sets the current play position, in sample frames. */ virtual void setPlayPosition(int frame) = 0; /** Returns the current play position, in sample frames. */ virtual int getPlayPosition() const = 0; }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/effect.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffect CkEffect */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/effecttype.h" #include class CkEffectProcessor; /** An audio effect. */ class CkEffect { public: /** Set an effect parameter. Parameter IDs are found in ck/effectparam.h. */ virtual void setParam(int paramId, float value) = 0; /** Reset the state of this effect. */ virtual void reset() = 0; /** Set whether this effect is bypassed. A bypassed effect is not applied to the audio. */ virtual void setBypassed(bool) = 0; /** Gets whether this effect is bypassed. A bypassed effect is not applied to the audio. */ virtual bool isBypassed() const = 0; /** Sets the wet/dry ratio for this effect The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the ffect. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual void setWetDryRatio(float) = 0; /** Gets the wet/dry ratio for this effect. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the effect. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual float getWetDryRatio() const = 0; /** Create a built-in effect. Effect types are found in ck/effecttype.h. */ static CkEffect* newEffect(CkEffectType); /** Factory function for creating effect processors for custom effects. */ typedef CkEffectProcessor* (*CustomEffectFunc)(void* arg); /** Register a custom effect. To unregister an effect, pass in NULL for the CustomEffectFunc. */ static void registerCustomEffect(int id, CustomEffectFunc); /** Create a custom effect. A factory function must have been previously registered with the given id, or this will return NULL. */ static CkEffect* newCustomEffect(int id, void* arg = NULL); /** Destroy the effect. */ virtual void destroy() = 0; protected: CkEffect() {} virtual ~CkEffect() {} private: CkEffect(const CkEffect&); CkEffect& operator=(const CkEffect&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/effectbus.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectBus CkEffectBus */ /** @{ */ #pragma once #include "ck/platform.h" class CkEffect; /** Manages a set of audio effects applied to sounds. */ class CkEffectBus { public: /** Add an effect to this bus. An effect can only be on one bus at a time. */ virtual void addEffect(CkEffect*) = 0; /** Remove an effect from this bus. */ virtual void removeEffect(CkEffect*) = 0; /** Remove all effects from this bus. */ virtual void removeAllEffects() = 0; /** Set the bus to which this bus's output is sent. If NULL (the default), the audio from this bus is mixed into the final output. */ virtual void setOutputBus(CkEffectBus*) = 0; /** Get the bus to which this bus's output is sent. If NULL (the default), the audio from this bus is mixed into the final output. */ virtual CkEffectBus* getOutputBus() = 0; /** Reset the state of all the effects on this bus. */ virtual void reset() = 0; /** Set whether this bus is bypassed. A bypassed effect is not applied to the audio. */ virtual void setBypassed(bool) = 0; /** Gets whether this bus is bypassed. Effects in a bypassed bus are not applied to the audio. */ virtual bool isBypassed() const = 0; /** Sets the wet/dry ratio for this bus. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the bus. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual void setWetDryRatio(float) = 0; /** Gets the wet/dry ratio for this bus. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the bus. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual float getWetDryRatio() const = 0; //////////////////////////////////////// /** Create a new effect bus. */ static CkEffectBus* newEffectBus(); /** Get the global effect bus. Effects on this bus are applied to the final audio before it is output. */ static CkEffectBus* getGlobalEffectBus(); /** Destroy this effect bus. */ virtual void destroy() = 0; protected: CkEffectBus() {} virtual ~CkEffectBus() {} private: CkEffectBus(const CkEffectBus&); CkEffectBus& operator=(const CkEffectBus&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/effectparam.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectParam CkEffectParam */ /** @{ */ #pragma once #include "ck/platform.h" /** Parameters for the Biquad Filter effect */ enum { /** Type of filter; should be one of the kCkBiquadFilterParam_FilterType values. */ kCkBiquadFilterParam_FilterType, /** Center frequency of the filter. */ kCkBiquadFilterParam_Freq, /** Q of the filter. */ kCkBiquadFilterParam_Q, /** Gain in dB (for Peak, LowShelf, and HighShelf filter types) */ kCkBiquadFilterParam_Gain, }; /** Filter types, used for the kCkBiquadFilterParam_FilterType param. */ enum { /** Low pass filter blocks high frequencies. */ kCkBiquadFilterParam_FilterType_LowPass, /** High pass filter blocks low frequencies. */ kCkBiquadFilterParam_FilterType_HighPass, /** Band pass filter blocks frequencies above and below the center frequency. */ kCkBiquadFilterParam_FilterType_BandPass, /** Notch filter blocks a narrow band of frequencies. */ kCkBiquadFilterParam_FilterType_Notch, /** Peak filter boosts a narrow band of frequencies. */ kCkBiquadFilterParam_FilterType_Peak, /** Low shelf filter boosts low frequencies. */ kCkBiquadFilterParam_FilterType_LowShelf, /** High shelf filter boosts high frequencies. */ kCkBiquadFilterParam_FilterType_HighShelf }; //////////////////////////////////////// /** Parameters for the Bit Crusher effect */ enum { /** Number of bits of resolution to keep in the input samples, in [1..24]. */ kCkBitCrusherParam_BitResolution, /** Milliseconds to hold each sample value. Higher values result in more reduction in the effective sample rate. Values around 1 ms provide a reasonable effect. */ kCkBitCrusherParam_HoldMs, }; //////////////////////////////////////// /** Parameters for the Ring Mod effect */ enum { /** Frequency (Hz) of the modulating signal. Values around 500 Hz are typical. */ kCkRingModParam_Freq, }; //////////////////////////////////////// /** Parameters for the Distortion effect */ enum { /** Scale factor for input; larger values cause a more pronounced effect. */ kCkDistortionParam_Drive, /** Offset for input. */ kCkDistortionParam_Offset, }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/effectprocessor.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectProcessor CkEffectProcessor */ /** @{ */ #pragma once #include "ck/platform.h" /** Performs audio processing for effects. To implement your own custom audio effects, create a subclass, then register a factory function that creates an instance of it with CkEffect::registerCustomEffect(). */ class CkEffectProcessor { public: virtual ~CkEffectProcessor() {} /** Set an effect parameter. Note that this should not be called directly; it is called by CkEffect::setParam(). */ virtual void setParam(int paramId, float value) = 0; /** Reset this effect's state. */ virtual void reset() = 0; /** If true, the effect is processed in-place; the input and output will be the same buffer. If false, input and output will be separate buffers. */ virtual bool isInPlace() const = 0; /** Process audio. The buffer contains interleaved stereo data; each sample is a signed 8.24 fixed-point value. If isInPlace() returns true, inBuf and outBuf will be pointers to the same buffer. It is OK to modify the data in inBuf, even if the effect is not in-place. (Remember that because the data is stereo, the number of samples is 2*frames.) @par This will only be called on older Android armv5 or armv6 devices, or if CkConfig.sampleType is set to kCkSampleType_Fixed. If you are not supporting those devices, you may leave this with its default implementation, which passes the audio through unchanged. */ virtual void process(int* inBuf, int* outBuf, int frames); /** Process audio. The buffer contains interleaved stereo data; each sample is a 32-bit floating-point value. If isInPlace() returns true, inBuf and outBuf will be pointers to the same buffer. It is OK to modify the data in inBuf, even if the effect is not in-place. (Remember that because the data is stereo, the number of samples is 2*frames.) */ virtual void process(float* inBuf, float* outBuf, int frames) = 0; /** Get the sample rate of the audio data. This value may be different on different devices, but will not change during app execution. */ static int getSampleRate(); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/effecttype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectType CkEffectType */ /** @{ */ #pragma once #include "ck/platform.h" /** Types of built-in effects available */ typedef enum { /** Biquadratic filter. See kCkBiquadFilterParam values for parameter IDs. */ kCkEffectType_BiquadFilter, /** Bit Crusher effect reduces bit resolution and/or bit rate, producing a retro low-fi 8-bit sound. See kCkBitCrusherParam values for parameter IDs. */ kCkEffectType_BitCrusher, /** Ring Mod effect modulates the audio by a sine wave. See kCkRingModParam values for parameter IDs. */ kCkEffectType_RingMod, /** Distortion effect. See kCkDistortionParam values for parameter IDs. */ kCkEffectType_Distortion, } CkEffectType; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/mixer.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkMixer CkMixer */ /** @{ */ #pragma once #include "ck/platform.h" #include /** A mixer represents a hierarchical grouping of sounds for controlling volumes. */ class CkMixer { public: /** Set the name of the mixer. The name should be 31 characters or less. */ virtual void setName(const char*) = 0; /** Get the name of the mixer. */ virtual const char* getName() const = 0; /** Set the volume of this mixer. (The actual volume used during mixing will also depend on ancestors.) */ virtual void setVolume(float) = 0; /** Get the volume of this mixer. (The actual volume used during mixing will also depend on ancestors.) */ virtual float getVolume() const = 0; /** Get the volume used for mixing (affected by ancestors). */ virtual float getMixedVolume() const = 0; /** Set whether this mixer is paused. A sound will be paused if the sound, its mixer, or any of its mixer's ancestors are paused. */ virtual void setPaused(bool) = 0; /** Get whether this mixer is paused. A sound will be paused if the sound, its mixer, or any of its mixer's ancestors are paused. */ virtual bool isPaused() const = 0; /** Returns true if this mixer, or any of its ancestors, is paused. */ virtual bool getMixedPauseState() const = 0; /** Set the parent of the mixer. Setting to NULL sets the master mixer as the parent. */ virtual void setParent(CkMixer*) = 0; /** Get the parent of the mixer. */ virtual CkMixer* getParent() = 0; /** Returns the master mixer, which is the root of the mixer hierarchy. */ static CkMixer* getMaster(); /** Creates a new mixer. */ static CkMixer* newMixer(const char* name, CkMixer* parent = NULL); /** Finds a mixer by name; returns NULL if not found. */ static CkMixer* find(const char* name); /** Destroys the mixer. */ virtual void destroy() = 0; protected: CkMixer() {} virtual ~CkMixer() {} private: CkMixer(const CkMixer&); CkMixer& operator=(const CkMixer&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/pathtype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkPathType CkPathType */ /** @{ */ #pragma once #include "ck/platform.h" /** Indicates how a file path should be interpreted. */ typedef enum { /** A full path to a file on the file system. */ kCkPathType_FileSystem = 0, #if CK_PLATFORM_ANDROID /** A path to an asset in the .apk. Assets are read-only. @par Only available on Android. */ kCkPathType_Asset, /** A path relative to the private files directory. @par Only available on Android. */ kCkPathType_PrivateFiles, /** A path relative to the external storage directory. @par Only available on Android. */ kCkPathType_ExternalStorage, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS /** A path relative to the application's resource directory. On iOS, the resource directory is the application bundle, and is read-only. On OS X, the resource directory is the directory containing the executable. @par Only available on iOS and OS X. */ kCkPathType_Resource, #endif #if CK_PLATFORM_WP8 /** A path relative to the local app data store. @par Only available on Windows Phone 8. */ kCkPathType_LocalDir, /** A path relative to the folder containing your app's package files. Files in your Visual Studio project with the "Content" property set to true will be installed here. This folder is read-only. @par Only available on Windows Phone 8. */ kCkPathType_InstallationDir, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS || CK_PLATFORM_WIN || CK_PLATFORM_LINUX /** A path relative to the directory used for temporary files. @par Only available on iOS, OS X, Windows, and Linux. */ kCkPathType_Temp, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_WIN || CK_PLATFORM_LINUX /** A path relative to the application's documents directory. On iOS, this is the app's Documents directory. On OS X and Windows, this is the user's Documents directory. On Linux, this is the user's home directory. @par Only available on iOS, OS X, Windows, and Linux. */ kCkPathType_Documents, #endif #if CK_PLATFORM_WIN || CK_PLATFORM_LINUX || CK_PLATFORM_OSX /** A path relative to the executable's directory. (On OS X, this is the same as kCkPathType_Resource.) @par Only available on Windows, Linux, and OS X. */ kCkPathType_ExeDir, #endif /** The default path type for reading files. */ #if CK_PLATFORM_ANDROID kCkPathType_ReadDefault = kCkPathType_Asset, #elif CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS kCkPathType_ReadDefault = kCkPathType_Resource, #elif CK_PLATFORM_WIN || CK_PLATFORM_LINUX kCkPathType_ReadDefault = kCkPathType_ExeDir, #elif CK_PLATFORM_WP8 kCkPathType_ReadDefault = kCkPathType_InstallationDir, #endif /** The default path type for writing files. */ #if CK_PLATFORM_ANDROID kCkPathType_WriteDefault = kCkPathType_PrivateFiles, #elif CK_PLATFORM_IOS || CK_PLATFORM_OSX kCkPathType_WriteDefault = kCkPathType_Documents, #elif CK_PLATFORM_TVOS kCkPathType_WriteDefault = kCkPathType_Temp, #elif CK_PLATFORM_WIN || CK_PLATFORM_LINUX kCkPathType_WriteDefault = kCkPathType_ExeDir, #elif CK_PLATFORM_WP8 kCkPathType_WriteDefault = kCkPathType_LocalDir, #endif /** The default path type. */ kCkPathType_Default = kCkPathType_ReadDefault } CkPathType; /** @} */ ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/platform.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ #pragma once // software platform #undef CK_PLATFORM_IOS #undef CK_PLATFORM_TVOS #undef CK_PLATFORM_ANDROID #undef CK_PLATFORM_OSX #undef CK_PLATFORM_WIN #undef CK_PLATFORM_WP8 #undef CK_PLATFORM_LINUX #ifdef __APPLE__ # include # if TARGET_OS_IPHONE # if TARGET_OS_IOS # define CK_PLATFORM_IOS 1 # elif TARGET_OS_TV # define CK_PLATFORM_TVOS 1 # endif # else # define CK_PLATFORM_OSX 1 # endif #elif defined(__ANDROID__) # define CK_PLATFORM_ANDROID 1 #elif defined(__linux__) # define CK_PLATFORM_LINUX 1 #elif defined(_WIN64) || defined(_WIN32) # if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP # define CK_PLATFORM_WP8 1 # else # define CK_PLATFORM_WIN 1 # endif #endif #if CK_PLATFORM_OSX && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060) # error "OS X 10.6 required!" #endif #if !CK_PLATFORM_IOS && !CK_PLATFORM_ANDROID && !CK_PLATFORM_OSX && !CK_PLATFORM_WIN && !CK_PLATFORM_WP8 && !CK_PLATFORM_LINUX && !CK_PLATFORM_TVOS # error "Unsupported platform!" #endif ================================================ FILE: Libraries/CricketAudio/Windows/Headers/ck/sound.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkSound CkSound */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" #include "ck/attenuationmode.h" #include class CkBank; class CkMixer; class CkEffectBus; class CkCustomStream; /** A sound (either memory-resident or streamed). */ class CkSound { public: /** Sets the mixer to which this sound is assigned. Setting NULL will assign it to the master mixer. */ virtual void setMixer(CkMixer*) = 0; /** Gets the mixer to which this sound is assigned. */ virtual CkMixer* getMixer() = 0; /** Returns true if the sound is ready. Bank sounds are ready immediately after creation; stream sounds may not be. */ virtual bool isReady() const = 0; /** Returns true if an error occurred while creating the sound. */ virtual bool isFailed() const = 0; /** Play the sound. */ virtual void play() = 0; /** Stop the sound. */ virtual void stop() = 0; /** Gets whether the sound is playing. */ virtual bool isPlaying() const = 0; /** Sets whether the sound is paused. Note that even if false, the sound will be paused if its mixer or any of its mixer's ancestors are paused.*/ virtual void setPaused(bool) = 0; /** Gets whether the sound is paused. Note that even if false, the sound will be paused if its mixer or any of its mixer's ancestors are paused.*/ virtual bool isPaused() const = 0; /** Returns true if the sound is pauses, its mixer is paused, or any of its mixer's ancestors are paused. */ virtual bool getMixedPauseState() const = 0; /** Set the loop start and end. Default is to loop over all sample frames. EndFrame is defined as one frame after the last frame of the loop. Setting endFrame = -1 is equivalent to setting it to getLength(). @par Android note: This has no effect for streams in formats other than .cks or Ogg Vorbis. */ virtual void setLoop(int startFrame, int endFrame) = 0; /** Get the loop start and end. Default is to loop over all sample frames. EndFrame is defined as one frame after the last frame of the loop. Setting endFrame = -1 is equivalent to setting it to getLength(). @par Android note: This has no effect for streams in formats other than .cks or Ogg Vorbis. */ virtual void getLoop(int& startFrame, int& endFrame) const = 0; /** Sets the number of times the sound should loop. 0 means no looping (play once and then stop). 1 means it will play twice; 2 means it will play 3 times; etc. -1 means it will loop indefinitely until the sound is stopped or releaseLoop() is called. */ virtual void setLoopCount(int) = 0; /** Gets the number of times the sound should loop. 0 means no looping (play once and then stop). 1 means it will play twice; 2 means it will play 3 times; etc. -1 means it will loop indefinitely until the sound is stopped or releaseLoop() is called. */ virtual int getLoopCount() const = 0; /** Gets the number of the current loop. For example, returns 0 if this is the first time playing through this sample; returns 1 if it is on its second loop through the sample; etc. */ virtual int getCurrentLoop() const = 0; /** Makes the current loop the last. This is useful when you don't know in advance how many times you will want to loop; set the loop count to -1, and call releaseLoop() when you want it to stop looping and play to the end. */ virtual void releaseLoop() = 0; /** Returns true if releaseLoop() has been called after the last call to play(). */ virtual bool isLoopReleased() const = 0; /** Set the play position in the sound, in sample frames. This can be called before playing, to start from an offset into the sound; or during playback, to jump to a new location. */ virtual void setPlayPosition(int) = 0; /** Set the play position in the sound, in milliseconds. This can be called before playing, to start from an offset into the sound; or during playback, to jump to a new location. */ virtual void setPlayPositionMs(float) = 0; /** Get the current play position in the sound, in sample frames. */ virtual int getPlayPosition() const = 0; /** Get the current play position in the sound, in milliseconds. */ virtual float getPlayPositionMs() const = 0; /** Sets the volume of this sound. The volume can range from 0 to 1. The default value is 1. Note that the actual volume used for mixing will also depend on the volume of the mixer to which this sound is assigned. */ virtual void setVolume(float) = 0; /** Gets the volume of this sound. The volume can range from 0 to 1. The default value is 1. Note that the actual volume used for mixing will also depend on the volume of the mixer to which this sound is assigned. */ virtual float getVolume() const = 0; /** Gets the volume value used for mixing. This is the product of the volume set with setVolume() and the mixed volume value of the mixer to which the sound is assigned. */ virtual float getMixedVolume() const = 0; /** Sets the pan. The pan can range from -1 (left) to +1 (right). The default is 0 (center). */ virtual void setPan(float) = 0; /** Gets the pan. The pan can range from -1 (left) to +1 (right). The default is 0 (center). */ virtual float getPan() const = 0; /** Sets the pan matrix explicitly. The pan matrix determines how the left and right channels of an input are weighted during mixing. Usually it is set by setPan(), but you can use setPanMatrix() if you need more control. For a mono input, the left channel of the output is the input scaled by ll, and the right channel of the output is the input scaled by rr. The off-diagonal lr and rl terms are ignored. For a stereo input, the left channel of the output is the left channel of the input scaled by ll plus the right channel of the input scaled by lr. The right channel of the output is the left channel of the input scaled by rl plus the right channel of the input scaled by rr. */ virtual void setPanMatrix(float ll, float lr, float rl, float rr) = 0; /** Gets the pan matrix. The pan matrix determines how the left and right channels of an input are weighted during mixing. Usually it is set by setPan(), but you can use setPanMatrix() if you need more control. For a mono input, the left channel of the output is the input scaled by ll, and the right channel of the output is the input scaled by rr. The off-diagonal lr and rl terms are ignored. For a stereo input, the left channel of the output is the left channel of the input scaled by ll plus the right channel of the input scaled by lr. The right channel of the output is the left channel of the input scaled by rl plus the right channel of the input scaled by rr. */ virtual void getPanMatrix(float& ll, float& lr, float& rl, float& rr) const = 0; /** Sets the pitch shift value, in half-steps. This also changes the playback speed of the sound. Positive values mean higher pitch (and faster playback); lower values mean lower pitch (and slower playback). The default value is 0. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setPitchShift(float halfSteps) = 0; /** Gets the pitch shift value, in half-steps. Positive values mean higher pitch (and faster playback); lower values mean lower pitch (and slower playback). The default value is 0. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual float getPitchShift() const = 0; /** Sets the playback speed. Values greater than 1 mean faster playback; values less than 1 mean slower playback. The default value is 1. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setSpeed(float) = 0; /** Gets the playback speed. Values greater than 1 mean faster playback; values less than 1 mean slower playback. The default value is 1. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual float getSpeed() const = 0; /** Sets the sound to be played when this sound finishes playing. The next sound will play immediately, with no gaps. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setNextSound(CkSound*) = 0; /** Gets the sound to be played when this sound finishes playing. The next sound will play immediately, with no gaps. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual CkSound* getNextSound() const = 0; /** Gets the total duration of the sound, in sample frames. Stream sounds will return -1 if they are not ready or if the length is unknown. */ virtual int getLength() const = 0; /** Gets the total duration of the sound, in milliseconds. Stream sounds will return -1 if they are not ready or if the length is unknown. */ virtual float getLengthMs() const = 0; /** Gets the sample rate of the sound, in Hz. Stream sounds will return -1 if they are not ready. */ virtual int getSampleRate() const = 0; /** Gets the number of channels in the sound (1 for mono, 2 for stereo). Stream sounds will return -1 if they are not ready. */ virtual int getChannels() const = 0; /** Sets the effect bus to which this sound's audio is sent to be processed, or NULL for dry output (no effects). @par Android note: Effects cannot be applied to streams in formats other than .cks or Ogg Vorbis. */ virtual void setEffectBus(CkEffectBus*) = 0; /** Gets the effect bus to which this sound's audio is sent to be processed, or NULL for dry output (no effects). @par Android note: Effects cannot be applied to streams in formats other than .cks or Ogg Vorbis. */ virtual CkEffectBus* getEffectBus() = 0; /** Sets whether 3D positioning is enabled. If enabled, pan will be determined by the sound and listener positions, ignoring the value set by setPan(). Volume will be attenuated based on the sound and listener positions and the attenuation settings. */ virtual void set3dEnabled(bool) = 0; /** Gets whether 3D positioning is enabled. If enabled, pan will be determined by the sound and listener positions, ignoring the value set by setPan(). Volume will be attenuated based on the sound and listener positions and the attenuation settings. */ virtual bool is3dEnabled() const = 0; /** Gets whether a 3D sound is virtual. If, due to distance attenuation, a 3D sound's volume becomes near enough to 0 to be inaudible, it becomes "virtual". A virtual sound is effectively paused and is not processed until it would become audible again; this reduces the amount of audio processing required. */ virtual bool isVirtual() const = 0; /** Sets the position of the sound emitter in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. */ virtual void set3dPosition(float x, float y, float z) = 0; /** Gets the position of the sound emitter in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. */ virtual void get3dPosition(float& x, float& y, float& z) const = 0; /** Sets the velocity of the sound emitter in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ virtual void set3dVelocity(float vx, float vy, float vz) = 0; /** Gets the velocity of the sound emitter in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ virtual void get3dVelocity(float& vx, float& vy, float& vz) const = 0; /** Sets the listener position and rotation in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. @param eyeX,eyeY,eyeZ The listener's position @param lookAtX,lookAtY,lookAtZ The listener's look-at point @param upX,upY,upZ The listener's up vector */ static void set3dListenerPosition(float eyeX, float eyeY, float eyeZ, float lookAtX, float lookAtY, float lookAtZ, float upX, float upY, float upZ); /** Gets the listener position and rotation in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. @param eyeX,eyeY,eyeZ The listener's position @param lookAtX,lookAtY,lookAtZ The listener's look-at point @param upX,upY,upZ The listener's up vector */ static void get3dListenerPosition(float& eyeX, float& eyeY, float& eyeZ, float& lookAtX, float& lookAtY, float& lookAtZ, float& upX, float& upY, float& upZ); /** Sets the listener velocity in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ static void set3dListenerVelocity(float vx, float vy, float vz); /** Gets the listener velocity in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ static void get3dListenerVelocity(float& vx, float& vy, float& vz); /** Sets parameters used for 3D volume attenuation. @param mode The attenuation mode (default is kCkAttenuationMode_InvDistanceSquared) @param nearDist The near distance; sounds closer than this distance will not be attenuated (default is 1.0) @param farDist The far distance; sounds further than this will be at the far volume (default is 100.0) @param farVol The far volume; sounds further than farDist will be at this volume (default is 0.0) */ static void set3dAttenuation(CkAttenuationMode mode, float nearDist, float farDist, float farVol); /** Gets parameters used for 3D volume attenuation. @param mode The attenuation mode @param nearDist The near distance; sounds closer than this distance will not be attenuated. @param farDist The far distance; sounds further than this will be at the far volume. @param farVol The far volume; sounds further than farDist will be at this volume. */ static void get3dAttenuation(CkAttenuationMode& mode, float& nearDist, float& farDist, float& farVol); /** Sets the speed of sound. This is used for doppler shift calculations when 3D positioning is enabled. If no doppler shift is desired, this can be set to 0 (which is the default value). You may want to use the predefined constants for the speed of sound (such as k_soundSpeed_MetersPerSecond); use the constant that corresponds to the unit system you are using for your velocity and position values. You can also exaggerate the doppler effect by using a smaller value. */ static void set3dSoundSpeed(float); /** Gets the speed of sound. This is used for doppler shift calculations when 3D positioning is enabled. */ static float get3dSoundSpeed(); /** The speed of sound in dry air at 20 degrees C, in centimeters per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_CentimetersPerSecond; /** The speed of sound in dry air at 20 degrees C, in meters per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_MetersPerSecond; /** The speed of sound in dry air at 20 degrees C, in inches per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_InchesPerSecond; /** The speed of sound in dry air at 20 degrees C, in feet per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_FeetPerSecond; //////////////////////////////////////// // bank sounds /** Creates a sound from a bank by index. This will return NULL if the index is invalid. */ static CkSound* newBankSound(CkBank*, int index); /** Creates a sound from a bank by name. If bank is NULL, all loaded banks are searched for the first matching sound. This will return NULL if no sound with that name can be found. */ static CkSound* newBankSound(CkBank*, const char* name); //////////////////////////////////////// // streams /** Creates a stream from a file path. This will return NULL if the file could not be opened. If a non-NULL value is returned, you should also check isFailed() to find out if any errors occurred during initialization. If the stream file is embedded in a larger file, specify the offset and length of the embedded data in bytes, and provide a string ending with a file extension that indicates the file format of the embedded file (for example, ".mp3" or "music.mp3"). Otherwise, leave the offset, length, and extension as 0. */ static CkSound* newStreamSound(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0, const char* extension = NULL); /** Factory function for creating custom streams. The function should return a CkCustomStream instance, or NULL to create a stream with the default handler. */ typedef CkCustomStream* (*CustomStreamFunc)(const char* path, void* data); /** Set the stream handler. Set it to NULL to use the default handler. */ static void setCustomStreamHandler(CustomStreamFunc, void* data); #if CK_PLATFORM_IOS /** Creates a stream from a URL for an asset in the iTunes library. The URL should be determined using an MPMediaQuery object; see the "iPod Library Access Programming Guide" document in the iOS Developer Library. Note that this will only work for music files without DRM; for files with DRM, the URL will be returned as nil. @par Only available on iOS version 4.3 or later; will return NULL on earlier iOS versions. */ static CkSound* newAssetStreamSound(const char* url); #endif /** Destroys the sound. */ virtual void destroy() = 0; protected: CkSound() {} virtual ~CkSound() {} private: CkSound(const CkSound&); CkSound& operator=(const CkSound&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/attenuationmode.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkAttenuationMode CkAttenuationMode */ /** @{ */ #pragma once #include "ck/platform.h" /** Indicates how volume on 3D sounds is attenuated with distance. */ typedef enum { /** No attenuation; volume is 1.0 when closer than the far distance, and far volume outside of that. */ kCkAttenuationMode_None = 0, /** Linear attenuation of volume between near distance and far distance. */ kCkAttenuationMode_Linear, /** Attenuation proportional to the reciprocal of the distance. */ kCkAttenuationMode_InvDistance, /** Attenuation proportional to the square of the reciprocal of the distance. This is a good choice for realistically simulating point sound sources. */ kCkAttenuationMode_InvDistanceSquared, } CkAttenuationMode; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/bank.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkBank CkBank */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" /** A bank of memory-resident sounds. */ class CkBank { public: /** Returns true when an asynchronously loaded bank has finished loading. */ virtual bool isLoaded() const = 0; /** Returns true if an asynchronously loaded bank had an error during loading. */ virtual bool isFailed() const = 0; /** Returns the name of the bank. */ virtual const char* getName() const = 0; /** Returns the number of sounds in the bank. */ virtual int getNumSounds() const = 0; /** Returns the name of a sound in this bank. The name will be 31 characters or less. */ virtual const char* getSoundName(int index) const = 0; //////////////////////////////////////// /** Loads a bank. This will return NULL if the bank cannot be loaded. If the bank file is embedded in a larger file, specify the offset and length of the embedded data; otherwise, leave them both as 0. */ static CkBank* newBank(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0); /** Loads a bank asynchronously. This will return NULL if the bank cannot be loaded. When loading a bank asynchronously, you should also check isFailed() after loading to make sure no errors occurred. If the bank file is embedded in a larger file, specify the offset and length of the embedded data; otherwise, leave them both as 0. */ static CkBank* newBankAsync(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0); /** Loads a bank from a memory buffer. The buffer should contain entire bank file; you are responsible for freeing the memory after the bank is deleted. This will return NULL if the bank cannot be loaded. */ static CkBank* newBankFromMemory(void*, int bytes); /** Finds a loaded bank by name; returns NULL if not found. */ static CkBank* find(const char* bankName); /** Destroys the bank. */ virtual void destroy() = 0; protected: CkBank() {} virtual ~CkBank() {} private: CkBank(const CkBank&); CkBank& operator=(const CkBank&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/ck.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup Ck Ck */ /** @{ */ #pragma once #include "ck/config.h" #include "ck/pathtype.h" #ifdef __cplusplus extern "C" { #endif /** Initializes Cricket Audio. Returns nonzero if successful. */ int CkInit(CkConfig*); /** Updates Cricket Audio. Should be called once per frame. */ void CkUpdate(); /** Shuts down Cricket Audio. */ void CkShutdown(); /** Suspends Cricket Audio; typically used when an app is made inactive. */ void CkSuspend(); /** Resumes Cricket Audio; typically used when an app is made active after having been inactive. */ void CkResume(); /** Returns a rough estimate of the load on the audio processing thread. This is the fraction of the interval between audio callbacks that was actually spent rendering audio; it will range between 0 and 1. */ float CkGetRenderLoad(); /** Returns the value of the clip flag. The clip flag is set to true whenever the final audio output "clips", i.e. exceeds the maximum value. */ bool CkGetClipFlag(); /** Resets the value of the clip flag to false. The clip flag is set to true whenever the final audio output "clips", i.e. exceeds the maximum value. */ void CkResetClipFlag(); /** Sets the maximum rate at which volumes change on playing sounds, in ms per full volume scale. Default value is 40 ms. */ void CkSetVolumeRampTime(float ms); /** Gets the maximum rate at which volumes change on playing sounds, in ms per full volume scale. */ float CkGetVolumeRampTime(); /** Default value of volume ramp time. */ extern const float Ck_volumeRampTimeMsDefault; /** Lock the audio processing thread to prevent it from processing any API calls. The lock should be held only for a short time. This is useful to ensure that certain calls are processed together. For example, if you want to play multiple sounds together exactly in sync, call CkLockAudio(), call play() on each sound, then call CkUnlockAudio(). */ void CkLockAudio(); /** Unlock the audio processing thread after a call to CkLockAudio(). */ void CkUnlockAudio(); /** Start capturing the final audio output to a file. The filename must end with ".wav" (for a Microsoft WAVE file) or ".raw" (for a headerless file containing 32-bit floating-point interleaved stereo samples). */ void CkStartCapture(const char* path, CkPathType pathType); /** Stop capturing audio output. */ void CkStopCapture(); #ifdef __cplusplus } // extern "C" #endif /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/config.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkConfig CkConfig */ /** @{ */ #pragma once #include "ck/platform.h" #if CK_PLATFORM_ANDROID # include #endif //////////////////////////////////////// /** Memory allocation function */ typedef void* (*CkAllocFunc)(int bytes); /** Memory deallocation function */ typedef void (*CkFreeFunc)(void*); /** Log message types */ typedef enum { /** Flag to enable INFO log messages */ kCkLog_Info = (1 << 0), /** Flag to enable WARNING log messages */ kCkLog_Warning = (1 << 1), /** Flag to enable ERROR log messages */ kCkLog_Error = (1 << 2), /** Flag to disable all log messages */ kCkLog_None = 0, /** Flag to enable all log messages */ kCkLog_All = (kCkLog_Info | kCkLog_Warning | kCkLog_Error) } CkLogType; /** Log message function */ typedef void (*CkLogFunc)(CkLogType, const char* msg); /** Sample types used for internal DSP pipeline */ typedef enum { /** Force floating-point samples */ kCkSampleType_Float, /** Force fixed-point samples */ kCkSampleType_Fixed, /** Use the default, based on the processor type */ kCkSampleType_Default } CkSampleType; //////////////////////////////////////// /** Configuration options */ struct _CkConfig { #ifdef __cplusplus # if CK_PLATFORM_ANDROID /** Constructor to be used from JNI functions. @param env A JNI environment pointer @param context An android.content.Context object from Java (typically an android.app.Activity or android.app.Service) */ _CkConfig(JNIEnv* env, jobject context); /** This constructor should be used when there is no valid JNIEnv* pointer; for example, from android_main() in a native activity using the android_native_app_glue library. See the code in src/samples/hellocricket/android-ndk-native for an example. @param vm A Java VM pointer @param context An android.content.Context object from Java (typically an android.app.Activity or android.app.Service) */ _CkConfig(JavaVM* vm, jobject context); # else _CkConfig(); # endif #endif // __cplusplus #if CK_PLATFORM_ANDROID /** The JNIEnv pointer. @par Only available on Android. */ JNIEnv* jni; /** The JavaVM pointer. @par Only available on Android. */ JavaVM* vm; /** A Java reference to your app's Context object (typically an Activity or Service). @par Only available on Android. */ jobject context; /** If true, always use Java AudioTrack for output of final mix, instead of OpenSL ES. This should usually be set to false, unless you are debugging specific issues related to low-level audio output. Default is false (use Java AudioTrack only when OpenSL ES is not available, i.e. Android versions prior to 2.3). @par Only available on Android. */ bool useJavaAudio; /** If true, software support for Ogg Vorbis stream sounds is enabled. If false, stream sounds will use the native Android decoder, which will not support all of the features available to sounds decoded in software. Default is true (Ogg Vorbis streams are decoded in software). @par Only available on Android. */ bool enableOggVorbis; #endif #if CK_PLATFORM_IOS || CK_PLATFORM_TVOS /** If true, hardware-assisted decoding is enabled for decoding compressed streams when available. See Apple's "Multimedia Programming Guide" for a list of codecs for which hardware support is available. Note that streams that use the hardware decoder take slightly longer (~300ms) to initialize, and our tests have shown a negligible effect on CPU usage, so the default value is false. @par Only available on iOS. */ bool enableHardwareDecoding; #endif /** Memory allocation function. Default is NULL (system new will be used). The allocator must be thread-safe. */ CkAllocFunc allocFunc; /** Memory deallocation function. Default is NULL (system delete will be used). The allocator must be thread-safe. */ CkFreeFunc freeFunc; /** Bitmask for which types of messages are logged. Default is kCkLog_All (all messages logged). */ unsigned int logMask; /** Function to handle log messages. Default is NULL (printf or equivalent will be used). */ CkLogFunc logFunc; /** Audio processing frame duration, in ms. Shorter times result in lower latency, but require more CPU. Default is 5 ms. */ float audioUpdateMs; /** Size of buffer for stream sounds, in ms. Larger buffers require more memory, but are less likely to skip due to slow file reads. Default is 500 ms. */ float streamBufferMs; /** Interval between file reads for stream sounds, in ms. Shorter times will allow for smaller stream buffer sizes, but require more CPU. This value should be set to significantly less than streamBufferMs, or your buffers will always underrun! Default is 100 ms. */ float streamFileUpdateMs; /** Initial size of the audio task buffer. If you see a "Reallocating audio task buffer" warning, consider increasing this from its default value of 500 to avoid additional memory allocations at runtime. */ int maxAudioTasks; /** Maximum render load. When the value of CkGetRenderLoad() exceeds this value, some sounds will not be rendered, to keep the CPU usage down. Default is 0.8. */ float maxRenderLoad; /** Sample type to be used internally for processing. The default is kCkSampleType_Default, which means that fixed-point samples are used on Android armv5 and armv6 devices, which may lack hardware support for floating-point operations, and that floating-point samples are used on all other devices. */ CkSampleType sampleType; }; typedef struct _CkConfig CkConfig; /** Default value of CkConfig.audioUpdateMs */ extern const float CkConfig_audioUpdateMsDefault; /** Default value of CkConfig.streamBufferMs */ extern const float CkConfig_streamBufferMsDefault; /** Default value of CkConfig.streamFileUpdateMs */ extern const float CkConfig_streamFileUpdateMsDefault; /** Default value of CkConfig.maxAudioTasks */ extern const int CkConfig_maxAudioTasksDefault; /** Default value of CkConfig.maxRenderLoad */ extern const float CkConfig_maxRenderLoadDefault; //////////////////////////////////////// #ifdef __OBJC__ /** If you are using Objective-C, call CkConfigInit() to initialize the CkConfig struct to its default values. (If you are using C++, the CkConfig struct is initialized by its constructor.) */ #ifdef __cplusplus extern "C" #endif void CkConfigInit(CkConfig*); #endif /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/customfile.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkCustomFile CkCustomFile */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" /** Custom file base class. If you want to override the low-level details of how files are read (for example, to read files over a network, or to decrypt encrypted files as they are read), create a subclass and register a handler with CkSetCustomFileHandler(). This will work for bank files, and for .cks and Ogg Vorbis streams, but not for other stream types such as MP3, AAC, etc. */ class CkCustomFile { public: virtual ~CkCustomFile() {} /** Returns true if the file was successfully opened. */ virtual bool isValid() const = 0; /** Read from the file. Returns number of bytes actually read. */ virtual int read(void* buf, int bytes) = 0; /** Returns the size of the file. */ virtual int getSize() const = 0; /** Sets the read position in the file. */ virtual void setPos(int pos) = 0; /** Returns the read position in the file. */ virtual int getPos() const = 0; }; /** Factory function for opening files using a CkCustomFile instance. The function should return CkCustomFile instance, or NULL to open the file with the default handler. */ typedef CkCustomFile* (*CkCustomFileFunc)(const char* path, void* data); /** Set the file handler. Set it to NULL to use the default handler. */ void CkSetCustomFileHandler(CkCustomFileFunc, void* data); /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/customstream.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkCustomStream CkCustomStream */ /** @{ */ #pragma once #include "ck/platform.h" /** Base class for custom streams. To create a custom stream sound (for example, for playing back audio in a proprietary file format), create a subclass, then register a factory function with CkSound::setCustomStreamHandler(). */ class CkCustomStream { public: virtual ~CkCustomStream() {} /** Initializes the stream (open data files, read file headers, etc). This is called from the file streaming thread, not the main thread, so synchronous file reading calls will not block audio or application logic. */ virtual void init() = 0; /** Returns whether the stream has failed in a way that renders it unusable; for example, if an audio file could not be found. */ virtual bool isFailed() const = 0; /** Returns the number of channels; should be either 1 or 2. */ virtual int getChannels() const = 0; /** Returns the sample rate of the audio. */ virtual int getSampleRate() const = 0; /** Returns the total duration of the sound, in sample frames. */ virtual int getLength() const = 0; /** Reads audio into the buffer; returns the number of sample frames actually read. The audio data should be 16-bit signed PCM. */ virtual int read(short* buf, int frames) = 0; /** Sets the current play position, in sample frames. */ virtual void setPlayPosition(int frame) = 0; /** Returns the current play position, in sample frames. */ virtual int getPlayPosition() const = 0; }; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/effect.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffect CkEffect */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/effecttype.h" #include class CkEffectProcessor; /** An audio effect. */ class CkEffect { public: /** Set an effect parameter. Parameter IDs are found in ck/effectparam.h. */ virtual void setParam(int paramId, float value) = 0; /** Reset the state of this effect. */ virtual void reset() = 0; /** Set whether this effect is bypassed. A bypassed effect is not applied to the audio. */ virtual void setBypassed(bool) = 0; /** Gets whether this effect is bypassed. A bypassed effect is not applied to the audio. */ virtual bool isBypassed() const = 0; /** Sets the wet/dry ratio for this effect The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the ffect. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual void setWetDryRatio(float) = 0; /** Gets the wet/dry ratio for this effect. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the effect. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual float getWetDryRatio() const = 0; /** Create a built-in effect. Effect types are found in ck/effecttype.h. */ static CkEffect* newEffect(CkEffectType); /** Factory function for creating effect processors for custom effects. */ typedef CkEffectProcessor* (*CustomEffectFunc)(void* arg); /** Register a custom effect. To unregister an effect, pass in NULL for the CustomEffectFunc. */ static void registerCustomEffect(int id, CustomEffectFunc); /** Create a custom effect. A factory function must have been previously registered with the given id, or this will return NULL. */ static CkEffect* newCustomEffect(int id, void* arg = NULL); /** Destroy the effect. */ virtual void destroy() = 0; protected: CkEffect() {} virtual ~CkEffect() {} private: CkEffect(const CkEffect&); CkEffect& operator=(const CkEffect&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/effectbus.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectBus CkEffectBus */ /** @{ */ #pragma once #include "ck/platform.h" class CkEffect; /** Manages a set of audio effects applied to sounds. */ class CkEffectBus { public: /** Add an effect to this bus. An effect can only be on one bus at a time. */ virtual void addEffect(CkEffect*) = 0; /** Remove an effect from this bus. */ virtual void removeEffect(CkEffect*) = 0; /** Remove all effects from this bus. */ virtual void removeAllEffects() = 0; /** Set the bus to which this bus's output is sent. If NULL (the default), the audio from this bus is mixed into the final output. */ virtual void setOutputBus(CkEffectBus*) = 0; /** Get the bus to which this bus's output is sent. If NULL (the default), the audio from this bus is mixed into the final output. */ virtual CkEffectBus* getOutputBus() = 0; /** Reset the state of all the effects on this bus. */ virtual void reset() = 0; /** Set whether this bus is bypassed. A bypassed effect is not applied to the audio. */ virtual void setBypassed(bool) = 0; /** Gets whether this bus is bypassed. Effects in a bypassed bus are not applied to the audio. */ virtual bool isBypassed() const = 0; /** Sets the wet/dry ratio for this bus. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the bus. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual void setWetDryRatio(float) = 0; /** Gets the wet/dry ratio for this bus. The ratio can range from 0 to 1. A value of 0 means the audio is left completely "dry", that is, with no effects applied; it is equivalent to bypassing the bus. A value of 1 means the audio is completely "wet", that is, the original "dry" signal is not mixed back into the processed audio. */ virtual float getWetDryRatio() const = 0; //////////////////////////////////////// /** Create a new effect bus. */ static CkEffectBus* newEffectBus(); /** Get the global effect bus. Effects on this bus are applied to the final audio before it is output. */ static CkEffectBus* getGlobalEffectBus(); /** Destroy this effect bus. */ virtual void destroy() = 0; protected: CkEffectBus() {} virtual ~CkEffectBus() {} private: CkEffectBus(const CkEffectBus&); CkEffectBus& operator=(const CkEffectBus&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/effectparam.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectParam CkEffectParam */ /** @{ */ #pragma once #include "ck/platform.h" /** Parameters for the Biquad Filter effect */ enum { /** Type of filter; should be one of the kCkBiquadFilterParam_FilterType values. */ kCkBiquadFilterParam_FilterType, /** Center frequency of the filter. */ kCkBiquadFilterParam_Freq, /** Q of the filter. */ kCkBiquadFilterParam_Q, /** Gain in dB (for Peak, LowShelf, and HighShelf filter types) */ kCkBiquadFilterParam_Gain, }; /** Filter types, used for the kCkBiquadFilterParam_FilterType param. */ enum { /** Low pass filter blocks high frequencies. */ kCkBiquadFilterParam_FilterType_LowPass, /** High pass filter blocks low frequencies. */ kCkBiquadFilterParam_FilterType_HighPass, /** Band pass filter blocks frequencies above and below the center frequency. */ kCkBiquadFilterParam_FilterType_BandPass, /** Notch filter blocks a narrow band of frequencies. */ kCkBiquadFilterParam_FilterType_Notch, /** Peak filter boosts a narrow band of frequencies. */ kCkBiquadFilterParam_FilterType_Peak, /** Low shelf filter boosts low frequencies. */ kCkBiquadFilterParam_FilterType_LowShelf, /** High shelf filter boosts high frequencies. */ kCkBiquadFilterParam_FilterType_HighShelf }; //////////////////////////////////////// /** Parameters for the Bit Crusher effect */ enum { /** Number of bits of resolution to keep in the input samples, in [1..24]. */ kCkBitCrusherParam_BitResolution, /** Milliseconds to hold each sample value. Higher values result in more reduction in the effective sample rate. Values around 1 ms provide a reasonable effect. */ kCkBitCrusherParam_HoldMs, }; //////////////////////////////////////// /** Parameters for the Ring Mod effect */ enum { /** Frequency (Hz) of the modulating signal. Values around 500 Hz are typical. */ kCkRingModParam_Freq, }; //////////////////////////////////////// /** Parameters for the Distortion effect */ enum { /** Scale factor for input; larger values cause a more pronounced effect. */ kCkDistortionParam_Drive, /** Offset for input. */ kCkDistortionParam_Offset, }; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/effectprocessor.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectProcessor CkEffectProcessor */ /** @{ */ #pragma once #include "ck/platform.h" /** Performs audio processing for effects. To implement your own custom audio effects, create a subclass, then register a factory function that creates an instance of it with CkEffect::registerCustomEffect(). */ class CkEffectProcessor { public: virtual ~CkEffectProcessor() {} /** Set an effect parameter. Note that this should not be called directly; it is called by CkEffect::setParam(). */ virtual void setParam(int paramId, float value) = 0; /** Reset this effect's state. */ virtual void reset() = 0; /** If true, the effect is processed in-place; the input and output will be the same buffer. If false, input and output will be separate buffers. */ virtual bool isInPlace() const = 0; /** Process audio. The buffer contains interleaved stereo data; each sample is a signed 8.24 fixed-point value. If isInPlace() returns true, inBuf and outBuf will be pointers to the same buffer. It is OK to modify the data in inBuf, even if the effect is not in-place. (Remember that because the data is stereo, the number of samples is 2*frames.) @par This will only be called on older Android armv5 or armv6 devices, or if CkConfig.sampleType is set to kCkSampleType_Fixed. If you are not supporting those devices, you may leave this with its default implementation, which passes the audio through unchanged. */ virtual void process(int* inBuf, int* outBuf, int frames); /** Process audio. The buffer contains interleaved stereo data; each sample is a 32-bit floating-point value. If isInPlace() returns true, inBuf and outBuf will be pointers to the same buffer. It is OK to modify the data in inBuf, even if the effect is not in-place. (Remember that because the data is stereo, the number of samples is 2*frames.) */ virtual void process(float* inBuf, float* outBuf, int frames) = 0; /** Get the sample rate of the audio data. This value may be different on different devices, but will not change during app execution. */ static int getSampleRate(); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/effecttype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkEffectType CkEffectType */ /** @{ */ #pragma once #include "ck/platform.h" /** Types of built-in effects available */ typedef enum { /** Biquadratic filter. See kCkBiquadFilterParam values for parameter IDs. */ kCkEffectType_BiquadFilter, /** Bit Crusher effect reduces bit resolution and/or bit rate, producing a retro low-fi 8-bit sound. See kCkBitCrusherParam values for parameter IDs. */ kCkEffectType_BitCrusher, /** Ring Mod effect modulates the audio by a sine wave. See kCkRingModParam values for parameter IDs. */ kCkEffectType_RingMod, /** Distortion effect. See kCkDistortionParam values for parameter IDs. */ kCkEffectType_Distortion, } CkEffectType; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/mixer.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkMixer CkMixer */ /** @{ */ #pragma once #include "ck/platform.h" #include /** A mixer represents a hierarchical grouping of sounds for controlling volumes. */ class CkMixer { public: /** Set the name of the mixer. The name should be 31 characters or less. */ virtual void setName(const char*) = 0; /** Get the name of the mixer. */ virtual const char* getName() const = 0; /** Set the volume of this mixer. (The actual volume used during mixing will also depend on ancestors.) */ virtual void setVolume(float) = 0; /** Get the volume of this mixer. (The actual volume used during mixing will also depend on ancestors.) */ virtual float getVolume() const = 0; /** Get the volume used for mixing (affected by ancestors). */ virtual float getMixedVolume() const = 0; /** Set whether this mixer is paused. A sound will be paused if the sound, its mixer, or any of its mixer's ancestors are paused. */ virtual void setPaused(bool) = 0; /** Get whether this mixer is paused. A sound will be paused if the sound, its mixer, or any of its mixer's ancestors are paused. */ virtual bool isPaused() const = 0; /** Returns true if this mixer, or any of its ancestors, is paused. */ virtual bool getMixedPauseState() const = 0; /** Set the parent of the mixer. Setting to NULL sets the master mixer as the parent. */ virtual void setParent(CkMixer*) = 0; /** Get the parent of the mixer. */ virtual CkMixer* getParent() = 0; /** Returns the master mixer, which is the root of the mixer hierarchy. */ static CkMixer* getMaster(); /** Creates a new mixer. */ static CkMixer* newMixer(const char* name, CkMixer* parent = NULL); /** Finds a mixer by name; returns NULL if not found. */ static CkMixer* find(const char* name); /** Destroys the mixer. */ virtual void destroy() = 0; protected: CkMixer() {} virtual ~CkMixer() {} private: CkMixer(const CkMixer&); CkMixer& operator=(const CkMixer&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/attenuationmode.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import "ck/attenuationmode.h" ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/bank.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import #import "ck/objc/pathtype.h" /** Objective-C interface for CkBank. See ck/bank.h for method documentation. */ @interface CkoBank : NSObject @property(nonatomic, readonly) BOOL loaded; @property(nonatomic, readonly) BOOL failed; @property(nonatomic, readonly, nonnull) NSString* name; @property(nonatomic, readonly) int numSounds; - (nonnull NSString*) soundName:(int)index; + (nullable CkoBank*) newBank:(nonnull NSString*)path; + (nullable CkoBank*) newBank:(nonnull NSString*)path pathType:(CkPathType)pathType; + (nullable CkoBank*) newBank:(nonnull NSString*)path pathType:(CkPathType)pathType offset:(int)offset length:(int)length; + (nullable CkoBank*) newBankAsync:(nonnull NSString*)path; + (nullable CkoBank*) newBankAsync:(nonnull NSString*)path pathType:(CkPathType)pathType; + (nullable CkoBank*) newBankAsync:(nonnull NSString*)path pathType:(CkPathType)pathType offset:(int)offset length:(int)length; + (nullable CkoBank*) newBankFromMemory:(nonnull void*)buf bytes:(int)bytes; + (nullable CkoBank*) find:(nonnull NSString*)name; @end ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/ck.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import "ck/ck.h" ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/config.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import "ck/config.h" ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/effect.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import #import "ck/effecttype.h" /** Objective-C interface for CkEffect. See ck/effect.h for method documentation. */ @interface CkoEffect : NSObject @property(nonatomic, assign) BOOL bypassed; @property(nonatomic, assign) float wetDryRatio; - (void) setParam:(int)paramId value:(float)value; - (void) reset; + (nullable CkoEffect*) newEffect:(CkEffectType)type; + (nullable CkoEffect*) newCustomEffect:(int)id; @end ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/effectbus.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import @class CkoEffect; /** Objective-C interface for CkEffectBus. See ck/effectbus.h for method documentation. */ @interface CkoEffectBus : NSObject @property(nonatomic, assign) BOOL bypassed; @property(nonatomic, assign) float wetDryRatio; @property(nonatomic, assign, nullable) CkoEffectBus* outputBus; - (void) addEffect:(nonnull CkoEffect*)effect; - (void) removeEffect:(nonnull CkoEffect*)effect; - (void) removeAllEffects; - (void) reset; + (nullable CkoEffectBus*) newEffectBus; + (nonnull CkoEffectBus*) globalEffectBus; @end ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/effectparam.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import "ck/effectparam.h" ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/effecttype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import "ck/effecttype.h" ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/mixer.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import /** Objective-C interface for CkMixer. See ck/mixer.h for method documentation. */ @interface CkoMixer : NSObject @property(nonatomic, copy, nonnull) NSString* name; @property(nonatomic, assign) float volume; @property(nonatomic, readonly) float mixedVolume; @property(nonatomic, assign) BOOL paused; @property(nonatomic, readonly) BOOL mixedPauseState; @property(nonatomic, assign, nullable) CkoMixer* parent; + (nonnull CkoMixer*) master; + (nullable CkoMixer*) find:(nonnull NSString*)name; + (nullable CkoMixer*) newMixer:(nonnull NSString*)name; + (nullable CkoMixer*) newMixer:(nonnull NSString*)name parent:(nullable CkoMixer*)parent; @end ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/pathtype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import "ck/pathtype.h" ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/platform.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import "ck/platform.h" ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/objc/sound.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com #import "ck/objc/pathtype.h" #import "ck/objc/attenuationmode.h" @class CkoBank; @class CkoMixer; @class CkoEffectBus; /** Objective-C interface for CkSound. See ck/sound.h for method documentation. */ @interface CkoSound : NSObject @property(nonatomic, assign, null_resettable) CkoMixer* mixer; @property(nonatomic, readonly) BOOL ready; @property(nonatomic, readonly) BOOL failed; @property(nonatomic, readonly) BOOL playing; @property(nonatomic, assign) BOOL paused; @property(nonatomic, assign) int loopCount; @property(nonatomic, readonly) int loopStart; @property(nonatomic, readonly) int loopEnd; @property(nonatomic, readonly) int currentLoop; @property(nonatomic, readonly) BOOL loopReleased; @property(nonatomic, assign) float volume; @property(nonatomic, assign) int playPosition; @property(nonatomic, assign) float playPositionMs; @property(nonatomic, readonly) float mixedVolume; @property(nonatomic, assign) float pan; @property(nonatomic, assign) float pitchShift; @property(nonatomic, assign) float speed; @property(nonatomic, assign, nullable) CkoSound* nextSound; @property(nonatomic, readonly) int length; @property(nonatomic, readonly) float lengthMs; @property(nonatomic, readonly) int sampleRate; @property(nonatomic, readonly) int channels; @property(nonatomic, assign, nullable) CkoEffectBus* effectBus; @property(nonatomic, assign) BOOL threeDEnabled; @property(nonatomic, readonly) BOOL isVirtual; - (void) play; - (void) stop; - (void) setLoop:(int)startFrame endFrame:(int)endFrame; - (void) releaseLoop; - (void) setPanMatrixLL:(float)ll LR:(float)lr RL:(float)rl RR:(float)rr; - (void) getPanMatrixLL:(nonnull float*)ll LR:(nonnull float*)lr RL:(nonnull float*)rl RR:(nonnull float*)rr; - (void) set3dPositionX:(float)x y:(float)y z:(float)z; - (void) get3dPositionX:(nonnull float*)x y:(nonnull float*)y z:(nonnull float*)z; - (void) set3dVelocityX:(float)x y:(float)y z:(float)z; - (void) get3dVelocityX:(nonnull float*)x y:(nonnull float*)y z:(nonnull float*)z; + (void) set3dListenerPositionEyeX:(float)eyeX eyeY:(float)eyeY eyeZ:(float)eyeZ lookAtX:(float)lookAtX lookAtY:(float)lookAtY lookAtZ:(float)lookAtZ upX:(float)upX upY:(float)upY upZ:(float)upZ; + (void) get3dListenerPositionEyeX:(nonnull float*)eyeX eyeY:(nonnull float*)eyeY eyeZ:(nonnull float*)eyeZ lookAtX:(nonnull float*)lookAtX lookAtY:(nonnull float*)lookAtY lookAtZ:(nonnull float*)lookAtZ upX:(nonnull float*)upX upY:(nonnull float*)upY upZ:(nonnull float*)upZ; + (void) set3dListenerVelocityX:(float)x y:(float)y z:(float)z; + (void) get3dListenerVelocityX:(nonnull float*)x y:(nonnull float*)y z:(nonnull float*)z; + (void) set3dAttenuationMode:(CkAttenuationMode)mode nearDist:(float)nearDist farDist:(float)farDist farVol:(float)farVol; + (void) get3dAttenuationMode:(nonnull CkAttenuationMode*)mode nearDist:(nonnull float*)nearDist farDist:(nonnull float*)farDist farVol:(nonnull float*)farVol; + (void) set3dSoundSpeed:(float)speed; + (float) get3dSoundSpeed; + (float) getSoundSpeedCentimetersPerSecond; + (float) getSoundSpeedMetersPerSecond; + (float) getSoundSpeedInchesPerSecond; + (float) getSoundSpeedFeetPerSecond; + (nullable CkoSound*) newBankSound:(nullable CkoBank*)bank index:(int)index; + (nullable CkoSound*) newBankSound:(nullable CkoBank*)bank name:(nonnull NSString*)name; + (nullable CkoSound*) newStreamSound:(nonnull NSString*)path; + (nullable CkoSound*) newStreamSound:(nonnull NSString*)path pathType:(CkPathType)pathType; + (nullable CkoSound*) newStreamSound:(nonnull NSString*)path pathType:(CkPathType)pathType offset:(int)offset length:(int)length extension:(nonnull NSString*)extension; #if CK_PLATFORM_IOS + (nullable CkoSound*) newAssetStreamSound:(nonnull NSURL*)url; #endif @end ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/pathtype.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkPathType CkPathType */ /** @{ */ #pragma once #include "ck/platform.h" /** Indicates how a file path should be interpreted. */ typedef enum { /** A full path to a file on the file system. */ kCkPathType_FileSystem = 0, #if CK_PLATFORM_ANDROID /** A path to an asset in the .apk. Assets are read-only. @par Only available on Android. */ kCkPathType_Asset, /** A path relative to the private files directory. @par Only available on Android. */ kCkPathType_PrivateFiles, /** A path relative to the external storage directory. @par Only available on Android. */ kCkPathType_ExternalStorage, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS /** A path relative to the application's resource directory. On iOS, the resource directory is the application bundle, and is read-only. On OS X, the resource directory is the directory containing the executable. @par Only available on iOS and OS X. */ kCkPathType_Resource, #endif #if CK_PLATFORM_WP8 /** A path relative to the local app data store. @par Only available on Windows Phone 8. */ kCkPathType_LocalDir, /** A path relative to the folder containing your app's package files. Files in your Visual Studio project with the "Content" property set to true will be installed here. This folder is read-only. @par Only available on Windows Phone 8. */ kCkPathType_InstallationDir, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS || CK_PLATFORM_WIN || CK_PLATFORM_LINUX /** A path relative to the directory used for temporary files. @par Only available on iOS, OS X, Windows, and Linux. */ kCkPathType_Temp, #endif #if CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_WIN || CK_PLATFORM_LINUX /** A path relative to the application's documents directory. On iOS, this is the app's Documents directory. On OS X and Windows, this is the user's Documents directory. On Linux, this is the user's home directory. @par Only available on iOS, OS X, Windows, and Linux. */ kCkPathType_Documents, #endif #if CK_PLATFORM_WIN || CK_PLATFORM_LINUX || CK_PLATFORM_OSX /** A path relative to the executable's directory. (On OS X, this is the same as kCkPathType_Resource.) @par Only available on Windows, Linux, and OS X. */ kCkPathType_ExeDir, #endif /** The default path type for reading files. */ #if CK_PLATFORM_ANDROID kCkPathType_ReadDefault = kCkPathType_Asset, #elif CK_PLATFORM_IOS || CK_PLATFORM_OSX || CK_PLATFORM_TVOS kCkPathType_ReadDefault = kCkPathType_Resource, #elif CK_PLATFORM_WIN || CK_PLATFORM_LINUX kCkPathType_ReadDefault = kCkPathType_ExeDir, #elif CK_PLATFORM_WP8 kCkPathType_ReadDefault = kCkPathType_InstallationDir, #endif /** The default path type for writing files. */ #if CK_PLATFORM_ANDROID kCkPathType_WriteDefault = kCkPathType_PrivateFiles, #elif CK_PLATFORM_IOS || CK_PLATFORM_OSX kCkPathType_WriteDefault = kCkPathType_Documents, #elif CK_PLATFORM_TVOS kCkPathType_WriteDefault = kCkPathType_Temp, #elif CK_PLATFORM_WIN || CK_PLATFORM_LINUX kCkPathType_WriteDefault = kCkPathType_ExeDir, #elif CK_PLATFORM_WP8 kCkPathType_WriteDefault = kCkPathType_LocalDir, #endif /** The default path type. */ kCkPathType_Default = kCkPathType_ReadDefault } CkPathType; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/platform.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ #pragma once // software platform #undef CK_PLATFORM_IOS #undef CK_PLATFORM_TVOS #undef CK_PLATFORM_ANDROID #undef CK_PLATFORM_OSX #undef CK_PLATFORM_WIN #undef CK_PLATFORM_WP8 #undef CK_PLATFORM_LINUX #ifdef __APPLE__ # include # if TARGET_OS_IPHONE # if TARGET_OS_IOS # define CK_PLATFORM_IOS 1 # elif TARGET_OS_TV # define CK_PLATFORM_TVOS 1 # endif # else # define CK_PLATFORM_OSX 1 # endif #elif defined(__ANDROID__) # define CK_PLATFORM_ANDROID 1 #elif defined(__linux__) # define CK_PLATFORM_LINUX 1 #elif defined(_WIN64) || defined(_WIN32) # if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP # define CK_PLATFORM_WP8 1 # else # define CK_PLATFORM_WIN 1 # endif #endif #if CK_PLATFORM_OSX && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060) # error "OS X 10.6 required!" #endif #if !CK_PLATFORM_IOS && !CK_PLATFORM_ANDROID && !CK_PLATFORM_OSX && !CK_PLATFORM_WIN && !CK_PLATFORM_WP8 && !CK_PLATFORM_LINUX && !CK_PLATFORM_TVOS # error "Unsupported platform!" #endif ================================================ FILE: Libraries/CricketAudio/iOS/Headers/ck/sound.h ================================================ // Copyright 2016 Cricket Technology // www.crickettechnology.com /** @file */ /** @defgroup CkSound CkSound */ /** @{ */ #pragma once #include "ck/platform.h" #include "ck/pathtype.h" #include "ck/attenuationmode.h" #include class CkBank; class CkMixer; class CkEffectBus; class CkCustomStream; /** A sound (either memory-resident or streamed). */ class CkSound { public: /** Sets the mixer to which this sound is assigned. Setting NULL will assign it to the master mixer. */ virtual void setMixer(CkMixer*) = 0; /** Gets the mixer to which this sound is assigned. */ virtual CkMixer* getMixer() = 0; /** Returns true if the sound is ready. Bank sounds are ready immediately after creation; stream sounds may not be. */ virtual bool isReady() const = 0; /** Returns true if an error occurred while creating the sound. */ virtual bool isFailed() const = 0; /** Play the sound. */ virtual void play() = 0; /** Stop the sound. */ virtual void stop() = 0; /** Gets whether the sound is playing. */ virtual bool isPlaying() const = 0; /** Sets whether the sound is paused. Note that even if false, the sound will be paused if its mixer or any of its mixer's ancestors are paused.*/ virtual void setPaused(bool) = 0; /** Gets whether the sound is paused. Note that even if false, the sound will be paused if its mixer or any of its mixer's ancestors are paused.*/ virtual bool isPaused() const = 0; /** Returns true if the sound is pauses, its mixer is paused, or any of its mixer's ancestors are paused. */ virtual bool getMixedPauseState() const = 0; /** Set the loop start and end. Default is to loop over all sample frames. EndFrame is defined as one frame after the last frame of the loop. Setting endFrame = -1 is equivalent to setting it to getLength(). @par Android note: This has no effect for streams in formats other than .cks or Ogg Vorbis. */ virtual void setLoop(int startFrame, int endFrame) = 0; /** Get the loop start and end. Default is to loop over all sample frames. EndFrame is defined as one frame after the last frame of the loop. Setting endFrame = -1 is equivalent to setting it to getLength(). @par Android note: This has no effect for streams in formats other than .cks or Ogg Vorbis. */ virtual void getLoop(int& startFrame, int& endFrame) const = 0; /** Sets the number of times the sound should loop. 0 means no looping (play once and then stop). 1 means it will play twice; 2 means it will play 3 times; etc. -1 means it will loop indefinitely until the sound is stopped or releaseLoop() is called. */ virtual void setLoopCount(int) = 0; /** Gets the number of times the sound should loop. 0 means no looping (play once and then stop). 1 means it will play twice; 2 means it will play 3 times; etc. -1 means it will loop indefinitely until the sound is stopped or releaseLoop() is called. */ virtual int getLoopCount() const = 0; /** Gets the number of the current loop. For example, returns 0 if this is the first time playing through this sample; returns 1 if it is on its second loop through the sample; etc. */ virtual int getCurrentLoop() const = 0; /** Makes the current loop the last. This is useful when you don't know in advance how many times you will want to loop; set the loop count to -1, and call releaseLoop() when you want it to stop looping and play to the end. */ virtual void releaseLoop() = 0; /** Returns true if releaseLoop() has been called after the last call to play(). */ virtual bool isLoopReleased() const = 0; /** Set the play position in the sound, in sample frames. This can be called before playing, to start from an offset into the sound; or during playback, to jump to a new location. */ virtual void setPlayPosition(int) = 0; /** Set the play position in the sound, in milliseconds. This can be called before playing, to start from an offset into the sound; or during playback, to jump to a new location. */ virtual void setPlayPositionMs(float) = 0; /** Get the current play position in the sound, in sample frames. */ virtual int getPlayPosition() const = 0; /** Get the current play position in the sound, in milliseconds. */ virtual float getPlayPositionMs() const = 0; /** Sets the volume of this sound. The volume can range from 0 to 1. The default value is 1. Note that the actual volume used for mixing will also depend on the volume of the mixer to which this sound is assigned. */ virtual void setVolume(float) = 0; /** Gets the volume of this sound. The volume can range from 0 to 1. The default value is 1. Note that the actual volume used for mixing will also depend on the volume of the mixer to which this sound is assigned. */ virtual float getVolume() const = 0; /** Gets the volume value used for mixing. This is the product of the volume set with setVolume() and the mixed volume value of the mixer to which the sound is assigned. */ virtual float getMixedVolume() const = 0; /** Sets the pan. The pan can range from -1 (left) to +1 (right). The default is 0 (center). */ virtual void setPan(float) = 0; /** Gets the pan. The pan can range from -1 (left) to +1 (right). The default is 0 (center). */ virtual float getPan() const = 0; /** Sets the pan matrix explicitly. The pan matrix determines how the left and right channels of an input are weighted during mixing. Usually it is set by setPan(), but you can use setPanMatrix() if you need more control. For a mono input, the left channel of the output is the input scaled by ll, and the right channel of the output is the input scaled by rr. The off-diagonal lr and rl terms are ignored. For a stereo input, the left channel of the output is the left channel of the input scaled by ll plus the right channel of the input scaled by lr. The right channel of the output is the left channel of the input scaled by rl plus the right channel of the input scaled by rr. */ virtual void setPanMatrix(float ll, float lr, float rl, float rr) = 0; /** Gets the pan matrix. The pan matrix determines how the left and right channels of an input are weighted during mixing. Usually it is set by setPan(), but you can use setPanMatrix() if you need more control. For a mono input, the left channel of the output is the input scaled by ll, and the right channel of the output is the input scaled by rr. The off-diagonal lr and rl terms are ignored. For a stereo input, the left channel of the output is the left channel of the input scaled by ll plus the right channel of the input scaled by lr. The right channel of the output is the left channel of the input scaled by rl plus the right channel of the input scaled by rr. */ virtual void getPanMatrix(float& ll, float& lr, float& rl, float& rr) const = 0; /** Sets the pitch shift value, in half-steps. This also changes the playback speed of the sound. Positive values mean higher pitch (and faster playback); lower values mean lower pitch (and slower playback). The default value is 0. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setPitchShift(float halfSteps) = 0; /** Gets the pitch shift value, in half-steps. Positive values mean higher pitch (and faster playback); lower values mean lower pitch (and slower playback). The default value is 0. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual float getPitchShift() const = 0; /** Sets the playback speed. Values greater than 1 mean faster playback; values less than 1 mean slower playback. The default value is 1. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setSpeed(float) = 0; /** Gets the playback speed. Values greater than 1 mean faster playback; values less than 1 mean slower playback. The default value is 1. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual float getSpeed() const = 0; /** Sets the sound to be played when this sound finishes playing. The next sound will play immediately, with no gaps. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual void setNextSound(CkSound*) = 0; /** Gets the sound to be played when this sound finishes playing. The next sound will play immediately, with no gaps. @par Android note: This does not work for streams in formats other than .cks or Ogg Vorbis. */ virtual CkSound* getNextSound() const = 0; /** Gets the total duration of the sound, in sample frames. Stream sounds will return -1 if they are not ready or if the length is unknown. */ virtual int getLength() const = 0; /** Gets the total duration of the sound, in milliseconds. Stream sounds will return -1 if they are not ready or if the length is unknown. */ virtual float getLengthMs() const = 0; /** Gets the sample rate of the sound, in Hz. Stream sounds will return -1 if they are not ready. */ virtual int getSampleRate() const = 0; /** Gets the number of channels in the sound (1 for mono, 2 for stereo). Stream sounds will return -1 if they are not ready. */ virtual int getChannels() const = 0; /** Sets the effect bus to which this sound's audio is sent to be processed, or NULL for dry output (no effects). @par Android note: Effects cannot be applied to streams in formats other than .cks or Ogg Vorbis. */ virtual void setEffectBus(CkEffectBus*) = 0; /** Gets the effect bus to which this sound's audio is sent to be processed, or NULL for dry output (no effects). @par Android note: Effects cannot be applied to streams in formats other than .cks or Ogg Vorbis. */ virtual CkEffectBus* getEffectBus() = 0; /** Sets whether 3D positioning is enabled. If enabled, pan will be determined by the sound and listener positions, ignoring the value set by setPan(). Volume will be attenuated based on the sound and listener positions and the attenuation settings. */ virtual void set3dEnabled(bool) = 0; /** Gets whether 3D positioning is enabled. If enabled, pan will be determined by the sound and listener positions, ignoring the value set by setPan(). Volume will be attenuated based on the sound and listener positions and the attenuation settings. */ virtual bool is3dEnabled() const = 0; /** Gets whether a 3D sound is virtual. If, due to distance attenuation, a 3D sound's volume becomes near enough to 0 to be inaudible, it becomes "virtual". A virtual sound is effectively paused and is not processed until it would become audible again; this reduces the amount of audio processing required. */ virtual bool isVirtual() const = 0; /** Sets the position of the sound emitter in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. */ virtual void set3dPosition(float x, float y, float z) = 0; /** Gets the position of the sound emitter in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. */ virtual void get3dPosition(float& x, float& y, float& z) const = 0; /** Sets the velocity of the sound emitter in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ virtual void set3dVelocity(float vx, float vy, float vz) = 0; /** Gets the velocity of the sound emitter in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ virtual void get3dVelocity(float& vx, float& vy, float& vz) const = 0; /** Sets the listener position and rotation in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. @param eyeX,eyeY,eyeZ The listener's position @param lookAtX,lookAtY,lookAtZ The listener's look-at point @param upX,upY,upZ The listener's up vector */ static void set3dListenerPosition(float eyeX, float eyeY, float eyeZ, float lookAtX, float lookAtY, float lookAtZ, float upX, float upY, float upZ); /** Gets the listener position and rotation in 3D space. This is used for pan and volume calculations when 3D positioning is enabled. @param eyeX,eyeY,eyeZ The listener's position @param lookAtX,lookAtY,lookAtZ The listener's look-at point @param upX,upY,upZ The listener's up vector */ static void get3dListenerPosition(float& eyeX, float& eyeY, float& eyeZ, float& lookAtX, float& lookAtY, float& lookAtZ, float& upX, float& upY, float& upZ); /** Sets the listener velocity in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ static void set3dListenerVelocity(float vx, float vy, float vz); /** Gets the listener velocity in 3D space. This is used for doppler shift calculations when 3D positioning is enabled. The units should be the same as those used for set3dSoundSpeed(). */ static void get3dListenerVelocity(float& vx, float& vy, float& vz); /** Sets parameters used for 3D volume attenuation. @param mode The attenuation mode (default is kCkAttenuationMode_InvDistanceSquared) @param nearDist The near distance; sounds closer than this distance will not be attenuated (default is 1.0) @param farDist The far distance; sounds further than this will be at the far volume (default is 100.0) @param farVol The far volume; sounds further than farDist will be at this volume (default is 0.0) */ static void set3dAttenuation(CkAttenuationMode mode, float nearDist, float farDist, float farVol); /** Gets parameters used for 3D volume attenuation. @param mode The attenuation mode @param nearDist The near distance; sounds closer than this distance will not be attenuated. @param farDist The far distance; sounds further than this will be at the far volume. @param farVol The far volume; sounds further than farDist will be at this volume. */ static void get3dAttenuation(CkAttenuationMode& mode, float& nearDist, float& farDist, float& farVol); /** Sets the speed of sound. This is used for doppler shift calculations when 3D positioning is enabled. If no doppler shift is desired, this can be set to 0 (which is the default value). You may want to use the predefined constants for the speed of sound (such as k_soundSpeed_MetersPerSecond); use the constant that corresponds to the unit system you are using for your velocity and position values. You can also exaggerate the doppler effect by using a smaller value. */ static void set3dSoundSpeed(float); /** Gets the speed of sound. This is used for doppler shift calculations when 3D positioning is enabled. */ static float get3dSoundSpeed(); /** The speed of sound in dry air at 20 degrees C, in centimeters per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_CentimetersPerSecond; /** The speed of sound in dry air at 20 degrees C, in meters per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_MetersPerSecond; /** The speed of sound in dry air at 20 degrees C, in inches per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_InchesPerSecond; /** The speed of sound in dry air at 20 degrees C, in feet per second. This value is provided as a convenience for CkSound::set3dSoundSpeed(). */ static const float k_soundSpeed_FeetPerSecond; //////////////////////////////////////// // bank sounds /** Creates a sound from a bank by index. This will return NULL if the index is invalid. */ static CkSound* newBankSound(CkBank*, int index); /** Creates a sound from a bank by name. If bank is NULL, all loaded banks are searched for the first matching sound. This will return NULL if no sound with that name can be found. */ static CkSound* newBankSound(CkBank*, const char* name); //////////////////////////////////////// // streams /** Creates a stream from a file path. This will return NULL if the file could not be opened. If a non-NULL value is returned, you should also check isFailed() to find out if any errors occurred during initialization. If the stream file is embedded in a larger file, specify the offset and length of the embedded data in bytes, and provide a string ending with a file extension that indicates the file format of the embedded file (for example, ".mp3" or "music.mp3"). Otherwise, leave the offset, length, and extension as 0. */ static CkSound* newStreamSound(const char* path, CkPathType = kCkPathType_Default, int offset = 0, int length = 0, const char* extension = NULL); /** Factory function for creating custom streams. The function should return a CkCustomStream instance, or NULL to create a stream with the default handler. */ typedef CkCustomStream* (*CustomStreamFunc)(const char* path, void* data); /** Set the stream handler. Set it to NULL to use the default handler. */ static void setCustomStreamHandler(CustomStreamFunc, void* data); #if CK_PLATFORM_IOS /** Creates a stream from a URL for an asset in the iTunes library. The URL should be determined using an MPMediaQuery object; see the "iPod Library Access Programming Guide" document in the iOS Developer Library. Note that this will only work for music files without DRM; for files with DRM, the URL will be returned as nil. @par Only available on iOS version 4.3 or later; will return NULL on earlier iOS versions. */ static CkSound* newAssetStreamSound(const char* url); #endif /** Destroys the sound. */ virtual void destroy() = 0; protected: CkSound() {} virtual ~CkSound() {} private: CkSound(const CkSound&); CkSound& operator=(const CkSound&); }; /** @} */ ================================================ FILE: Libraries/CricketAudio/iOS/Libs/libck.a ================================================ [File too large to display: 41.8 MB] ================================================ FILE: Projects/Android/chillisource/build.gradle ================================================ // // build.gradle // ChilliSource // Created by Ian Copland on 12/03/2015. // // The MIT License (MIT) // // Copyright (c) 2015 Tag Games Limited // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // apply plugin: 'com.android.library' apply from: '../../../Tools/Scripts/android-build.gradle' android { publishNonDefault true compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { minSdkVersion 9 targetSdkVersion 22 versionCode 1 versionName "1.0" } sourceSets { main { java.srcDir '../../../Source/CSBackend/Platform/Android/Main/Java/' jni.srcDir '../../../Source/' jniLibs.srcDir 'src/main/libs' } googlePlay { java.srcDir '../../../Source/CSBackend/Platform/Android/GooglePlay/Java/' } amazon { java.srcDir '../../../Source/CSBackend/Platform/Android/Amazon/Java/' } } buildTypes { release { } debug { debuggable true } } flavorDimensions "sku", "abi" productFlavors { googlePlay { dimension "sku" } amazon { dimension "sku" } arm { dimension "abi" ndk { abiFilter "armeabi" } } armv7 { dimension "abi" ndk { abiFilter "armeabi-v7a" } } arm64 { dimension "abi" ndk { abiFilter "arm64-v8a" } } x86 { dimension "abi" ndk { abiFilter "x86" } } x64 { dimension "abi" ndk { abiFilter "x86_64" } } } csInitLibrary tasks, "ChilliSource" } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) googlePlayCompile fileTree(dir: 'src/googlePlay/libs', include: ['*.jar']) amazonCompile fileTree(dir: 'src/amazon/libs', include: ['*.jar']) csAddDefaultDependencies dependencies } ================================================ FILE: Projects/Android/chillisource/chillisource.iml ================================================ ================================================ FILE: Projects/Android/chillisource/src/googlePlay/aidl/com/android/vending/billing/IInAppBillingService.aidl ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.vending.billing; import android.os.Bundle; /** * InAppBillingService is the service that provides in-app billing version 3 and beyond. * This service provides the following features: * 1. Provides a new API to get details of in-app items published for the app including * price, type, title and description. * 2. The purchase flow is synchronous and purchase information is available immediately * after it completes. * 3. Purchase information of in-app purchases is maintained within the Google Play system * till the purchase is consumed. * 4. An API to consume a purchase of an inapp item. All purchases of one-time * in-app items are consumable and thereafter can be purchased again. * 5. An API to get current purchases of the user immediately. This will not contain any * consumed purchases. * * All calls will give a response code with the following possible values * RESULT_OK = 0 - success * RESULT_USER_CANCELED = 1 - user pressed back or canceled a dialog * RESULT_BILLING_UNAVAILABLE = 3 - this billing API version is not supported for the type requested * RESULT_ITEM_UNAVAILABLE = 4 - requested SKU is not available for purchase * RESULT_DEVELOPER_ERROR = 5 - invalid arguments provided to the API * RESULT_ERROR = 6 - Fatal error during the API action * RESULT_ITEM_ALREADY_OWNED = 7 - Failure to purchase since item is already owned * RESULT_ITEM_NOT_OWNED = 8 - Failure to consume since item is not owned */ interface IInAppBillingService { /** * Checks support for the requested billing API version, package and in-app type. * Minimum API version supported by this interface is 3. * @param apiVersion the billing version which the app is using * @param packageName the package name of the calling app * @param type type of the in-app item being purchased "inapp" for one-time purchases * and "subs" for subscription. * @return RESULT_OK(0) on success, corresponding result code on failures */ int isBillingSupported(int apiVersion, String packageName, String type); /** * Provides details of a list of SKUs * Given a list of SKUs of a valid type in the skusBundle, this returns a bundle * with a list JSON strings containing the productId, price, title and description. * This API can be called with a maximum of 20 SKUs. * @param apiVersion billing API version that the Third-party is using * @param packageName the package name of the calling app * @param skusBundle bundle containing a StringArrayList of SKUs with key "ITEM_ID_LIST" * @return Bundle containing the following key-value pairs * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on * failure as listed above. * "DETAILS_LIST" with a StringArrayList containing purchase information * in JSON format similar to: * '{ "productId" : "exampleSku", "type" : "inapp", "price" : "$5.00", * "title : "Example Title", "description" : "This is an example description" }' */ Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle); /** * Returns a pending intent to launch the purchase flow for an in-app item by providing a SKU, * the type, a unique purchase token and an optional developer payload. * @param apiVersion billing API version that the app is using * @param packageName package name of the calling app * @param sku the SKU of the in-app item as published in the developer console * @param type the type of the in-app item ("inapp" for one-time purchases * and "subs" for subscription). * @param developerPayload optional argument to be sent back with the purchase information * @return Bundle containing the following key-value pairs * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on * failure as listed above. * "BUY_INTENT" - PendingIntent to start the purchase flow * * The Pending intent should be launched with startIntentSenderForResult. When purchase flow * has completed, the onActivityResult() will give a resultCode of OK or CANCELED. * If the purchase is successful, the result data will contain the following key-value pairs * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on * failure as listed above. * "INAPP_PURCHASE_DATA" - String in JSON format similar to * '{"orderId":"12999763169054705758.1371079406387615", * "packageName":"com.example.app", * "productId":"exampleSku", * "purchaseTime":1345678900000, * "purchaseToken" : "122333444455555", * "developerPayload":"example developer payload" }' * "INAPP_DATA_SIGNATURE" - String containing the signature of the purchase data that * was signed with the private key of the developer * TODO: change this to app-specific keys. */ Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type, String developerPayload); /** * Returns the current SKUs owned by the user of the type and package name specified along with * purchase information and a signature of the data to be validated. * This will return all SKUs that have been purchased in V3 and managed items purchased using * V1 and V2 that have not been consumed. * @param apiVersion billing API version that the app is using * @param packageName package name of the calling app * @param type the type of the in-app items being requested * ("inapp" for one-time purchases and "subs" for subscription). * @param continuationToken to be set as null for the first call, if the number of owned * skus are too many, a continuationToken is returned in the response bundle. * This method can be called again with the continuation token to get the next set of * owned skus. * @return Bundle containing the following key-value pairs * "RESPONSE_CODE" with int value, RESULT_OK(0) if success, other response codes on * failure as listed above. * "INAPP_PURCHASE_ITEM_LIST" - StringArrayList containing the list of SKUs * "INAPP_PURCHASE_DATA_LIST" - StringArrayList containing the purchase information * "INAPP_DATA_SIGNATURE_LIST"- StringArrayList containing the signatures * of the purchase information * "INAPP_CONTINUATION_TOKEN" - String containing a continuation token for the * next set of in-app purchases. Only set if the * user has more owned skus than the current list. */ Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken); /** * Consume the last purchase of the given SKU. This will result in this item being removed * from all subsequent responses to getPurchases() and allow re-purchase of this item. * @param apiVersion billing API version that the app is using * @param packageName package name of the calling app * @param purchaseToken token in the purchase information JSON that identifies the purchase * to be consumed * @return 0 if consumption succeeded. Appropriate error values for failures. */ int consumePurchase(int apiVersion, String packageName, String purchaseToken); } ================================================ FILE: Projects/Android/chillisource/src/main/AndroidManifest.xml ================================================ ================================================ FILE: Projects/Android/chillisource/src/main/jni/Android.mk ================================================ # # Android.mk # ChilliSource # Created by Ian Copland on 12/03/2015 # # The MIT License (MIT) # # Copyright (c) 2015 Tag Games Limited # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # #prepare the ChilliSource libraries CS_PROJECT_ROOT=../../../../../../.. include $(CS_PROJECT_ROOT)/ChilliSource/Tools/Scripts/AndroidBuildConfig.mk #gather all files in the engine that should be built CS_SOURCEFILES_CHILLISOURCE := $(shell 'python' '$(CS_SCRIPT_GETFILESWITHEXTENSIONS)' '--directory' '$(CS_PROJECT_ROOT)/ChilliSource/Source/ChilliSource/' '--extensions' 'cpp,c,cc') CS_SOURCEFILES_PLATFORM := $(shell 'python' '$(CS_SCRIPT_GETFILESWITHEXTENSIONS)' '--directory' '$(CS_PROJECT_ROOT)/ChilliSource/Source/CSBackend/Platform/Android/Main/JNI/' '--extensions' 'cpp,c,cc') CS_SOURCEFILES_RENDERING := $(shell 'python' '$(CS_SCRIPT_GETFILESWITHEXTENSIONS)' '--directory' '$(CS_PROJECT_ROOT)/ChilliSource/Source/CSBackend/Rendering/OpenGL/' '--extensions' 'cpp,c,cc') #add files for appropriate android skus ifeq ($(CS_FLAVOUR_SKU), googleplay) CS_SOURCEFILES_PLATFORM +=$(shell 'python' '$(CS_SCRIPT_GETFILESWITHEXTENSIONS)' '--directory' '$(CS_PROJECT_ROOT)/ChilliSource/Source/CSBackend/Platform/Android/GooglePlay/JNI/' '--extensions' 'cpp,c,cc') else ifeq ($(CS_FLAVOUR_SKU), amazon) CS_SOURCEFILES_PLATFORM +=$(shell 'python' '$(CS_SCRIPT_GETFILESWITHEXTENSIONS)' '--directory' '$(CS_PROJECT_ROOT)/ChilliSource/Source/CSBackend/Platform/Android/Amazon/JNI/' '--extensions' 'cpp,c,cc') endif #build the ChilliSource static library include $(CLEAR_VARS) LOCAL_MODULE := ChilliSource LOCAL_CXXFLAGS := $(CS_CXXFLAGS) LOCAL_SRC_FILES := $(CS_SOURCEFILES_CHILLISOURCE) $(CS_SOURCEFILES_PLATFORM) $(CS_SOURCEFILES_RENDERING) LOCAL_C_INCLUDES := $(CS_C_INCLUDES) LOCAL_SHORT_COMMANDS := true include $(BUILD_STATIC_LIBRARY) ================================================ FILE: Projects/Android/chillisource/src/main/jni/Application.mk ================================================ # # Application.mk # ChilliSource # Created by Ian Copland on 12/03/2015 # # The MIT License (MIT) # # Copyright (c) 2015 Tag Games Limited # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # CS_PROJECT_ROOT=../../../../../../.. include $(CS_PROJECT_ROOT)/ChilliSource/Tools/Scripts/AndroidApplicationConfig.mk NDK_TOOLCHAIN_VERSION := $(CS_NDK_TOOLCHAIN_VERSION) APP_STL := $(CS_APP_STL) LOCAL_CPP_FEATURES += $(CS_LOCAL_CPP_FEATURES) APP_PLATFORM := $(CS_APP_PLATFORM) ================================================ FILE: Projects/Android/chillisource/src/main/res/values/strings.xml ================================================ ChilliSource ================================================ FILE: Projects/Android/playapkexpansion/build.gradle ================================================ apply plugin: 'com.android.library' android { compileSdkVersion 22 buildToolsVersion "22.0.1" defaultConfig { minSdkVersion 4 targetSdkVersion 22 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(":playlicensing") } ================================================ FILE: Projects/Android/playapkexpansion/playapkexpansion.iml ================================================ ================================================ FILE: Projects/Android/playapkexpansion/src/main/AndroidManifest.xml ================================================ ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/Constants.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader; import java.io.File; /** * Contains the internal constants that are used in the download manager. * As a general rule, modifying these constants should be done with care. */ public class Constants { /** Tag used for debugging/logging */ public static final String TAG = "LVLDL"; /** * Expansion path where we store obb files */ public static final String EXP_PATH = File.separator + "Android" + File.separator + "obb" + File.separator; /** The intent that gets sent when the service must wake up for a retry */ public static final String ACTION_RETRY = "android.intent.action.DOWNLOAD_WAKEUP"; /** the intent that gets sent when clicking a successful download */ public static final String ACTION_OPEN = "android.intent.action.DOWNLOAD_OPEN"; /** the intent that gets sent when clicking an incomplete/failed download */ public static final String ACTION_LIST = "android.intent.action.DOWNLOAD_LIST"; /** the intent that gets sent when deleting the notification of a completed download */ public static final String ACTION_HIDE = "android.intent.action.DOWNLOAD_HIDE"; /** * When a number has to be appended to the filename, this string is used to separate the * base filename from the sequence number */ public static final String FILENAME_SEQUENCE_SEPARATOR = "-"; /** The default user agent used for downloads */ public static final String DEFAULT_USER_AGENT = "Android.LVLDM"; /** The buffer size used to stream the data */ public static final int BUFFER_SIZE = 4096; /** The minimum amount of progress that has to be done before the progress bar gets updated */ public static final int MIN_PROGRESS_STEP = 4096; /** The minimum amount of time that has to elapse before the progress bar gets updated, in ms */ public static final long MIN_PROGRESS_TIME = 1000; /** The maximum number of rows in the database (FIFO) */ public static final int MAX_DOWNLOADS = 1000; /** * The number of times that the download manager will retry its network * operations when no progress is happening before it gives up. */ public static final int MAX_RETRIES = 5; /** * The minimum amount of time that the download manager accepts for * a Retry-After response header with a parameter in delta-seconds. */ public static final int MIN_RETRY_AFTER = 30; // 30s /** * The maximum amount of time that the download manager accepts for * a Retry-After response header with a parameter in delta-seconds. */ public static final int MAX_RETRY_AFTER = 24 * 60 * 60; // 24h /** * The maximum number of redirects. */ public static final int MAX_REDIRECTS = 5; // can't be more than 7. /** * The time between a failure and the first retry after an IOException. * Each subsequent retry grows exponentially, doubling each time. * The time is in seconds. */ public static final int RETRY_FIRST_DELAY = 30; /** Enable separate connectivity logging */ public static final boolean LOGX = true; /** Enable verbose logging */ public static final boolean LOGV = false; /** Enable super-verbose logging */ private static final boolean LOCAL_LOGVV = false; public static final boolean LOGVV = LOCAL_LOGVV && LOGV; /** * This download has successfully completed. * Warning: there might be other status values that indicate success * in the future. * Use isSucccess() to capture the entire category. */ public static final int STATUS_SUCCESS = 200; /** * This request couldn't be parsed. This is also used when processing * requests with unknown/unsupported URI schemes. */ public static final int STATUS_BAD_REQUEST = 400; /** * This download can't be performed because the content type cannot be * handled. */ public static final int STATUS_NOT_ACCEPTABLE = 406; /** * This download cannot be performed because the length cannot be * determined accurately. This is the code for the HTTP error "Length * Required", which is typically used when making requests that require * a content length but don't have one, and it is also used in the * client when a response is received whose length cannot be determined * accurately (therefore making it impossible to know when a download * completes). */ public static final int STATUS_LENGTH_REQUIRED = 411; /** * This download was interrupted and cannot be resumed. * This is the code for the HTTP error "Precondition Failed", and it is * also used in situations where the client doesn't have an ETag at all. */ public static final int STATUS_PRECONDITION_FAILED = 412; /** * The lowest-valued error status that is not an actual HTTP status code. */ public static final int MIN_ARTIFICIAL_ERROR_STATUS = 488; /** * The requested destination file already exists. */ public static final int STATUS_FILE_ALREADY_EXISTS_ERROR = 488; /** * Some possibly transient error occurred, but we can't resume the download. */ public static final int STATUS_CANNOT_RESUME = 489; /** * This download was canceled */ public static final int STATUS_CANCELED = 490; /** * This download has completed with an error. * Warning: there will be other status values that indicate errors in * the future. Use isStatusError() to capture the entire category. */ public static final int STATUS_UNKNOWN_ERROR = 491; /** * This download couldn't be completed because of a storage issue. * Typically, that's because the filesystem is missing or full. * Use the more specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR} * and {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate. */ public static final int STATUS_FILE_ERROR = 492; /** * This download couldn't be completed because of an HTTP * redirect response that the download manager couldn't * handle. */ public static final int STATUS_UNHANDLED_REDIRECT = 493; /** * This download couldn't be completed because of an * unspecified unhandled HTTP code. */ public static final int STATUS_UNHANDLED_HTTP_CODE = 494; /** * This download couldn't be completed because of an * error receiving or processing data at the HTTP level. */ public static final int STATUS_HTTP_DATA_ERROR = 495; /** * This download couldn't be completed because of an * HttpException while setting up the request. */ public static final int STATUS_HTTP_EXCEPTION = 496; /** * This download couldn't be completed because there were * too many redirects. */ public static final int STATUS_TOO_MANY_REDIRECTS = 497; /** * This download couldn't be completed due to insufficient storage * space. Typically, this is because the SD card is full. */ public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498; /** * This download couldn't be completed because no external storage * device was found. Typically, this is because the SD card is not * mounted. */ public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499; /** * The wake duration to check to see if a download is possible. */ public static final long WATCHDOG_WAKE_TIMER = 60*1000; /** * The wake duration to check to see if the process was killed. */ public static final long ACTIVE_THREAD_WATCHDOG = 5*1000; } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/DownloadProgressInfo.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader; import android.os.Parcel; import android.os.Parcelable; /** * This class contains progress information about the active download(s). * * When you build the Activity that initiates a download and tracks the * progress by implementing the {@link IDownloaderClient} interface, you'll * receive a DownloadProgressInfo object in each call to the {@link * IDownloaderClient#onDownloadProgress} method. This allows you to update * your activity's UI with information about the download progress, such * as the progress so far, time remaining and current speed. */ public class DownloadProgressInfo implements Parcelable { public long mOverallTotal; public long mOverallProgress; public long mTimeRemaining; // time remaining public float mCurrentSpeed; // speed in KB/S @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel p, int i) { p.writeLong(mOverallTotal); p.writeLong(mOverallProgress); p.writeLong(mTimeRemaining); p.writeFloat(mCurrentSpeed); } public DownloadProgressInfo(Parcel p) { mOverallTotal = p.readLong(); mOverallProgress = p.readLong(); mTimeRemaining = p.readLong(); mCurrentSpeed = p.readFloat(); } public DownloadProgressInfo(long overallTotal, long overallProgress, long timeRemaining, float currentSpeed) { this.mOverallTotal = overallTotal; this.mOverallProgress = overallProgress; this.mTimeRemaining = timeRemaining; this.mCurrentSpeed = currentSpeed; } public static final Creator CREATOR = new Creator() { @Override public DownloadProgressInfo createFromParcel(Parcel parcel) { return new DownloadProgressInfo(parcel); } @Override public DownloadProgressInfo[] newArray(int i) { return new DownloadProgressInfo[i]; } }; } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/DownloaderClientMarshaller.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader; import com.google.android.vending.expansion.downloader.impl.DownloaderService; import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.content.pm.PackageManager.NameNotFoundException; import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; import android.os.Messenger; import android.os.RemoteException; import android.util.Log; /** * This class binds the service API to your application client. It contains the IDownloaderClient proxy, * which is used to call functions in your client as well as the Stub, which is used to call functions * in the client implementation of IDownloaderClient. * *

The IPC is implemented using an Android Messenger and a service Binder. The connect method * should be called whenever the client wants to bind to the service. It opens up a service connection * that ends up calling the onServiceConnected client API that passes the service messenger * in. If the client wants to be notified by the service, it is responsible for then passing its * messenger to the service in a separate call. * *

Critical methods are {@link #startDownloadServiceIfRequired} and {@link #CreateStub}. * *

When your application first starts, you should first check whether your app's expansion files are * already on the device. If not, you should then call {@link #startDownloadServiceIfRequired}, which * starts your {@link impl.DownloaderService} to download the expansion files if necessary. The method * returns a value indicating whether download is required or not. * *

If a download is required, {@link #startDownloadServiceIfRequired} begins the download through * the specified service and you should then call {@link #CreateStub} to instantiate a member {@link * IStub} object that you need in order to receive calls through your {@link IDownloaderClient} * interface. */ public class DownloaderClientMarshaller { public static final int MSG_ONDOWNLOADSTATE_CHANGED = 10; public static final int MSG_ONDOWNLOADPROGRESS = 11; public static final int MSG_ONSERVICECONNECTED = 12; public static final String PARAM_NEW_STATE = "newState"; public static final String PARAM_PROGRESS = "progress"; public static final String PARAM_MESSENGER = DownloaderService.EXTRA_MESSAGE_HANDLER; public static final int NO_DOWNLOAD_REQUIRED = DownloaderService.NO_DOWNLOAD_REQUIRED; public static final int LVL_CHECK_REQUIRED = DownloaderService.LVL_CHECK_REQUIRED; public static final int DOWNLOAD_REQUIRED = DownloaderService.DOWNLOAD_REQUIRED; private static class Proxy implements IDownloaderClient { private Messenger mServiceMessenger; @Override public void onDownloadStateChanged(int newState) { Bundle params = new Bundle(1); params.putInt(PARAM_NEW_STATE, newState); send(MSG_ONDOWNLOADSTATE_CHANGED, params); } @Override public void onDownloadProgress(DownloadProgressInfo progress) { Bundle params = new Bundle(1); params.putParcelable(PARAM_PROGRESS, progress); send(MSG_ONDOWNLOADPROGRESS, params); } private void send(int method, Bundle params) { Message m = Message.obtain(null, method); m.setData(params); try { mServiceMessenger.send(m); } catch (RemoteException e) { e.printStackTrace(); } } public Proxy(Messenger msg) { mServiceMessenger = msg; } @Override public void onServiceConnected(Messenger m) { /** * This is never called through the proxy. */ } } private static class Stub implements IStub { private IDownloaderClient mItf = null; private Class mDownloaderServiceClass; private boolean mBound; private Messenger mServiceMessenger; private Context mContext; /** * Target we publish for clients to send messages to IncomingHandler. */ final Messenger mMessenger = new Messenger(new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_ONDOWNLOADPROGRESS: Bundle bun = msg.getData(); if ( null != mContext ) { bun.setClassLoader(mContext.getClassLoader()); DownloadProgressInfo dpi = (DownloadProgressInfo) msg.getData() .getParcelable(PARAM_PROGRESS); mItf.onDownloadProgress(dpi); } break; case MSG_ONDOWNLOADSTATE_CHANGED: mItf.onDownloadStateChanged(msg.getData().getInt(PARAM_NEW_STATE)); break; case MSG_ONSERVICECONNECTED: mItf.onServiceConnected( (Messenger) msg.getData().getParcelable(PARAM_MESSENGER)); break; } } }); public Stub(IDownloaderClient itf, Class downloaderService) { mItf = itf; mDownloaderServiceClass = downloaderService; } /** * Class for interacting with the main interface of the service. */ private ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName className, IBinder service) { // This is called when the connection with the service has been // established, giving us the object we can use to // interact with the service. We are communicating with the // service using a Messenger, so here we get a client-side // representation of that from the raw IBinder object. mServiceMessenger = new Messenger(service); mItf.onServiceConnected( mServiceMessenger); } public void onServiceDisconnected(ComponentName className) { // This is called when the connection with the service has been // unexpectedly disconnected -- that is, its process crashed. mServiceMessenger = null; } }; @Override public void connect(Context c) { mContext = c; Intent bindIntent = new Intent(c, mDownloaderServiceClass); bindIntent.putExtra(PARAM_MESSENGER, mMessenger); if ( !c.bindService(bindIntent, mConnection, Context.BIND_DEBUG_UNBIND) ) { if ( Constants.LOGVV ) { Log.d(Constants.TAG, "Service Unbound"); } } else { mBound = true; } } @Override public void disconnect(Context c) { if (mBound) { c.unbindService(mConnection); mBound = false; } mContext = null; } @Override public Messenger getMessenger() { return mMessenger; } } /** * Returns a proxy that will marshal calls to IDownloaderClient methods * * @param msg * @return */ public static IDownloaderClient CreateProxy(Messenger msg) { return new Proxy(msg); } /** * Returns a stub object that, when connected, will listen for marshaled * {@link IDownloaderClient} methods and translate them into calls to the supplied * interface. * * @param itf An implementation of IDownloaderClient that will be called * when remote method calls are unmarshaled. * @param downloaderService The class for your implementation of {@link * impl.DownloaderService}. * @return The {@link IStub} that allows you to connect to the service such that * your {@link IDownloaderClient} receives status updates. */ public static IStub CreateStub(IDownloaderClient itf, Class downloaderService) { return new Stub(itf, downloaderService); } /** * Starts the download if necessary. This function starts a flow that does ` * many things. 1) Checks to see if the APK version has been checked and * the metadata database updated 2) If the APK version does not match, * checks the new LVL status to see if a new download is required 3) If the * APK version does match, then checks to see if the download(s) have been * completed 4) If the downloads have been completed, returns * NO_DOWNLOAD_REQUIRED The idea is that this can be called during the * startup of an application to quickly ascertain if the application needs * to wait to hear about any updated APK expansion files. Note that this does * mean that the application MUST be run for the first time with a network * connection, even if Market delivers all of the files. * * @param context Your application Context. * @param notificationClient A PendingIntent to start the Activity in your application * that shows the download progress and which will also start the application when download * completes. * @param serviceClass the class of your {@link imp.DownloaderService} implementation * @return whether the service was started and the reason for starting the service. * Either {@link #NO_DOWNLOAD_REQUIRED}, {@link #LVL_CHECK_REQUIRED}, or {@link * #DOWNLOAD_REQUIRED}. * @throws NameNotFoundException */ public static int startDownloadServiceIfRequired(Context context, PendingIntent notificationClient, Class serviceClass) throws NameNotFoundException { return DownloaderService.startDownloadServiceIfRequired(context, notificationClient, serviceClass); } /** * This version assumes that the intent contains the pending intent as a parameter. This * is used for responding to alarms. *

The pending intent must be in an extra with the key {@link * impl.DownloaderService#EXTRA_PENDING_INTENT}. * * @param context * @param notificationClient * @param serviceClass the class of the service to start * @return * @throws NameNotFoundException */ public static int startDownloadServiceIfRequired(Context context, Intent notificationClient, Class serviceClass) throws NameNotFoundException { return DownloaderService.startDownloadServiceIfRequired(context, notificationClient, serviceClass); } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/DownloaderServiceMarshaller.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader; import com.google.android.vending.expansion.downloader.impl.DownloaderService; import android.content.Context; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.Messenger; import android.os.RemoteException; /** * This class is used by the client activity to proxy requests to the Downloader * Service. * * Most importantly, you must call {@link #CreateProxy} during the {@link * IDownloaderClient#onServiceConnected} callback in your activity in order to instantiate * an {@link IDownloaderService} object that you can then use to issue commands to the {@link * DownloaderService} (such as to pause and resume downloads). */ public class DownloaderServiceMarshaller { public static final int MSG_REQUEST_ABORT_DOWNLOAD = 1; public static final int MSG_REQUEST_PAUSE_DOWNLOAD = 2; public static final int MSG_SET_DOWNLOAD_FLAGS = 3; public static final int MSG_REQUEST_CONTINUE_DOWNLOAD = 4; public static final int MSG_REQUEST_DOWNLOAD_STATE = 5; public static final int MSG_REQUEST_CLIENT_UPDATE = 6; public static final String PARAMS_FLAGS = "flags"; public static final String PARAM_MESSENGER = DownloaderService.EXTRA_MESSAGE_HANDLER; private static class Proxy implements IDownloaderService { private Messenger mMsg; private void send(int method, Bundle params) { Message m = Message.obtain(null, method); m.setData(params); try { mMsg.send(m); } catch (RemoteException e) { e.printStackTrace(); } } public Proxy(Messenger msg) { mMsg = msg; } @Override public void requestAbortDownload() { send(MSG_REQUEST_ABORT_DOWNLOAD, new Bundle()); } @Override public void requestPauseDownload() { send(MSG_REQUEST_PAUSE_DOWNLOAD, new Bundle()); } @Override public void setDownloadFlags(int flags) { Bundle params = new Bundle(); params.putInt(PARAMS_FLAGS, flags); send(MSG_SET_DOWNLOAD_FLAGS, params); } @Override public void requestContinueDownload() { send(MSG_REQUEST_CONTINUE_DOWNLOAD, new Bundle()); } @Override public void requestDownloadStatus() { send(MSG_REQUEST_DOWNLOAD_STATE, new Bundle()); } @Override public void onClientUpdated(Messenger clientMessenger) { Bundle bundle = new Bundle(1); bundle.putParcelable(PARAM_MESSENGER, clientMessenger); send(MSG_REQUEST_CLIENT_UPDATE, bundle); } } private static class Stub implements IStub { private IDownloaderService mItf = null; final Messenger mMessenger = new Messenger(new Handler() { @Override public void handleMessage(Message msg) { switch (msg.what) { case MSG_REQUEST_ABORT_DOWNLOAD: mItf.requestAbortDownload(); break; case MSG_REQUEST_CONTINUE_DOWNLOAD: mItf.requestContinueDownload(); break; case MSG_REQUEST_PAUSE_DOWNLOAD: mItf.requestPauseDownload(); break; case MSG_SET_DOWNLOAD_FLAGS: mItf.setDownloadFlags(msg.getData().getInt(PARAMS_FLAGS)); break; case MSG_REQUEST_DOWNLOAD_STATE: mItf.requestDownloadStatus(); break; case MSG_REQUEST_CLIENT_UPDATE: mItf.onClientUpdated((Messenger) msg.getData().getParcelable( PARAM_MESSENGER)); break; } } }); public Stub(IDownloaderService itf) { mItf = itf; } @Override public Messenger getMessenger() { return mMessenger; } @Override public void connect(Context c) { } @Override public void disconnect(Context c) { } } /** * Returns a proxy that will marshall calls to IDownloaderService methods * * @param ctx * @return */ public static IDownloaderService CreateProxy(Messenger msg) { return new Proxy(msg); } /** * Returns a stub object that, when connected, will listen for marshalled * IDownloaderService methods and translate them into calls to the supplied * interface. * * @param itf An implementation of IDownloaderService that will be called * when remote method calls are unmarshalled. * @return */ public static IStub CreateStub(IDownloaderService itf) { return new Stub(itf); } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/Helpers.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader; import com.android.vending.expansion.downloader.R; import android.content.Context; import android.os.Environment; import android.os.StatFs; import android.os.SystemClock; import android.util.Log; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; import java.util.Random; import java.util.TimeZone; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Some helper functions for the download manager */ public class Helpers { public static Random sRandom = new Random(SystemClock.uptimeMillis()); /** Regex used to parse content-disposition headers */ private static final Pattern CONTENT_DISPOSITION_PATTERN = Pattern .compile("attachment;\\s*filename\\s*=\\s*\"([^\"]*)\""); private Helpers() { } /* * Parse the Content-Disposition HTTP Header. The format of the header is * defined here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html This * header provides a filename for content that is going to be downloaded to * the file system. We only support the attachment type. */ static String parseContentDisposition(String contentDisposition) { try { Matcher m = CONTENT_DISPOSITION_PATTERN.matcher(contentDisposition); if (m.find()) { return m.group(1); } } catch (IllegalStateException ex) { // This function is defined as returning null when it can't parse // the header } return null; } /** * @return the root of the filesystem containing the given path */ public static File getFilesystemRoot(String path) { File cache = Environment.getDownloadCacheDirectory(); if (path.startsWith(cache.getPath())) { return cache; } File external = Environment.getExternalStorageDirectory(); if (path.startsWith(external.getPath())) { return external; } throw new IllegalArgumentException( "Cannot determine filesystem root for " + path); } public static boolean isExternalMediaMounted() { if (!Environment.getExternalStorageState().equals( Environment.MEDIA_MOUNTED)) { // No SD card found. if ( Constants.LOGVV ) { Log.d(Constants.TAG, "no external storage"); } return false; } return true; } /** * @return the number of bytes available on the filesystem rooted at the * given File */ public static long getAvailableBytes(File root) { StatFs stat = new StatFs(root.getPath()); // put a bit of margin (in case creating the file grows the system by a // few blocks) long availableBlocks = (long) stat.getAvailableBlocks() - 4; return stat.getBlockSize() * availableBlocks; } /** * Checks whether the filename looks legitimate */ public static boolean isFilenameValid(String filename) { filename = filename.replaceFirst("/+", "/"); // normalize leading // slashes return filename.startsWith(Environment.getDownloadCacheDirectory().toString()) || filename.startsWith(Environment.getExternalStorageDirectory().toString()); } /* * Delete the given file from device */ /* package */static void deleteFile(String path) { try { File file = new File(path); file.delete(); } catch (Exception e) { Log.w(Constants.TAG, "file: '" + path + "' couldn't be deleted", e); } } /** * Showing progress in MB here. It would be nice to choose the unit (KB, MB, * GB) based on total file size, but given what we know about the expected * ranges of file sizes for APK expansion files, it's probably not necessary. * * @param overallProgress * @param overallTotal * @return */ static public String getDownloadProgressString(long overallProgress, long overallTotal) { if (overallTotal == 0) { if ( Constants.LOGVV ) { Log.e(Constants.TAG, "Notification called when total is zero"); } return ""; } return String.format("%.2f", (float) overallProgress / (1024.0f * 1024.0f)) + "MB /" + String.format("%.2f", (float) overallTotal / (1024.0f * 1024.0f)) + "MB"; } /** * Adds a percentile to getDownloadProgressString. * * @param overallProgress * @param overallTotal * @return */ static public String getDownloadProgressStringNotification(long overallProgress, long overallTotal) { if (overallTotal == 0) { if ( Constants.LOGVV ) { Log.e(Constants.TAG, "Notification called when total is zero"); } return ""; } return getDownloadProgressString(overallProgress, overallTotal) + " (" + getDownloadProgressPercent(overallProgress, overallTotal) + ")"; } public static String getDownloadProgressPercent(long overallProgress, long overallTotal) { if (overallTotal == 0) { if ( Constants.LOGVV ) { Log.e(Constants.TAG, "Notification called when total is zero"); } return ""; } return Long.toString(overallProgress * 100 / overallTotal) + "%"; } public static String getSpeedString(float bytesPerMillisecond) { return String.format("%.2f", bytesPerMillisecond * 1000 / 1024); } public static String getTimeRemaining(long durationInMilliseconds) { SimpleDateFormat sdf; if (durationInMilliseconds > 1000 * 60 * 60) { sdf = new SimpleDateFormat("HH:mm", Locale.getDefault()); } else { sdf = new SimpleDateFormat("mm:ss", Locale.getDefault()); } return sdf.format(new Date(durationInMilliseconds - TimeZone.getDefault().getRawOffset())); } /** * Returns the file name (without full path) for an Expansion APK file from * the given context. * * @param c the context * @param mainFile true for main file, false for patch file * @param versionCode the version of the file * @return String the file name of the expansion file */ public static String getExpansionAPKFileName(Context c, boolean mainFile, int versionCode) { return (mainFile ? "main." : "patch.") + versionCode + "." + c.getPackageName() + ".obb"; } /** * Returns the filename (where the file should be saved) from info about a * download */ static public String generateSaveFileName(Context c, String fileName) { String path = getSaveFilePath(c) + File.separator + fileName; return path; } static public String getSaveFilePath(Context c) { File root = Environment.getExternalStorageDirectory(); String path = root.toString() + Constants.EXP_PATH + c.getPackageName(); return path; } /** * Helper function to ascertain the existence of a file and return * true/false appropriately * * @param c the app/activity/service context * @param fileName the name (sans path) of the file to query * @param fileSize the size that the file must match * @param deleteFileOnMismatch if the file sizes do not match, delete the * file * @return true if it does exist, false otherwise */ static public boolean doesFileExist(Context c, String fileName, long fileSize, boolean deleteFileOnMismatch) { // the file may have been delivered by Market --- let's make sure // it's the size we expect File fileForNewFile = new File(Helpers.generateSaveFileName(c, fileName)); if (fileForNewFile.exists()) { if (fileForNewFile.length() == fileSize) { return true; } if (deleteFileOnMismatch) { // delete the file --- we won't be able to resume // because we cannot confirm the integrity of the file fileForNewFile.delete(); } } return false; } /** * Converts download states that are returned by the {@link * IDownloaderClient#onDownloadStateChanged} callback into usable strings. * This is useful if using the state strings built into the library to display user messages. * @param state One of the STATE_* constants from {@link IDownloaderClient}. * @return string resource ID for the corresponding string. */ static public int getDownloaderStringResourceIDFromState(int state) { switch (state) { case IDownloaderClient.STATE_IDLE: return R.string.state_idle; case IDownloaderClient.STATE_FETCHING_URL: return R.string.state_fetching_url; case IDownloaderClient.STATE_CONNECTING: return R.string.state_connecting; case IDownloaderClient.STATE_DOWNLOADING: return R.string.state_downloading; case IDownloaderClient.STATE_COMPLETED: return R.string.state_completed; case IDownloaderClient.STATE_PAUSED_NETWORK_UNAVAILABLE: return R.string.state_paused_network_unavailable; case IDownloaderClient.STATE_PAUSED_BY_REQUEST: return R.string.state_paused_by_request; case IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION: return R.string.state_paused_wifi_disabled; case IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION: return R.string.state_paused_wifi_unavailable; case IDownloaderClient.STATE_PAUSED_WIFI_DISABLED: return R.string.state_paused_wifi_disabled; case IDownloaderClient.STATE_PAUSED_NEED_WIFI: return R.string.state_paused_wifi_unavailable; case IDownloaderClient.STATE_PAUSED_ROAMING: return R.string.state_paused_roaming; case IDownloaderClient.STATE_PAUSED_NETWORK_SETUP_FAILURE: return R.string.state_paused_network_setup_failure; case IDownloaderClient.STATE_PAUSED_SDCARD_UNAVAILABLE: return R.string.state_paused_sdcard_unavailable; case IDownloaderClient.STATE_FAILED_UNLICENSED: return R.string.state_failed_unlicensed; case IDownloaderClient.STATE_FAILED_FETCHING_URL: return R.string.state_failed_fetching_url; case IDownloaderClient.STATE_FAILED_SDCARD_FULL: return R.string.state_failed_sdcard_full; case IDownloaderClient.STATE_FAILED_CANCELED: return R.string.state_failed_cancelled; default: return R.string.state_unknown; } } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/IDownloaderClient.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader; import android.os.Messenger; /** * This interface should be implemented by the client activity for the * downloader. It is used to pass status from the service to the client. */ public interface IDownloaderClient { static final int STATE_IDLE = 1; static final int STATE_FETCHING_URL = 2; static final int STATE_CONNECTING = 3; static final int STATE_DOWNLOADING = 4; static final int STATE_COMPLETED = 5; static final int STATE_PAUSED_NETWORK_UNAVAILABLE = 6; static final int STATE_PAUSED_BY_REQUEST = 7; /** * Both STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION and * STATE_PAUSED_NEED_CELLULAR_PERMISSION imply that Wi-Fi is unavailable and * cellular permission will restart the service. Wi-Fi disabled means that * the Wi-Fi manager is returning that Wi-Fi is not enabled, while in the * other case Wi-Fi is enabled but not available. */ static final int STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION = 8; static final int STATE_PAUSED_NEED_CELLULAR_PERMISSION = 9; /** * Both STATE_PAUSED_WIFI_DISABLED and STATE_PAUSED_NEED_WIFI imply that * Wi-Fi is unavailable and cellular permission will NOT restart the * service. Wi-Fi disabled means that the Wi-Fi manager is returning that * Wi-Fi is not enabled, while in the other case Wi-Fi is enabled but not * available. *

* The service does not return these values. We recommend that app * developers with very large payloads do not allow these payloads to be * downloaded over cellular connections. */ static final int STATE_PAUSED_WIFI_DISABLED = 10; static final int STATE_PAUSED_NEED_WIFI = 11; static final int STATE_PAUSED_ROAMING = 12; /** * Scary case. We were on a network that redirected us to another website * that delivered us the wrong file. */ static final int STATE_PAUSED_NETWORK_SETUP_FAILURE = 13; static final int STATE_PAUSED_SDCARD_UNAVAILABLE = 14; static final int STATE_FAILED_UNLICENSED = 15; static final int STATE_FAILED_FETCHING_URL = 16; static final int STATE_FAILED_SDCARD_FULL = 17; static final int STATE_FAILED_CANCELED = 18; static final int STATE_FAILED = 19; /** * Called internally by the stub when the service is bound to the client. *

* Critical implementation detail. In onServiceConnected we create the * remote service and marshaler. This is how we pass the client information * back to the service so the client can be properly notified of changes. We * must do this every time we reconnect to the service. *

* That is, when you receive this callback, you should call * {@link DownloaderServiceMarshaller#CreateProxy} to instantiate a member * instance of {@link IDownloaderService}, then call * {@link IDownloaderService#onClientUpdated} with the Messenger retrieved * from your {@link IStub} proxy object. * * @param m the service Messenger. This Messenger is used to call the * service API from the client. */ void onServiceConnected(Messenger m); /** * Called when the download state changes. Depending on the state, there may * be user requests. The service is free to change the download state in the * middle of a user request, so the client should be able to handle this. *

* The Downloader Library includes a collection of string resources that * correspond to each of the states, which you can use to provide users a * useful message based on the state provided in this callback. To fetch the * appropriate string for a state, call * {@link Helpers#getDownloaderStringResourceIDFromState}. *

* What this means to the developer: The application has gotten a message * that the download has paused due to lack of WiFi. The developer should * then show UI asking the user if they want to enable downloading over * cellular connections with appropriate warnings. If the application * suddenly starts downloading, the application should revert to showing the * progress again, rather than leaving up the download over cellular UI up. * * @param newState one of the STATE_* values defined in IDownloaderClient */ void onDownloadStateChanged(int newState); /** * Shows the download progress. This is intended to be used to fill out a * client UI. This progress should only be shown in a few states such as * STATE_DOWNLOADING. * * @param progress the DownloadProgressInfo object containing the current * progress of all downloads. */ void onDownloadProgress(DownloadProgressInfo progress); } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/IDownloaderService.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader; import com.google.android.vending.expansion.downloader.impl.DownloaderService; import android.os.Messenger; /** * This interface is implemented by the DownloaderService and by the * DownloaderServiceMarshaller. It contains functions to control the service. * When a client binds to the service, it must call the onClientUpdated * function. *

* You can acquire a proxy that implements this interface for your service by * calling {@link DownloaderServiceMarshaller#CreateProxy} during the * {@link IDownloaderClient#onServiceConnected} callback. At which point, you * should immediately call {@link #onClientUpdated}. */ public interface IDownloaderService { /** * Set this flag in response to the * IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION state and then * call RequestContinueDownload to resume a download */ public static final int FLAGS_DOWNLOAD_OVER_CELLULAR = 1; /** * Request that the service abort the current download. The service should * respond by changing the state to {@link IDownloaderClient.STATE_ABORTED}. */ void requestAbortDownload(); /** * Request that the service pause the current download. The service should * respond by changing the state to * {@link IDownloaderClient.STATE_PAUSED_BY_REQUEST}. */ void requestPauseDownload(); /** * Request that the service continue a paused download, when in any paused * or failed state, including * {@link IDownloaderClient.STATE_PAUSED_BY_REQUEST}. */ void requestContinueDownload(); /** * Set the flags for this download (e.g. * {@link DownloaderService.FLAGS_DOWNLOAD_OVER_CELLULAR}). * * @param flags */ void setDownloadFlags(int flags); /** * Requests that the download status be sent to the client. */ void requestDownloadStatus(); /** * Call this when you get {@link * IDownloaderClient.onServiceConnected(Messenger m)} from the * DownloaderClient to register the client with the service. It will * automatically send the current status to the client. * * @param clientMessenger */ void onClientUpdated(Messenger clientMessenger); } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/IStub.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader; import android.content.Context; import android.os.Messenger; /** * This is the interface that is used to connect/disconnect from the downloader * service. *

* You should get a proxy object that implements this interface by calling * {@link DownloaderClientMarshaller#CreateStub} in your activity when the * downloader service starts. Then, call {@link #connect} during your activity's * onResume() and call {@link #disconnect} during onStop(). *

* Then during the {@link IDownloaderClient#onServiceConnected} callback, you * should call {@link #getMessenger} to pass the stub's Messenger object to * {@link IDownloaderService#onClientUpdated}. */ public interface IStub { Messenger getMessenger(); void connect(Context c); void disconnect(Context c); } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/SystemFacade.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader; import android.app.Notification; import android.app.NotificationManager; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager.NameNotFoundException; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.telephony.TelephonyManager; import android.util.Log; /** * Contains useful helper functions, typically tied to the application context. */ class SystemFacade { private Context mContext; private NotificationManager mNotificationManager; public SystemFacade(Context context) { mContext = context; mNotificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); } public long currentTimeMillis() { return System.currentTimeMillis(); } public Integer getActiveNetworkType() { ConnectivityManager connectivity = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); if (connectivity == null) { Log.w(Constants.TAG, "couldn't get connectivity manager"); return null; } NetworkInfo activeInfo = connectivity.getActiveNetworkInfo(); if (activeInfo == null) { if (Constants.LOGVV) { Log.v(Constants.TAG, "network is not available"); } return null; } return activeInfo.getType(); } public boolean isNetworkRoaming() { ConnectivityManager connectivity = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); if (connectivity == null) { Log.w(Constants.TAG, "couldn't get connectivity manager"); return false; } NetworkInfo info = connectivity.getActiveNetworkInfo(); boolean isMobile = (info != null && info.getType() == ConnectivityManager.TYPE_MOBILE); TelephonyManager tm = (TelephonyManager) mContext .getSystemService(Context.TELEPHONY_SERVICE); if (null == tm) { Log.w(Constants.TAG, "couldn't get telephony manager"); return false; } boolean isRoaming = isMobile && tm.isNetworkRoaming(); if (Constants.LOGVV && isRoaming) { Log.v(Constants.TAG, "network is roaming"); } return isRoaming; } public Long getMaxBytesOverMobile() { return (long) Integer.MAX_VALUE; } public Long getRecommendedMaxBytesOverMobile() { return 2097152L; } public void sendBroadcast(Intent intent) { mContext.sendBroadcast(intent); } public boolean userOwnsPackage(int uid, String packageName) throws NameNotFoundException { return mContext.getPackageManager().getApplicationInfo(packageName, 0).uid == uid; } public void postNotification(long id, Notification notification) { /** * TODO: The system notification manager takes ints, not longs, as IDs, * but the download manager uses IDs take straight from the database, * which are longs. This will have to be dealt with at some point. */ mNotificationManager.notify((int) id, notification); } public void cancelNotification(long id) { mNotificationManager.cancel((int) id); } public void cancelAllNotifications() { mNotificationManager.cancelAll(); } public void startThread(Thread thread) { thread.start(); } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/AndroidHttpClient.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * This is a port of AndroidHttpClient to pre-Froyo devices, that takes advantage of * the SSLSessionCache added Froyo devices using reflection. */ package com.google.android.vending.expansion.downloader.impl; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URI; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpEntityEnclosingRequest; import org.apache.http.HttpException; import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.HttpRequestInterceptor; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.HttpClient; import org.apache.http.client.ResponseHandler; import org.apache.http.client.methods.HttpUriRequest; import org.apache.http.client.params.HttpClientParams; import org.apache.http.client.protocol.ClientContext; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.conn.scheme.SocketFactory; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.entity.AbstractHttpEntity; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.impl.client.RequestWrapper; import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; import org.apache.http.params.BasicHttpParams; import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpParams; import org.apache.http.params.HttpProtocolParams; import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.BasicHttpProcessor; import org.apache.http.protocol.HttpContext; import android.content.ContentResolver; import android.content.Context; import android.net.SSLCertificateSocketFactory; import android.os.Looper; import android.util.Log; /** * Subclass of the Apache {@link DefaultHttpClient} that is configured with * reasonable default settings and registered schemes for Android, and * also lets the user add {@link HttpRequestInterceptor} classes. * Don't create this directly, use the {@link #newInstance} factory method. * *

This client processes cookies but does not retain them by default. * To retain cookies, simply add a cookie store to the HttpContext:

* *
context.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
*/ public final class AndroidHttpClient implements HttpClient { static Class sSslSessionCacheClass; static { // if we are on Froyo+ devices, we can take advantage of the SSLSessionCache try { sSslSessionCacheClass = Class.forName("android.net.SSLSessionCache"); } catch (Exception e) { } } // Gzip of data shorter than this probably won't be worthwhile public static long DEFAULT_SYNC_MIN_GZIP_BYTES = 256; // Default connection and socket timeout of 60 seconds. Tweak to taste. private static final int SOCKET_OPERATION_TIMEOUT = 60 * 1000; private static final String TAG = "AndroidHttpClient"; /** Interceptor throws an exception if the executing thread is blocked */ private static final HttpRequestInterceptor sThreadCheckInterceptor = new HttpRequestInterceptor() { public void process(HttpRequest request, HttpContext context) { // Prevent the HttpRequest from being sent on the main thread if (Looper.myLooper() != null && Looper.myLooper() == Looper.getMainLooper() ) { throw new RuntimeException("This thread forbids HTTP requests"); } } }; /** * Create a new HttpClient with reasonable defaults (which you can update). * * @param userAgent to report in your HTTP requests * @param context to use for caching SSL sessions (may be null for no caching) * @return AndroidHttpClient for you to use for all your requests. */ public static AndroidHttpClient newInstance(String userAgent, Context context) { HttpParams params = new BasicHttpParams(); // Turn off stale checking. Our connections break all the time anyway, // and it's not worth it to pay the penalty of checking every time. HttpConnectionParams.setStaleCheckingEnabled(params, false); HttpConnectionParams.setConnectionTimeout(params, SOCKET_OPERATION_TIMEOUT); HttpConnectionParams.setSoTimeout(params, SOCKET_OPERATION_TIMEOUT); HttpConnectionParams.setSocketBufferSize(params, 8192); // Don't handle redirects -- return them to the caller. Our code // often wants to re-POST after a redirect, which we must do ourselves. HttpClientParams.setRedirecting(params, false); Object sessionCache = null; // Use a session cache for SSL sockets -- Froyo only if ( null != context && null != sSslSessionCacheClass ) { Constructor ct; try { ct = sSslSessionCacheClass.getConstructor(Context.class); sessionCache = ct.newInstance(context); } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InstantiationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } } // Set the specified user agent and register standard protocols. HttpProtocolParams.setUserAgent(params, userAgent); SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); SocketFactory sslCertificateSocketFactory = null; if ( null != sessionCache ) { Method getHttpSocketFactoryMethod; try { getHttpSocketFactoryMethod = SSLCertificateSocketFactory.class.getDeclaredMethod("getHttpSocketFactory",Integer.TYPE, sSslSessionCacheClass); sslCertificateSocketFactory = (SocketFactory)getHttpSocketFactoryMethod.invoke(null, SOCKET_OPERATION_TIMEOUT, sessionCache); } catch (SecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (NoSuchMethodException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalArgumentException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IllegalAccessException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvocationTargetException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if ( null == sslCertificateSocketFactory ) { sslCertificateSocketFactory = SSLSocketFactory.getSocketFactory(); } schemeRegistry.register(new Scheme("https", sslCertificateSocketFactory, 443)); ClientConnectionManager manager = new ThreadSafeClientConnManager(params, schemeRegistry); // We use a factory method to modify superclass initialization // parameters without the funny call-a-static-method dance. return new AndroidHttpClient(manager, params); } /** * Create a new HttpClient with reasonable defaults (which you can update). * @param userAgent to report in your HTTP requests. * @return AndroidHttpClient for you to use for all your requests. */ public static AndroidHttpClient newInstance(String userAgent) { return newInstance(userAgent, null /* session cache */); } private final HttpClient delegate; private RuntimeException mLeakedException = new IllegalStateException( "AndroidHttpClient created and never closed"); private AndroidHttpClient(ClientConnectionManager ccm, HttpParams params) { this.delegate = new DefaultHttpClient(ccm, params) { @Override protected BasicHttpProcessor createHttpProcessor() { // Add interceptor to prevent making requests from main thread. BasicHttpProcessor processor = super.createHttpProcessor(); processor.addRequestInterceptor(sThreadCheckInterceptor); processor.addRequestInterceptor(new CurlLogger()); return processor; } @Override protected HttpContext createHttpContext() { // Same as DefaultHttpClient.createHttpContext() minus the // cookie store. HttpContext context = new BasicHttpContext(); context.setAttribute( ClientContext.AUTHSCHEME_REGISTRY, getAuthSchemes()); context.setAttribute( ClientContext.COOKIESPEC_REGISTRY, getCookieSpecs()); context.setAttribute( ClientContext.CREDS_PROVIDER, getCredentialsProvider()); return context; } }; } @Override protected void finalize() throws Throwable { super.finalize(); if (mLeakedException != null) { Log.e(TAG, "Leak found", mLeakedException); mLeakedException = null; } } /** * Modifies a request to indicate to the server that we would like a * gzipped response. (Uses the "Accept-Encoding" HTTP header.) * @param request the request to modify * @see #getUngzippedContent */ public static void modifyRequestToAcceptGzipResponse(HttpRequest request) { request.addHeader("Accept-Encoding", "gzip"); } /** * Gets the input stream from a response entity. If the entity is gzipped * then this will get a stream over the uncompressed data. * * @param entity the entity whose content should be read * @return the input stream to read from * @throws IOException */ public static InputStream getUngzippedContent(HttpEntity entity) throws IOException { InputStream responseStream = entity.getContent(); if (responseStream == null) return responseStream; Header header = entity.getContentEncoding(); if (header == null) return responseStream; String contentEncoding = header.getValue(); if (contentEncoding == null) return responseStream; if (contentEncoding.contains("gzip")) responseStream = new GZIPInputStream(responseStream); return responseStream; } /** * Release resources associated with this client. You must call this, * or significant resources (sockets and memory) may be leaked. */ public void close() { if (mLeakedException != null) { getConnectionManager().shutdown(); mLeakedException = null; } } public HttpParams getParams() { return delegate.getParams(); } public ClientConnectionManager getConnectionManager() { return delegate.getConnectionManager(); } public HttpResponse execute(HttpUriRequest request) throws IOException { return delegate.execute(request); } public HttpResponse execute(HttpUriRequest request, HttpContext context) throws IOException { return delegate.execute(request, context); } public HttpResponse execute(HttpHost target, HttpRequest request) throws IOException { return delegate.execute(target, request); } public HttpResponse execute(HttpHost target, HttpRequest request, HttpContext context) throws IOException { return delegate.execute(target, request, context); } public T execute(HttpUriRequest request, ResponseHandler responseHandler) throws IOException, ClientProtocolException { return delegate.execute(request, responseHandler); } public T execute(HttpUriRequest request, ResponseHandler responseHandler, HttpContext context) throws IOException, ClientProtocolException { return delegate.execute(request, responseHandler, context); } public T execute(HttpHost target, HttpRequest request, ResponseHandler responseHandler) throws IOException, ClientProtocolException { return delegate.execute(target, request, responseHandler); } public T execute(HttpHost target, HttpRequest request, ResponseHandler responseHandler, HttpContext context) throws IOException, ClientProtocolException { return delegate.execute(target, request, responseHandler, context); } /** * Compress data to send to server. * Creates a Http Entity holding the gzipped data. * The data will not be compressed if it is too short. * @param data The bytes to compress * @return Entity holding the data */ public static AbstractHttpEntity getCompressedEntity(byte data[], ContentResolver resolver) throws IOException { AbstractHttpEntity entity; if (data.length < getMinGzipSize(resolver)) { entity = new ByteArrayEntity(data); } else { ByteArrayOutputStream arr = new ByteArrayOutputStream(); OutputStream zipper = new GZIPOutputStream(arr); zipper.write(data); zipper.close(); entity = new ByteArrayEntity(arr.toByteArray()); entity.setContentEncoding("gzip"); } return entity; } /** * Retrieves the minimum size for compressing data. * Shorter data will not be compressed. */ public static long getMinGzipSize(ContentResolver resolver) { return DEFAULT_SYNC_MIN_GZIP_BYTES; // For now, this is just a constant. } /* cURL logging support. */ /** * Logging tag and level. */ private static class LoggingConfiguration { private final String tag; private final int level; private LoggingConfiguration(String tag, int level) { this.tag = tag; this.level = level; } /** * Returns true if logging is turned on for this configuration. */ private boolean isLoggable() { return Log.isLoggable(tag, level); } /** * Prints a message using this configuration. */ private void println(String message) { Log.println(level, tag, message); } } /** cURL logging configuration. */ private volatile LoggingConfiguration curlConfiguration; /** * Enables cURL request logging for this client. * * @param name to log messages with * @param level at which to log messages (see {@link android.util.Log}) */ public void enableCurlLogging(String name, int level) { if (name == null) { throw new NullPointerException("name"); } if (level < Log.VERBOSE || level > Log.ASSERT) { throw new IllegalArgumentException("Level is out of range [" + Log.VERBOSE + ".." + Log.ASSERT + "]"); } curlConfiguration = new LoggingConfiguration(name, level); } /** * Disables cURL logging for this client. */ public void disableCurlLogging() { curlConfiguration = null; } /** * Logs cURL commands equivalent to requests. */ private class CurlLogger implements HttpRequestInterceptor { public void process(HttpRequest request, HttpContext context) throws HttpException, IOException { LoggingConfiguration configuration = curlConfiguration; if (configuration != null && configuration.isLoggable() && request instanceof HttpUriRequest) { // Never print auth token -- we used to check ro.secure=0 to // enable that, but can't do that in unbundled code. configuration.println(toCurl((HttpUriRequest) request, false)); } } } /** * Generates a cURL command equivalent to the given request. */ private static String toCurl(HttpUriRequest request, boolean logAuthToken) throws IOException { StringBuilder builder = new StringBuilder(); builder.append("curl "); for (Header header: request.getAllHeaders()) { if (!logAuthToken && (header.getName().equals("Authorization") || header.getName().equals("Cookie"))) { continue; } builder.append("--header \""); builder.append(header.toString().trim()); builder.append("\" "); } URI uri = request.getURI(); // If this is a wrapped request, use the URI from the original // request instead. getURI() on the wrapper seems to return a // relative URI. We want an absolute URI. if (request instanceof RequestWrapper) { HttpRequest original = ((RequestWrapper) request).getOriginal(); if (original instanceof HttpUriRequest) { uri = ((HttpUriRequest) original).getURI(); } } builder.append("\""); builder.append(uri); builder.append("\""); if (request instanceof HttpEntityEnclosingRequest) { HttpEntityEnclosingRequest entityRequest = (HttpEntityEnclosingRequest) request; HttpEntity entity = entityRequest.getEntity(); if (entity != null && entity.isRepeatable()) { if (entity.getContentLength() < 1024) { ByteArrayOutputStream stream = new ByteArrayOutputStream(); entity.writeTo(stream); String entityString = stream.toString(); // TODO: Check the content type, too. builder.append(" --data-ascii \"") .append(entityString) .append("\""); } else { builder.append(" [TOO MUCH DATA TO INCLUDE]"); } } } return builder.toString(); } /** * Returns the date of the given HTTP date string. This method can identify * and parse the date formats emitted by common HTTP servers, such as * RFC 822, * RFC 850, * RFC 1036, * RFC 1123 and * ANSI * C's asctime(). * * @return the number of milliseconds since Jan. 1, 1970, midnight GMT. * @throws IllegalArgumentException if {@code dateString} is not a date or * of an unsupported format. */ public static long parseDate(String dateString) { return HttpDateTime.parse(dateString); } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/CustomIntentService.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; import android.app.Service; import android.content.Intent; import android.os.Handler; import android.os.HandlerThread; import android.os.IBinder; import android.os.Looper; import android.os.Message; import android.util.Log; /** * This service differs from IntentService in a few minor ways/ It will not * auto-stop itself after the intent is handled unless the target returns "true" * in should stop. Since the goal of this service is to handle a single kind of * intent, it does not queue up batches of intents of the same type. */ public abstract class CustomIntentService extends Service { private String mName; private boolean mRedelivery; private volatile ServiceHandler mServiceHandler; private volatile Looper mServiceLooper; private static final String LOG_TAG = "CancellableIntentService"; private static final int WHAT_MESSAGE = -10; public CustomIntentService(String paramString) { this.mName = paramString; } @Override public IBinder onBind(Intent paramIntent) { return null; } @Override public void onCreate() { super.onCreate(); HandlerThread localHandlerThread = new HandlerThread("IntentService[" + this.mName + "]"); localHandlerThread.start(); this.mServiceLooper = localHandlerThread.getLooper(); this.mServiceHandler = new ServiceHandler(this.mServiceLooper); } @Override public void onDestroy() { Thread localThread = this.mServiceLooper.getThread(); if ((localThread != null) && (localThread.isAlive())) { localThread.interrupt(); } this.mServiceLooper.quit(); Log.d(LOG_TAG, "onDestroy"); } protected abstract void onHandleIntent(Intent paramIntent); protected abstract boolean shouldStop(); @Override public void onStart(Intent paramIntent, int startId) { if (!this.mServiceHandler.hasMessages(WHAT_MESSAGE)) { Message localMessage = this.mServiceHandler.obtainMessage(); localMessage.arg1 = startId; localMessage.obj = paramIntent; localMessage.what = WHAT_MESSAGE; this.mServiceHandler.sendMessage(localMessage); } } @Override public int onStartCommand(Intent paramIntent, int flags, int startId) { onStart(paramIntent, startId); return mRedelivery ? START_REDELIVER_INTENT : START_NOT_STICKY; } public void setIntentRedelivery(boolean enabled) { this.mRedelivery = enabled; } private final class ServiceHandler extends Handler { public ServiceHandler(Looper looper) { super(looper); } @Override public void handleMessage(Message paramMessage) { CustomIntentService.this .onHandleIntent((Intent) paramMessage.obj); if (shouldStop()) { Log.d(LOG_TAG, "stopSelf"); CustomIntentService.this.stopSelf(paramMessage.arg1); Log.d(LOG_TAG, "afterStopSelf"); } } } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/CustomNotificationFactory.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; /** * Uses the class-loader model to utilize the updated notification builders in * Honeycomb while maintaining a compatible version for older devices. */ public class CustomNotificationFactory { static public DownloadNotification.ICustomNotification createCustomNotification() { if (android.os.Build.VERSION.SDK_INT > 13) return new V14CustomNotification(); else return new V3CustomNotification(); } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/DownloadInfo.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; import com.google.android.vending.expansion.downloader.Constants; import com.google.android.vending.expansion.downloader.Helpers; import android.util.Log; /** * Representation of information about an individual download from the database. */ public class DownloadInfo { public String mUri; public final int mIndex; public final String mFileName; public String mETag; public long mTotalBytes; public long mCurrentBytes; public long mLastMod; public int mStatus; public int mControl; public int mNumFailed; public int mRetryAfter; public int mRedirectCount; boolean mInitialized; public int mFuzz; public DownloadInfo(int index, String fileName, String pkg) { mFuzz = Helpers.sRandom.nextInt(1001); mFileName = fileName; mIndex = index; } public void resetDownload() { mCurrentBytes = 0; mETag = ""; mLastMod = 0; mStatus = 0; mControl = 0; mNumFailed = 0; mRetryAfter = 0; mRedirectCount = 0; } /** * Returns the time when a download should be restarted. */ public long restartTime(long now) { if (mNumFailed == 0) { return now; } if (mRetryAfter > 0) { return mLastMod + mRetryAfter; } return mLastMod + Constants.RETRY_FIRST_DELAY * (1000 + mFuzz) * (1 << (mNumFailed - 1)); } public void logVerboseInfo() { Log.v(Constants.TAG, "Service adding new entry"); Log.v(Constants.TAG, "FILENAME: " + mFileName); Log.v(Constants.TAG, "URI : " + mUri); Log.v(Constants.TAG, "FILENAME: " + mFileName); Log.v(Constants.TAG, "CONTROL : " + mControl); Log.v(Constants.TAG, "STATUS : " + mStatus); Log.v(Constants.TAG, "FAILED_C: " + mNumFailed); Log.v(Constants.TAG, "RETRY_AF: " + mRetryAfter); Log.v(Constants.TAG, "REDIRECT: " + mRedirectCount); Log.v(Constants.TAG, "LAST_MOD: " + mLastMod); Log.v(Constants.TAG, "TOTAL : " + mTotalBytes); Log.v(Constants.TAG, "CURRENT : " + mCurrentBytes); Log.v(Constants.TAG, "ETAG : " + mETag); } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/DownloadNotification.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; import com.android.vending.expansion.downloader.R; import com.google.android.vending.expansion.downloader.DownloadProgressInfo; import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; import com.google.android.vending.expansion.downloader.Helpers; import com.google.android.vending.expansion.downloader.IDownloaderClient; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.os.Messenger; /** * This class handles displaying the notification associated with the download * queue going on in the download manager. It handles multiple status types; * Some require user interaction and some do not. Some of the user interactions * may be transient. (for example: the user is queried to continue the download * on 3G when it started on WiFi, but then the phone locks onto WiFi again so * the prompt automatically goes away) *

* The application interface for the downloader also needs to understand and * handle these transient states. */ public class DownloadNotification implements IDownloaderClient { private int mState; private final Context mContext; private final NotificationManager mNotificationManager; private String mCurrentTitle; private IDownloaderClient mClientProxy; final ICustomNotification mCustomNotification; private Notification mNotification; private Notification mCurrentNotification; private CharSequence mLabel; private String mCurrentText; private PendingIntent mContentIntent; private DownloadProgressInfo mProgressInfo; static final String LOGTAG = "DownloadNotification"; static final int NOTIFICATION_ID = LOGTAG.hashCode(); public PendingIntent getClientIntent() { return mContentIntent; } public void setClientIntent(PendingIntent mClientIntent) { this.mContentIntent = mClientIntent; } public void resendState() { if (null != mClientProxy) { mClientProxy.onDownloadStateChanged(mState); } } @Override public void onDownloadStateChanged(int newState) { if (null != mClientProxy) { mClientProxy.onDownloadStateChanged(newState); } if (newState != mState) { mState = newState; if (newState == IDownloaderClient.STATE_IDLE || null == mContentIntent) { return; } int stringDownloadID; int iconResource; boolean ongoingEvent; // get the new title string and paused text switch (newState) { case 0: iconResource = android.R.drawable.stat_sys_warning; stringDownloadID = R.string.state_unknown; ongoingEvent = false; break; case IDownloaderClient.STATE_DOWNLOADING: iconResource = android.R.drawable.stat_sys_download; stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); ongoingEvent = true; break; case IDownloaderClient.STATE_FETCHING_URL: case IDownloaderClient.STATE_CONNECTING: iconResource = android.R.drawable.stat_sys_download_done; stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); ongoingEvent = true; break; case IDownloaderClient.STATE_COMPLETED: case IDownloaderClient.STATE_PAUSED_BY_REQUEST: iconResource = android.R.drawable.stat_sys_download_done; stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); ongoingEvent = false; break; case IDownloaderClient.STATE_FAILED: case IDownloaderClient.STATE_FAILED_CANCELED: case IDownloaderClient.STATE_FAILED_FETCHING_URL: case IDownloaderClient.STATE_FAILED_SDCARD_FULL: case IDownloaderClient.STATE_FAILED_UNLICENSED: iconResource = android.R.drawable.stat_sys_warning; stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); ongoingEvent = false; break; default: iconResource = android.R.drawable.stat_sys_warning; stringDownloadID = Helpers.getDownloaderStringResourceIDFromState(newState); ongoingEvent = true; break; } mCurrentText = mContext.getString(stringDownloadID); mCurrentTitle = mLabel.toString(); mCurrentNotification.tickerText = mLabel + ": " + mCurrentText; mCurrentNotification.icon = iconResource; mCurrentNotification.setLatestEventInfo(mContext, mCurrentTitle, mCurrentText, mContentIntent); if (ongoingEvent) { mCurrentNotification.flags |= Notification.FLAG_ONGOING_EVENT; } else { mCurrentNotification.flags &= ~Notification.FLAG_ONGOING_EVENT; mCurrentNotification.flags |= Notification.FLAG_AUTO_CANCEL; } mNotificationManager.notify(NOTIFICATION_ID, mCurrentNotification); } } @Override public void onDownloadProgress(DownloadProgressInfo progress) { mProgressInfo = progress; if (null != mClientProxy) { mClientProxy.onDownloadProgress(progress); } if (progress.mOverallTotal <= 0) { // we just show the text mNotification.tickerText = mCurrentTitle; mNotification.icon = android.R.drawable.stat_sys_download; mNotification.setLatestEventInfo(mContext, mLabel, mCurrentText, mContentIntent); mCurrentNotification = mNotification; } else { mCustomNotification.setCurrentBytes(progress.mOverallProgress); mCustomNotification.setTotalBytes(progress.mOverallTotal); mCustomNotification.setIcon(android.R.drawable.stat_sys_download); mCustomNotification.setPendingIntent(mContentIntent); mCustomNotification.setTicker(mLabel + ": " + mCurrentText); mCustomNotification.setTitle(mLabel); mCustomNotification.setTimeRemaining(progress.mTimeRemaining); mCurrentNotification = mCustomNotification.updateNotification(mContext); } mNotificationManager.notify(NOTIFICATION_ID, mCurrentNotification); } public interface ICustomNotification { void setTitle(CharSequence title); void setTicker(CharSequence ticker); void setPendingIntent(PendingIntent mContentIntent); void setTotalBytes(long totalBytes); void setCurrentBytes(long currentBytes); void setIcon(int iconResource); void setTimeRemaining(long timeRemaining); Notification updateNotification(Context c); } /** * Called in response to onClientUpdated. Creates a new proxy and notifies * it of the current state. * * @param msg the client Messenger to notify */ public void setMessenger(Messenger msg) { mClientProxy = DownloaderClientMarshaller.CreateProxy(msg); if (null != mProgressInfo) { mClientProxy.onDownloadProgress(mProgressInfo); } if (mState != -1) { mClientProxy.onDownloadStateChanged(mState); } } /** * Constructor * * @param ctx The context to use to obtain access to the Notification * Service */ DownloadNotification(Context ctx, CharSequence applicationLabel) { mState = -1; mContext = ctx; mLabel = applicationLabel; mNotificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); mCustomNotification = CustomNotificationFactory .createCustomNotification(); mNotification = new Notification(); mCurrentNotification = mNotification; } @Override public void onServiceConnected(Messenger m) { } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/DownloadThread.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; import com.google.android.vending.expansion.downloader.Constants; import com.google.android.vending.expansion.downloader.Helpers; import com.google.android.vending.expansion.downloader.IDownloaderClient; import org.apache.http.Header; import org.apache.http.HttpHost; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.conn.params.ConnRouteParams; import android.content.Context; import android.net.Proxy; import android.os.PowerManager; import android.os.Process; import android.util.Log; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.SyncFailedException; import java.net.URI; import java.net.URISyntaxException; import java.util.Locale; /** * Runs an actual download */ public class DownloadThread { private Context mContext; private DownloadInfo mInfo; private DownloaderService mService; private final DownloadsDB mDB; private final DownloadNotification mNotification; private String mUserAgent; public DownloadThread(DownloadInfo info, DownloaderService service, DownloadNotification notification) { mContext = service; mInfo = info; mService = service; mNotification = notification; mDB = DownloadsDB.getDB(service); mUserAgent = "APKXDL (Linux; U; Android " + android.os.Build.VERSION.RELEASE + ";" + Locale.getDefault().toString() + "; " + android.os.Build.DEVICE + "/" + android.os.Build.ID + ")" + service.getPackageName(); } /** * Returns the default user agent */ private String userAgent() { return mUserAgent; } /** * State for the entire run() method. */ private static class State { public String mFilename; public FileOutputStream mStream; public boolean mCountRetry = false; public int mRetryAfter = 0; public int mRedirectCount = 0; public String mNewUri; public boolean mGotData = false; public String mRequestUri; public State(DownloadInfo info, DownloaderService service) { mRedirectCount = info.mRedirectCount; mRequestUri = info.mUri; mFilename = service.generateTempSaveFileName(info.mFileName); } } /** * State within executeDownload() */ private static class InnerState { public int mBytesSoFar = 0; public int mBytesThisSession = 0; public String mHeaderETag; public boolean mContinuingDownload = false; public String mHeaderContentLength; public String mHeaderContentDisposition; public String mHeaderContentLocation; public int mBytesNotified = 0; public long mTimeLastNotification = 0; } /** * Raised from methods called by run() to indicate that the current request * should be stopped immediately. Note the message passed to this exception * will be logged and therefore must be guaranteed not to contain any PII, * meaning it generally can't include any information about the request URI, * headers, or destination filename. */ private class StopRequest extends Throwable { /** * */ private static final long serialVersionUID = 6338592678988347973L; public int mFinalStatus; public StopRequest(int finalStatus, String message) { super(message); mFinalStatus = finalStatus; } public StopRequest(int finalStatus, String message, Throwable throwable) { super(message, throwable); mFinalStatus = finalStatus; } } /** * Raised from methods called by executeDownload() to indicate that the * download should be retried immediately. */ private class RetryDownload extends Throwable { /** * */ private static final long serialVersionUID = 6196036036517540229L; } /** * Returns the preferred proxy to be used by clients. This is a wrapper * around {@link android.net.Proxy#getHost()}. Currently no proxy will be * returned for localhost or if the active network is Wi-Fi. * * @param context the context which will be passed to * {@link android.net.Proxy#getHost()} * @param url the target URL for the request * @note Calling this method requires permission * android.permission.ACCESS_NETWORK_STATE * @return The preferred proxy to be used by clients, or null if there is no * proxy. */ public HttpHost getPreferredHttpHost(Context context, String url) { if (!isLocalHost(url) && !mService.isWiFi()) { final String proxyHost = Proxy.getHost(context); if (proxyHost != null) { return new HttpHost(proxyHost, Proxy.getPort(context), "http"); } } return null; } static final private boolean isLocalHost(String url) { if (url == null) { return false; } try { final URI uri = URI.create(url); final String host = uri.getHost(); if (host != null) { // TODO: InetAddress.isLoopbackAddress should be used to check // for localhost. However no public factory methods exist which // can be used without triggering DNS lookup if host is not // localhost. if (host.equalsIgnoreCase("localhost") || host.equals("127.0.0.1") || host.equals("[::1]")) { return true; } } } catch (IllegalArgumentException iex) { // Ignore (URI.create) } return false; } /** * Executes the download in a separate thread */ public void run() { Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); State state = new State(mInfo, mService); AndroidHttpClient client = null; PowerManager.WakeLock wakeLock = null; int finalStatus = DownloaderService.STATUS_UNKNOWN_ERROR; try { PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE); wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, Constants.TAG); wakeLock.acquire(); if (Constants.LOGV) { Log.v(Constants.TAG, "initiating download for " + mInfo.mFileName); Log.v(Constants.TAG, " at " + mInfo.mUri); } client = AndroidHttpClient.newInstance(userAgent(), mContext); boolean finished = false; while (!finished) { if (Constants.LOGV) { Log.v(Constants.TAG, "initiating download for " + mInfo.mFileName); Log.v(Constants.TAG, " at " + mInfo.mUri); } // Set or unset proxy, which may have changed since last GET // request. // setDefaultProxy() supports null as proxy parameter. ConnRouteParams.setDefaultProxy(client.getParams(), getPreferredHttpHost(mContext, state.mRequestUri)); HttpGet request = new HttpGet(state.mRequestUri); try { executeDownload(state, client, request); finished = true; } catch (RetryDownload exc) { // fall through } finally { request.abort(); request = null; } } if (Constants.LOGV) { Log.v(Constants.TAG, "download completed for " + mInfo.mFileName); Log.v(Constants.TAG, " at " + mInfo.mUri); } finalizeDestinationFile(state); finalStatus = DownloaderService.STATUS_SUCCESS; } catch (StopRequest error) { // remove the cause before printing, in case it contains PII Log.w(Constants.TAG, "Aborting request for download " + mInfo.mFileName + ": " + error.getMessage()); error.printStackTrace(); finalStatus = error.mFinalStatus; // fall through to finally block } catch (Throwable ex) { // sometimes the socket code throws unchecked // exceptions Log.w(Constants.TAG, "Exception for " + mInfo.mFileName + ": " + ex); finalStatus = DownloaderService.STATUS_UNKNOWN_ERROR; // falls through to the code that reports an error } finally { if (wakeLock != null) { wakeLock.release(); wakeLock = null; } if (client != null) { client.close(); client = null; } cleanupDestination(state, finalStatus); notifyDownloadCompleted(finalStatus, state.mCountRetry, state.mRetryAfter, state.mRedirectCount, state.mGotData, state.mFilename); } } /** * Fully execute a single download request - setup and send the request, * handle the response, and transfer the data to the destination file. */ private void executeDownload(State state, AndroidHttpClient client, HttpGet request) throws StopRequest, RetryDownload { InnerState innerState = new InnerState(); byte data[] = new byte[Constants.BUFFER_SIZE]; checkPausedOrCanceled(state); setupDestinationFile(state, innerState); addRequestHeaders(innerState, request); // check just before sending the request to avoid using an invalid // connection at all checkConnectivity(state); mNotification.onDownloadStateChanged(IDownloaderClient.STATE_CONNECTING); HttpResponse response = sendRequest(state, client, request); handleExceptionalStatus(state, innerState, response); if (Constants.LOGV) { Log.v(Constants.TAG, "received response for " + mInfo.mUri); } processResponseHeaders(state, innerState, response); InputStream entityStream = openResponseEntity(state, response); mNotification.onDownloadStateChanged(IDownloaderClient.STATE_DOWNLOADING); transferData(state, innerState, data, entityStream); } /** * Check if current connectivity is valid for this request. */ private void checkConnectivity(State state) throws StopRequest { switch (mService.getNetworkAvailabilityState(mDB)) { case DownloaderService.NETWORK_OK: return; case DownloaderService.NETWORK_NO_CONNECTION: throw new StopRequest(DownloaderService.STATUS_WAITING_FOR_NETWORK, "waiting for network to return"); case DownloaderService.NETWORK_TYPE_DISALLOWED_BY_REQUESTOR: throw new StopRequest( DownloaderService.STATUS_QUEUED_FOR_WIFI_OR_CELLULAR_PERMISSION, "waiting for wifi or for download over cellular to be authorized"); case DownloaderService.NETWORK_CANNOT_USE_ROAMING: throw new StopRequest(DownloaderService.STATUS_WAITING_FOR_NETWORK, "roaming is not allowed"); case DownloaderService.NETWORK_UNUSABLE_DUE_TO_SIZE: throw new StopRequest(DownloaderService.STATUS_QUEUED_FOR_WIFI, "waiting for wifi"); } } /** * Transfer as much data as possible from the HTTP response to the * destination file. * * @param data buffer to use to read data * @param entityStream stream for reading the HTTP response entity */ private void transferData(State state, InnerState innerState, byte[] data, InputStream entityStream) throws StopRequest { for (;;) { int bytesRead = readFromResponse(state, innerState, data, entityStream); if (bytesRead == -1) { // success, end of stream already reached handleEndOfStream(state, innerState); return; } state.mGotData = true; writeDataToDestination(state, data, bytesRead); innerState.mBytesSoFar += bytesRead; innerState.mBytesThisSession += bytesRead; reportProgress(state, innerState); checkPausedOrCanceled(state); } } /** * Called after a successful completion to take any necessary action on the * downloaded file. */ private void finalizeDestinationFile(State state) throws StopRequest { syncDestination(state); String tempFilename = state.mFilename; String finalFilename = Helpers.generateSaveFileName(mService, mInfo.mFileName); if (!state.mFilename.equals(finalFilename)) { File startFile = new File(tempFilename); File destFile = new File(finalFilename); if (mInfo.mTotalBytes != -1 && mInfo.mCurrentBytes == mInfo.mTotalBytes) { if (!startFile.renameTo(destFile)) { throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, "unable to finalize destination file"); } } else { throw new StopRequest(DownloaderService.STATUS_FILE_DELIVERED_INCORRECTLY, "file delivered with incorrect size. probably due to network not browser configured"); } } } /** * Called just before the thread finishes, regardless of status, to take any * necessary action on the downloaded file. */ private void cleanupDestination(State state, int finalStatus) { closeDestination(state); if (state.mFilename != null && DownloaderService.isStatusError(finalStatus)) { new File(state.mFilename).delete(); state.mFilename = null; } } /** * Sync the destination file to storage. */ private void syncDestination(State state) { FileOutputStream downloadedFileStream = null; try { downloadedFileStream = new FileOutputStream(state.mFilename, true); downloadedFileStream.getFD().sync(); } catch (FileNotFoundException ex) { Log.w(Constants.TAG, "file " + state.mFilename + " not found: " + ex); } catch (SyncFailedException ex) { Log.w(Constants.TAG, "file " + state.mFilename + " sync failed: " + ex); } catch (IOException ex) { Log.w(Constants.TAG, "IOException trying to sync " + state.mFilename + ": " + ex); } catch (RuntimeException ex) { Log.w(Constants.TAG, "exception while syncing file: ", ex); } finally { if (downloadedFileStream != null) { try { downloadedFileStream.close(); } catch (IOException ex) { Log.w(Constants.TAG, "IOException while closing synced file: ", ex); } catch (RuntimeException ex) { Log.w(Constants.TAG, "exception while closing file: ", ex); } } } } /** * Close the destination output stream. */ private void closeDestination(State state) { try { // close the file if (state.mStream != null) { state.mStream.close(); state.mStream = null; } } catch (IOException ex) { if (Constants.LOGV) { Log.v(Constants.TAG, "exception when closing the file after download : " + ex); } // nothing can really be done if the file can't be closed } } /** * Check if the download has been paused or canceled, stopping the request * appropriately if it has been. */ private void checkPausedOrCanceled(State state) throws StopRequest { if (mService.getControl() == DownloaderService.CONTROL_PAUSED) { int status = mService.getStatus(); switch (status) { case DownloaderService.STATUS_PAUSED_BY_APP: throw new StopRequest(mService.getStatus(), "download paused"); } } } /** * Report download progress through the database if necessary. */ private void reportProgress(State state, InnerState innerState) { long now = System.currentTimeMillis(); if (innerState.mBytesSoFar - innerState.mBytesNotified > Constants.MIN_PROGRESS_STEP && now - innerState.mTimeLastNotification > Constants.MIN_PROGRESS_TIME) { // we store progress updates to the database here mInfo.mCurrentBytes = innerState.mBytesSoFar; mDB.updateDownloadCurrentBytes(mInfo); innerState.mBytesNotified = innerState.mBytesSoFar; innerState.mTimeLastNotification = now; long totalBytesSoFar = innerState.mBytesThisSession + mService.mBytesSoFar; if (Constants.LOGVV) { Log.v(Constants.TAG, "downloaded " + mInfo.mCurrentBytes + " out of " + mInfo.mTotalBytes); Log.v(Constants.TAG, " total " + totalBytesSoFar + " out of " + mService.mTotalLength); } mService.notifyUpdateBytes(totalBytesSoFar); } } /** * Write a data buffer to the destination file. * * @param data buffer containing the data to write * @param bytesRead how many bytes to write from the buffer */ private void writeDataToDestination(State state, byte[] data, int bytesRead) throws StopRequest { for (;;) { try { if (state.mStream == null) { state.mStream = new FileOutputStream(state.mFilename, true); } state.mStream.write(data, 0, bytesRead); // we close after every write --- this may be too inefficient closeDestination(state); return; } catch (IOException ex) { if (!Helpers.isExternalMediaMounted()) { throw new StopRequest(DownloaderService.STATUS_DEVICE_NOT_FOUND_ERROR, "external media not mounted while writing destination file"); } long availableBytes = Helpers.getAvailableBytes(Helpers.getFilesystemRoot(state.mFilename)); if (availableBytes < bytesRead) { throw new StopRequest(DownloaderService.STATUS_INSUFFICIENT_SPACE_ERROR, "insufficient space while writing destination file", ex); } throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, "while writing destination file: " + ex.toString(), ex); } } } /** * Called when we've reached the end of the HTTP response stream, to update * the database and check for consistency. */ private void handleEndOfStream(State state, InnerState innerState) throws StopRequest { mInfo.mCurrentBytes = innerState.mBytesSoFar; // this should always be set from the market // if ( innerState.mHeaderContentLength == null ) { // mInfo.mTotalBytes = innerState.mBytesSoFar; // } mDB.updateDownload(mInfo); boolean lengthMismatched = (innerState.mHeaderContentLength != null) && (innerState.mBytesSoFar != Integer.parseInt(innerState.mHeaderContentLength)); if (lengthMismatched) { if (cannotResume(innerState)) { throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME, "mismatched content length"); } else { throw new StopRequest(getFinalStatusForHttpError(state), "closed socket before end of file"); } } } private boolean cannotResume(InnerState innerState) { return innerState.mBytesSoFar > 0 && innerState.mHeaderETag == null; } /** * Read some data from the HTTP response stream, handling I/O errors. * * @param data buffer to use to read data * @param entityStream stream for reading the HTTP response entity * @return the number of bytes actually read or -1 if the end of the stream * has been reached */ private int readFromResponse(State state, InnerState innerState, byte[] data, InputStream entityStream) throws StopRequest { try { return entityStream.read(data); } catch (IOException ex) { logNetworkState(); mInfo.mCurrentBytes = innerState.mBytesSoFar; mDB.updateDownload(mInfo); if (cannotResume(innerState)) { String message = "while reading response: " + ex.toString() + ", can't resume interrupted download with no ETag"; throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME, message, ex); } else { throw new StopRequest(getFinalStatusForHttpError(state), "while reading response: " + ex.toString(), ex); } } } /** * Open a stream for the HTTP response entity, handling I/O errors. * * @return an InputStream to read the response entity */ private InputStream openResponseEntity(State state, HttpResponse response) throws StopRequest { try { return response.getEntity().getContent(); } catch (IOException ex) { logNetworkState(); throw new StopRequest(getFinalStatusForHttpError(state), "while getting entity: " + ex.toString(), ex); } } private void logNetworkState() { if (Constants.LOGX) { Log.i(Constants.TAG, "Net " + (mService.getNetworkAvailabilityState(mDB) == DownloaderService.NETWORK_OK ? "Up" : "Down")); } } /** * Read HTTP response headers and take appropriate action, including setting * up the destination file and updating the database. */ private void processResponseHeaders(State state, InnerState innerState, HttpResponse response) throws StopRequest { if (innerState.mContinuingDownload) { // ignore response headers on resume requests return; } readResponseHeaders(state, innerState, response); try { state.mFilename = mService.generateSaveFile(mInfo.mFileName, mInfo.mTotalBytes); } catch (DownloaderService.GenerateSaveFileError exc) { throw new StopRequest(exc.mStatus, exc.mMessage); } try { state.mStream = new FileOutputStream(state.mFilename); } catch (FileNotFoundException exc) { // make sure the directory exists File pathFile = new File(Helpers.getSaveFilePath(mService)); try { if (pathFile.mkdirs()) { state.mStream = new FileOutputStream(state.mFilename); } } catch (Exception ex) { throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, "while opening destination file: " + exc.toString(), exc); } } if (Constants.LOGV) { Log.v(Constants.TAG, "writing " + mInfo.mUri + " to " + state.mFilename); } updateDatabaseFromHeaders(state, innerState); // check connectivity again now that we know the total size checkConnectivity(state); } /** * Update necessary database fields based on values of HTTP response headers * that have been read. */ private void updateDatabaseFromHeaders(State state, InnerState innerState) { mInfo.mETag = innerState.mHeaderETag; mDB.updateDownload(mInfo); } /** * Read headers from the HTTP response and store them into local state. */ private void readResponseHeaders(State state, InnerState innerState, HttpResponse response) throws StopRequest { Header header = response.getFirstHeader("Content-Disposition"); if (header != null) { innerState.mHeaderContentDisposition = header.getValue(); } header = response.getFirstHeader("Content-Location"); if (header != null) { innerState.mHeaderContentLocation = header.getValue(); } header = response.getFirstHeader("ETag"); if (header != null) { innerState.mHeaderETag = header.getValue(); } String headerTransferEncoding = null; header = response.getFirstHeader("Transfer-Encoding"); if (header != null) { headerTransferEncoding = header.getValue(); } String headerContentType = null; header = response.getFirstHeader("Content-Type"); if (header != null) { headerContentType = header.getValue(); if (!headerContentType.equals("application/vnd.android.obb")) { throw new StopRequest(DownloaderService.STATUS_FILE_DELIVERED_INCORRECTLY, "file delivered with incorrect Mime type"); } } if (headerTransferEncoding == null) { header = response.getFirstHeader("Content-Length"); if (header != null) { innerState.mHeaderContentLength = header.getValue(); // this is always set from Market long contentLength = Long.parseLong(innerState.mHeaderContentLength); if (contentLength != -1 && contentLength != mInfo.mTotalBytes) { // we're most likely on a bad wifi connection -- we should // probably // also look at the mime type --- but the size mismatch is // enough // to tell us that something is wrong here Log.e(Constants.TAG, "Incorrect file size delivered."); } } } else { // Ignore content-length with transfer-encoding - 2616 4.4 3 if (Constants.LOGVV) { Log.v(Constants.TAG, "ignoring content-length because of xfer-encoding"); } } if (Constants.LOGVV) { Log.v(Constants.TAG, "Content-Disposition: " + innerState.mHeaderContentDisposition); Log.v(Constants.TAG, "Content-Length: " + innerState.mHeaderContentLength); Log.v(Constants.TAG, "Content-Location: " + innerState.mHeaderContentLocation); Log.v(Constants.TAG, "ETag: " + innerState.mHeaderETag); Log.v(Constants.TAG, "Transfer-Encoding: " + headerTransferEncoding); } boolean noSizeInfo = innerState.mHeaderContentLength == null && (headerTransferEncoding == null || !headerTransferEncoding.equalsIgnoreCase("chunked")); if (noSizeInfo) { throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR, "can't know size of download, giving up"); } } /** * Check the HTTP response status and handle anything unusual (e.g. not * 200/206). */ private void handleExceptionalStatus(State state, InnerState innerState, HttpResponse response) throws StopRequest, RetryDownload { int statusCode = response.getStatusLine().getStatusCode(); if (statusCode == 503 && mInfo.mNumFailed < Constants.MAX_RETRIES) { handleServiceUnavailable(state, response); } if (statusCode == 301 || statusCode == 302 || statusCode == 303 || statusCode == 307) { handleRedirect(state, response, statusCode); } int expectedStatus = innerState.mContinuingDownload ? 206 : DownloaderService.STATUS_SUCCESS; if (statusCode != expectedStatus) { handleOtherStatus(state, innerState, statusCode); } else { // no longer redirected state.mRedirectCount = 0; } } /** * Handle a status that we don't know how to deal with properly. */ private void handleOtherStatus(State state, InnerState innerState, int statusCode) throws StopRequest { int finalStatus; if (DownloaderService.isStatusError(statusCode)) { finalStatus = statusCode; } else if (statusCode >= 300 && statusCode < 400) { finalStatus = DownloaderService.STATUS_UNHANDLED_REDIRECT; } else if (innerState.mContinuingDownload && statusCode == DownloaderService.STATUS_SUCCESS) { finalStatus = DownloaderService.STATUS_CANNOT_RESUME; } else { finalStatus = DownloaderService.STATUS_UNHANDLED_HTTP_CODE; } throw new StopRequest(finalStatus, "http error " + statusCode); } /** * Handle a 3xx redirect status. */ private void handleRedirect(State state, HttpResponse response, int statusCode) throws StopRequest, RetryDownload { if (Constants.LOGVV) { Log.v(Constants.TAG, "got HTTP redirect " + statusCode); } if (state.mRedirectCount >= Constants.MAX_REDIRECTS) { throw new StopRequest(DownloaderService.STATUS_TOO_MANY_REDIRECTS, "too many redirects"); } Header header = response.getFirstHeader("Location"); if (header == null) { return; } if (Constants.LOGVV) { Log.v(Constants.TAG, "Location :" + header.getValue()); } String newUri; try { newUri = new URI(mInfo.mUri).resolve(new URI(header.getValue())).toString(); } catch (URISyntaxException ex) { if (Constants.LOGV) { Log.d(Constants.TAG, "Couldn't resolve redirect URI " + header.getValue() + " for " + mInfo.mUri); } throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR, "Couldn't resolve redirect URI"); } ++state.mRedirectCount; state.mRequestUri = newUri; if (statusCode == 301 || statusCode == 303) { // use the new URI for all future requests (should a retry/resume be // necessary) state.mNewUri = newUri; } throw new RetryDownload(); } /** * Add headers for this download to the HTTP request to allow for resume. */ private void addRequestHeaders(InnerState innerState, HttpGet request) { if (innerState.mContinuingDownload) { if (innerState.mHeaderETag != null) { request.addHeader("If-Match", innerState.mHeaderETag); } request.addHeader("Range", "bytes=" + innerState.mBytesSoFar + "-"); } } /** * Handle a 503 Service Unavailable status by processing the Retry-After * header. */ private void handleServiceUnavailable(State state, HttpResponse response) throws StopRequest { if (Constants.LOGVV) { Log.v(Constants.TAG, "got HTTP response code 503"); } state.mCountRetry = true; Header header = response.getFirstHeader("Retry-After"); if (header != null) { try { if (Constants.LOGVV) { Log.v(Constants.TAG, "Retry-After :" + header.getValue()); } state.mRetryAfter = Integer.parseInt(header.getValue()); if (state.mRetryAfter < 0) { state.mRetryAfter = 0; } else { if (state.mRetryAfter < Constants.MIN_RETRY_AFTER) { state.mRetryAfter = Constants.MIN_RETRY_AFTER; } else if (state.mRetryAfter > Constants.MAX_RETRY_AFTER) { state.mRetryAfter = Constants.MAX_RETRY_AFTER; } state.mRetryAfter += Helpers.sRandom.nextInt(Constants.MIN_RETRY_AFTER + 1); state.mRetryAfter *= 1000; } } catch (NumberFormatException ex) { // ignored - retryAfter stays 0 in this case. } } throw new StopRequest(DownloaderService.STATUS_WAITING_TO_RETRY, "got 503 Service Unavailable, will retry later"); } /** * Send the request to the server, handling any I/O exceptions. */ private HttpResponse sendRequest(State state, AndroidHttpClient client, HttpGet request) throws StopRequest { try { return client.execute(request); } catch (IllegalArgumentException ex) { throw new StopRequest(DownloaderService.STATUS_HTTP_DATA_ERROR, "while trying to execute request: " + ex.toString(), ex); } catch (IOException ex) { logNetworkState(); throw new StopRequest(getFinalStatusForHttpError(state), "while trying to execute request: " + ex.toString(), ex); } } private int getFinalStatusForHttpError(State state) { if (mService.getNetworkAvailabilityState(mDB) != DownloaderService.NETWORK_OK) { return DownloaderService.STATUS_WAITING_FOR_NETWORK; } else if (mInfo.mNumFailed < Constants.MAX_RETRIES) { state.mCountRetry = true; return DownloaderService.STATUS_WAITING_TO_RETRY; } else { Log.w(Constants.TAG, "reached max retries for " + mInfo.mNumFailed); return DownloaderService.STATUS_HTTP_DATA_ERROR; } } /** * Prepare the destination file to receive data. If the file already exists, * we'll set up appropriately for resumption. */ private void setupDestinationFile(State state, InnerState innerState) throws StopRequest { if (state.mFilename != null) { // only true if we've already run a // thread for this download if (!Helpers.isFilenameValid(state.mFilename)) { // this should never happen throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, "found invalid internal destination filename"); } // We're resuming a download that got interrupted File f = new File(state.mFilename); if (f.exists()) { long fileLength = f.length(); if (fileLength == 0) { // The download hadn't actually started, we can restart from // scratch f.delete(); state.mFilename = null; } else if (mInfo.mETag == null) { // This should've been caught upon failure f.delete(); throw new StopRequest(DownloaderService.STATUS_CANNOT_RESUME, "Trying to resume a download that can't be resumed"); } else { // All right, we'll be able to resume this download try { state.mStream = new FileOutputStream(state.mFilename, true); } catch (FileNotFoundException exc) { throw new StopRequest(DownloaderService.STATUS_FILE_ERROR, "while opening destination for resuming: " + exc.toString(), exc); } innerState.mBytesSoFar = (int) fileLength; if (mInfo.mTotalBytes != -1) { innerState.mHeaderContentLength = Long.toString(mInfo.mTotalBytes); } innerState.mHeaderETag = mInfo.mETag; innerState.mContinuingDownload = true; } } } if (state.mStream != null) { closeDestination(state); } } /** * Stores information about the completed download, and notifies the * initiating application. */ private void notifyDownloadCompleted( int status, boolean countRetry, int retryAfter, int redirectCount, boolean gotData, String filename) { updateDownloadDatabase( status, countRetry, retryAfter, redirectCount, gotData, filename); if (DownloaderService.isStatusCompleted(status)) { // TBD: send status update? } } private void updateDownloadDatabase( int status, boolean countRetry, int retryAfter, int redirectCount, boolean gotData, String filename) { mInfo.mStatus = status; mInfo.mRetryAfter = retryAfter; mInfo.mRedirectCount = redirectCount; mInfo.mLastMod = System.currentTimeMillis(); if (!countRetry) { mInfo.mNumFailed = 0; } else if (gotData) { mInfo.mNumFailed = 1; } else { mInfo.mNumFailed++; } mDB.updateDownload(mInfo); } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/DownloaderService.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; import com.google.android.vending.expansion.downloader.Constants; import com.google.android.vending.expansion.downloader.DownloadProgressInfo; import com.google.android.vending.expansion.downloader.DownloaderServiceMarshaller; import com.google.android.vending.expansion.downloader.Helpers; import com.google.android.vending.expansion.downloader.IDownloaderClient; import com.google.android.vending.expansion.downloader.IDownloaderService; import com.google.android.vending.expansion.downloader.IStub; import com.google.android.vending.licensing.AESObfuscator; import com.google.android.vending.licensing.APKExpansionPolicy; import com.google.android.vending.licensing.LicenseChecker; import com.google.android.vending.licensing.LicenseCheckerCallback; import com.google.android.vending.licensing.Policy; import android.app.AlarmManager; import android.app.PendingIntent; import android.app.Service; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.wifi.WifiManager; import android.os.Handler; import android.os.IBinder; import android.os.Messenger; import android.os.SystemClock; import android.provider.Settings.Secure; import android.telephony.TelephonyManager; import android.util.Log; import java.io.File; /** * Performs the background downloads requested by applications that use the * Downloads provider. This service does not run as a foreground task, so * Android may kill it off at will, but it will try to restart itself if it can. * Note that Android by default will kill off any process that has an open file * handle on the shared (SD Card) partition if the partition is unmounted. */ public abstract class DownloaderService extends CustomIntentService implements IDownloaderService { public DownloaderService() { super("LVLDownloadService"); } private static final String LOG_TAG = "LVLDL"; // the following NETWORK_* constants are used to indicates specific reasons // for disallowing a // download from using a network, since specific causes can require special // handling /** * The network is usable for the given download. */ public static final int NETWORK_OK = 1; /** * There is no network connectivity. */ public static final int NETWORK_NO_CONNECTION = 2; /** * The download exceeds the maximum size for this network. */ public static final int NETWORK_UNUSABLE_DUE_TO_SIZE = 3; /** * The download exceeds the recommended maximum size for this network, the * user must confirm for this download to proceed without WiFi. */ public static final int NETWORK_RECOMMENDED_UNUSABLE_DUE_TO_SIZE = 4; /** * The current connection is roaming, and the download can't proceed over a * roaming connection. */ public static final int NETWORK_CANNOT_USE_ROAMING = 5; /** * The app requesting the download specific that it can't use the current * network connection. */ public static final int NETWORK_TYPE_DISALLOWED_BY_REQUESTOR = 6; /** * For intents used to notify the user that a download exceeds a size * threshold, if this extra is true, WiFi is required for this download * size; otherwise, it is only recommended. */ public static final String EXTRA_IS_WIFI_REQUIRED = "isWifiRequired"; public static final String EXTRA_FILE_NAME = "downloadId"; /** * Used with DOWNLOAD_STATUS */ public static final String EXTRA_STATUS_STATE = "ESS"; public static final String EXTRA_STATUS_TOTAL_SIZE = "ETS"; public static final String EXTRA_STATUS_CURRENT_FILE_SIZE = "CFS"; public static final String EXTRA_STATUS_TOTAL_PROGRESS = "TFP"; public static final String EXTRA_STATUS_CURRENT_PROGRESS = "CFP"; public static final String ACTION_DOWNLOADS_CHANGED = "downloadsChanged"; /** * Broadcast intent action sent by the download manager when a download * completes. */ public final static String ACTION_DOWNLOAD_COMPLETE = "lvldownloader.intent.action.DOWNLOAD_COMPLETE"; /** * Broadcast intent action sent by the download manager when download status * changes. */ public final static String ACTION_DOWNLOAD_STATUS = "lvldownloader.intent.action.DOWNLOAD_STATUS"; /* * Lists the states that the download manager can set on a download to * notify applications of the download progress. The codes follow the HTTP * families:
1xx: informational
2xx: success
3xx: redirects (not * used by the download manager)
4xx: client errors
5xx: server * errors */ /** * Returns whether the status is informational (i.e. 1xx). */ public static boolean isStatusInformational(int status) { return (status >= 100 && status < 200); } /** * Returns whether the status is a success (i.e. 2xx). */ public static boolean isStatusSuccess(int status) { return (status >= 200 && status < 300); } /** * Returns whether the status is an error (i.e. 4xx or 5xx). */ public static boolean isStatusError(int status) { return (status >= 400 && status < 600); } /** * Returns whether the status is a client error (i.e. 4xx). */ public static boolean isStatusClientError(int status) { return (status >= 400 && status < 500); } /** * Returns whether the status is a server error (i.e. 5xx). */ public static boolean isStatusServerError(int status) { return (status >= 500 && status < 600); } /** * Returns whether the download has completed (either with success or * error). */ public static boolean isStatusCompleted(int status) { return (status >= 200 && status < 300) || (status >= 400 && status < 600); } /** * This download hasn't stated yet */ public static final int STATUS_PENDING = 190; /** * This download has started */ public static final int STATUS_RUNNING = 192; /** * This download has been paused by the owning app. */ public static final int STATUS_PAUSED_BY_APP = 193; /** * This download encountered some network error and is waiting before * retrying the request. */ public static final int STATUS_WAITING_TO_RETRY = 194; /** * This download is waiting for network connectivity to proceed. */ public static final int STATUS_WAITING_FOR_NETWORK = 195; /** * This download is waiting for a Wi-Fi connection to proceed or for * permission to download over cellular. */ public static final int STATUS_QUEUED_FOR_WIFI_OR_CELLULAR_PERMISSION = 196; /** * This download is waiting for a Wi-Fi connection to proceed. */ public static final int STATUS_QUEUED_FOR_WIFI = 197; /** * This download has successfully completed. Warning: there might be other * status values that indicate success in the future. Use isSucccess() to * capture the entire category. * * @hide */ public static final int STATUS_SUCCESS = 200; /** * The requested URL is no longer available */ public static final int STATUS_FORBIDDEN = 403; /** * The file was delivered incorrectly */ public static final int STATUS_FILE_DELIVERED_INCORRECTLY = 487; /** * The requested destination file already exists. */ public static final int STATUS_FILE_ALREADY_EXISTS_ERROR = 488; /** * Some possibly transient error occurred, but we can't resume the download. */ public static final int STATUS_CANNOT_RESUME = 489; /** * This download was canceled * * @hide */ public static final int STATUS_CANCELED = 490; /** * This download has completed with an error. Warning: there will be other * status values that indicate errors in the future. Use isStatusError() to * capture the entire category. */ public static final int STATUS_UNKNOWN_ERROR = 491; /** * This download couldn't be completed because of a storage issue. * Typically, that's because the filesystem is missing or full. Use the more * specific {@link #STATUS_INSUFFICIENT_SPACE_ERROR} and * {@link #STATUS_DEVICE_NOT_FOUND_ERROR} when appropriate. * * @hide */ public static final int STATUS_FILE_ERROR = 492; /** * This download couldn't be completed because of an HTTP redirect response * that the download manager couldn't handle. * * @hide */ public static final int STATUS_UNHANDLED_REDIRECT = 493; /** * This download couldn't be completed because of an unspecified unhandled * HTTP code. * * @hide */ public static final int STATUS_UNHANDLED_HTTP_CODE = 494; /** * This download couldn't be completed because of an error receiving or * processing data at the HTTP level. * * @hide */ public static final int STATUS_HTTP_DATA_ERROR = 495; /** * This download couldn't be completed because of an HttpException while * setting up the request. * * @hide */ public static final int STATUS_HTTP_EXCEPTION = 496; /** * This download couldn't be completed because there were too many * redirects. * * @hide */ public static final int STATUS_TOO_MANY_REDIRECTS = 497; /** * This download couldn't be completed due to insufficient storage space. * Typically, this is because the SD card is full. * * @hide */ public static final int STATUS_INSUFFICIENT_SPACE_ERROR = 498; /** * This download couldn't be completed because no external storage device * was found. Typically, this is because the SD card is not mounted. * * @hide */ public static final int STATUS_DEVICE_NOT_FOUND_ERROR = 499; /** * This download is allowed to run. * * @hide */ public static final int CONTROL_RUN = 0; /** * This download must pause at the first opportunity. * * @hide */ public static final int CONTROL_PAUSED = 1; /** * This download is visible but only shows in the notifications while it's * in progress. * * @hide */ public static final int VISIBILITY_VISIBLE = 0; /** * This download is visible and shows in the notifications while in progress * and after completion. * * @hide */ public static final int VISIBILITY_VISIBLE_NOTIFY_COMPLETED = 1; /** * This download doesn't show in the UI or in the notifications. * * @hide */ public static final int VISIBILITY_HIDDEN = 2; /** * Bit flag for {@link #setAllowedNetworkTypes} corresponding to * {@link ConnectivityManager#TYPE_MOBILE}. */ public static final int NETWORK_MOBILE = 1 << 0; /** * Bit flag for {@link #setAllowedNetworkTypes} corresponding to * {@link ConnectivityManager#TYPE_WIFI}. */ public static final int NETWORK_WIFI = 1 << 1; private final static String TEMP_EXT = ".tmp"; /** * Service thread status */ private static boolean sIsRunning; @Override public IBinder onBind(Intent paramIntent) { Log.d(Constants.TAG, "Service Bound"); return this.mServiceMessenger.getBinder(); } /** * Network state. */ private boolean mIsConnected; private boolean mIsFailover; private boolean mIsCellularConnection; private boolean mIsRoaming; private boolean mIsAtLeast3G; private boolean mIsAtLeast4G; private boolean mStateChanged; /** * Download state */ private int mControl; private int mStatus; public boolean isWiFi() { return mIsConnected && !mIsCellularConnection; } /** * Bindings to important services */ private ConnectivityManager mConnectivityManager; private WifiManager mWifiManager; /** * Package we are downloading for (defaults to package of application) */ private PackageInfo mPackageInfo; /** * Byte counts */ long mBytesSoFar; long mTotalLength; int mFileCount; /** * Used for calculating time remaining and speed */ long mBytesAtSample; long mMillisecondsAtSample; float mAverageDownloadSpeed; /** * Our binding to the network state broadcasts */ private BroadcastReceiver mConnReceiver; final private IStub mServiceStub = DownloaderServiceMarshaller.CreateStub(this); final private Messenger mServiceMessenger = mServiceStub.getMessenger(); private Messenger mClientMessenger; private DownloadNotification mNotification; private PendingIntent mPendingIntent; private PendingIntent mAlarmIntent; /** * Updates the network type based upon the type and subtype returned from * the connectivity manager. Subtype is only used for cellular signals. * * @param type * @param subType */ private void updateNetworkType(int type, int subType) { switch (type) { case ConnectivityManager.TYPE_WIFI: case ConnectivityManager.TYPE_ETHERNET: case ConnectivityManager.TYPE_BLUETOOTH: mIsCellularConnection = false; mIsAtLeast3G = false; mIsAtLeast4G = false; break; case ConnectivityManager.TYPE_WIMAX: mIsCellularConnection = true; mIsAtLeast3G = true; mIsAtLeast4G = true; break; case ConnectivityManager.TYPE_MOBILE: mIsCellularConnection = true; switch (subType) { case TelephonyManager.NETWORK_TYPE_1xRTT: case TelephonyManager.NETWORK_TYPE_CDMA: case TelephonyManager.NETWORK_TYPE_EDGE: case TelephonyManager.NETWORK_TYPE_GPRS: case TelephonyManager.NETWORK_TYPE_IDEN: mIsAtLeast3G = false; mIsAtLeast4G = false; break; case TelephonyManager.NETWORK_TYPE_HSDPA: case TelephonyManager.NETWORK_TYPE_HSUPA: case TelephonyManager.NETWORK_TYPE_HSPA: case TelephonyManager.NETWORK_TYPE_EVDO_0: case TelephonyManager.NETWORK_TYPE_EVDO_A: case TelephonyManager.NETWORK_TYPE_UMTS: mIsAtLeast3G = true; mIsAtLeast4G = false; break; case TelephonyManager.NETWORK_TYPE_LTE: // 4G case TelephonyManager.NETWORK_TYPE_EHRPD: // 3G ++ interop // with 4G case TelephonyManager.NETWORK_TYPE_HSPAP: // 3G ++ but // marketed as // 4G mIsAtLeast3G = true; mIsAtLeast4G = true; break; default: mIsCellularConnection = false; mIsAtLeast3G = false; mIsAtLeast4G = false; } } } private void updateNetworkState(NetworkInfo info) { boolean isConnected = mIsConnected; boolean isFailover = mIsFailover; boolean isCellularConnection = mIsCellularConnection; boolean isRoaming = mIsRoaming; boolean isAtLeast3G = mIsAtLeast3G; if (null != info) { mIsRoaming = info.isRoaming(); mIsFailover = info.isFailover(); mIsConnected = info.isConnected(); updateNetworkType(info.getType(), info.getSubtype()); } else { mIsRoaming = false; mIsFailover = false; mIsConnected = false; updateNetworkType(-1, -1); } mStateChanged = (mStateChanged || isConnected != mIsConnected || isFailover != mIsFailover || isCellularConnection != mIsCellularConnection || isRoaming != mIsRoaming || isAtLeast3G != mIsAtLeast3G); if (Constants.LOGVV) { if (mStateChanged) { Log.v(LOG_TAG, "Network state changed: "); Log.v(LOG_TAG, "Starting State: " + (isConnected ? "Connected " : "Not Connected ") + (isCellularConnection ? "Cellular " : "WiFi ") + (isRoaming ? "Roaming " : "Local ") + (isAtLeast3G ? "3G+ " : "<3G ")); Log.v(LOG_TAG, "Ending State: " + (mIsConnected ? "Connected " : "Not Connected ") + (mIsCellularConnection ? "Cellular " : "WiFi ") + (mIsRoaming ? "Roaming " : "Local ") + (mIsAtLeast3G ? "3G+ " : "<3G ")); if (isServiceRunning()) { if (mIsRoaming) { mStatus = STATUS_WAITING_FOR_NETWORK; mControl = CONTROL_PAUSED; } else if (mIsCellularConnection) { DownloadsDB db = DownloadsDB.getDB(this); int flags = db.getFlags(); if (0 == (flags & FLAGS_DOWNLOAD_OVER_CELLULAR)) { mStatus = STATUS_QUEUED_FOR_WIFI; mControl = CONTROL_PAUSED; } } } } } } /** * Polls the network state, setting the flags appropriately. */ void pollNetworkState() { if (null == mConnectivityManager) { mConnectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); } if (null == mWifiManager) { mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE); } if (mConnectivityManager == null) { Log.w(Constants.TAG, "couldn't get connectivity manager to poll network state"); } else { NetworkInfo activeInfo = mConnectivityManager .getActiveNetworkInfo(); updateNetworkState(activeInfo); } } public static final int NO_DOWNLOAD_REQUIRED = 0; public static final int LVL_CHECK_REQUIRED = 1; public static final int DOWNLOAD_REQUIRED = 2; public static final String EXTRA_PACKAGE_NAME = "EPN"; public static final String EXTRA_PENDING_INTENT = "EPI"; public static final String EXTRA_MESSAGE_HANDLER = "EMH"; /** * Returns true if the LVL check is required * * @param db a downloads DB synchronized with the latest state * @param pi the package info for the project * @return returns true if the filenames need to be returned */ private static boolean isLVLCheckRequired(DownloadsDB db, PackageInfo pi) { // we need to update the LVL check and get a successful status to // proceed if (db.mVersionCode != pi.versionCode) { return true; } return false; } /** * Careful! Only use this internally. * * @return whether we think the service is running */ private static synchronized boolean isServiceRunning() { return sIsRunning; } private static synchronized void setServiceRunning(boolean isRunning) { sIsRunning = isRunning; } public static int startDownloadServiceIfRequired(Context context, Intent intent, Class serviceClass) throws NameNotFoundException { final PendingIntent pendingIntent = (PendingIntent) intent .getParcelableExtra(EXTRA_PENDING_INTENT); return startDownloadServiceIfRequired(context, pendingIntent, serviceClass); } public static int startDownloadServiceIfRequired(Context context, PendingIntent pendingIntent, Class serviceClass) throws NameNotFoundException { String packageName = context.getPackageName(); String className = serviceClass.getName(); return startDownloadServiceIfRequired(context, pendingIntent, packageName, className); } /** * Starts the download if necessary. This function starts a flow that does ` * many things. 1) Checks to see if the APK version has been checked and the * metadata database updated 2) If the APK version does not match, checks * the new LVL status to see if a new download is required 3) If the APK * version does match, then checks to see if the download(s) have been * completed 4) If the downloads have been completed, returns * NO_DOWNLOAD_REQUIRED The idea is that this can be called during the * startup of an application to quickly ascertain if the application needs * to wait to hear about any updated APK expansion files. Note that this * does mean that the application MUST be run for the first time with a * network connection, even if Market delivers all of the files. * * @param context * @param thisIntent * @return true if the app should wait for more guidance from the * downloader, false if the app can continue * @throws NameNotFoundException */ public static int startDownloadServiceIfRequired(Context context, PendingIntent pendingIntent, String classPackage, String className) throws NameNotFoundException { // first: do we need to do an LVL update? // we begin by getting our APK version from the package manager final PackageInfo pi = context.getPackageManager().getPackageInfo( context.getPackageName(), 0); int status = NO_DOWNLOAD_REQUIRED; // the database automatically reads the metadata for version code // and download status when the instance is created DownloadsDB db = DownloadsDB.getDB(context); // we need to update the LVL check and get a successful status to // proceed if (isLVLCheckRequired(db, pi)) { status = LVL_CHECK_REQUIRED; } // we don't have to update LVL. do we still have a download to start? if (db.mStatus == 0) { DownloadInfo[] infos = db.getDownloads(); if (null != infos) { for (DownloadInfo info : infos) { if (!Helpers.doesFileExist(context, info.mFileName, info.mTotalBytes, true)) { status = DOWNLOAD_REQUIRED; db.updateStatus(-1); break; } } } } else { status = DOWNLOAD_REQUIRED; } switch (status) { case DOWNLOAD_REQUIRED: case LVL_CHECK_REQUIRED: Intent fileIntent = new Intent(); fileIntent.setClassName(classPackage, className); fileIntent.putExtra(EXTRA_PENDING_INTENT, pendingIntent); context.startService(fileIntent); break; } return status; } @Override public void requestAbortDownload() { mControl = CONTROL_PAUSED; mStatus = STATUS_CANCELED; } @Override public void requestPauseDownload() { mControl = CONTROL_PAUSED; mStatus = STATUS_PAUSED_BY_APP; } @Override public void setDownloadFlags(int flags) { DownloadsDB.getDB(this).updateFlags(flags); } @Override public void requestContinueDownload() { if (mControl == CONTROL_PAUSED) { mControl = CONTROL_RUN; } Intent fileIntent = new Intent(this, this.getClass()); fileIntent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent); this.startService(fileIntent); } public abstract String getPublicKey(); public abstract byte[] getSALT(); public abstract String getAlarmReceiverClassName(); private class LVLRunnable implements Runnable { LVLRunnable(Context context, PendingIntent intent) { mContext = context; mPendingIntent = intent; } final Context mContext; @Override public void run() { setServiceRunning(true); mNotification.onDownloadStateChanged(IDownloaderClient.STATE_FETCHING_URL); String deviceId = Secure.getString(mContext.getContentResolver(), Secure.ANDROID_ID); final APKExpansionPolicy aep = new APKExpansionPolicy(mContext, new AESObfuscator(getSALT(), mContext.getPackageName(), deviceId)); // reset our policy back to the start of the world to force a // re-check aep.resetPolicy(); // let's try and get the OBB file from LVL first // Construct the LicenseChecker with a Policy. final LicenseChecker checker = new LicenseChecker(mContext, aep, getPublicKey() // Your public licensing key. ); checker.checkAccess(new LicenseCheckerCallback() { @Override public void allow(int reason) { try { int count = aep.getExpansionURLCount(); DownloadsDB db = DownloadsDB.getDB(mContext); int status = 0; if (count != 0) { for (int i = 0; i < count; i++) { String currentFileName = aep .getExpansionFileName(i); if (null != currentFileName) { DownloadInfo di = new DownloadInfo(i, currentFileName, mContext.getPackageName()); long fileSize = aep.getExpansionFileSize(i); if (handleFileUpdated(db, i, currentFileName, fileSize)) { status |= -1; di.resetDownload(); di.mUri = aep.getExpansionURL(i); di.mTotalBytes = fileSize; di.mStatus = status; db.updateDownload(di); } else { // we need to read the download // information // from // the database DownloadInfo dbdi = db .getDownloadInfoByFileName(di.mFileName); if (null == dbdi) { // the file exists already and is // the // correct size // was delivered by Market or // through // another mechanism Log.d(LOG_TAG, "file " + di.mFileName + " found. Not downloading."); di.mStatus = STATUS_SUCCESS; di.mTotalBytes = fileSize; di.mCurrentBytes = fileSize; di.mUri = aep.getExpansionURL(i); db.updateDownload(di); } else if (dbdi.mStatus != STATUS_SUCCESS) { // we just update the URL dbdi.mUri = aep.getExpansionURL(i); db.updateDownload(dbdi); status |= -1; } } } } } // first: do we need to do an LVL update? // we begin by getting our APK version from the package // manager PackageInfo pi; try { pi = mContext.getPackageManager().getPackageInfo( mContext.getPackageName(), 0); db.updateMetadata(pi.versionCode, status); Class serviceClass = DownloaderService.this.getClass(); switch (startDownloadServiceIfRequired(mContext, mPendingIntent, serviceClass)) { case NO_DOWNLOAD_REQUIRED: mNotification .onDownloadStateChanged(IDownloaderClient.STATE_COMPLETED); break; case LVL_CHECK_REQUIRED: // DANGER WILL ROBINSON! Log.e(LOG_TAG, "In LVL checking loop!"); mNotification .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_UNLICENSED); throw new RuntimeException( "Error with LVL checking and database integrity"); case DOWNLOAD_REQUIRED: // do nothing. the download will notify the // application // when things are done break; } } catch (NameNotFoundException e1) { e1.printStackTrace(); throw new RuntimeException( "Error with getting information from package name"); } } finally { setServiceRunning(false); } } @Override public void dontAllow(int reason) { try { switch (reason) { case Policy.NOT_LICENSED: mNotification .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_UNLICENSED); break; case Policy.RETRY: mNotification .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_FETCHING_URL); break; } } finally { setServiceRunning(false); } } @Override public void applicationError(int errorCode) { try { mNotification .onDownloadStateChanged(IDownloaderClient.STATE_FAILED_FETCHING_URL); } finally { setServiceRunning(false); } } }); } }; /** * Updates the LVL information from the server. * * @param context */ public void updateLVL(final Context context) { Context c = context.getApplicationContext(); Handler h = new Handler(c.getMainLooper()); h.post(new LVLRunnable(c, mPendingIntent)); } /** * The APK has been updated and a filename has been sent down from the * Market call. If the file has the same name as the previous file, we do * nothing as the file is guaranteed to be the same. If the file does not * have the same name, we download it if it hasn't already been delivered by * Market. * * @param index the index of the file from market (0 = main, 1 = patch) * @param filename the name of the new file * @param fileSize the size of the new file * @return */ public boolean handleFileUpdated(DownloadsDB db, int index, String filename, long fileSize) { DownloadInfo di = db.getDownloadInfoByFileName(filename); if (null != di) { String oldFile = di.mFileName; // cleanup if (null != oldFile) { if (filename.equals(oldFile)) { return false; } // remove partially downloaded file if it is there String deleteFile = Helpers.generateSaveFileName(this, oldFile); File f = new File(deleteFile); if (f.exists()) f.delete(); } } return !Helpers.doesFileExist(this, filename, fileSize, true); } private void scheduleAlarm(long wakeUp) { AlarmManager alarms = (AlarmManager) getSystemService(Context.ALARM_SERVICE); if (alarms == null) { Log.e(Constants.TAG, "couldn't get alarm manager"); return; } if (Constants.LOGV) { Log.v(Constants.TAG, "scheduling retry in " + wakeUp + "ms"); } String className = getAlarmReceiverClassName(); Intent intent = new Intent(Constants.ACTION_RETRY); intent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent); intent.setClassName(this.getPackageName(), className); mAlarmIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_ONE_SHOT); alarms.set( AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + wakeUp, mAlarmIntent ); } private void cancelAlarms() { if (null != mAlarmIntent) { AlarmManager alarms = (AlarmManager) getSystemService(Context.ALARM_SERVICE); if (alarms == null) { Log.e(Constants.TAG, "couldn't get alarm manager"); return; } alarms.cancel(mAlarmIntent); mAlarmIntent = null; } } /** * We use this to track network state, such as when WiFi, Cellular, etc. is * enabled when downloads are paused or in progress. */ private class InnerBroadcastReceiver extends BroadcastReceiver { final Service mService; InnerBroadcastReceiver(Service service) { mService = service; } @Override public void onReceive(Context context, Intent intent) { pollNetworkState(); if (mStateChanged && !isServiceRunning()) { Log.d(Constants.TAG, "InnerBroadcastReceiver Called"); Intent fileIntent = new Intent(context, mService.getClass()); fileIntent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent); // send a new intent to the service context.startService(fileIntent); } } }; /** * This is the main thread for the Downloader. This thread is responsible * for queuing up downloads and other goodness. */ @Override protected void onHandleIntent(Intent intent) { setServiceRunning(true); try { // the database automatically reads the metadata for version code // and download status when the instance is created DownloadsDB db = DownloadsDB.getDB(this); final PendingIntent pendingIntent = (PendingIntent) intent .getParcelableExtra(EXTRA_PENDING_INTENT); if (null != pendingIntent) { mNotification.setClientIntent(pendingIntent); mPendingIntent = pendingIntent; } else if (null != mPendingIntent) { mNotification.setClientIntent(mPendingIntent); } else { Log.e(LOG_TAG, "Downloader started in bad state without notification intent."); return; } // when the LVL check completes, a successful response will update // the service if (isLVLCheckRequired(db, mPackageInfo)) { updateLVL(this); return; } // get each download DownloadInfo[] infos = db.getDownloads(); mBytesSoFar = 0; mTotalLength = 0; mFileCount = infos.length; for (DownloadInfo info : infos) { // We do an (simple) integrity check on each file, just to make // sure if (info.mStatus == STATUS_SUCCESS) { // verify that the file matches the state if (!Helpers.doesFileExist(this, info.mFileName, info.mTotalBytes, true)) { info.mStatus = 0; info.mCurrentBytes = 0; } } // get aggregate data mTotalLength += info.mTotalBytes; mBytesSoFar += info.mCurrentBytes; } // loop through all downloads and fetch them pollNetworkState(); if (null == mConnReceiver) { /** * We use this to track network state, such as when WiFi, * Cellular, etc. is enabled when downloads are paused or in * progress. */ mConnReceiver = new InnerBroadcastReceiver(this); IntentFilter intentFilter = new IntentFilter( ConnectivityManager.CONNECTIVITY_ACTION); intentFilter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION); registerReceiver(mConnReceiver, intentFilter); } for (DownloadInfo info : infos) { long startingCount = info.mCurrentBytes; if (info.mStatus != STATUS_SUCCESS) { DownloadThread dt = new DownloadThread(info, this, mNotification); cancelAlarms(); scheduleAlarm(Constants.ACTIVE_THREAD_WATCHDOG); dt.run(); cancelAlarms(); } db.updateFromDb(info); boolean setWakeWatchdog = false; int notifyStatus; switch (info.mStatus) { case STATUS_FORBIDDEN: // the URL is out of date updateLVL(this); return; case STATUS_SUCCESS: mBytesSoFar += info.mCurrentBytes - startingCount; db.updateMetadata(mPackageInfo.versionCode, 0); continue; case STATUS_FILE_DELIVERED_INCORRECTLY: // we may be on a network that is returning us a web // page on redirect notifyStatus = IDownloaderClient.STATE_PAUSED_NETWORK_SETUP_FAILURE; info.mCurrentBytes = 0; db.updateDownload(info); setWakeWatchdog = true; break; case STATUS_PAUSED_BY_APP: notifyStatus = IDownloaderClient.STATE_PAUSED_BY_REQUEST; break; case STATUS_WAITING_FOR_NETWORK: case STATUS_WAITING_TO_RETRY: notifyStatus = IDownloaderClient.STATE_PAUSED_NETWORK_UNAVAILABLE; setWakeWatchdog = true; break; case STATUS_QUEUED_FOR_WIFI_OR_CELLULAR_PERMISSION: case STATUS_QUEUED_FOR_WIFI: // look for more detail here if (null != mWifiManager) { if (!mWifiManager.isWifiEnabled()) { notifyStatus = IDownloaderClient.STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION; setWakeWatchdog = true; break; } } notifyStatus = IDownloaderClient.STATE_PAUSED_NEED_CELLULAR_PERMISSION; setWakeWatchdog = true; break; case STATUS_CANCELED: notifyStatus = IDownloaderClient.STATE_FAILED_CANCELED; setWakeWatchdog = true; break; case STATUS_INSUFFICIENT_SPACE_ERROR: notifyStatus = IDownloaderClient.STATE_FAILED_SDCARD_FULL; setWakeWatchdog = true; break; case STATUS_DEVICE_NOT_FOUND_ERROR: notifyStatus = IDownloaderClient.STATE_PAUSED_SDCARD_UNAVAILABLE; setWakeWatchdog = true; break; default: notifyStatus = IDownloaderClient.STATE_FAILED; break; } if (setWakeWatchdog) { scheduleAlarm(Constants.WATCHDOG_WAKE_TIMER); } else { cancelAlarms(); } // failure or pause state mNotification.onDownloadStateChanged(notifyStatus); return; } // all downloads complete mNotification.onDownloadStateChanged(IDownloaderClient.STATE_COMPLETED); } finally { setServiceRunning(false); } } @Override public void onDestroy() { if (null != mConnReceiver) { unregisterReceiver(mConnReceiver); mConnReceiver = null; } mServiceStub.disconnect(this); super.onDestroy(); } public int getNetworkAvailabilityState(DownloadsDB db) { if (mIsConnected) { if (!mIsCellularConnection) return NETWORK_OK; int flags = db.mFlags; if (mIsRoaming) return NETWORK_CANNOT_USE_ROAMING; if (0 != (flags & FLAGS_DOWNLOAD_OVER_CELLULAR)) { return NETWORK_OK; } else { return NETWORK_TYPE_DISALLOWED_BY_REQUESTOR; } } return NETWORK_NO_CONNECTION; } @Override public void onCreate() { super.onCreate(); try { mPackageInfo = getPackageManager().getPackageInfo( getPackageName(), 0); ApplicationInfo ai = getApplicationInfo(); CharSequence applicationLabel = getPackageManager().getApplicationLabel(ai); mNotification = new DownloadNotification(this, applicationLabel); } catch (NameNotFoundException e) { e.printStackTrace(); } } /** * Exception thrown from methods called by generateSaveFile() for any fatal * error. */ public static class GenerateSaveFileError extends Exception { private static final long serialVersionUID = 3465966015408936540L; int mStatus; String mMessage; public GenerateSaveFileError(int status, String message) { mStatus = status; mMessage = message; } } /** * Returns the filename (where the file should be saved) from info about a * download */ public String generateTempSaveFileName(String fileName) { String path = Helpers.getSaveFilePath(this) + File.separator + fileName + TEMP_EXT; return path; } /** * Creates a filename (where the file should be saved) from info about a * download. */ public String generateSaveFile(String filename, long filesize) throws GenerateSaveFileError { String path = generateTempSaveFileName(filename); File expPath = new File(path); if (!Helpers.isExternalMediaMounted()) { Log.d(Constants.TAG, "External media not mounted: " + path); throw new GenerateSaveFileError(STATUS_DEVICE_NOT_FOUND_ERROR, "external media is not yet mounted"); } if (expPath.exists()) { Log.d(Constants.TAG, "File already exists: " + path); throw new GenerateSaveFileError(STATUS_FILE_ALREADY_EXISTS_ERROR, "requested destination file already exists"); } if (Helpers.getAvailableBytes(Helpers.getFilesystemRoot(path)) < filesize) { throw new GenerateSaveFileError(STATUS_INSUFFICIENT_SPACE_ERROR, "insufficient space on external storage"); } return path; } /** * @return a non-localized string appropriate for logging corresponding to * one of the NETWORK_* constants. */ public String getLogMessageForNetworkError(int networkError) { switch (networkError) { case NETWORK_RECOMMENDED_UNUSABLE_DUE_TO_SIZE: return "download size exceeds recommended limit for mobile network"; case NETWORK_UNUSABLE_DUE_TO_SIZE: return "download size exceeds limit for mobile network"; case NETWORK_NO_CONNECTION: return "no network connection available"; case NETWORK_CANNOT_USE_ROAMING: return "download cannot use the current network connection because it is roaming"; case NETWORK_TYPE_DISALLOWED_BY_REQUESTOR: return "download was requested to not use the current network type"; default: return "unknown error with network connectivity"; } } public int getControl() { return mControl; } public int getStatus() { return mStatus; } /** * Calculating a moving average for the speed so we don't get jumpy * calculations for time etc. */ static private final float SMOOTHING_FACTOR = 0.005f; public void notifyUpdateBytes(long totalBytesSoFar) { long timeRemaining; long currentTime = SystemClock.uptimeMillis(); if (0 != mMillisecondsAtSample) { // we have a sample. long timePassed = currentTime - mMillisecondsAtSample; long bytesInSample = totalBytesSoFar - mBytesAtSample; float currentSpeedSample = (float) bytesInSample / (float) timePassed; if (0 != mAverageDownloadSpeed) { mAverageDownloadSpeed = SMOOTHING_FACTOR * currentSpeedSample + (1 - SMOOTHING_FACTOR) * mAverageDownloadSpeed; } else { mAverageDownloadSpeed = currentSpeedSample; } timeRemaining = (long) ((mTotalLength - totalBytesSoFar) / mAverageDownloadSpeed); } else { timeRemaining = -1; } mMillisecondsAtSample = currentTime; mBytesAtSample = totalBytesSoFar; mNotification.onDownloadProgress( new DownloadProgressInfo(mTotalLength, totalBytesSoFar, timeRemaining, mAverageDownloadSpeed) ); } @Override protected boolean shouldStop() { // the database automatically reads the metadata for version code // and download status when the instance is created DownloadsDB db = DownloadsDB.getDB(this); if (db.mStatus == 0) { return true; } return false; } @Override public void requestDownloadStatus() { mNotification.resendState(); } @Override public void onClientUpdated(Messenger clientMessenger) { this.mClientMessenger = clientMessenger; mNotification.setMessenger(mClientMessenger); } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/DownloadsDB.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteDoneException; import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteStatement; import android.provider.BaseColumns; import android.util.Log; public class DownloadsDB { private static final String DATABASE_NAME = "DownloadsDB"; private static final int DATABASE_VERSION = 7; public static final String LOG_TAG = DownloadsDB.class.getName(); final SQLiteOpenHelper mHelper; SQLiteStatement mGetDownloadByIndex; SQLiteStatement mUpdateCurrentBytes; private static DownloadsDB mDownloadsDB; long mMetadataRowID = -1; int mVersionCode = -1; int mStatus = -1; int mFlags; static public synchronized DownloadsDB getDB(Context paramContext) { if (null == mDownloadsDB) { return new DownloadsDB(paramContext); } return mDownloadsDB; } private SQLiteStatement getDownloadByIndexStatement() { if (null == mGetDownloadByIndex) { mGetDownloadByIndex = mHelper.getReadableDatabase().compileStatement( "SELECT " + BaseColumns._ID + " FROM " + DownloadColumns.TABLE_NAME + " WHERE " + DownloadColumns.INDEX + " = ?"); } return mGetDownloadByIndex; } private SQLiteStatement getUpdateCurrentBytesStatement() { if (null == mUpdateCurrentBytes) { mUpdateCurrentBytes = mHelper.getReadableDatabase().compileStatement( "UPDATE " + DownloadColumns.TABLE_NAME + " SET " + DownloadColumns.CURRENTBYTES + " = ?" + " WHERE " + DownloadColumns.INDEX + " = ?"); } return mUpdateCurrentBytes; } private DownloadsDB(Context paramContext) { this.mHelper = new DownloadsContentDBHelper(paramContext); final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); // Query for the version code, the row ID of the metadata (for future // updating) the status and the flags Cursor cur = sqldb.rawQuery("SELECT " + MetadataColumns.APKVERSION + "," + BaseColumns._ID + "," + MetadataColumns.DOWNLOAD_STATUS + "," + MetadataColumns.FLAGS + " FROM " + MetadataColumns.TABLE_NAME + " LIMIT 1", null); if (null != cur && cur.moveToFirst()) { mVersionCode = cur.getInt(0); mMetadataRowID = cur.getLong(1); mStatus = cur.getInt(2); mFlags = cur.getInt(3); cur.close(); } mDownloadsDB = this; } protected DownloadInfo getDownloadInfoByFileName(String fileName) { final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); Cursor itemcur = null; try { itemcur = sqldb.query(DownloadColumns.TABLE_NAME, DC_PROJECTION, DownloadColumns.FILENAME + " = ?", new String[] { fileName }, null, null, null); if (null != itemcur && itemcur.moveToFirst()) { return getDownloadInfoFromCursor(itemcur); } } finally { if (null != itemcur) itemcur.close(); } return null; } public long getIDForDownloadInfo(final DownloadInfo di) { return getIDByIndex(di.mIndex); } public long getIDByIndex(int index) { SQLiteStatement downloadByIndex = getDownloadByIndexStatement(); downloadByIndex.clearBindings(); downloadByIndex.bindLong(1, index); try { return downloadByIndex.simpleQueryForLong(); } catch (SQLiteDoneException e) { return -1; } } public void updateDownloadCurrentBytes(final DownloadInfo di) { SQLiteStatement downloadCurrentBytes = getUpdateCurrentBytesStatement(); downloadCurrentBytes.clearBindings(); downloadCurrentBytes.bindLong(1, di.mCurrentBytes); downloadCurrentBytes.bindLong(2, di.mIndex); downloadCurrentBytes.execute(); } public void close() { this.mHelper.close(); } protected static class DownloadsContentDBHelper extends SQLiteOpenHelper { DownloadsContentDBHelper(Context paramContext) { super(paramContext, DATABASE_NAME, null, DATABASE_VERSION); } private String createTableQueryFromArray(String paramString, String[][] paramArrayOfString) { StringBuilder localStringBuilder = new StringBuilder(); localStringBuilder.append("CREATE TABLE "); localStringBuilder.append(paramString); localStringBuilder.append(" ("); int i = paramArrayOfString.length; for (int j = 0;; j++) { if (j >= i) { localStringBuilder .setLength(localStringBuilder.length() - 1); localStringBuilder.append(");"); return localStringBuilder.toString(); } String[] arrayOfString = paramArrayOfString[j]; localStringBuilder.append(' '); localStringBuilder.append(arrayOfString[0]); localStringBuilder.append(' '); localStringBuilder.append(arrayOfString[1]); localStringBuilder.append(','); } } /** * These two arrays must match and have the same order. For every Schema * there must be a corresponding table name. */ static final private String[][][] sSchemas = { DownloadColumns.SCHEMA, MetadataColumns.SCHEMA }; static final private String[] sTables = { DownloadColumns.TABLE_NAME, MetadataColumns.TABLE_NAME }; /** * Goes through all of the tables in sTables and drops each table if it * exists. Altered to no longer make use of reflection. */ private void dropTables(SQLiteDatabase paramSQLiteDatabase) { for (String table : sTables) { try { paramSQLiteDatabase.execSQL("DROP TABLE IF EXISTS " + table); } catch (Exception localException) { localException.printStackTrace(); } } } /** * Goes through all of the tables in sTables and creates a database with * the corresponding schema described in sSchemas. Altered to no longer * make use of reflection. */ public void onCreate(SQLiteDatabase paramSQLiteDatabase) { int numSchemas = sSchemas.length; for (int i = 0; i < numSchemas; i++) { try { String[][] schema = (String[][]) sSchemas[i]; paramSQLiteDatabase.execSQL(createTableQueryFromArray( sTables[i], schema)); } catch (Exception localException) { while (true) localException.printStackTrace(); } } } public void onUpgrade(SQLiteDatabase paramSQLiteDatabase, int paramInt1, int paramInt2) { Log.w(DownloadsContentDBHelper.class.getName(), "Upgrading database from version " + paramInt1 + " to " + paramInt2 + ", which will destroy all old data"); dropTables(paramSQLiteDatabase); onCreate(paramSQLiteDatabase); } } public static class MetadataColumns implements BaseColumns { public static final String APKVERSION = "APKVERSION"; public static final String DOWNLOAD_STATUS = "DOWNLOADSTATUS"; public static final String FLAGS = "DOWNLOADFLAGS"; public static final String[][] SCHEMA = { { BaseColumns._ID, "INTEGER PRIMARY KEY" }, { APKVERSION, "INTEGER" }, { DOWNLOAD_STATUS, "INTEGER" }, { FLAGS, "INTEGER" } }; public static final String TABLE_NAME = "MetadataColumns"; public static final String _ID = "MetadataColumns._id"; } public static class DownloadColumns implements BaseColumns { public static final String INDEX = "FILEIDX"; public static final String URI = "URI"; public static final String FILENAME = "FN"; public static final String ETAG = "ETAG"; public static final String TOTALBYTES = "TOTALBYTES"; public static final String CURRENTBYTES = "CURRENTBYTES"; public static final String LASTMOD = "LASTMOD"; public static final String STATUS = "STATUS"; public static final String CONTROL = "CONTROL"; public static final String NUM_FAILED = "FAILCOUNT"; public static final String RETRY_AFTER = "RETRYAFTER"; public static final String REDIRECT_COUNT = "REDIRECTCOUNT"; public static final String[][] SCHEMA = { { BaseColumns._ID, "INTEGER PRIMARY KEY" }, { INDEX, "INTEGER UNIQUE" }, { URI, "TEXT" }, { FILENAME, "TEXT UNIQUE" }, { ETAG, "TEXT" }, { TOTALBYTES, "INTEGER" }, { CURRENTBYTES, "INTEGER" }, { LASTMOD, "INTEGER" }, { STATUS, "INTEGER" }, { CONTROL, "INTEGER" }, { NUM_FAILED, "INTEGER" }, { RETRY_AFTER, "INTEGER" }, { REDIRECT_COUNT, "INTEGER" } }; public static final String TABLE_NAME = "DownloadColumns"; public static final String _ID = "DownloadColumns._id"; } private static final String[] DC_PROJECTION = { DownloadColumns.FILENAME, DownloadColumns.URI, DownloadColumns.ETAG, DownloadColumns.TOTALBYTES, DownloadColumns.CURRENTBYTES, DownloadColumns.LASTMOD, DownloadColumns.STATUS, DownloadColumns.CONTROL, DownloadColumns.NUM_FAILED, DownloadColumns.RETRY_AFTER, DownloadColumns.REDIRECT_COUNT, DownloadColumns.INDEX }; private static final int FILENAME_IDX = 0; private static final int URI_IDX = 1; private static final int ETAG_IDX = 2; private static final int TOTALBYTES_IDX = 3; private static final int CURRENTBYTES_IDX = 4; private static final int LASTMOD_IDX = 5; private static final int STATUS_IDX = 6; private static final int CONTROL_IDX = 7; private static final int NUM_FAILED_IDX = 8; private static final int RETRY_AFTER_IDX = 9; private static final int REDIRECT_COUNT_IDX = 10; private static final int INDEX_IDX = 11; /** * This function will add a new file to the database if it does not exist. * * @param di DownloadInfo that we wish to store * @return the row id of the record to be updated/inserted, or -1 */ public boolean updateDownload(DownloadInfo di) { ContentValues cv = new ContentValues(); cv.put(DownloadColumns.INDEX, di.mIndex); cv.put(DownloadColumns.FILENAME, di.mFileName); cv.put(DownloadColumns.URI, di.mUri); cv.put(DownloadColumns.ETAG, di.mETag); cv.put(DownloadColumns.TOTALBYTES, di.mTotalBytes); cv.put(DownloadColumns.CURRENTBYTES, di.mCurrentBytes); cv.put(DownloadColumns.LASTMOD, di.mLastMod); cv.put(DownloadColumns.STATUS, di.mStatus); cv.put(DownloadColumns.CONTROL, di.mControl); cv.put(DownloadColumns.NUM_FAILED, di.mNumFailed); cv.put(DownloadColumns.RETRY_AFTER, di.mRetryAfter); cv.put(DownloadColumns.REDIRECT_COUNT, di.mRedirectCount); return updateDownload(di, cv); } public boolean updateDownload(DownloadInfo di, ContentValues cv) { long id = di == null ? -1 : getIDForDownloadInfo(di); try { final SQLiteDatabase sqldb = mHelper.getWritableDatabase(); if (id != -1) { if (1 != sqldb.update(DownloadColumns.TABLE_NAME, cv, DownloadColumns._ID + " = " + id, null)) { return false; } } else { return -1 != sqldb.insert(DownloadColumns.TABLE_NAME, DownloadColumns.URI, cv); } } catch (android.database.sqlite.SQLiteException ex) { ex.printStackTrace(); } return false; } public int getLastCheckedVersionCode() { return mVersionCode; } public boolean isDownloadRequired() { final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); Cursor cur = sqldb.rawQuery("SELECT Count(*) FROM " + DownloadColumns.TABLE_NAME + " WHERE " + DownloadColumns.STATUS + " <> 0", null); try { if (null != cur && cur.moveToFirst()) { return 0 == cur.getInt(0); } } finally { if (null != cur) cur.close(); } return true; } public int getFlags() { return mFlags; } public boolean updateFlags(int flags) { if (mFlags != flags) { ContentValues cv = new ContentValues(); cv.put(MetadataColumns.FLAGS, flags); if (updateMetadata(cv)) { mFlags = flags; return true; } else { return false; } } else { return true; } }; public boolean updateStatus(int status) { if (mStatus != status) { ContentValues cv = new ContentValues(); cv.put(MetadataColumns.DOWNLOAD_STATUS, status); if (updateMetadata(cv)) { mStatus = status; return true; } else { return false; } } else { return true; } }; public boolean updateMetadata(ContentValues cv) { final SQLiteDatabase sqldb = mHelper.getWritableDatabase(); if (-1 == this.mMetadataRowID) { long newID = sqldb.insert(MetadataColumns.TABLE_NAME, MetadataColumns.APKVERSION, cv); if (-1 == newID) return false; mMetadataRowID = newID; } else { if (0 == sqldb.update(MetadataColumns.TABLE_NAME, cv, BaseColumns._ID + " = " + mMetadataRowID, null)) return false; } return true; } public boolean updateMetadata(int apkVersion, int downloadStatus) { ContentValues cv = new ContentValues(); cv.put(MetadataColumns.APKVERSION, apkVersion); cv.put(MetadataColumns.DOWNLOAD_STATUS, downloadStatus); if (updateMetadata(cv)) { mVersionCode = apkVersion; mStatus = downloadStatus; return true; } else { return false; } }; public boolean updateFromDb(DownloadInfo di) { final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); Cursor cur = null; try { cur = sqldb.query(DownloadColumns.TABLE_NAME, DC_PROJECTION, DownloadColumns.FILENAME + "= ?", new String[] { di.mFileName }, null, null, null); if (null != cur && cur.moveToFirst()) { setDownloadInfoFromCursor(di, cur); return true; } return false; } finally { if (null != cur) { cur.close(); } } } public void setDownloadInfoFromCursor(DownloadInfo di, Cursor cur) { di.mUri = cur.getString(URI_IDX); di.mETag = cur.getString(ETAG_IDX); di.mTotalBytes = cur.getLong(TOTALBYTES_IDX); di.mCurrentBytes = cur.getLong(CURRENTBYTES_IDX); di.mLastMod = cur.getLong(LASTMOD_IDX); di.mStatus = cur.getInt(STATUS_IDX); di.mControl = cur.getInt(CONTROL_IDX); di.mNumFailed = cur.getInt(NUM_FAILED_IDX); di.mRetryAfter = cur.getInt(RETRY_AFTER_IDX); di.mRedirectCount = cur.getInt(REDIRECT_COUNT_IDX); } public DownloadInfo getDownloadInfoFromCursor(Cursor cur) { DownloadInfo di = new DownloadInfo(cur.getInt(INDEX_IDX), cur.getString(FILENAME_IDX), this.getClass().getPackage() .getName()); setDownloadInfoFromCursor(di, cur); return di; } public DownloadInfo[] getDownloads() { final SQLiteDatabase sqldb = mHelper.getReadableDatabase(); Cursor cur = null; try { cur = sqldb.query(DownloadColumns.TABLE_NAME, DC_PROJECTION, null, null, null, null, null); if (null != cur && cur.moveToFirst()) { DownloadInfo[] retInfos = new DownloadInfo[cur.getCount()]; int idx = 0; do { DownloadInfo di = getDownloadInfoFromCursor(cur); retInfos[idx++] = di; } while (cur.moveToNext()); return retInfos; } return null; } finally { if (null != cur) { cur.close(); } } } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/HttpDateTime.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; import android.text.format.Time; import java.util.Calendar; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Helper for parsing an HTTP date. */ public final class HttpDateTime { /* * Regular expression for parsing HTTP-date. Wdy, DD Mon YYYY HH:MM:SS GMT * RFC 822, updated by RFC 1123 Weekday, DD-Mon-YY HH:MM:SS GMT RFC 850, * obsoleted by RFC 1036 Wdy Mon DD HH:MM:SS YYYY ANSI C's asctime() format * with following variations Wdy, DD-Mon-YYYY HH:MM:SS GMT Wdy, (SP)D Mon * YYYY HH:MM:SS GMT Wdy,DD Mon YYYY HH:MM:SS GMT Wdy, DD-Mon-YY HH:MM:SS * GMT Wdy, DD Mon YYYY HH:MM:SS -HHMM Wdy, DD Mon YYYY HH:MM:SS Wdy Mon * (SP)D HH:MM:SS YYYY Wdy Mon DD HH:MM:SS YYYY GMT HH can be H if the first * digit is zero. Mon can be the full name of the month. */ private static final String HTTP_DATE_RFC_REGEXP = "([0-9]{1,2})[- ]([A-Za-z]{3,9})[- ]([0-9]{2,4})[ ]" + "([0-9]{1,2}:[0-9][0-9]:[0-9][0-9])"; private static final String HTTP_DATE_ANSIC_REGEXP = "[ ]([A-Za-z]{3,9})[ ]+([0-9]{1,2})[ ]" + "([0-9]{1,2}:[0-9][0-9]:[0-9][0-9])[ ]([0-9]{2,4})"; /** * The compiled version of the HTTP-date regular expressions. */ private static final Pattern HTTP_DATE_RFC_PATTERN = Pattern.compile(HTTP_DATE_RFC_REGEXP); private static final Pattern HTTP_DATE_ANSIC_PATTERN = Pattern.compile(HTTP_DATE_ANSIC_REGEXP); private static class TimeOfDay { TimeOfDay(int h, int m, int s) { this.hour = h; this.minute = m; this.second = s; } int hour; int minute; int second; } public static long parse(String timeString) throws IllegalArgumentException { int date = 1; int month = Calendar.JANUARY; int year = 1970; TimeOfDay timeOfDay; Matcher rfcMatcher = HTTP_DATE_RFC_PATTERN.matcher(timeString); if (rfcMatcher.find()) { date = getDate(rfcMatcher.group(1)); month = getMonth(rfcMatcher.group(2)); year = getYear(rfcMatcher.group(3)); timeOfDay = getTime(rfcMatcher.group(4)); } else { Matcher ansicMatcher = HTTP_DATE_ANSIC_PATTERN.matcher(timeString); if (ansicMatcher.find()) { month = getMonth(ansicMatcher.group(1)); date = getDate(ansicMatcher.group(2)); timeOfDay = getTime(ansicMatcher.group(3)); year = getYear(ansicMatcher.group(4)); } else { throw new IllegalArgumentException(); } } // FIXME: Y2038 BUG! if (year >= 2038) { year = 2038; month = Calendar.JANUARY; date = 1; } Time time = new Time(Time.TIMEZONE_UTC); time.set(timeOfDay.second, timeOfDay.minute, timeOfDay.hour, date, month, year); return time.toMillis(false /* use isDst */); } private static int getDate(String dateString) { if (dateString.length() == 2) { return (dateString.charAt(0) - '0') * 10 + (dateString.charAt(1) - '0'); } else { return (dateString.charAt(0) - '0'); } } /* * jan = 9 + 0 + 13 = 22 feb = 5 + 4 + 1 = 10 mar = 12 + 0 + 17 = 29 apr = 0 * + 15 + 17 = 32 may = 12 + 0 + 24 = 36 jun = 9 + 20 + 13 = 42 jul = 9 + 20 * + 11 = 40 aug = 0 + 20 + 6 = 26 sep = 18 + 4 + 15 = 37 oct = 14 + 2 + 19 * = 35 nov = 13 + 14 + 21 = 48 dec = 3 + 4 + 2 = 9 */ private static int getMonth(String monthString) { int hash = Character.toLowerCase(monthString.charAt(0)) + Character.toLowerCase(monthString.charAt(1)) + Character.toLowerCase(monthString.charAt(2)) - 3 * 'a'; switch (hash) { case 22: return Calendar.JANUARY; case 10: return Calendar.FEBRUARY; case 29: return Calendar.MARCH; case 32: return Calendar.APRIL; case 36: return Calendar.MAY; case 42: return Calendar.JUNE; case 40: return Calendar.JULY; case 26: return Calendar.AUGUST; case 37: return Calendar.SEPTEMBER; case 35: return Calendar.OCTOBER; case 48: return Calendar.NOVEMBER; case 9: return Calendar.DECEMBER; default: throw new IllegalArgumentException(); } } private static int getYear(String yearString) { if (yearString.length() == 2) { int year = (yearString.charAt(0) - '0') * 10 + (yearString.charAt(1) - '0'); if (year >= 70) { return year + 1900; } else { return year + 2000; } } else if (yearString.length() == 3) { // According to RFC 2822, three digit years should be added to 1900. int year = (yearString.charAt(0) - '0') * 100 + (yearString.charAt(1) - '0') * 10 + (yearString.charAt(2) - '0'); return year + 1900; } else if (yearString.length() == 4) { return (yearString.charAt(0) - '0') * 1000 + (yearString.charAt(1) - '0') * 100 + (yearString.charAt(2) - '0') * 10 + (yearString.charAt(3) - '0'); } else { return 1970; } } private static TimeOfDay getTime(String timeString) { // HH might be H int i = 0; int hour = timeString.charAt(i++) - '0'; if (timeString.charAt(i) != ':') hour = hour * 10 + (timeString.charAt(i++) - '0'); // Skip ':' i++; int minute = (timeString.charAt(i++) - '0') * 10 + (timeString.charAt(i++) - '0'); // Skip ':' i++; int second = (timeString.charAt(i++) - '0') * 10 + (timeString.charAt(i++) - '0'); return new TimeOfDay(hour, minute, second); } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/V14CustomNotification.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; import com.android.vending.expansion.downloader.R; import com.google.android.vending.expansion.downloader.Helpers; import android.app.Notification; import android.app.PendingIntent; import android.content.Context; public class V14CustomNotification implements DownloadNotification.ICustomNotification { CharSequence mTitle; CharSequence mTicker; int mIcon; long mTotalKB = -1; long mCurrentKB = -1; long mTimeRemaining; PendingIntent mPendingIntent; @Override public void setIcon(int icon) { mIcon = icon; } @Override public void setTitle(CharSequence title) { mTitle = title; } @Override public void setTotalBytes(long totalBytes) { mTotalKB = totalBytes; } @Override public void setCurrentBytes(long currentBytes) { mCurrentKB = currentBytes; } void setProgress(Notification.Builder builder) { } @Override public Notification updateNotification(Context c) { Notification.Builder builder = new Notification.Builder(c); builder.setContentTitle(mTitle); if (mTotalKB > 0 && -1 != mCurrentKB) { builder.setProgress((int) (mTotalKB >> 8), (int) (mCurrentKB >> 8), false); } else { builder.setProgress(0, 0, true); } builder.setContentText(Helpers.getDownloadProgressString(mCurrentKB, mTotalKB)); builder.setContentInfo(c.getString(R.string.time_remaining_notification, Helpers.getTimeRemaining(mTimeRemaining))); if (mIcon != 0) { builder.setSmallIcon(mIcon); } else { int iconResource = android.R.drawable.stat_sys_download; builder.setSmallIcon(iconResource); } builder.setOngoing(true); builder.setTicker(mTicker); builder.setContentIntent(mPendingIntent); builder.setOnlyAlertOnce(true); return builder.getNotification(); } @Override public void setPendingIntent(PendingIntent contentIntent) { mPendingIntent = contentIntent; } @Override public void setTicker(CharSequence ticker) { mTicker = ticker; } @Override public void setTimeRemaining(long timeRemaining) { mTimeRemaining = timeRemaining; } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/java/com/google/android/vending/expansion/downloader/impl/V3CustomNotification.java ================================================ /* * Copyright (C) 2012 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.vending.expansion.downloader.impl; import com.android.vending.expansion.downloader.R; import com.google.android.vending.expansion.downloader.Helpers; import android.app.Notification; import android.app.PendingIntent; import android.content.Context; import android.graphics.BitmapFactory; import android.view.View; import android.widget.RemoteViews; public class V3CustomNotification implements DownloadNotification.ICustomNotification { CharSequence mTitle; CharSequence mTicker; int mIcon; long mTotalBytes = -1; long mCurrentBytes = -1; long mTimeRemaining; PendingIntent mPendingIntent; Notification mNotification = new Notification(); @Override public void setIcon(int icon) { mIcon = icon; } @Override public void setTitle(CharSequence title) { mTitle = title; } @Override public void setTotalBytes(long totalBytes) { mTotalBytes = totalBytes; } @Override public void setCurrentBytes(long currentBytes) { mCurrentBytes = currentBytes; } @Override public Notification updateNotification(Context c) { Notification n = mNotification; n.icon = mIcon; n.flags |= Notification.FLAG_ONGOING_EVENT; if (android.os.Build.VERSION.SDK_INT > 10) { n.flags |= Notification.FLAG_ONLY_ALERT_ONCE; // only matters for // Honeycomb } // Build the RemoteView object RemoteViews expandedView = new RemoteViews( c.getPackageName(), R.layout.status_bar_ongoing_event_progress_bar); expandedView.setTextViewText(R.id.title, mTitle); // look at strings expandedView.setViewVisibility(R.id.description, View.VISIBLE); expandedView.setTextViewText(R.id.description, Helpers.getDownloadProgressString(mCurrentBytes, mTotalBytes)); expandedView.setViewVisibility(R.id.progress_bar_frame, View.VISIBLE); expandedView.setProgressBar(R.id.progress_bar, (int) (mTotalBytes >> 8), (int) (mCurrentBytes >> 8), mTotalBytes <= 0); expandedView.setViewVisibility(R.id.time_remaining, View.VISIBLE); expandedView.setTextViewText( R.id.time_remaining, c.getString(R.string.time_remaining_notification, Helpers.getTimeRemaining(mTimeRemaining))); expandedView.setTextViewText(R.id.progress_text, Helpers.getDownloadProgressPercent(mCurrentBytes, mTotalBytes)); expandedView.setImageViewResource(R.id.appIcon, mIcon); n.contentView = expandedView; n.contentIntent = mPendingIntent; return n; } @Override public void setPendingIntent(PendingIntent contentIntent) { mPendingIntent = contentIntent; } @Override public void setTicker(CharSequence ticker) { mTicker = ticker; } @Override public void setTimeRemaining(long timeRemaining) { mTimeRemaining = timeRemaining; } } ================================================ FILE: Projects/Android/playapkexpansion/src/main/res/layout/status_bar_ongoing_event_progress_bar.xml ================================================ ================================================ FILE: Projects/Android/playapkexpansion/src/main/res/values/strings.xml ================================================ Download complete Download unsuccessful Starting..." Waiting for download to start Looking for resources to download Connecting to the download server Downloading resources Download finished Download paused because no network is available Download paused. Test a website in browser Download paused Download paused because wifi is unavailable Download paused because wifi is disabled Download paused because you are roaming Download paused because the external storage is unavailable Download failed because you may not have purchased this app Download failed because the resources could not be found Download failed because the external storage is full Download cancelled Download failed %1$s KB/s Time remaining: %1$s %1$s left ================================================ FILE: Projects/Android/playapkexpansion/src/main/res/values/styles.xml ================================================ ================================================ FILE: Projects/Android/playapkexpansion/src/main/res/values-v11/styles.xml ================================================ ================================================ FILE: Projects/Android/playapkexpansion/src/main/res/values-v9/styles.xml ================================================